devicetree-language-server 0.4.1 → 0.4.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/README.md +1 -1
- package/dist/server.js +177 -163
- package/package.json +2 -1
package/dist/server.js
CHANGED
|
@@ -1,187 +1,189 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Gx=Object.create;var Tp=Object.defineProperty;var Yx=Object.getOwnPropertyDescriptor;var Kx=Object.getOwnPropertyNames;var Xx=Object.getPrototypeOf,Jx=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qx=(t,e)=>{for(var n in e)Tp(t,n,{get:e[n],enumerable:!0})},Zx=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Kx(e))!Jx.call(t,s)&&s!==n&&Tp(t,s,{get:()=>e[s],enumerable:!(r=Yx(e,s))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?Gx(Xx(t)):{},Zx(e||!t||!t.__esModule?Tp(n,"default",{value:t,enumerable:!0}):n,t));var Ql=w(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.thenable=kt.typedArray=kt.stringArray=kt.array=kt.func=kt.error=kt.number=kt.string=kt.boolean=void 0;function eM(t){return t===!0||t===!1}kt.boolean=eM;function m_(t){return typeof t=="string"||t instanceof String}kt.string=m_;function tM(t){return typeof t=="number"||t instanceof Number}kt.number=tM;function nM(t){return t instanceof Error}kt.error=nM;function g_(t){return typeof t=="function"}kt.func=g_;function y_(t){return Array.isArray(t)}kt.array=y_;function rM(t){return y_(t)&&t.every(e=>m_(e))}kt.stringArray=rM;function sM(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=sM;function iM(t){return t&&g_(t.then)}kt.thenable=iM});var to=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function oM(t){return t===!0||t===!1}Xt.boolean=oM;function b_(t){return typeof t=="string"||t instanceof String}Xt.string=b_;function aM(t){return typeof t=="number"||t instanceof Number}Xt.number=aM;function cM(t){return t instanceof Error}Xt.error=cM;function lM(t){return typeof t=="function"}Xt.func=lM;function v_(t){return Array.isArray(t)}Xt.array=v_;function uM(t){return v_(t)&&t.every(e=>b_(e))}Xt.stringArray=uM});var Wp=w(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.Message=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType=Z.RequestType0=Z.AbstractMessageSignature=Z.ParameterStructures=Z.ResponseError=Z.ErrorCodes=void 0;var ui=to(),_p;(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})(_p||(Z.ErrorCodes=_p={}));var Sp=class t extends Error{constructor(e,n,r){super(n),this.code=ui.number(e)?e:_p.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Z.ResponseError=Sp;var mn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Z.ParameterStructures=mn;mn.auto=new mn("auto");mn.byPosition=new mn("byPosition");mn.byName=new mn("byName");var rt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return mn.auto}};Z.AbstractMessageSignature=rt;var Ep=class extends rt{constructor(e){super(e,0)}};Z.RequestType0=Ep;var wp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType=wp;var kp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType1=kp;var Np=class extends rt{constructor(e){super(e,2)}};Z.RequestType2=Np;var Pp=class extends rt{constructor(e){super(e,3)}};Z.RequestType3=Pp;var Rp=class extends rt{constructor(e){super(e,4)}};Z.RequestType4=Rp;var Cp=class extends rt{constructor(e){super(e,5)}};Z.RequestType5=Cp;var Dp=class extends rt{constructor(e){super(e,6)}};Z.RequestType6=Dp;var Ap=class extends rt{constructor(e){super(e,7)}};Z.RequestType7=Ap;var Op=class extends rt{constructor(e){super(e,8)}};Z.RequestType8=Op;var Ip=class extends rt{constructor(e){super(e,9)}};Z.RequestType9=Ip;var xp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType=xp;var Mp=class extends rt{constructor(e){super(e,0)}};Z.NotificationType0=Mp;var $p=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType1=$p;var Lp=class extends rt{constructor(e){super(e,2)}};Z.NotificationType2=Lp;var qp=class extends rt{constructor(e){super(e,3)}};Z.NotificationType3=qp;var jp=class extends rt{constructor(e){super(e,4)}};Z.NotificationType4=jp;var Fp=class extends rt{constructor(e){super(e,5)}};Z.NotificationType5=Fp;var Bp=class extends rt{constructor(e){super(e,6)}};Z.NotificationType6=Bp;var Up=class extends rt{constructor(e){super(e,7)}};Z.NotificationType7=Up;var Vp=class extends rt{constructor(e){super(e,8)}};Z.NotificationType8=Vp;var zp=class extends rt{constructor(e){super(e,9)}};Z.NotificationType9=zp;var T_;(function(t){function e(s){let i=s;return i&&ui.string(i.method)&&(ui.string(i.id)||ui.number(i.id))}t.isRequest=e;function n(s){let i=s;return i&&ui.string(i.method)&&s.id===void 0}t.isNotification=n;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(ui.string(i.id)||ui.number(i.id)||i.id===null)}t.isResponse=r})(T_||(Z.Message=T_={}))});var Gp=w(bs=>{"use strict";var __;Object.defineProperty(bs,"__esModule",{value:!0});bs.LRUCache=bs.LinkedMap=bs.Touch=void 0;var Jt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Jt||(bs.Touch=Jt={}));var Zl=class{constructor(){this[__]="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,n=Jt.None){let r=this._map.get(e);if(r)return n!==Jt.None&&this.touch(r,n),r.value}set(e,n,r=Jt.None){let s=this._map.get(e);if(s)s.value=n,r!==Jt.None&&this.touch(s,r);else{switch(s={key:e,value:n,next:void 0,previous:void 0},r){case Jt.None:this.addItemLast(s);break;case Jt.First:this.addItemFirst(s);break;case Jt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,s=this._head;for(;s;){if(n?e.bind(n)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}[(__=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.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 n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Jt.First&&n!==Jt.Last)){if(n===Jt.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Jt.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};bs.LinkedMap=Zl;var Hp=class extends Zl{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),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,n=Jt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Jt.None)}set(e,n){return super.set(e,n,Jt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};bs.LRUCache=Hp});var E_=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.Disposable=void 0;var S_;(function(t){function e(n){return{dispose:n}}t.create=e})(S_||(eu.Disposable=S_={}))});var vs=w(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Yp;function Kp(){if(Yp===void 0)throw new Error("No runtime abstraction layer installed");return Yp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Yp=n}t.install=e})(Kp||(Kp={}));Xp.default=Kp});var ro=w(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.Emitter=no.Event=void 0;var dM=vs(),w_;(function(t){let e={dispose(){}};t.None=function(){return e}})(w_||(no.Event=w_={}));var Jp=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===n){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{n.push(r[i].apply(s[i],e))}catch(a){(0,dM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},tu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Jp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),s.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};no.Emitter=tu;tu._noop=function(){}});var su=w(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var fM=vs(),hM=to(),Qp=ro(),nu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Qp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||hM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(nu||(so.CancellationToken=nu={}));var pM=Object.freeze(function(t,e){let n=(0,fM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),ru=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?pM:(this._emitter||(this._emitter=new Qp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Zp=class{get token(){return this._token||(this._token=new ru),this._token}cancel(){this._token?this._token.cancel():this._token=nu.Cancelled}dispose(){this._token?this._token instanceof ru&&this._token.dispose():this._token=nu.None}};so.CancellationTokenSource=Zp});var k_=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.SharedArrayReceiverStrategy=io.SharedArraySenderStrategy=void 0;var mM=su(),Aa;(function(t){t.Continue=0,t.Cancelled=1})(Aa||(Aa={}));var em=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Aa.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Aa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};io.SharedArraySenderStrategy=em;var tm=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Aa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},nm=class{constructor(e){this.token=new tm(e)}cancel(){}dispose(){}},rm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new mM.CancellationTokenSource:new nm(n)}};io.SharedArrayReceiverStrategy=rm});var im=w(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.Semaphore=void 0;var gM=vs(),sm=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((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,gM.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 n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};iu.Semaphore=sm});var P_=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.ReadableStreamMessageReader=Ts.AbstractMessageReader=Ts.MessageReader=void 0;var am=vs(),oo=to(),om=ro(),yM=im(),N_;(function(t){function e(n){let r=n;return r&&oo.func(r.listen)&&oo.func(r.dispose)&&oo.func(r.onError)&&oo.func(r.onClose)&&oo.func(r.onPartialMessage)}t.is=e})(N_||(Ts.MessageReader=N_={}));var ou=class{constructor(){this.errorEmitter=new om.Emitter,this.closeEmitter=new om.Emitter,this.partialMessageEmitter=new om.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: ${oo.string(e.message)?e.message:"unknown"}`)}};Ts.AbstractMessageReader=ou;var cm;(function(t){function e(n){let r,s,i,o=new Map,a,c=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,c.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,am.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(cm||(cm={}));var lm=class extends ou{constructor(e,n){super(),this.readable=e,this.options=cm.fromOptions(n),this.buffer=(0,am.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new yM.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 n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(r))}`));return}let
|
|
4
|
-
`,
|
|
5
|
-
`,
|
|
6
|
-
${u}`);let f=u.substr(0,d),h=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,h)}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
|
|
7
|
-
${JSON.stringify(N.error,void 0,4)}`):
|
|
8
|
-
${JSON.stringify(N,null,4)}`);let x=N;if(
|
|
2
|
+
"use strict";var mM=Object.create;var Cp=Object.defineProperty;var gM=Object.getOwnPropertyDescriptor;var yM=Object.getOwnPropertyNames;var bM=Object.getPrototypeOf,vM=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),TM=(t,e)=>{for(var n in e)Cp(t,n,{get:e[n],enumerable:!0})},_M=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yM(e))!vM.call(t,i)&&i!==n&&Cp(t,i,{get:()=>e[i],enumerable:!(r=gM(e,i))||r.enumerable});return t};var K=(t,e,n)=>(n=t!=null?mM(bM(t)):{},_M(e||!t||!t.__esModule?Cp(n,"default",{value:t,enumerable:!0}):n,t));var ru=k(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.thenable=Nt.typedArray=Nt.stringArray=Nt.array=Nt.func=Nt.error=Nt.number=Nt.string=Nt.boolean=void 0;function SM(t){return t===!0||t===!1}Nt.boolean=SM;function D_(t){return typeof t=="string"||t instanceof String}Nt.string=D_;function EM(t){return typeof t=="number"||t instanceof Number}Nt.number=EM;function wM(t){return t instanceof Error}Nt.error=wM;function A_(t){return typeof t=="function"}Nt.func=A_;function O_(t){return Array.isArray(t)}Nt.array=O_;function kM(t){return O_(t)&&t.every(e=>D_(e))}Nt.stringArray=kM;function NM(t,e){return Array.isArray(t)&&t.every(e)}Nt.typedArray=NM;function PM(t){return t&&A_(t.then)}Nt.thenable=PM});var no=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function RM(t){return t===!0||t===!1}Jt.boolean=RM;function I_(t){return typeof t=="string"||t instanceof String}Jt.string=I_;function CM(t){return typeof t=="number"||t instanceof Number}Jt.number=CM;function DM(t){return t instanceof Error}Jt.error=DM;function AM(t){return typeof t=="function"}Jt.func=AM;function x_(t){return Array.isArray(t)}Jt.array=x_;function OM(t){return x_(t)&&t.every(e=>I_(e))}Jt.stringArray=OM});var em=k(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.Message=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType=Z.RequestType0=Z.AbstractMessageSignature=Z.ParameterStructures=Z.ResponseError=Z.ErrorCodes=void 0;var fs=no(),Dp;(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})(Dp||(Z.ErrorCodes=Dp={}));var Ap=class t extends Error{constructor(e,n,r){super(n),this.code=fs.number(e)?e:Dp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Z.ResponseError=Ap;var gn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Z.ParameterStructures=gn;gn.auto=new gn("auto");gn.byPosition=new gn("byPosition");gn.byName=new gn("byName");var st=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return gn.auto}};Z.AbstractMessageSignature=st;var Op=class extends st{constructor(e){super(e,0)}};Z.RequestType0=Op;var Ip=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType=Ip;var xp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType1=xp;var Mp=class extends st{constructor(e){super(e,2)}};Z.RequestType2=Mp;var Lp=class extends st{constructor(e){super(e,3)}};Z.RequestType3=Lp;var $p=class extends st{constructor(e){super(e,4)}};Z.RequestType4=$p;var qp=class extends st{constructor(e){super(e,5)}};Z.RequestType5=qp;var jp=class extends st{constructor(e){super(e,6)}};Z.RequestType6=jp;var Fp=class extends st{constructor(e){super(e,7)}};Z.RequestType7=Fp;var Bp=class extends st{constructor(e){super(e,8)}};Z.RequestType8=Bp;var Up=class extends st{constructor(e){super(e,9)}};Z.RequestType9=Up;var Vp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType=Vp;var zp=class extends st{constructor(e){super(e,0)}};Z.NotificationType0=zp;var Wp=class extends st{constructor(e,n=gn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType1=Wp;var Hp=class extends st{constructor(e){super(e,2)}};Z.NotificationType2=Hp;var Gp=class extends st{constructor(e){super(e,3)}};Z.NotificationType3=Gp;var Yp=class extends st{constructor(e){super(e,4)}};Z.NotificationType4=Yp;var Kp=class extends st{constructor(e){super(e,5)}};Z.NotificationType5=Kp;var Xp=class extends st{constructor(e){super(e,6)}};Z.NotificationType6=Xp;var Jp=class extends st{constructor(e){super(e,7)}};Z.NotificationType7=Jp;var Qp=class extends st{constructor(e){super(e,8)}};Z.NotificationType8=Qp;var Zp=class extends st{constructor(e){super(e,9)}};Z.NotificationType9=Zp;var M_;(function(t){function e(i){let s=i;return s&&fs.string(s.method)&&(fs.string(s.id)||fs.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&fs.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(fs.string(s.id)||fs.number(s.id)||s.id===null)}t.isResponse=r})(M_||(Z.Message=M_={}))});var nm=k(_i=>{"use strict";var L_;Object.defineProperty(_i,"__esModule",{value:!0});_i.LRUCache=_i.LinkedMap=_i.Touch=void 0;var Qt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Qt||(_i.Touch=Qt={}));var iu=class{constructor(){this[L_]="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,n=Qt.None){let r=this._map.get(e);if(r)return n!==Qt.None&&this.touch(r,n),r.value}set(e,n,r=Qt.None){let i=this._map.get(e);if(i)i.value=n,r!==Qt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Qt.None:this.addItemLast(i);break;case Qt.First:this.addItemFirst(i);break;case Qt.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 n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(L_=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.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 n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Qt.First&&n!==Qt.Last)){if(n===Qt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Qt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};_i.LinkedMap=iu;var tm=class extends iu{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),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,n=Qt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Qt.None)}set(e,n){return super.set(e,n,Qt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};_i.LRUCache=tm});var q_=k(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.Disposable=void 0;var $_;(function(t){function e(n){return{dispose:n}}t.create=e})($_||(su.Disposable=$_={}))});var Si=k(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var rm;function im(){if(rm===void 0)throw new Error("No runtime abstraction layer installed");return rm}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");rm=n}t.install=e})(im||(im={}));sm.default=im});var io=k(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.Emitter=ro.Event=void 0;var IM=Si(),j_;(function(t){let e={dispose(){}};t.None=function(){return e}})(j_||(ro.Event=j_={}));var om=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,IM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ou=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new om),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.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)}};ro.Emitter=ou;ou._noop=function(){}});var lu=k(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var xM=Si(),MM=no(),am=io(),au;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:am.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:am.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||MM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(au||(so.CancellationToken=au={}));var LM=Object.freeze(function(t,e){let n=(0,xM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),cu=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?LM:(this._emitter||(this._emitter=new am.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},cm=class{get token(){return this._token||(this._token=new cu),this._token}cancel(){this._token?this._token.cancel():this._token=au.Cancelled}dispose(){this._token?this._token instanceof cu&&this._token.dispose():this._token=au.None}};so.CancellationTokenSource=cm});var F_=k(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.SharedArrayReceiverStrategy=oo.SharedArraySenderStrategy=void 0;var $M=lu(),Oa;(function(t){t.Continue=0,t.Cancelled=1})(Oa||(Oa={}));var lm=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Oa.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Oa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};oo.SharedArraySenderStrategy=lm;var um=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Oa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},dm=class{constructor(e){this.token=new um(e)}cancel(){}dispose(){}},fm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new $M.CancellationTokenSource:new dm(n)}};oo.SharedArrayReceiverStrategy=fm});var pm=k(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Semaphore=void 0;var qM=Si(),hm=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((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,qM.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 n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};uu.Semaphore=hm});var U_=k(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ReadableStreamMessageReader=Ei.AbstractMessageReader=Ei.MessageReader=void 0;var gm=Si(),ao=no(),mm=io(),jM=pm(),B_;(function(t){function e(n){let r=n;return r&&ao.func(r.listen)&&ao.func(r.dispose)&&ao.func(r.onError)&&ao.func(r.onClose)&&ao.func(r.onPartialMessage)}t.is=e})(B_||(Ei.MessageReader=B_={}));var du=class{constructor(){this.errorEmitter=new mm.Emitter,this.closeEmitter=new mm.Emitter,this.partialMessageEmitter=new mm.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: ${ao.string(e.message)?e.message:"unknown"}`)}};Ei.AbstractMessageReader=du;var ym;(function(t){function e(n){let r,i,s,o=new Map,a,c=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,c.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,gm.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(ym||(ym={}));var bm=class extends du{constructor(e,n){super(),this.readable=e,this.options=ym.fromOptions(n),this.buffer=(0,gm.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new jM.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 n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(r))}`));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 n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,gm.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ei.ReadableStreamMessageReader=bm});var G_=k(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.WriteableStreamMessageWriter=wi.AbstractMessageWriter=wi.MessageWriter=void 0;var V_=Si(),Ia=no(),FM=pm(),z_=io(),BM="Content-Length: ",W_=`\r
|
|
4
|
+
`,H_;(function(t){function e(n){let r=n;return r&&Ia.func(r.dispose)&&Ia.func(r.onClose)&&Ia.func(r.onError)&&Ia.func(r.write)}t.is=e})(H_||(wi.MessageWriter=H_={}));var fu=class{constructor(){this.errorEmitter=new z_.Emitter,this.closeEmitter=new z_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}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: ${Ia.string(e.message)?e.message:"unknown"}`)}};wi.AbstractMessageWriter=fu;var vm;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,V_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,V_.default)().applicationJson.encoder}}t.fromOptions=e})(vm||(vm={}));var Tm=class extends fu{constructor(e,n){super(),this.writable=e,this.options=vm.fromOptions(n),this.errorCount=0,this.writeSemaphore=new FM.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(BM,r.byteLength.toString(),W_),i.push(W_),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};wi.WriteableStreamMessageWriter=Tm});var Y_=k(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.AbstractMessageBuffer=void 0;var UM=13,VM=10,zM=`\r
|
|
5
|
+
`,_m=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(i=0;i<l.length;){switch(l[i]){case UM:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case VM:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=l.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(zM);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),h=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,h)}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 n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};hu.AbstractMessageBuffer=_m});var Z_=k(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.createMessageConnection=le.ConnectionOptions=le.MessageStrategy=le.CancellationStrategy=le.CancellationSenderStrategy=le.CancellationReceiverStrategy=le.RequestCancellationReceiverStrategy=le.IdCancellationReceiverStrategy=le.ConnectionStrategy=le.ConnectionError=le.ConnectionErrors=le.LogTraceNotification=le.SetTraceNotification=le.TraceFormat=le.TraceValues=le.Trace=le.NullLogger=le.ProgressType=le.ProgressToken=void 0;var K_=Si(),gt=no(),ne=em(),X_=nm(),xa=io(),Sm=lu(),$a;(function(t){t.type=new ne.NotificationType("$/cancelRequest")})($a||($a={}));var Em;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Em||(le.ProgressToken=Em={}));var Ma;(function(t){t.type=new ne.NotificationType("$/progress")})(Ma||(Ma={}));var wm=class{constructor(){}};le.ProgressType=wm;var km;(function(t){function e(n){return gt.func(n)}t.is=e})(km||(km={}));le.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ie;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ie||(le.Trace=Ie={}));var J_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(J_||(le.TraceValues=J_={}));(function(t){function e(r){if(!gt.string(r))return t.Off;switch(r=r.toLowerCase(),r){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 n(r){switch(r){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=n})(Ie||(le.Trace=Ie={}));var xn;(function(t){t.Text="text",t.JSON="json"})(xn||(le.TraceFormat=xn={}));(function(t){function e(n){return gt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(xn||(le.TraceFormat=xn={}));var Nm;(function(t){t.type=new ne.NotificationType("$/setTrace")})(Nm||(le.SetTraceNotification=Nm={}));var pu;(function(t){t.type=new ne.NotificationType("$/logTrace")})(pu||(le.LogTraceNotification=pu={}));var La;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(La||(le.ConnectionErrors=La={}));var co=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};le.ConnectionError=co;var Pm;(function(t){function e(n){let r=n;return r&>.func(r.cancelUndispatched)}t.is=e})(Pm||(le.ConnectionStrategy=Pm={}));var mu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&>.func(r.createCancellationTokenSource)&&(r.dispose===void 0||gt.func(r.dispose))}t.is=e})(mu||(le.IdCancellationReceiverStrategy=mu={}));var Rm;(function(t){function e(n){let r=n;return r&&r.kind==="request"&>.func(r.createCancellationTokenSource)&&(r.dispose===void 0||gt.func(r.dispose))}t.is=e})(Rm||(le.RequestCancellationReceiverStrategy=Rm={}));var gu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new Sm.CancellationTokenSource}});function e(n){return mu.is(n)||Rm.is(n)}t.is=e})(gu||(le.CancellationReceiverStrategy=gu={}));var yu;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification($a.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&>.func(r.sendCancellation)&>.func(r.cleanup)}t.is=e})(yu||(le.CancellationSenderStrategy=yu={}));var bu;(function(t){t.Message=Object.freeze({receiver:gu.Message,sender:yu.Message});function e(n){let r=n;return r&&gu.is(r.receiver)&&yu.is(r.sender)}t.is=e})(bu||(le.CancellationStrategy=bu={}));var vu;(function(t){function e(n){let r=n;return r&>.func(r.handleMessage)}t.is=e})(vu||(le.MessageStrategy=vu={}));var Q_;(function(t){function e(n){let r=n;return r&&(bu.is(r.cancellationStrategy)||Pm.is(r.connectionStrategy)||vu.is(r.messageStrategy))}t.is=e})(Q_||(le.ConnectionOptions=Q_={}));var ur;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(ur||(ur={}));function WM(t,e,n,r){let i=n!==void 0?n:le.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,h=new Map,y,p=new X_.LinkedMap,T=new Map,S=new Set,b=new Map,v=Ie.Off,w=xn.Text,C,L=ur.New,B=new xa.Emitter,q=new xa.Emitter,ae=new xa.Emitter,We=new xa.Emitter,Dt=new xa.Emitter,ge=r&&r.cancellationStrategy?r.cancellationStrategy:bu.Message;function Un(N){if(N===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+N.toString()}function vi(N){return N===null?"res-unknown-"+(++a).toString():"res-"+N.toString()}function Bl(){return"not-"+(++o).toString()}function Rp(N,x){ne.Message.isRequest(x)?N.set(Un(x.id),x):ne.Message.isResponse(x)?N.set(vi(x.id),x):N.set(Bl(),x)}function Ul(N){}function Na(){return L===ur.Listening}function ls(){return L===ur.Closed}function ei(){return L===ur.Disposed}function Js(){(L===ur.New||L===ur.Listening)&&(L=ur.Closed,q.fire(void 0))}function us(N){B.fire([N,void 0,void 0])}function Vl(N){B.fire(N)}t.onClose(Js),t.onError(us),e.onClose(Js),e.onError(Vl);function Pa(){y||p.size===0||(y=(0,K_.default)().timer.setImmediate(()=>{y=void 0,zl()}))}function Ra(N){ne.Message.isRequest(N)?Hl(N):ne.Message.isNotification(N)?Yl(N):ne.Message.isResponse(N)?Gl(N):Qs(N)}function zl(){if(p.size===0)return;let N=p.shift();try{let x=r?.messageStrategy;vu.is(x)?x.handleMessage(N,Ra):Ra(N)}finally{Pa()}}let Wl=N=>{try{if(ne.Message.isNotification(N)&&N.method===$a.type.method){let x=N.params.id,z=Un(x),X=p.get(z);if(ne.Message.isRequest(X)){let qe=r?.connectionStrategy,it=qe&&qe.cancelUndispatched?qe.cancelUndispatched(X,Ul):void 0;if(it&&(it.error!==void 0||it.result!==void 0)){p.delete(z),b.delete(x),it.id=X.id,ds(it,N.method,Date.now()),e.write(it).catch(()=>i.error("Sending response for canceled message failed."));return}}let He=b.get(x);if(He!==void 0){He.cancel(),Zs(N);return}else S.add(x)}Rp(p,N)}finally{Pa()}};function Hl(N){if(ei())return;function x(ye,Xe,De){let yt={jsonrpc:c,id:N.id};ye instanceof ne.ResponseError?yt.error=ye.toJson():yt.result=ye===void 0?null:ye,ds(yt,Xe,De),e.write(yt).catch(()=>i.error("Sending response failed."))}function z(ye,Xe,De){let yt={jsonrpc:c,id:N.id,error:ye.toJson()};ds(yt,Xe,De),e.write(yt).catch(()=>i.error("Sending response failed."))}function X(ye,Xe,De){ye===void 0&&(ye=null);let yt={jsonrpc:c,id:N.id,result:ye};ds(yt,Xe,De),e.write(yt).catch(()=>i.error("Sending response failed."))}Jl(N);let He=u.get(N.method),qe,it;He&&(qe=He.type,it=He.handler);let ht=Date.now();if(it||l){let ye=N.id??String(Date.now()),Xe=mu.is(ge.receiver)?ge.receiver.createCancellationTokenSource(ye):ge.receiver.createCancellationTokenSource(N);N.id!==null&&S.has(N.id)&&Xe.cancel(),N.id!==null&&b.set(ye,Xe);try{let De;if(it)if(N.params===void 0){if(qe!==void 0&&qe.numberOfParams!==0){z(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${N.method} defines ${qe.numberOfParams} params but received none.`),N.method,ht);return}De=it(Xe.token)}else if(Array.isArray(N.params)){if(qe!==void 0&&qe.parameterStructures===ne.ParameterStructures.byName){z(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${N.method} defines parameters by name but received parameters by position`),N.method,ht);return}De=it(...N.params,Xe.token)}else{if(qe!==void 0&&qe.parameterStructures===ne.ParameterStructures.byPosition){z(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${N.method} defines parameters by position but received parameters by name`),N.method,ht);return}De=it(N.params,Xe.token)}else l&&(De=l(N.method,N.params,Xe.token));let yt=De;De?yt.then?yt.then(Lt=>{b.delete(ye),x(Lt,N.method,ht)},Lt=>{b.delete(ye),Lt instanceof ne.ResponseError?z(Lt,N.method,ht):Lt&>.string(Lt.message)?z(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${N.method} failed with message: ${Lt.message}`),N.method,ht):z(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${N.method} failed unexpectedly without providing any details.`),N.method,ht)}):(b.delete(ye),x(De,N.method,ht)):(b.delete(ye),X(De,N.method,ht))}catch(De){b.delete(ye),De instanceof ne.ResponseError?x(De,N.method,ht):De&>.string(De.message)?z(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${N.method} failed with message: ${De.message}`),N.method,ht):z(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${N.method} failed unexpectedly without providing any details.`),N.method,ht)}}else z(new ne.ResponseError(ne.ErrorCodes.MethodNotFound,`Unhandled method ${N.method}`),N.method,ht)}function Gl(N){if(!ei())if(N.id===null)N.error?i.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(N.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let x=N.id,z=T.get(x);if(Ql(N,z),z!==void 0){T.delete(x);try{if(N.error){let X=N.error;z.reject(new ne.ResponseError(X.code,X.message,X.data))}else if(N.result!==void 0)z.resolve(N.result);else throw new Error("Should never happen.")}catch(X){X.message?i.error(`Response handler '${z.method}' failed with message: ${X.message}`):i.error(`Response handler '${z.method}' failed unexpectedly.`)}}}}function Yl(N){if(ei())return;let x,z;if(N.method===$a.type.method){let X=N.params.id;S.delete(X),Zs(N);return}else{let X=f.get(N.method);X&&(z=X.handler,x=X.type)}if(z||d)try{if(Zs(N),z)if(N.params===void 0)x!==void 0&&x.numberOfParams!==0&&x.parameterStructures!==ne.ParameterStructures.byName&&i.error(`Notification ${N.method} defines ${x.numberOfParams} params but received none.`),z();else if(Array.isArray(N.params)){let X=N.params;N.method===Ma.type.method&&X.length===2&&Em.is(X[0])?z({token:X[0],value:X[1]}):(x!==void 0&&(x.parameterStructures===ne.ParameterStructures.byName&&i.error(`Notification ${N.method} defines parameters by name but received parameters by position`),x.numberOfParams!==N.params.length&&i.error(`Notification ${N.method} defines ${x.numberOfParams} params but received ${X.length} arguments`)),z(...X))}else x!==void 0&&x.parameterStructures===ne.ParameterStructures.byPosition&&i.error(`Notification ${N.method} defines parameters by position but received parameters by name`),z(N.params);else d&&d(N.method,N.params)}catch(X){X.message?i.error(`Notification handler '${N.method}' failed with message: ${X.message}`):i.error(`Notification handler '${N.method}' failed unexpectedly.`)}else ae.fire(N)}function Qs(N){if(!N){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(N,null,4)}`);let x=N;if(gt.string(x.id)||gt.number(x.id)){let z=x.id,X=T.get(z);X&&X.reject(new Error("The received response has neither a result nor an error property."))}}function ar(N){if(N!=null)switch(v){case Ie.Verbose:return JSON.stringify(N,null,4);case Ie.Compact:return JSON.stringify(N);default:return}}function Kl(N){if(!(v===Ie.Off||!C))if(w===xn.Text){let x;(v===Ie.Verbose||v===Ie.Compact)&&N.params&&(x=`Params: ${ar(N.params)}
|
|
9
9
|
|
|
10
|
-
`),C.log(`Sending request '${N.method} - (${N.id})'.`,x)}else
|
|
10
|
+
`),C.log(`Sending request '${N.method} - (${N.id})'.`,x)}else ti("send-request",N)}function Xl(N){if(!(v===Ie.Off||!C))if(w===xn.Text){let x;(v===Ie.Verbose||v===Ie.Compact)&&(N.params?x=`Params: ${ar(N.params)}
|
|
11
11
|
|
|
12
12
|
`:x=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),C.log(`Sending notification '${N.method}'.`,x)}else
|
|
14
|
+
`),C.log(`Sending notification '${N.method}'.`,x)}else ti("send-notification",N)}function ds(N,x,z){if(!(v===Ie.Off||!C))if(w===xn.Text){let X;(v===Ie.Verbose||v===Ie.Compact)&&(N.error&&N.error.data?X=`Error data: ${ar(N.error.data)}
|
|
15
15
|
|
|
16
|
-
`:N.result?X=`Result: ${
|
|
16
|
+
`:N.result?X=`Result: ${ar(N.result)}
|
|
17
17
|
|
|
18
18
|
`:N.error===void 0&&(X=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),C.log(`Sending response '${x} - (${N.id})'. Processing request took ${Date.now()-z}ms`,X)}else
|
|
20
|
+
`)),C.log(`Sending response '${x} - (${N.id})'. Processing request took ${Date.now()-z}ms`,X)}else ti("send-response",N)}function Jl(N){if(!(v===Ie.Off||!C))if(w===xn.Text){let x;(v===Ie.Verbose||v===Ie.Compact)&&N.params&&(x=`Params: ${ar(N.params)}
|
|
21
21
|
|
|
22
|
-
`),C.log(`Received request '${N.method} - (${N.id})'.`,x)}else
|
|
22
|
+
`),C.log(`Received request '${N.method} - (${N.id})'.`,x)}else ti("receive-request",N)}function Zs(N){if(!(v===Ie.Off||!C||N.method===pu.type.method))if(w===xn.Text){let x;(v===Ie.Verbose||v===Ie.Compact)&&(N.params?x=`Params: ${ar(N.params)}
|
|
23
23
|
|
|
24
24
|
`:x=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),C.log(`Received notification '${N.method}'.`,x)}else
|
|
26
|
+
`),C.log(`Received notification '${N.method}'.`,x)}else ti("receive-notification",N)}function Ql(N,x){if(!(v===Ie.Off||!C))if(w===xn.Text){let z;if((v===Ie.Verbose||v===Ie.Compact)&&(N.error&&N.error.data?z=`Error data: ${ar(N.error.data)}
|
|
27
27
|
|
|
28
|
-
`:N.result?z=`Result: ${
|
|
28
|
+
`:N.result?z=`Result: ${ar(N.result)}
|
|
29
29
|
|
|
30
30
|
`:N.error===void 0&&(z=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),x){let X=N.error?` Request failed: ${N.error.message} (${N.error.code}).`:"";C.log(`Received response '${x.method} - (${N.id})' in ${Date.now()-x.timerStart}ms.${X}`,z)}else C.log(`Received response ${N.id} without active response promise.`,z)}else Zr("receive-response",N)}function Zr(N,x){if(!C||T===Oe.Off)return;let z={isLSPMessage:!0,type:N,message:x,timestamp:Date.now()};C.log(z)}function ys(){if(ai())throw new ao(Ma.Closed,"Connection is closed.");if(Qr())throw new ao(Ma.Disposed,"Connection is disposed.")}function Yl(){if(ka())throw new ao(Ma.AlreadyListening,"Connection is already listening")}function Kl(){if(!ka())throw new Error("Call listen() first.")}function Cr(N){return N===void 0?null:N}function Ra(N){if(N!==null)return N}function Ca(N){return N!=null&&!Array.isArray(N)&&typeof N=="object"}function Zi(N,x){switch(N){case ne.ParameterStructures.auto:return Ca(x)?Ra(x):[Cr(x)];case ne.ParameterStructures.byName:if(!Ca(x))throw new Error("Received parameters by name but param is not an object literal.");return Ra(x);case ne.ParameterStructures.byPosition:return[Cr(x)];default:throw new Error(`Unknown parameter structure ${N.toString()}`)}}function Da(N,x){let z,X=N.numberOfParams;switch(X){case 0:z=void 0;break;case 1:z=Zi(N.parameterStructures,x[0]);break;default:z=[];for(let ze=0;ze<x.length&&ze<X;ze++)z.push(Cr(x[ze]));if(x.length<X)for(let ze=x.length;ze<X;ze++)z.push(null);break}return z}let es={sendNotification:(N,...x)=>{ys();let z,X;if(ft.string(N)){z=N;let $e=x[0],nt=0,ut=ne.ParameterStructures.auto;ne.ParameterStructures.is($e)&&(nt=1,ut=$e);let ge=x.length,Ye=ge-nt;switch(Ye){case 0:X=void 0;break;case 1:X=Zi(ut,x[nt]);break;default:if(ut===ne.ParameterStructures.byName)throw new Error(`Received ${Ye} parameters for 'by Name' notification parameter structure.`);X=x.slice(nt,ge).map(Ce=>Cr(Ce));break}}else{let $e=x;z=N.method,X=Da(N,$e)}let ze={jsonrpc:c,method:z,params:X};return Wl(ze),e.write(ze).catch($e=>{throw s.error("Sending notification failed."),$e})},onNotification:(N,x)=>{ys();let z;return ft.func(N)?d=N:x&&(ft.string(N)?(z=N,f.set(N,{type:void 0,handler:x})):(z=N.method,f.set(N.method,{type:N,handler:x}))),{dispose:()=>{z!==void 0?f.delete(z):d=void 0}}},onProgress:(N,x,z)=>{if(h.has(x))throw new Error(`Progress handler for token ${x} already registered`);return h.set(x,z),{dispose:()=>{h.delete(x)}}},sendProgress:(N,x,z)=>es.sendNotification(xa.type,{token:x,value:z}),onUnhandledProgress:Ve.event,sendRequest:(N,...x)=>{ys(),Kl();let z,X,ze;if(ft.string(N)){z=N;let ge=x[0],Ye=x[x.length-1],Ce=0,mt=ne.ParameterStructures.auto;ne.ParameterStructures.is(ge)&&(Ce=1,mt=ge);let Mt=x.length;hm.CancellationToken.is(Ye)&&(Mt=Mt-1,ze=Ye);let In=Mt-Ce;switch(In){case 0:X=void 0;break;case 1:X=Zi(mt,x[Ce]);break;default:if(mt===ne.ParameterStructures.byName)throw new Error(`Received ${In} parameters for 'by Name' request parameter structure.`);X=x.slice(Ce,Mt).map(Xl=>Cr(Xl));break}}else{let ge=x;z=N.method,X=Da(N,ge);let Ye=N.numberOfParams;ze=hm.CancellationToken.is(ge[Ye])?ge[Ye]:void 0}let $e=i++,nt;ze&&(nt=ze.onCancellationRequested(()=>{let ge=me.sender.sendCancellation(es,$e);return ge===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${$e}`),Promise.resolve()):ge.catch(()=>{s.log(`Sending cancellation messages for id ${$e} failed`)})}));let ut={jsonrpc:c,id:$e,method:z,params:X};return zl(ut),typeof me.sender.enableCancellation=="function"&&me.sender.enableCancellation(ut),new Promise(async(ge,Ye)=>{let Ce=In=>{ge(In),me.sender.cleanup($e),nt?.dispose()},mt=In=>{Ye(In),me.sender.cleanup($e),nt?.dispose()},Mt={method:z,timerStart:Date.now(),resolve:Ce,reject:mt};try{await e.write(ut),b.set($e,Mt)}catch(In){throw s.error("Sending request failed."),Mt.reject(new ne.ResponseError(ne.ErrorCodes.MessageWriteError,In.message?In.message:"Unknown reason")),In}})},onRequest:(N,x)=>{ys();let z=null;return gm.is(N)?(z=void 0,l=N):ft.string(N)?(z=null,x!==void 0&&(z=N,u.set(N,{handler:x,type:void 0}))):x!==void 0&&(z=N.method,u.set(N.method,{type:N,handler:x})),{dispose:()=>{z!==null&&(z!==void 0?u.delete(z):l=void 0)}}},hasPendingResponse:()=>b.size>0,trace:async(N,x,z)=>{let X=!1,ze=xn.Text;z!==void 0&&(ft.boolean(z)?X=z:(X=z.sendNotification||!1,ze=z.traceFormat||xn.Text)),T=N,k=ze,T===Oe.Off?C=void 0:C=x,X&&!ai()&&!Qr()&&await es.sendNotification(ym.type,{value:Oe.toString(N)})},onError:B.event,onClose:q.event,onUnhandledNotification:oe.event,onDispose:Dt.event,end:()=>{e.end()},dispose:()=>{if(Qr())return;$=lr.Disposed,Dt.fire(void 0);let N=new ne.ResponseError(ne.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let x of b.values())x.reject(N);b=new Map,_=new Map,E=new Set,m=new M_.LinkedMap,ft.func(e.dispose)&&e.dispose(),ft.func(t.dispose)&&t.dispose()},listen:()=>{ys(),Yl(),$=lr.Listening,t.listen(Fl)},inspect:()=>{(0,x_.default)().console.log("inspect")}};return es.onNotification(lu.type,N=>{if(T===Oe.Off||!C)return;let x=T===Oe.Verbose||T===Oe.Compact;C.log(N.message,x?N.verbose:void 0)}),es.onNotification(xa.type,N=>{let x=h.get(N.token);x?x(N.value):Ve.fire(N)}),es}ce.createMessageConnection=EM});var mu=w(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 Ze=Wp();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return Ze.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return Ze.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return Ze.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return Ze.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return Ze.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return Ze.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return Ze.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return Ze.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return Ze.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return Ze.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return Ze.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return Ze.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return Ze.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return Ze.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return Ze.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return Ze.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return Ze.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return Ze.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return Ze.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return Ze.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return Ze.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return Ze.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return Ze.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return Ze.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return Ze.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return Ze.ParameterStructures}});var Tm=Gp();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Tm.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Tm.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Tm.Touch}});var wM=E_();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return wM.Disposable}});var j_=ro();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return j_.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return j_.Emitter}});var F_=su();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return F_.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return F_.CancellationToken}});var B_=k_();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return B_.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return B_.SharedArrayReceiverStrategy}});var _m=P_();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return _m.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return _m.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _m.ReadableStreamMessageReader}});var Sm=O_();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Sm.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Sm.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Sm.WriteableStreamMessageWriter}});var kM=I_();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return kM.AbstractMessageBuffer}});var Ut=q_();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Ut.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Ut.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Ut.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Ut.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Ut.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Ut.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Ut.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Ut.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Ut.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Ut.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Ut.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Ut.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Ut.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ut.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ut.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Ut.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Ut.MessageStrategy}});var NM=vs();I.RAL=NM.default});var z_=w(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var U_=require("util"),ns=mu(),gu=class t extends ns.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new U_.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};gu.emptyBuffer=Buffer.allocUnsafe(0);var Em=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ns.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ns.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ns.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ns.Disposable.create(()=>this.stream.off("data",e))}},wm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ns.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ns.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ns.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,n,i):this.stream.write(e,i)})}end(){this.stream.end()}},V_=Object.freeze({messageBuffer:Object.freeze({create:t=>new gu(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(n){return Promise.reject(n)}}}),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 U_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Em(t),asWritableStream:t=>new wm(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function km(){return V_}(function(t){function e(){ns.RAL.install(V_)}t.install=e})(km||(km={}));Nm.default=km});var hi=w(_e=>{"use strict";var PM=_e&&_e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),RM=_e&&_e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&PM(e,t,n)};Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.createServerSocketTransport=_e.createClientSocketTransport=_e.createServerPipeTransport=_e.createClientPipeTransport=_e.generateRandomPipeName=_e.StreamMessageWriter=_e.StreamMessageReader=_e.SocketMessageWriter=_e.SocketMessageReader=_e.PortMessageWriter=_e.PortMessageReader=_e.IPCMessageWriter=_e.IPCMessageReader=void 0;var co=z_();co.default.install();var W_=require("path"),CM=require("os"),DM=require("crypto"),vu=require("net"),Mn=mu();RM(mu(),_e);var Pm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};_e.IPCMessageReader=Pm;var Rm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.IPCMessageWriter=Rm;var Cm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};_e.PortMessageReader=Cm;var Dm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.PortMessageWriter=Dm;var di=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,co.default)().stream.asReadableStream(e),n)}};_e.SocketMessageReader=di;var fi=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,co.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};_e.SocketMessageWriter=fi;var yu=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,co.default)().stream.asReadableStream(e),n)}};_e.StreamMessageReader=yu;var bu=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,co.default)().stream.asWritableStream(e),n)}};_e.StreamMessageWriter=bu;var H_=process.env.XDG_RUNTIME_DIR,AM=new Map([["linux",107],["darwin",103]]);function OM(){let t=(0,DM.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;H_?e=W_.join(H_,`vscode-ipc-${t}.sock`):e=W_.join(CM.tmpdir(),`vscode-${t}.sock`);let n=AM.get(process.platform);return n!==void 0&&e.length>n&&(0,co.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}_e.generateRandomPipeName=OM;function IM(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,vu.createServer)(a=>{o.close(),n([new di(a,e),new fi(a,e)])});o.on("error",i),o.listen(t,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}_e.createClientPipeTransport=IM;function xM(t,e="utf-8"){let n=(0,vu.createConnection)(t);return[new di(n,e),new fi(n,e)]}_e.createServerPipeTransport=xM;function MM(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,vu.createServer)(a=>{o.close(),n([new di(a,e),new fi(a,e)])});o.on("error",i),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}_e.createClientSocketTransport=MM;function $M(t,e="utf-8"){let n=(0,vu.createConnection)(t,"127.0.0.1");return[new di(n,e),new fi(n,e)]}_e.createServerSocketTransport=$M;function LM(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function qM(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function jM(t,e,n,r){n||(n=Mn.NullLogger);let s=LM(t)?new yu(t):t,i=qM(e)?new bu(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(s,i,n,r)}_e.createMessageConnection=jM});var Am=w((uK,G_)=>{"use strict";G_.exports=hi()});var _u=w((Y_,Tu)=>{(function(t){if(typeof Tu=="object"&&typeof Tu.exports=="object"){var e=t(require,Y_);e!==void 0&&(Tu.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 n;(function(g){function P(R){return typeof R=="string"}g.is=P})(n||(e.DocumentUri=n={}));var r;(function(g){function P(R){return typeof R=="string"}g.is=P})(r||(e.URI=r={}));var s;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(s||(e.integer=s={}));var i;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(i||(e.uinteger=i={}));var o;(function(g){function P(v,p){return v===Number.MAX_VALUE&&(v=i.MAX_VALUE),p===Number.MAX_VALUE&&(p=i.MAX_VALUE),{line:v,character:p}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&A.uinteger(p.line)&&A.uinteger(p.character)}g.is=R})(o||(e.Position=o={}));var a;(function(g){function P(v,p,D,M){if(A.uinteger(v)&&A.uinteger(p)&&A.uinteger(D)&&A.uinteger(M))return{start:o.create(v,p),end:o.create(D,M)};if(o.is(v)&&o.is(p))return{start:v,end:p};throw new Error("Range#create called with invalid arguments[".concat(v,", ").concat(p,", ").concat(D,", ").concat(M,"]"))}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&o.is(p.start)&&o.is(p.end)}g.is=R})(a||(e.Range=a={}));var c;(function(g){function P(v,p){return{uri:v,range:p}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&(A.string(p.uri)||A.undefined(p.uri))}g.is=R})(c||(e.Location=c={}));var l;(function(g){function P(v,p,D,M){return{targetUri:v,targetRange:p,targetSelectionRange:D,originSelectionRange:M}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&a.is(p.targetRange)&&A.string(p.targetUri)&&a.is(p.targetSelectionRange)&&(a.is(p.originSelectionRange)||A.undefined(p.originSelectionRange))}g.is=R})(l||(e.LocationLink=l={}));var u;(function(g){function P(v,p,D,M){return{red:v,green:p,blue:D,alpha:M}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&A.numberRange(p.red,0,1)&&A.numberRange(p.green,0,1)&&A.numberRange(p.blue,0,1)&&A.numberRange(p.alpha,0,1)}g.is=R})(u||(e.Color=u={}));var d;(function(g){function P(v,p){return{range:v,color:p}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&u.is(p.color)}g.is=R})(d||(e.ColorInformation=d={}));var f;(function(g){function P(v,p,D){return{label:v,textEdit:p,additionalTextEdits:D}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&A.string(p.label)&&(A.undefined(p.textEdit)||C.is(p))&&(A.undefined(p.additionalTextEdits)||A.typedArray(p.additionalTextEdits,C.is))}g.is=R})(f||(e.ColorPresentation=f={}));var h;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(h||(e.FoldingRangeKind=h={}));var y;(function(g){function P(v,p,D,M,ae,gt){var Qe={startLine:v,endLine:p};return A.defined(D)&&(Qe.startCharacter=D),A.defined(M)&&(Qe.endCharacter=M),A.defined(ae)&&(Qe.kind=ae),A.defined(gt)&&(Qe.collapsedText=gt),Qe}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&A.uinteger(p.startLine)&&A.uinteger(p.startLine)&&(A.undefined(p.startCharacter)||A.uinteger(p.startCharacter))&&(A.undefined(p.endCharacter)||A.uinteger(p.endCharacter))&&(A.undefined(p.kind)||A.string(p.kind))}g.is=R})(y||(e.FoldingRange=y={}));var m;(function(g){function P(v,p){return{location:v,message:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&c.is(p.location)&&A.string(p.message)}g.is=R})(m||(e.DiagnosticRelatedInformation=m={}));var b;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(b||(e.DiagnosticSeverity=b={}));var E;(function(g){g.Unnecessary=1,g.Deprecated=2})(E||(e.DiagnosticTag=E={}));var _;(function(g){function P(R){var v=R;return A.objectLiteral(v)&&A.string(v.href)}g.is=P})(_||(e.CodeDescription=_={}));var T;(function(g){function P(v,p,D,M,ae,gt){var Qe={range:v,message:p};return A.defined(D)&&(Qe.severity=D),A.defined(M)&&(Qe.code=M),A.defined(ae)&&(Qe.source=ae),A.defined(gt)&&(Qe.relatedInformation=gt),Qe}g.create=P;function R(v){var p,D=v;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((p=D.codeDescription)===null||p===void 0?void 0:p.href))&&(A.string(D.source)||A.undefined(D.source))&&(A.undefined(D.relatedInformation)||A.typedArray(D.relatedInformation,m.is))}g.is=R})(T||(e.Diagnostic=T={}));var k;(function(g){function P(v,p){for(var D=[],M=2;M<arguments.length;M++)D[M-2]=arguments[M];var ae={title:v,command:p};return A.defined(D)&&D.length>0&&(ae.arguments=D),ae}g.create=P;function R(v){var p=v;return A.defined(p)&&A.string(p.title)&&A.string(p.command)}g.is=R})(k||(e.Command=k={}));var C;(function(g){function P(D,M){return{range:D,newText:M}}g.replace=P;function R(D,M){return{range:{start:D,end:D},newText:M}}g.insert=R;function v(D){return{range:D,newText:""}}g.del=v;function p(D){var M=D;return A.objectLiteral(M)&&A.string(M.newText)&&a.is(M.range)}g.is=p})(C||(e.TextEdit=C={}));var $;(function(g){function P(v,p,D){var M={label:v};return p!==void 0&&(M.needsConfirmation=p),D!==void 0&&(M.description=D),M}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&A.string(p.label)&&(A.boolean(p.needsConfirmation)||p.needsConfirmation===void 0)&&(A.string(p.description)||p.description===void 0)}g.is=R})($||(e.ChangeAnnotation=$={}));var B;(function(g){function P(R){var v=R;return A.string(v)}g.is=P})(B||(e.ChangeAnnotationIdentifier=B={}));var q;(function(g){function P(D,M,ae){return{range:D,newText:M,annotationId:ae}}g.replace=P;function R(D,M,ae){return{range:{start:D,end:D},newText:M,annotationId:ae}}g.insert=R;function v(D,M){return{range:D,newText:"",annotationId:M}}g.del=v;function p(D){var M=D;return C.is(M)&&($.is(M.annotationId)||B.is(M.annotationId))}g.is=p})(q||(e.AnnotatedTextEdit=q={}));var oe;(function(g){function P(v,p){return{textDocument:v,edits:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&ai.is(p.textDocument)&&Array.isArray(p.edits)}g.is=R})(oe||(e.TextDocumentEdit=oe={}));var Ve;(function(g){function P(v,p,D){var M={kind:"create",uri:v};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(M.options=p),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(v){var p=v;return p&&p.kind==="create"&&A.string(p.uri)&&(p.options===void 0||(p.options.overwrite===void 0||A.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||A.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||B.is(p.annotationId))}g.is=R})(Ve||(e.CreateFile=Ve={}));var Dt;(function(g){function P(v,p,D,M){var ae={kind:"rename",oldUri:v,newUri:p};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ae.options=D),M!==void 0&&(ae.annotationId=M),ae}g.create=P;function R(v){var p=v;return p&&p.kind==="rename"&&A.string(p.oldUri)&&A.string(p.newUri)&&(p.options===void 0||(p.options.overwrite===void 0||A.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||A.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||B.is(p.annotationId))}g.is=R})(Dt||(e.RenameFile=Dt={}));var me;(function(g){function P(v,p,D){var M={kind:"delete",uri:v};return p!==void 0&&(p.recursive!==void 0||p.ignoreIfNotExists!==void 0)&&(M.options=p),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(v){var p=v;return p&&p.kind==="delete"&&A.string(p.uri)&&(p.options===void 0||(p.options.recursive===void 0||A.boolean(p.options.recursive))&&(p.options.ignoreIfNotExists===void 0||A.boolean(p.options.ignoreIfNotExists)))&&(p.annotationId===void 0||B.is(p.annotationId))}g.is=R})(me||(e.DeleteFile=me={}));var Un;(function(g){function P(R){var v=R;return v&&(v.changes!==void 0||v.documentChanges!==void 0)&&(v.documentChanges===void 0||v.documentChanges.every(function(p){return A.string(p.kind)?Ve.is(p)||Dt.is(p)||me.is(p):oe.is(p)}))}g.is=P})(Un||(e.WorkspaceEdit=Un={}));var gs=function(){function g(P,R){this.edits=P,this.changeAnnotations=R}return g.prototype.insert=function(P,R,v){var p,D;if(v===void 0?p=C.insert(P,R):B.is(v)?(D=v,p=q.insert(P,R,v)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(v),p=q.insert(P,R,D)),this.edits.push(p),D!==void 0)return D},g.prototype.replace=function(P,R,v){var p,D;if(v===void 0?p=C.replace(P,R):B.is(v)?(D=v,p=q.replace(P,R,v)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(v),p=q.replace(P,R,D)),this.edits.push(p),D!==void 0)return D},g.prototype.delete=function(P,R){var v,p;if(R===void 0?v=C.del(P):B.is(R)?(p=R,v=q.del(P,R)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(R),v=q.del(P,p)),this.edits.push(v),p!==void 0)return p},g.prototype.add=function(P){this.edits.push(P)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),$l=function(){function g(P){this._annotations=P===void 0?Object.create(null):P,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(P,R){var v;if(B.is(P)?v=P:(v=this.nextId(),R=P),this._annotations[v]!==void 0)throw new Error("Id ".concat(v," is already in use."));if(R===void 0)throw new Error("No annotation provided for id ".concat(v));return this._annotations[v]=R,this._size++,v},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),vp=function(){function g(P){var R=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new $l(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(v){if(oe.is(v)){var p=new gs(v.edits,R._changeAnnotations);R._textEditChanges[v.textDocument.uri]=p}})):P.changes&&Object.keys(P.changes).forEach(function(v){var p=new gs(P.changes[v]);R._textEditChanges[v]=p})):this._workspaceEdit={}}return Object.defineProperty(g.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}),g.prototype.getTextEditChange=function(P){if(ai.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R={uri:P.uri,version:P.version},v=this._textEditChanges[R.uri];if(!v){var p=[],D={textDocument:R,edits:p};this._workspaceEdit.documentChanges.push(D),v=new gs(p,this._changeAnnotations),this._textEditChanges[R.uri]=v}return v}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var v=this._textEditChanges[P];if(!v){var p=[];this._workspaceEdit.changes[P]=p,v=new gs(p),this._textEditChanges[P]=v}return v}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new $l,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(P,R,v){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;$.is(R)||B.is(R)?p=R:v=R;var D,M;if(p===void 0?D=Ve.create(P,v):(M=B.is(p)?p:this._changeAnnotations.manage(p),D=Ve.create(P,v,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g.prototype.renameFile=function(P,R,v,p){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;$.is(v)||B.is(v)?D=v:p=v;var M,ae;if(D===void 0?M=Dt.create(P,R,p):(ae=B.is(D)?D:this._changeAnnotations.manage(D),M=Dt.create(P,R,p,ae)),this._workspaceEdit.documentChanges.push(M),ae!==void 0)return ae},g.prototype.deleteFile=function(P,R,v){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;$.is(R)||B.is(R)?p=R:v=R;var D,M;if(p===void 0?D=me.create(P,v):(M=B.is(p)?p:this._changeAnnotations.manage(p),D=me.create(P,v,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g}();e.WorkspaceChange=vp;var Ll;(function(g){function P(v){return{uri:v}}g.create=P;function R(v){var p=v;return A.defined(p)&&A.string(p.uri)}g.is=R})(Ll||(e.TextDocumentIdentifier=Ll={}));var ka;(function(g){function P(v,p){return{uri:v,version:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&A.string(p.uri)&&A.integer(p.version)}g.is=R})(ka||(e.VersionedTextDocumentIdentifier=ka={}));var ai;(function(g){function P(v,p){return{uri:v,version:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&A.string(p.uri)&&(p.version===null||A.integer(p.version))}g.is=R})(ai||(e.OptionalVersionedTextDocumentIdentifier=ai={}));var Qr;(function(g){function P(v,p,D,M){return{uri:v,languageId:p,version:D,text:M}}g.create=P;function R(v){var p=v;return A.defined(p)&&A.string(p.uri)&&A.string(p.languageId)&&A.integer(p.version)&&A.string(p.text)}g.is=R})(Qr||(e.TextDocumentItem=Qr={}));var Xi;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function P(R){var v=R;return v===g.PlainText||v===g.Markdown}g.is=P})(Xi||(e.MarkupKind=Xi={}));var ci;(function(g){function P(R){var v=R;return A.objectLiteral(R)&&Xi.is(v.kind)&&A.string(v.value)}g.is=P})(ci||(e.MarkupContent=ci={}));var ql;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(ql||(e.CompletionItemKind=ql={}));var Na;(function(g){g.PlainText=1,g.Snippet=2})(Na||(e.InsertTextFormat=Na={}));var Pa;(function(g){g.Deprecated=1})(Pa||(e.CompletionItemTag=Pa={}));var jl;(function(g){function P(v,p,D){return{newText:v,insert:p,replace:D}}g.create=P;function R(v){var p=v;return p&&A.string(p.newText)&&a.is(p.insert)&&a.is(p.replace)}g.is=R})(jl||(e.InsertReplaceEdit=jl={}));var Fl;(function(g){g.asIs=1,g.adjustIndentation=2})(Fl||(e.InsertTextMode=Fl={}));var Bl;(function(g){function P(R){var v=R;return v&&(A.string(v.detail)||v.detail===void 0)&&(A.string(v.description)||v.description===void 0)}g.is=P})(Bl||(e.CompletionItemLabelDetails=Bl={}));var Ul;(function(g){function P(R){return{label:R}}g.create=P})(Ul||(e.CompletionItem=Ul={}));var Vl;(function(g){function P(R,v){return{items:R||[],isIncomplete:!!v}}g.create=P})(Vl||(e.CompletionList=Vl={}));var Ji;(function(g){function P(v){return v.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=P;function R(v){var p=v;return A.string(p)||A.objectLiteral(p)&&A.string(p.language)&&A.string(p.value)}g.is=R})(Ji||(e.MarkedString=Ji={}));var or;(function(g){function P(R){var v=R;return!!v&&A.objectLiteral(v)&&(ci.is(v.contents)||Ji.is(v.contents)||A.typedArray(v.contents,Ji.is))&&(R.range===void 0||a.is(R.range))}g.is=P})(or||(e.Hover=or={}));var zl;(function(g){function P(R,v){return v?{label:R,documentation:v}:{label:R}}g.create=P})(zl||(e.ParameterInformation=zl={}));var Wl;(function(g){function P(R,v){for(var p=[],D=2;D<arguments.length;D++)p[D-2]=arguments[D];var M={label:R};return A.defined(v)&&(M.documentation=v),A.defined(p)?M.parameters=p:M.parameters=[],M}g.create=P})(Wl||(e.SignatureInformation=Wl={}));var li;(function(g){g.Text=1,g.Read=2,g.Write=3})(li||(e.DocumentHighlightKind=li={}));var Hl;(function(g){function P(R,v){var p={range:R};return A.number(v)&&(p.kind=v),p}g.create=P})(Hl||(e.DocumentHighlight=Hl={}));var Qi;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(Qi||(e.SymbolKind=Qi={}));var Gl;(function(g){g.Deprecated=1})(Gl||(e.SymbolTag=Gl={}));var Zr;(function(g){function P(R,v,p,D,M){var ae={name:R,kind:v,location:{uri:D,range:p}};return M&&(ae.containerName=M),ae}g.create=P})(Zr||(e.SymbolInformation=Zr={}));var ys;(function(g){function P(R,v,p,D){return D!==void 0?{name:R,kind:v,location:{uri:p,range:D}}:{name:R,kind:v,location:{uri:p}}}g.create=P})(ys||(e.WorkspaceSymbol=ys={}));var Yl;(function(g){function P(v,p,D,M,ae,gt){var Qe={name:v,detail:p,kind:D,range:M,selectionRange:ae};return gt!==void 0&&(Qe.children=gt),Qe}g.create=P;function R(v){var p=v;return p&&A.string(p.name)&&A.number(p.kind)&&a.is(p.range)&&a.is(p.selectionRange)&&(p.detail===void 0||A.string(p.detail))&&(p.deprecated===void 0||A.boolean(p.deprecated))&&(p.children===void 0||Array.isArray(p.children))&&(p.tags===void 0||Array.isArray(p.tags))}g.is=R})(Yl||(e.DocumentSymbol=Yl={}));var Kl;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(Kl||(e.CodeActionKind=Kl={}));var Cr;(function(g){g.Invoked=1,g.Automatic=2})(Cr||(e.CodeActionTriggerKind=Cr={}));var Ra;(function(g){function P(v,p,D){var M={diagnostics:v};return p!=null&&(M.only=p),D!=null&&(M.triggerKind=D),M}g.create=P;function R(v){var p=v;return A.defined(p)&&A.typedArray(p.diagnostics,T.is)&&(p.only===void 0||A.typedArray(p.only,A.string))&&(p.triggerKind===void 0||p.triggerKind===Cr.Invoked||p.triggerKind===Cr.Automatic)}g.is=R})(Ra||(e.CodeActionContext=Ra={}));var Ca;(function(g){function P(v,p,D){var M={title:v},ae=!0;return typeof p=="string"?(ae=!1,M.kind=p):k.is(p)?M.command=p:M.edit=p,ae&&D!==void 0&&(M.kind=D),M}g.create=P;function R(v){var p=v;return p&&A.string(p.title)&&(p.diagnostics===void 0||A.typedArray(p.diagnostics,T.is))&&(p.kind===void 0||A.string(p.kind))&&(p.edit!==void 0||p.command!==void 0)&&(p.command===void 0||k.is(p.command))&&(p.isPreferred===void 0||A.boolean(p.isPreferred))&&(p.edit===void 0||Un.is(p.edit))}g.is=R})(Ca||(e.CodeAction=Ca={}));var Zi;(function(g){function P(v,p){var D={range:v};return A.defined(p)&&(D.data=p),D}g.create=P;function R(v){var p=v;return A.defined(p)&&a.is(p.range)&&(A.undefined(p.command)||k.is(p.command))}g.is=R})(Zi||(e.CodeLens=Zi={}));var Da;(function(g){function P(v,p){return{tabSize:v,insertSpaces:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&A.uinteger(p.tabSize)&&A.boolean(p.insertSpaces)}g.is=R})(Da||(e.FormattingOptions=Da={}));var es;(function(g){function P(v,p,D){return{range:v,target:p,data:D}}g.create=P;function R(v){var p=v;return A.defined(p)&&a.is(p.range)&&(A.undefined(p.target)||A.string(p.target))}g.is=R})(es||(e.DocumentLink=es={}));var N;(function(g){function P(v,p){return{range:v,parent:p}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&(p.parent===void 0||g.is(p.parent))}g.is=R})(N||(e.SelectionRange=N={}));var x;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(x||(e.SemanticTokenTypes=x={}));var z;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(z||(e.SemanticTokenModifiers=z={}));var X;(function(g){function P(R){var v=R;return A.objectLiteral(v)&&(v.resultId===void 0||typeof v.resultId=="string")&&Array.isArray(v.data)&&(v.data.length===0||typeof v.data[0]=="number")}g.is=P})(X||(e.SemanticTokens=X={}));var ze;(function(g){function P(v,p){return{range:v,text:p}}g.create=P;function R(v){var p=v;return p!=null&&a.is(p.range)&&A.string(p.text)}g.is=R})(ze||(e.InlineValueText=ze={}));var $e;(function(g){function P(v,p,D){return{range:v,variableName:p,caseSensitiveLookup:D}}g.create=P;function R(v){var p=v;return p!=null&&a.is(p.range)&&A.boolean(p.caseSensitiveLookup)&&(A.string(p.variableName)||p.variableName===void 0)}g.is=R})($e||(e.InlineValueVariableLookup=$e={}));var nt;(function(g){function P(v,p){return{range:v,expression:p}}g.create=P;function R(v){var p=v;return p!=null&&a.is(p.range)&&(A.string(p.expression)||p.expression===void 0)}g.is=R})(nt||(e.InlineValueEvaluatableExpression=nt={}));var ut;(function(g){function P(v,p){return{frameId:v,stoppedLocation:p}}g.create=P;function R(v){var p=v;return A.defined(p)&&a.is(v.stoppedLocation)}g.is=R})(ut||(e.InlineValueContext=ut={}));var ge;(function(g){g.Type=1,g.Parameter=2;function P(R){return R===1||R===2}g.is=P})(ge||(e.InlayHintKind=ge={}));var Ye;(function(g){function P(v){return{value:v}}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&(p.tooltip===void 0||A.string(p.tooltip)||ci.is(p.tooltip))&&(p.location===void 0||c.is(p.location))&&(p.command===void 0||k.is(p.command))}g.is=R})(Ye||(e.InlayHintLabelPart=Ye={}));var Ce;(function(g){function P(v,p,D){var M={position:v,label:p};return D!==void 0&&(M.kind=D),M}g.create=P;function R(v){var p=v;return A.objectLiteral(p)&&o.is(p.position)&&(A.string(p.label)||A.typedArray(p.label,Ye.is))&&(p.kind===void 0||ge.is(p.kind))&&p.textEdits===void 0||A.typedArray(p.textEdits,C.is)&&(p.tooltip===void 0||A.string(p.tooltip)||ci.is(p.tooltip))&&(p.paddingLeft===void 0||A.boolean(p.paddingLeft))&&(p.paddingRight===void 0||A.boolean(p.paddingRight))}g.is=R})(Ce||(e.InlayHint=Ce={}));var mt;(function(g){function P(R){return{kind:"snippet",value:R}}g.createSnippet=P})(mt||(e.StringValue=mt={}));var Mt;(function(g){function P(R,v,p,D){return{insertText:R,filterText:v,range:p,command:D}}g.create=P})(Mt||(e.InlineCompletionItem=Mt={}));var In;(function(g){function P(R){return{items:R}}g.create=P})(In||(e.InlineCompletionList=In={}));var Xl;(function(g){g.Invoked=0,g.Automatic=1})(Xl||(e.InlineCompletionTriggerKind=Xl={}));var u_;(function(g){function P(R,v){return{range:R,text:v}}g.create=P})(u_||(e.SelectedCompletionInfo=u_={}));var d_;(function(g){function P(R,v){return{triggerKind:R,selectedCompletionInfo:v}}g.create=P})(d_||(e.InlineCompletionContext=d_={}));var f_;(function(g){function P(R){var v=R;return A.objectLiteral(v)&&r.is(v.uri)&&A.string(v.name)}g.is=P})(f_||(e.WorkspaceFolder=f_={})),e.EOL=[`
|
|
32
|
+
`)),x){let X=N.error?` Request failed: ${N.error.message} (${N.error.code}).`:"";C.log(`Received response '${x.method} - (${N.id})' in ${Date.now()-x.timerStart}ms.${X}`,z)}else C.log(`Received response ${N.id} without active response promise.`,z)}else ti("receive-response",N)}function ti(N,x){if(!C||v===Ie.Off)return;let z={isLSPMessage:!0,type:N,message:x,timestamp:Date.now()};C.log(z)}function Ti(){if(ls())throw new co(La.Closed,"Connection is closed.");if(ei())throw new co(La.Disposed,"Connection is disposed.")}function Zl(){if(Na())throw new co(La.AlreadyListening,"Connection is already listening")}function eu(){if(!Na())throw new Error("Call listen() first.")}function Dr(N){return N===void 0?null:N}function Ca(N){if(N!==null)return N}function Da(N){return N!=null&&!Array.isArray(N)&&typeof N=="object"}function eo(N,x){switch(N){case ne.ParameterStructures.auto:return Da(x)?Ca(x):[Dr(x)];case ne.ParameterStructures.byName:if(!Da(x))throw new Error("Received parameters by name but param is not an object literal.");return Ca(x);case ne.ParameterStructures.byPosition:return[Dr(x)];default:throw new Error(`Unknown parameter structure ${N.toString()}`)}}function Aa(N,x){let z,X=N.numberOfParams;switch(X){case 0:z=void 0;break;case 1:z=eo(N.parameterStructures,x[0]);break;default:z=[];for(let He=0;He<x.length&&He<X;He++)z.push(Dr(x[He]));if(x.length<X)for(let He=x.length;He<X;He++)z.push(null);break}return z}let ni={sendNotification:(N,...x)=>{Ti();let z,X;if(gt.string(N)){z=N;let qe=x[0],it=0,ht=ne.ParameterStructures.auto;ne.ParameterStructures.is(qe)&&(it=1,ht=qe);let ye=x.length,Xe=ye-it;switch(Xe){case 0:X=void 0;break;case 1:X=eo(ht,x[it]);break;default:if(ht===ne.ParameterStructures.byName)throw new Error(`Received ${Xe} parameters for 'by Name' notification parameter structure.`);X=x.slice(it,ye).map(De=>Dr(De));break}}else{let qe=x;z=N.method,X=Aa(N,qe)}let He={jsonrpc:c,method:z,params:X};return Xl(He),e.write(He).catch(qe=>{throw i.error("Sending notification failed."),qe})},onNotification:(N,x)=>{Ti();let z;return gt.func(N)?d=N:x&&(gt.string(N)?(z=N,f.set(N,{type:void 0,handler:x})):(z=N.method,f.set(N.method,{type:N,handler:x}))),{dispose:()=>{z!==void 0?f.delete(z):d=void 0}}},onProgress:(N,x,z)=>{if(h.has(x))throw new Error(`Progress handler for token ${x} already registered`);return h.set(x,z),{dispose:()=>{h.delete(x)}}},sendProgress:(N,x,z)=>ni.sendNotification(Ma.type,{token:x,value:z}),onUnhandledProgress:We.event,sendRequest:(N,...x)=>{Ti(),eu();let z,X,He;if(gt.string(N)){z=N;let ye=x[0],Xe=x[x.length-1],De=0,yt=ne.ParameterStructures.auto;ne.ParameterStructures.is(ye)&&(De=1,yt=ye);let Lt=x.length;Sm.CancellationToken.is(Xe)&&(Lt=Lt-1,He=Xe);let In=Lt-De;switch(In){case 0:X=void 0;break;case 1:X=eo(yt,x[De]);break;default:if(yt===ne.ParameterStructures.byName)throw new Error(`Received ${In} parameters for 'by Name' request parameter structure.`);X=x.slice(De,Lt).map(tu=>Dr(tu));break}}else{let ye=x;z=N.method,X=Aa(N,ye);let Xe=N.numberOfParams;He=Sm.CancellationToken.is(ye[Xe])?ye[Xe]:void 0}let qe=s++,it;He&&(it=He.onCancellationRequested(()=>{let ye=ge.sender.sendCancellation(ni,qe);return ye===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${qe}`),Promise.resolve()):ye.catch(()=>{i.log(`Sending cancellation messages for id ${qe} failed`)})}));let ht={jsonrpc:c,id:qe,method:z,params:X};return Kl(ht),typeof ge.sender.enableCancellation=="function"&&ge.sender.enableCancellation(ht),new Promise(async(ye,Xe)=>{let De=In=>{ye(In),ge.sender.cleanup(qe),it?.dispose()},yt=In=>{Xe(In),ge.sender.cleanup(qe),it?.dispose()},Lt={method:z,timerStart:Date.now(),resolve:De,reject:yt};try{await e.write(ht),T.set(qe,Lt)}catch(In){throw i.error("Sending request failed."),Lt.reject(new ne.ResponseError(ne.ErrorCodes.MessageWriteError,In.message?In.message:"Unknown reason")),In}})},onRequest:(N,x)=>{Ti();let z=null;return km.is(N)?(z=void 0,l=N):gt.string(N)?(z=null,x!==void 0&&(z=N,u.set(N,{handler:x,type:void 0}))):x!==void 0&&(z=N.method,u.set(N.method,{type:N,handler:x})),{dispose:()=>{z!==null&&(z!==void 0?u.delete(z):l=void 0)}}},hasPendingResponse:()=>T.size>0,trace:async(N,x,z)=>{let X=!1,He=xn.Text;z!==void 0&&(gt.boolean(z)?X=z:(X=z.sendNotification||!1,He=z.traceFormat||xn.Text)),v=N,w=He,v===Ie.Off?C=void 0:C=x,X&&!ls()&&!ei()&&await ni.sendNotification(Nm.type,{value:Ie.toString(N)})},onError:B.event,onClose:q.event,onUnhandledNotification:ae.event,onDispose:Dt.event,end:()=>{e.end()},dispose:()=>{if(ei())return;L=ur.Disposed,Dt.fire(void 0);let N=new ne.ResponseError(ne.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let x of T.values())x.reject(N);T=new Map,b=new Map,S=new Set,p=new X_.LinkedMap,gt.func(e.dispose)&&e.dispose(),gt.func(t.dispose)&&t.dispose()},listen:()=>{Ti(),Zl(),L=ur.Listening,t.listen(Wl)},inspect:()=>{(0,K_.default)().console.log("inspect")}};return ni.onNotification(pu.type,N=>{if(v===Ie.Off||!C)return;let x=v===Ie.Verbose||v===Ie.Compact;C.log(N.message,x?N.verbose:void 0)}),ni.onNotification(Ma.type,N=>{let x=h.get(N.token);x?x(N.value):We.fire(N)}),ni}le.createMessageConnection=WM});var Tu=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 et=em();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return et.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return et.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return et.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return et.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return et.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return et.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return et.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return et.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return et.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return et.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return et.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return et.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return et.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return et.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return et.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return et.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return et.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return et.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return et.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return et.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return et.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return et.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return et.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return et.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return et.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return et.ParameterStructures}});var Cm=nm();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Cm.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Cm.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Cm.Touch}});var HM=q_();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return HM.Disposable}});var eS=io();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return eS.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return eS.Emitter}});var tS=lu();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return tS.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return tS.CancellationToken}});var nS=F_();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return nS.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return nS.SharedArrayReceiverStrategy}});var Dm=U_();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return Dm.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return Dm.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Dm.ReadableStreamMessageReader}});var Am=G_();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Am.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Am.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Am.WriteableStreamMessageWriter}});var GM=Y_();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return GM.AbstractMessageBuffer}});var Vt=Z_();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var YM=Si();I.RAL=YM.default});var sS=k(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var rS=require("util"),ii=Tu(),_u=class t extends ii.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new rS.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};_u.emptyBuffer=Buffer.allocUnsafe(0);var Om=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ii.Disposable.create(()=>this.stream.off("data",e))}},Im=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},iS=Object.freeze({messageBuffer:Object.freeze({create:t=>new _u(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(n){return Promise.reject(n)}}}),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 rS.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Om(t),asWritableStream:t=>new Im(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function xm(){return iS}(function(t){function e(){ii.RAL.install(iS)}t.install=e})(xm||(xm={}));Mm.default=xm});var ms=k(Se=>{"use strict";var KM=Se&&Se.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),XM=Se&&Se.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KM(e,t,n)};Object.defineProperty(Se,"__esModule",{value:!0});Se.createMessageConnection=Se.createServerSocketTransport=Se.createClientSocketTransport=Se.createServerPipeTransport=Se.createClientPipeTransport=Se.generateRandomPipeName=Se.StreamMessageWriter=Se.StreamMessageReader=Se.SocketMessageWriter=Se.SocketMessageReader=Se.PortMessageWriter=Se.PortMessageReader=Se.IPCMessageWriter=Se.IPCMessageReader=void 0;var lo=sS();lo.default.install();var oS=require("path"),JM=require("os"),QM=require("crypto"),wu=require("net"),Mn=Tu();XM(Tu(),Se);var Lm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};Se.IPCMessageReader=Lm;var $m=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Se.IPCMessageWriter=$m;var qm=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};Se.PortMessageReader=qm;var jm=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Se.PortMessageWriter=jm;var hs=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,lo.default)().stream.asReadableStream(e),n)}};Se.SocketMessageReader=hs;var ps=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Se.SocketMessageWriter=ps;var Su=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,lo.default)().stream.asReadableStream(e),n)}};Se.StreamMessageReader=Su;var Eu=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n)}};Se.StreamMessageWriter=Eu;var aS=process.env.XDG_RUNTIME_DIR,ZM=new Map([["linux",107],["darwin",103]]);function e1(){let t=(0,QM.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;aS?e=oS.join(aS,`vscode-ipc-${t}.sock`):e=oS.join(JM.tmpdir(),`vscode-${t}.sock`);let n=ZM.get(process.platform);return n!==void 0&&e.length>n&&(0,lo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Se.generateRandomPipeName=e1;function t1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,wu.createServer)(a=>{o.close(),n([new hs(a,e),new ps(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientPipeTransport=t1;function n1(t,e="utf-8"){let n=(0,wu.createConnection)(t);return[new hs(n,e),new ps(n,e)]}Se.createServerPipeTransport=n1;function r1(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,wu.createServer)(a=>{o.close(),n([new hs(a,e),new ps(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientSocketTransport=r1;function i1(t,e="utf-8"){let n=(0,wu.createConnection)(t,"127.0.0.1");return[new hs(n,e),new ps(n,e)]}Se.createServerSocketTransport=i1;function s1(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function o1(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function a1(t,e,n,r){n||(n=Mn.NullLogger);let i=s1(t)?new Su(t):t,s=o1(e)?new Eu(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(i,s,n,r)}Se.createMessageConnection=a1});var Fm=k((WK,cS)=>{"use strict";cS.exports=ms()});var Nu=k((lS,ku)=>{(function(t){if(typeof ku=="object"&&typeof ku.exports=="object"){var e=t(require,lS);e!==void 0&&(ku.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 n;(function(g){function P(R){return typeof R=="string"}g.is=P})(n||(e.DocumentUri=n={}));var r;(function(g){function P(R){return typeof R=="string"}g.is=P})(r||(e.URI=r={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function P(R){return typeof R=="number"&&g.MIN_VALUE<=R&&R<=g.MAX_VALUE}g.is=P})(s||(e.uinteger=s={}));var o;(function(g){function P(_,m){return _===Number.MAX_VALUE&&(_=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:_,character:m}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}g.is=R})(o||(e.Position=o={}));var a;(function(g){function P(_,m,D,M){if(A.uinteger(_)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(M))return{start:o.create(_,m),end:o.create(D,M)};if(o.is(_)&&o.is(m))return{start:_,end:m};throw new Error("Range#create called with invalid arguments[".concat(_,", ").concat(m,", ").concat(D,", ").concat(M,"]"))}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}g.is=R})(a||(e.Range=a={}));var c;(function(g){function P(_,m){return{uri:_,range:m}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}g.is=R})(c||(e.Location=c={}));var l;(function(g){function P(_,m,D,M){return{targetUri:_,targetRange:m,targetSelectionRange:D,originSelectionRange:M}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&a.is(m.targetRange)&&A.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||A.undefined(m.originSelectionRange))}g.is=R})(l||(e.LocationLink=l={}));var u;(function(g){function P(_,m,D,M){return{red:_,green:m,blue:D,alpha:M}}g.create=P;function R(_){var m=_;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)}g.is=R})(u||(e.Color=u={}));var d;(function(g){function P(_,m){return{range:_,color:m}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}g.is=R})(d||(e.ColorInformation=d={}));var f;(function(g){function P(_,m,D){return{label:_,textEdit:m,additionalTextEdits:D}}g.create=P;function R(_){var m=_;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))}g.is=R})(f||(e.ColorPresentation=f={}));var h;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(h||(e.FoldingRangeKind=h={}));var y;(function(g){function P(_,m,D,M,ce,bt){var Ze={startLine:_,endLine:m};return A.defined(D)&&(Ze.startCharacter=D),A.defined(M)&&(Ze.endCharacter=M),A.defined(ce)&&(Ze.kind=ce),A.defined(bt)&&(Ze.collapsedText=bt),Ze}g.create=P;function R(_){var m=_;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))}g.is=R})(y||(e.FoldingRange=y={}));var p;(function(g){function P(_,m){return{location:_,message:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}g.is=R})(p||(e.DiagnosticRelatedInformation=p={}));var T;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(T||(e.DiagnosticSeverity=T={}));var S;(function(g){g.Unnecessary=1,g.Deprecated=2})(S||(e.DiagnosticTag=S={}));var b;(function(g){function P(R){var _=R;return A.objectLiteral(_)&&A.string(_.href)}g.is=P})(b||(e.CodeDescription=b={}));var v;(function(g){function P(_,m,D,M,ce,bt){var Ze={range:_,message:m};return A.defined(D)&&(Ze.severity=D),A.defined(M)&&(Ze.code=M),A.defined(ce)&&(Ze.source=ce),A.defined(bt)&&(Ze.relatedInformation=bt),Ze}g.create=P;function R(_){var m,D=_;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,p.is))}g.is=R})(v||(e.Diagnostic=v={}));var w;(function(g){function P(_,m){for(var D=[],M=2;M<arguments.length;M++)D[M-2]=arguments[M];var ce={title:_,command:m};return A.defined(D)&&D.length>0&&(ce.arguments=D),ce}g.create=P;function R(_){var m=_;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}g.is=R})(w||(e.Command=w={}));var C;(function(g){function P(D,M){return{range:D,newText:M}}g.replace=P;function R(D,M){return{range:{start:D,end:D},newText:M}}g.insert=R;function _(D){return{range:D,newText:""}}g.del=_;function m(D){var M=D;return A.objectLiteral(M)&&A.string(M.newText)&&a.is(M.range)}g.is=m})(C||(e.TextEdit=C={}));var L;(function(g){function P(_,m,D){var M={label:_};return m!==void 0&&(M.needsConfirmation=m),D!==void 0&&(M.description=D),M}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&A.string(m.label)&&(A.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(A.string(m.description)||m.description===void 0)}g.is=R})(L||(e.ChangeAnnotation=L={}));var B;(function(g){function P(R){var _=R;return A.string(_)}g.is=P})(B||(e.ChangeAnnotationIdentifier=B={}));var q;(function(g){function P(D,M,ce){return{range:D,newText:M,annotationId:ce}}g.replace=P;function R(D,M,ce){return{range:{start:D,end:D},newText:M,annotationId:ce}}g.insert=R;function _(D,M){return{range:D,newText:"",annotationId:M}}g.del=_;function m(D){var M=D;return C.is(M)&&(L.is(M.annotationId)||B.is(M.annotationId))}g.is=m})(q||(e.AnnotatedTextEdit=q={}));var ae;(function(g){function P(_,m){return{textDocument:_,edits:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&ls.is(m.textDocument)&&Array.isArray(m.edits)}g.is=R})(ae||(e.TextDocumentEdit=ae={}));var We;(function(g){function P(_,m,D){var M={kind:"create",uri:_};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(_){var m=_;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||B.is(m.annotationId))}g.is=R})(We||(e.CreateFile=We={}));var Dt;(function(g){function P(_,m,D,M){var ce={kind:"rename",oldUri:_,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ce.options=D),M!==void 0&&(ce.annotationId=M),ce}g.create=P;function R(_){var m=_;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||B.is(m.annotationId))}g.is=R})(Dt||(e.RenameFile=Dt={}));var ge;(function(g){function P(_,m,D){var M={kind:"delete",uri:_};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(M.options=m),D!==void 0&&(M.annotationId=D),M}g.create=P;function R(_){var m=_;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||B.is(m.annotationId))}g.is=R})(ge||(e.DeleteFile=ge={}));var Un;(function(g){function P(R){var _=R;return _&&(_.changes!==void 0||_.documentChanges!==void 0)&&(_.documentChanges===void 0||_.documentChanges.every(function(m){return A.string(m.kind)?We.is(m)||Dt.is(m)||ge.is(m):ae.is(m)}))}g.is=P})(Un||(e.WorkspaceEdit=Un={}));var vi=function(){function g(P,R){this.edits=P,this.changeAnnotations=R}return g.prototype.insert=function(P,R,_){var m,D;if(_===void 0?m=C.insert(P,R):B.is(_)?(D=_,m=q.insert(P,R,_)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(_),m=q.insert(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.replace=function(P,R,_){var m,D;if(_===void 0?m=C.replace(P,R):B.is(_)?(D=_,m=q.replace(P,R,_)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(_),m=q.replace(P,R,D)),this.edits.push(m),D!==void 0)return D},g.prototype.delete=function(P,R){var _,m;if(R===void 0?_=C.del(P):B.is(R)?(m=R,_=q.del(P,R)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(R),_=q.del(P,m)),this.edits.push(_),m!==void 0)return m},g.prototype.add=function(P){this.edits.push(P)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(P){if(P===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),Bl=function(){function g(P){this._annotations=P===void 0?Object.create(null):P,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(P,R){var _;if(B.is(P)?_=P:(_=this.nextId(),R=P),this._annotations[_]!==void 0)throw new Error("Id ".concat(_," is already in use."));if(R===void 0)throw new Error("No annotation provided for id ".concat(_));return this._annotations[_]=R,this._size++,_},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),Rp=function(){function g(P){var R=this;this._textEditChanges=Object.create(null),P!==void 0?(this._workspaceEdit=P,P.documentChanges?(this._changeAnnotations=new Bl(P.changeAnnotations),P.changeAnnotations=this._changeAnnotations.all(),P.documentChanges.forEach(function(_){if(ae.is(_)){var m=new vi(_.edits,R._changeAnnotations);R._textEditChanges[_.textDocument.uri]=m}})):P.changes&&Object.keys(P.changes).forEach(function(_){var m=new vi(P.changes[_]);R._textEditChanges[_]=m})):this._workspaceEdit={}}return Object.defineProperty(g.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}),g.prototype.getTextEditChange=function(P){if(ls.is(P)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R={uri:P.uri,version:P.version},_=this._textEditChanges[R.uri];if(!_){var m=[],D={textDocument:R,edits:m};this._workspaceEdit.documentChanges.push(D),_=new vi(m,this._changeAnnotations),this._textEditChanges[R.uri]=_}return _}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var _=this._textEditChanges[P];if(!_){var m=[];this._workspaceEdit.changes[P]=m,_=new vi(m),this._textEditChanges[P]=_}return _}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Bl,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(P,R,_){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:_=R;var D,M;if(m===void 0?D=We.create(P,_):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=We.create(P,_,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g.prototype.renameFile=function(P,R,_,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(_)||B.is(_)?D=_:m=_;var M,ce;if(D===void 0?M=Dt.create(P,R,m):(ce=B.is(D)?D:this._changeAnnotations.manage(D),M=Dt.create(P,R,m,ce)),this._workspaceEdit.documentChanges.push(M),ce!==void 0)return ce},g.prototype.deleteFile=function(P,R,_){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;L.is(R)||B.is(R)?m=R:_=R;var D,M;if(m===void 0?D=ge.create(P,_):(M=B.is(m)?m:this._changeAnnotations.manage(m),D=ge.create(P,_,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},g}();e.WorkspaceChange=Rp;var Ul;(function(g){function P(_){return{uri:_}}g.create=P;function R(_){var m=_;return A.defined(m)&&A.string(m.uri)}g.is=R})(Ul||(e.TextDocumentIdentifier=Ul={}));var Na;(function(g){function P(_,m){return{uri:_,version:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}g.is=R})(Na||(e.VersionedTextDocumentIdentifier=Na={}));var ls;(function(g){function P(_,m){return{uri:_,version:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}g.is=R})(ls||(e.OptionalVersionedTextDocumentIdentifier=ls={}));var ei;(function(g){function P(_,m,D,M){return{uri:_,languageId:m,version:D,text:M}}g.create=P;function R(_){var m=_;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}g.is=R})(ei||(e.TextDocumentItem=ei={}));var Js;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function P(R){var _=R;return _===g.PlainText||_===g.Markdown}g.is=P})(Js||(e.MarkupKind=Js={}));var us;(function(g){function P(R){var _=R;return A.objectLiteral(R)&&Js.is(_.kind)&&A.string(_.value)}g.is=P})(us||(e.MarkupContent=us={}));var Vl;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(Vl||(e.CompletionItemKind=Vl={}));var Pa;(function(g){g.PlainText=1,g.Snippet=2})(Pa||(e.InsertTextFormat=Pa={}));var Ra;(function(g){g.Deprecated=1})(Ra||(e.CompletionItemTag=Ra={}));var zl;(function(g){function P(_,m,D){return{newText:_,insert:m,replace:D}}g.create=P;function R(_){var m=_;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}g.is=R})(zl||(e.InsertReplaceEdit=zl={}));var Wl;(function(g){g.asIs=1,g.adjustIndentation=2})(Wl||(e.InsertTextMode=Wl={}));var Hl;(function(g){function P(R){var _=R;return _&&(A.string(_.detail)||_.detail===void 0)&&(A.string(_.description)||_.description===void 0)}g.is=P})(Hl||(e.CompletionItemLabelDetails=Hl={}));var Gl;(function(g){function P(R){return{label:R}}g.create=P})(Gl||(e.CompletionItem=Gl={}));var Yl;(function(g){function P(R,_){return{items:R||[],isIncomplete:!!_}}g.create=P})(Yl||(e.CompletionList=Yl={}));var Qs;(function(g){function P(_){return _.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=P;function R(_){var m=_;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}g.is=R})(Qs||(e.MarkedString=Qs={}));var ar;(function(g){function P(R){var _=R;return!!_&&A.objectLiteral(_)&&(us.is(_.contents)||Qs.is(_.contents)||A.typedArray(_.contents,Qs.is))&&(R.range===void 0||a.is(R.range))}g.is=P})(ar||(e.Hover=ar={}));var Kl;(function(g){function P(R,_){return _?{label:R,documentation:_}:{label:R}}g.create=P})(Kl||(e.ParameterInformation=Kl={}));var Xl;(function(g){function P(R,_){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var M={label:R};return A.defined(_)&&(M.documentation=_),A.defined(m)?M.parameters=m:M.parameters=[],M}g.create=P})(Xl||(e.SignatureInformation=Xl={}));var ds;(function(g){g.Text=1,g.Read=2,g.Write=3})(ds||(e.DocumentHighlightKind=ds={}));var Jl;(function(g){function P(R,_){var m={range:R};return A.number(_)&&(m.kind=_),m}g.create=P})(Jl||(e.DocumentHighlight=Jl={}));var Zs;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(Zs||(e.SymbolKind=Zs={}));var Ql;(function(g){g.Deprecated=1})(Ql||(e.SymbolTag=Ql={}));var ti;(function(g){function P(R,_,m,D,M){var ce={name:R,kind:_,location:{uri:D,range:m}};return M&&(ce.containerName=M),ce}g.create=P})(ti||(e.SymbolInformation=ti={}));var Ti;(function(g){function P(R,_,m,D){return D!==void 0?{name:R,kind:_,location:{uri:m,range:D}}:{name:R,kind:_,location:{uri:m}}}g.create=P})(Ti||(e.WorkspaceSymbol=Ti={}));var Zl;(function(g){function P(_,m,D,M,ce,bt){var Ze={name:_,detail:m,kind:D,range:M,selectionRange:ce};return bt!==void 0&&(Ze.children=bt),Ze}g.create=P;function R(_){var m=_;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))}g.is=R})(Zl||(e.DocumentSymbol=Zl={}));var eu;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(eu||(e.CodeActionKind=eu={}));var Dr;(function(g){g.Invoked=1,g.Automatic=2})(Dr||(e.CodeActionTriggerKind=Dr={}));var Ca;(function(g){function P(_,m,D){var M={diagnostics:_};return m!=null&&(M.only=m),D!=null&&(M.triggerKind=D),M}g.create=P;function R(_){var m=_;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===Dr.Invoked||m.triggerKind===Dr.Automatic)}g.is=R})(Ca||(e.CodeActionContext=Ca={}));var Da;(function(g){function P(_,m,D){var M={title:_},ce=!0;return typeof m=="string"?(ce=!1,M.kind=m):w.is(m)?M.command=m:M.edit=m,ce&&D!==void 0&&(M.kind=D),M}g.create=P;function R(_){var m=_;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||w.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Un.is(m.edit))}g.is=R})(Da||(e.CodeAction=Da={}));var eo;(function(g){function P(_,m){var D={range:_};return A.defined(m)&&(D.data=m),D}g.create=P;function R(_){var m=_;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||w.is(m.command))}g.is=R})(eo||(e.CodeLens=eo={}));var Aa;(function(g){function P(_,m){return{tabSize:_,insertSpaces:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}g.is=R})(Aa||(e.FormattingOptions=Aa={}));var ni;(function(g){function P(_,m,D){return{range:_,target:m,data:D}}g.create=P;function R(_){var m=_;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}g.is=R})(ni||(e.DocumentLink=ni={}));var N;(function(g){function P(_,m){return{range:_,parent:m}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||g.is(m.parent))}g.is=R})(N||(e.SelectionRange=N={}));var x;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(x||(e.SemanticTokenTypes=x={}));var z;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(z||(e.SemanticTokenModifiers=z={}));var X;(function(g){function P(R){var _=R;return A.objectLiteral(_)&&(_.resultId===void 0||typeof _.resultId=="string")&&Array.isArray(_.data)&&(_.data.length===0||typeof _.data[0]=="number")}g.is=P})(X||(e.SemanticTokens=X={}));var He;(function(g){function P(_,m){return{range:_,text:m}}g.create=P;function R(_){var m=_;return m!=null&&a.is(m.range)&&A.string(m.text)}g.is=R})(He||(e.InlineValueText=He={}));var qe;(function(g){function P(_,m,D){return{range:_,variableName:m,caseSensitiveLookup:D}}g.create=P;function R(_){var m=_;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}g.is=R})(qe||(e.InlineValueVariableLookup=qe={}));var it;(function(g){function P(_,m){return{range:_,expression:m}}g.create=P;function R(_){var m=_;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}g.is=R})(it||(e.InlineValueEvaluatableExpression=it={}));var ht;(function(g){function P(_,m){return{frameId:_,stoppedLocation:m}}g.create=P;function R(_){var m=_;return A.defined(m)&&a.is(_.stoppedLocation)}g.is=R})(ht||(e.InlineValueContext=ht={}));var ye;(function(g){g.Type=1,g.Parameter=2;function P(R){return R===1||R===2}g.is=P})(ye||(e.InlayHintKind=ye={}));var Xe;(function(g){function P(_){return{value:_}}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||us.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||w.is(m.command))}g.is=R})(Xe||(e.InlayHintLabelPart=Xe={}));var De;(function(g){function P(_,m,D){var M={position:_,label:m};return D!==void 0&&(M.kind=D),M}g.create=P;function R(_){var m=_;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,Xe.is))&&(m.kind===void 0||ye.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||us.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}g.is=R})(De||(e.InlayHint=De={}));var yt;(function(g){function P(R){return{kind:"snippet",value:R}}g.createSnippet=P})(yt||(e.StringValue=yt={}));var Lt;(function(g){function P(R,_,m,D){return{insertText:R,filterText:_,range:m,command:D}}g.create=P})(Lt||(e.InlineCompletionItem=Lt={}));var In;(function(g){function P(R){return{items:R}}g.create=P})(In||(e.InlineCompletionList=In={}));var tu;(function(g){g.Invoked=0,g.Automatic=1})(tu||(e.InlineCompletionTriggerKind=tu={}));var k_;(function(g){function P(R,_){return{range:R,text:_}}g.create=P})(k_||(e.SelectedCompletionInfo=k_={}));var N_;(function(g){function P(R,_){return{triggerKind:R,selectedCompletionInfo:_}}g.create=P})(N_||(e.InlineCompletionContext=N_={}));var P_;(function(g){function P(R){var _=R;return A.objectLiteral(_)&&r.is(_.uri)&&A.string(_.name)}g.is=P})(P_||(e.WorkspaceFolder=P_={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
35
|
-
`,D==="\r"&&
|
|
36
|
-
`&&p++}v&&R.length>0&&P.push(R.length),this._lineOffsets=P}return this._lineOffsets},g.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var R=this.getLineOffsets(),v=0,p=R.length;if(p===0)return o.create(0,P);for(;v<p;){var D=Math.floor((v+p)/2);R[D]>P?p=D:v=D+1}var M=v-1;return o.create(M,P-R[M])},g.prototype.offsetAt=function(P){var R=this.getLineOffsets();if(P.line>=R.length)return this._content.length;if(P.line<0)return 0;var v=R[P.line],p=P.line+1<R.length?R[P.line+1]:this._content.length;return Math.max(Math.min(v+P.character,p),v)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var P=Object.prototype.toString;function R(Te){return typeof Te<"u"}g.defined=R;function v(Te){return typeof Te>"u"}g.undefined=v;function p(Te){return Te===!0||Te===!1}g.boolean=p;function D(Te){return P.call(Te)==="[object String]"}g.string=D;function M(Te){return P.call(Te)==="[object Number]"}g.number=M;function ae(Te,eo,Jl){return P.call(Te)==="[object Number]"&&eo<=Te&&Te<=Jl}g.numberRange=ae;function gt(Te){return P.call(Te)==="[object Number]"&&-2147483648<=Te&&Te<=2147483647}g.integer=gt;function Qe(Te){return P.call(Te)==="[object Number]"&&0<=Te&&Te<=2147483647}g.uinteger=Qe;function ar(Te){return P.call(Te)==="[object Function]"}g.func=ar;function cr(Te){return Te!==null&&typeof Te=="object"}g.objectLiteral=cr;function ts(Te,eo){return Array.isArray(Te)&&Te.every(eo)}g.typedArray=ts})(A||(A={}))})});var dt=w(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.ProtocolNotificationType=gn.ProtocolNotificationType0=gn.ProtocolRequestType=gn.ProtocolRequestType0=gn.RegistrationType=gn.MessageDirection=void 0;var lo=hi(),K_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(K_||(gn.MessageDirection=K_={}));var Om=class{constructor(e){this.method=e}};gn.RegistrationType=Om;var Im=class extends lo.RequestType0{constructor(e){super(e)}};gn.ProtocolRequestType0=Im;var xm=class extends lo.RequestType{constructor(e){super(e,lo.ParameterStructures.byName)}};gn.ProtocolRequestType=xm;var Mm=class extends lo.NotificationType0{constructor(e){super(e)}};gn.ProtocolNotificationType0=Mm;var $m=class extends lo.NotificationType{constructor(e){super(e,lo.ParameterStructures.byName)}};gn.ProtocolNotificationType=$m});var Su=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.objectLiteral=Nt.typedArray=Nt.stringArray=Nt.array=Nt.func=Nt.error=Nt.number=Nt.string=Nt.boolean=void 0;function FM(t){return t===!0||t===!1}Nt.boolean=FM;function X_(t){return typeof t=="string"||t instanceof String}Nt.string=X_;function BM(t){return typeof t=="number"||t instanceof Number}Nt.number=BM;function UM(t){return t instanceof Error}Nt.error=UM;function VM(t){return typeof t=="function"}Nt.func=VM;function J_(t){return Array.isArray(t)}Nt.array=J_;function zM(t){return J_(t)&&t.every(e=>X_(e))}Nt.stringArray=zM;function WM(t,e){return Array.isArray(t)&&t.every(e)}Nt.typedArray=WM;function HM(t){return t!==null&&typeof t=="object"}Nt.objectLiteral=HM});var eS=w(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.ImplementationRequest=void 0;var Q_=dt(),Z_;(function(t){t.method="textDocument/implementation",t.messageDirection=Q_.MessageDirection.clientToServer,t.type=new Q_.ProtocolRequestType(t.method)})(Z_||(Eu.ImplementationRequest=Z_={}))});var rS=w(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.TypeDefinitionRequest=void 0;var tS=dt(),nS;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=tS.MessageDirection.clientToServer,t.type=new tS.ProtocolRequestType(t.method)})(nS||(wu.TypeDefinitionRequest=nS={}))});var oS=w(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.DidChangeWorkspaceFoldersNotification=uo.WorkspaceFoldersRequest=void 0;var ku=dt(),sS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ku.MessageDirection.serverToClient,t.type=new ku.ProtocolRequestType0(t.method)})(sS||(uo.WorkspaceFoldersRequest=sS={}));var iS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ku.MessageDirection.clientToServer,t.type=new ku.ProtocolNotificationType(t.method)})(iS||(uo.DidChangeWorkspaceFoldersNotification=iS={}))});var lS=w(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ConfigurationRequest=void 0;var aS=dt(),cS;(function(t){t.method="workspace/configuration",t.messageDirection=aS.MessageDirection.serverToClient,t.type=new aS.ProtocolRequestType(t.method)})(cS||(Nu.ConfigurationRequest=cS={}))});var fS=w(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ColorPresentationRequest=fo.DocumentColorRequest=void 0;var Pu=dt(),uS;(function(t){t.method="textDocument/documentColor",t.messageDirection=Pu.MessageDirection.clientToServer,t.type=new Pu.ProtocolRequestType(t.method)})(uS||(fo.DocumentColorRequest=uS={}));var dS;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Pu.MessageDirection.clientToServer,t.type=new Pu.ProtocolRequestType(t.method)})(dS||(fo.ColorPresentationRequest=dS={}))});var mS=w(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.FoldingRangeRefreshRequest=ho.FoldingRangeRequest=void 0;var Ru=dt(),hS;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ru.MessageDirection.clientToServer,t.type=new Ru.ProtocolRequestType(t.method)})(hS||(ho.FoldingRangeRequest=hS={}));var pS;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ru.MessageDirection.serverToClient,t.type=new Ru.ProtocolRequestType0(t.method)})(pS||(ho.FoldingRangeRefreshRequest=pS={}))});var bS=w(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.DeclarationRequest=void 0;var gS=dt(),yS;(function(t){t.method="textDocument/declaration",t.messageDirection=gS.MessageDirection.clientToServer,t.type=new gS.ProtocolRequestType(t.method)})(yS||(Cu.DeclarationRequest=yS={}))});var _S=w(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.SelectionRangeRequest=void 0;var vS=dt(),TS;(function(t){t.method="textDocument/selectionRange",t.messageDirection=vS.MessageDirection.clientToServer,t.type=new vS.ProtocolRequestType(t.method)})(TS||(Du.SelectionRangeRequest=TS={}))});var kS=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.WorkDoneProgressCancelNotification=Ss.WorkDoneProgressCreateRequest=Ss.WorkDoneProgress=void 0;var GM=hi(),Au=dt(),SS;(function(t){t.type=new GM.ProgressType;function e(n){return n===t.type}t.is=e})(SS||(Ss.WorkDoneProgress=SS={}));var ES;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Au.MessageDirection.serverToClient,t.type=new Au.ProtocolRequestType(t.method)})(ES||(Ss.WorkDoneProgressCreateRequest=ES={}));var wS;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Au.MessageDirection.clientToServer,t.type=new Au.ProtocolNotificationType(t.method)})(wS||(Ss.WorkDoneProgressCancelNotification=wS={}))});var CS=w(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.CallHierarchyOutgoingCallsRequest=Es.CallHierarchyIncomingCallsRequest=Es.CallHierarchyPrepareRequest=void 0;var po=dt(),NS;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(NS||(Es.CallHierarchyPrepareRequest=NS={}));var PS;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(PS||(Es.CallHierarchyIncomingCallsRequest=PS={}));var RS;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(RS||(Es.CallHierarchyOutgoingCallsRequest=RS={}))});var MS=w(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.SemanticTokensRefreshRequest=yn.SemanticTokensRangeRequest=yn.SemanticTokensDeltaRequest=yn.SemanticTokensRequest=yn.SemanticTokensRegistrationType=yn.TokenFormat=void 0;var rs=dt(),DS;(function(t){t.Relative="relative"})(DS||(yn.TokenFormat=DS={}));var La;(function(t){t.method="textDocument/semanticTokens",t.type=new rs.RegistrationType(t.method)})(La||(yn.SemanticTokensRegistrationType=La={}));var AS;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=rs.MessageDirection.clientToServer,t.type=new rs.ProtocolRequestType(t.method),t.registrationMethod=La.method})(AS||(yn.SemanticTokensRequest=AS={}));var OS;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=rs.MessageDirection.clientToServer,t.type=new rs.ProtocolRequestType(t.method),t.registrationMethod=La.method})(OS||(yn.SemanticTokensDeltaRequest=OS={}));var IS;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=rs.MessageDirection.clientToServer,t.type=new rs.ProtocolRequestType(t.method),t.registrationMethod=La.method})(IS||(yn.SemanticTokensRangeRequest=IS={}));var xS;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType0(t.method)})(xS||(yn.SemanticTokensRefreshRequest=xS={}))});var qS=w(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.ShowDocumentRequest=void 0;var $S=dt(),LS;(function(t){t.method="window/showDocument",t.messageDirection=$S.MessageDirection.serverToClient,t.type=new $S.ProtocolRequestType(t.method)})(LS||(Ou.ShowDocumentRequest=LS={}))});var BS=w(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.LinkedEditingRangeRequest=void 0;var jS=dt(),FS;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=jS.MessageDirection.clientToServer,t.type=new jS.ProtocolRequestType(t.method)})(FS||(Iu.LinkedEditingRangeRequest=FS={}))});var KS=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.WillDeleteFilesRequest=Qt.DidDeleteFilesNotification=Qt.DidRenameFilesNotification=Qt.WillRenameFilesRequest=Qt.DidCreateFilesNotification=Qt.WillCreateFilesRequest=Qt.FileOperationPatternKind=void 0;var Vn=dt(),US;(function(t){t.file="file",t.folder="folder"})(US||(Qt.FileOperationPatternKind=US={}));var VS;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(VS||(Qt.WillCreateFilesRequest=VS={}));var zS;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(zS||(Qt.DidCreateFilesNotification=zS={}));var WS;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(WS||(Qt.WillRenameFilesRequest=WS={}));var HS;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(HS||(Qt.DidRenameFilesNotification=HS={}));var GS;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(GS||(Qt.DidDeleteFilesNotification=GS={}));var YS;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(YS||(Qt.WillDeleteFilesRequest=YS={}))});var eE=w(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.MonikerRequest=ws.MonikerKind=ws.UniquenessLevel=void 0;var XS=dt(),JS;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(JS||(ws.UniquenessLevel=JS={}));var QS;(function(t){t.$import="import",t.$export="export",t.local="local"})(QS||(ws.MonikerKind=QS={}));var ZS;(function(t){t.method="textDocument/moniker",t.messageDirection=XS.MessageDirection.clientToServer,t.type=new XS.ProtocolRequestType(t.method)})(ZS||(ws.MonikerRequest=ZS={}))});var sE=w(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.TypeHierarchySubtypesRequest=ks.TypeHierarchySupertypesRequest=ks.TypeHierarchyPrepareRequest=void 0;var mo=dt(),tE;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(tE||(ks.TypeHierarchyPrepareRequest=tE={}));var nE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(nE||(ks.TypeHierarchySupertypesRequest=nE={}));var rE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(rE||(ks.TypeHierarchySubtypesRequest=rE={}))});var aE=w(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.InlineValueRefreshRequest=go.InlineValueRequest=void 0;var xu=dt(),iE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=xu.MessageDirection.clientToServer,t.type=new xu.ProtocolRequestType(t.method)})(iE||(go.InlineValueRequest=iE={}));var oE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=xu.MessageDirection.serverToClient,t.type=new xu.ProtocolRequestType0(t.method)})(oE||(go.InlineValueRefreshRequest=oE={}))});var dE=w(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.InlayHintRefreshRequest=Ns.InlayHintResolveRequest=Ns.InlayHintRequest=void 0;var yo=dt(),cE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(cE||(Ns.InlayHintRequest=cE={}));var lE;(function(t){t.method="inlayHint/resolve",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(lE||(Ns.InlayHintResolveRequest=lE={}));var uE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=yo.MessageDirection.serverToClient,t.type=new yo.ProtocolRequestType0(t.method)})(uE||(Ns.InlayHintRefreshRequest=uE={}))});var bE=w(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.DiagnosticRefreshRequest=zn.WorkspaceDiagnosticRequest=zn.DocumentDiagnosticRequest=zn.DocumentDiagnosticReportKind=zn.DiagnosticServerCancellationData=void 0;var yE=hi(),YM=Su(),bo=dt(),fE;(function(t){function e(n){let r=n;return r&&YM.boolean(r.retriggerRequest)}t.is=e})(fE||(zn.DiagnosticServerCancellationData=fE={}));var hE;(function(t){t.Full="full",t.Unchanged="unchanged"})(hE||(zn.DocumentDiagnosticReportKind=hE={}));var pE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new yE.ProgressType})(pE||(zn.DocumentDiagnosticRequest=pE={}));var mE;(function(t){t.method="workspace/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new yE.ProgressType})(mE||(zn.WorkspaceDiagnosticRequest=mE={}));var gE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(gE||(zn.DiagnosticRefreshRequest=gE={}))});var kE=w(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.DidCloseNotebookDocumentNotification=yt.DidSaveNotebookDocumentNotification=yt.DidChangeNotebookDocumentNotification=yt.NotebookCellArrayChange=yt.DidOpenNotebookDocumentNotification=yt.NotebookDocumentSyncRegistrationType=yt.NotebookDocument=yt.NotebookCell=yt.ExecutionSummary=yt.NotebookCellKind=void 0;var qa=_u(),ur=Su(),Dr=dt(),Lm;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Lm||(yt.NotebookCellKind=Lm={}));var qm;(function(t){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}t.create=e;function n(s){let i=s;return ur.objectLiteral(i)&&qa.uinteger.is(i.executionOrder)&&(i.success===void 0||ur.boolean(i.success))}t.is=n;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}t.equals=r})(qm||(yt.ExecutionSummary=qm={}));var Mu;(function(t){function e(i,o){return{kind:i,document:o}}t.create=e;function n(i){let o=i;return ur.objectLiteral(o)&&Lm.is(o.kind)&&qa.DocumentUri.is(o.document)&&(o.metadata===void 0||ur.objectLiteral(o.metadata))}t.is=n;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!qm.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(ur.objectLiteral(i)&&ur.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(Mu||(yt.NotebookCell=Mu={}));var vE;(function(t){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}t.create=e;function n(r){let s=r;return ur.objectLiteral(s)&&ur.string(s.uri)&&qa.integer.is(s.version)&&ur.typedArray(s.cells,Mu.is)}t.is=n})(vE||(yt.NotebookDocument=vE={}));var vo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Dr.MessageDirection.clientToServer,t.type=new Dr.RegistrationType(t.method)})(vo||(yt.NotebookDocumentSyncRegistrationType=vo={}));var TE;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Dr.MessageDirection.clientToServer,t.type=new Dr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(TE||(yt.DidOpenNotebookDocumentNotification=TE={}));var _E;(function(t){function e(r){let s=r;return ur.objectLiteral(s)&&qa.uinteger.is(s.start)&&qa.uinteger.is(s.deleteCount)&&(s.cells===void 0||ur.typedArray(s.cells,Mu.is))}t.is=e;function n(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}t.create=n})(_E||(yt.NotebookCellArrayChange=_E={}));var SE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Dr.MessageDirection.clientToServer,t.type=new Dr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(SE||(yt.DidChangeNotebookDocumentNotification=SE={}));var EE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Dr.MessageDirection.clientToServer,t.type=new Dr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(EE||(yt.DidSaveNotebookDocumentNotification=EE={}));var wE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Dr.MessageDirection.clientToServer,t.type=new Dr.ProtocolNotificationType(t.method),t.registrationMethod=vo.method})(wE||(yt.DidCloseNotebookDocumentNotification=wE={}))});var RE=w($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.InlineCompletionRequest=void 0;var NE=dt(),PE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=NE.MessageDirection.clientToServer,t.type=new NE.ProtocolRequestType(t.method)})(PE||($u.InlineCompletionRequest=PE={}))});var Bw=w(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var U=dt(),CE=_u(),$t=Su(),KM=eS();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return KM.ImplementationRequest}});var XM=rS();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return XM.TypeDefinitionRequest}});var Lw=oS();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Lw.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Lw.DidChangeWorkspaceFoldersNotification}});var JM=lS();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return JM.ConfigurationRequest}});var qw=fS();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return qw.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return qw.ColorPresentationRequest}});var jw=mS();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return jw.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return jw.FoldingRangeRefreshRequest}});var QM=bS();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return QM.DeclarationRequest}});var ZM=_S();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return ZM.SelectionRangeRequest}});var Vm=kS();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Vm.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Vm.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Vm.WorkDoneProgressCancelNotification}});var zm=CS();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return zm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return zm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return zm.CallHierarchyPrepareRequest}});var To=MS();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return To.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return To.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return To.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return To.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return To.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return To.SemanticTokensRegistrationType}});var e$=qS();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return e$.ShowDocumentRequest}});var t$=BS();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return t$.LinkedEditingRangeRequest}});var pi=KS();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return pi.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return pi.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return pi.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return pi.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return pi.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return pi.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return pi.WillDeleteFilesRequest}});var Wm=eE();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Wm.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Wm.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Wm.MonikerRequest}});var Hm=sE();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Hm.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Hm.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Hm.TypeHierarchySupertypesRequest}});var Fw=aE();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return Fw.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Fw.InlineValueRefreshRequest}});var Gm=dE();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return Gm.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Gm.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Gm.InlayHintRefreshRequest}});var ja=bE();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ja.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ja.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ja.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ja.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ja.DiagnosticRefreshRequest}});var Ar=kE();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return Ar.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return Ar.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return Ar.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return Ar.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Ar.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Ar.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Ar.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Ar.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Ar.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Ar.DidCloseNotebookDocumentNotification}});var n$=RE();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return n$.InlineCompletionRequest}});var jm;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(jm||(S.TextDocumentFilter=jm={}));var Fm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Fm||(S.NotebookDocumentFilter=Fm={}));var Bm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Fm.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(Bm||(S.NotebookCellTextDocumentFilter=Bm={}));var Um;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!jm.is(r)&&!Bm.is(r))return!1;return!0}t.is=e})(Um||(S.DocumentSelector=Um={}));var DE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(DE||(S.RegistrationRequest=DE={}));var AE;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(AE||(S.UnregistrationRequest=AE={}));var OE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(OE||(S.ResourceOperationKind=OE={}));var IE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(IE||(S.FailureHandlingKind=IE={}));var xE;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(xE||(S.PositionEncodingKind=xE={}));var ME;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(ME||(S.StaticRegistrationOptions=ME={}));var $E;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Um.is(r.documentSelector))}t.is=e})($E||(S.TextDocumentRegistrationOptions=$E={}));var LE;(function(t){function e(r){let s=r;return $t.objectLiteral(s)&&(s.workDoneProgress===void 0||$t.boolean(s.workDoneProgress))}t.is=e;function n(r){let s=r;return s&&$t.boolean(s.workDoneProgress)}t.hasWorkDoneProgress=n})(LE||(S.WorkDoneProgressOptions=LE={}));var qE;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qE||(S.InitializeRequest=qE={}));var jE;(function(t){t.unknownProtocolVersion=1})(jE||(S.InitializeErrorCodes=jE={}));var FE;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(FE||(S.InitializedNotification=FE={}));var BE;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(BE||(S.ShutdownRequest=BE={}));var UE;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(UE||(S.ExitNotification=UE={}));var VE;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(VE||(S.DidChangeConfigurationNotification=VE={}));var zE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(zE||(S.MessageType=zE={}));var WE;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(WE||(S.ShowMessageNotification=WE={}));var HE;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(HE||(S.ShowMessageRequest=HE={}));var GE;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(GE||(S.LogMessageNotification=GE={}));var YE;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(YE||(S.TelemetryEventNotification=YE={}));var KE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(KE||(S.TextDocumentSyncKind=KE={}));var XE;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(XE||(S.DidOpenTextDocumentNotification=XE={}));var JE;(function(t){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}t.isIncremental=e;function n(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}t.isFull=n})(JE||(S.TextDocumentContentChangeEvent=JE={}));var QE;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(QE||(S.DidChangeTextDocumentNotification=QE={}));var ZE;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ZE||(S.DidCloseTextDocumentNotification=ZE={}));var ew;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ew||(S.DidSaveTextDocumentNotification=ew={}));var tw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(tw||(S.TextDocumentSaveReason=tw={}));var nw;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(nw||(S.WillSaveTextDocumentNotification=nw={}));var rw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(rw||(S.WillSaveTextDocumentWaitUntilRequest=rw={}));var sw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(sw||(S.DidChangeWatchedFilesNotification=sw={}));var iw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(iw||(S.FileChangeType=iw={}));var ow;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(CE.URI.is(r.baseUri)||CE.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(ow||(S.RelativePattern=ow={}));var aw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(aw||(S.WatchKind=aw={}));var cw;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(cw||(S.PublishDiagnosticsNotification=cw={}));var lw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(lw||(S.CompletionTriggerKind=lw={}));var uw;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(uw||(S.CompletionRequest=uw={}));var dw;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(dw||(S.CompletionResolveRequest=dw={}));var fw;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(fw||(S.HoverRequest=fw={}));var hw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(hw||(S.SignatureHelpTriggerKind=hw={}));var pw;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(pw||(S.SignatureHelpRequest=pw={}));var mw;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(mw||(S.DefinitionRequest=mw={}));var gw;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(gw||(S.ReferencesRequest=gw={}));var yw;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(yw||(S.DocumentHighlightRequest=yw={}));var bw;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(bw||(S.DocumentSymbolRequest=bw={}));var vw;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(vw||(S.CodeActionRequest=vw={}));var Tw;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Tw||(S.CodeActionResolveRequest=Tw={}));var _w;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(_w||(S.WorkspaceSymbolRequest=_w={}));var Sw;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Sw||(S.WorkspaceSymbolResolveRequest=Sw={}));var Ew;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ew||(S.CodeLensRequest=Ew={}));var ww;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ww||(S.CodeLensResolveRequest=ww={}));var kw;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(kw||(S.CodeLensRefreshRequest=kw={}));var Nw;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Nw||(S.DocumentLinkRequest=Nw={}));var Pw;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Pw||(S.DocumentLinkResolveRequest=Pw={}));var Rw;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Rw||(S.DocumentFormattingRequest=Rw={}));var Cw;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Cw||(S.DocumentRangeFormattingRequest=Cw={}));var Dw;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Dw||(S.DocumentRangesFormattingRequest=Dw={}));var Aw;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Aw||(S.DocumentOnTypeFormattingRequest=Aw={}));var Ow;(function(t){t.Identifier=1})(Ow||(S.PrepareSupportDefaultBehavior=Ow={}));var Iw;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Iw||(S.RenameRequest=Iw={}));var xw;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(xw||(S.PrepareRenameRequest=xw={}));var Mw;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mw||(S.ExecuteCommandRequest=Mw={}));var $w;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})($w||(S.ApplyWorkspaceEditRequest=$w={}))});var Vw=w(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.createProtocolConnection=void 0;var Uw=hi();function r$(t,e,n,r){return Uw.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Uw.createMessageConnection)(t,e,n,r)}Lu.createProtocolConnection=r$});var Ww=w(bn=>{"use strict";var s$=bn&&bn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),qu=bn&&bn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&s$(e,t,n)};Object.defineProperty(bn,"__esModule",{value:!0});bn.LSPErrorCodes=bn.createProtocolConnection=void 0;qu(hi(),bn);qu(_u(),bn);qu(dt(),bn);qu(Bw(),bn);var i$=Vw();Object.defineProperty(bn,"createProtocolConnection",{enumerable:!0,get:function(){return i$.createProtocolConnection}});var zw;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(zw||(bn.LSPErrorCodes=zw={}))});var bt=w(Or=>{"use strict";var o$=Or&&Or.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Hw=Or&&Or.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&o$(e,t,n)};Object.defineProperty(Or,"__esModule",{value:!0});Or.createProtocolConnection=void 0;var a$=Am();Hw(Am(),Or);Hw(Ww(),Or);function c$(t,e,n,r){return(0,a$.createMessageConnection)(t,e,n,r)}Or.createProtocolConnection=c$});var Ym=w(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.generateUuid=Wn.parse=Wn.isUUID=Wn.v4=Wn.empty=void 0;var Fa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ba=class t extends Fa{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(""))}};Ba._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ba._timeHighBits=["8","9","a","b"];Wn.empty=new Fa("00000000-0000-0000-0000-000000000000");function Gw(){return new Ba}Wn.v4=Gw;var l$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Yw(t){return l$.test(t)}Wn.isUUID=Yw;function u$(t){if(!Yw(t))throw new Error("invalid uuid");return new Fa(t)}Wn.parse=u$;function d$(){return Gw().asHex()}Wn.generateUuid=d$});var Kw=w(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.attachPartialResult=Rs.ProgressFeature=Rs.attachWorkDone=void 0;var Ps=bt(),f$=Ym(),mi=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,s){let i={kind:"begin",title:e,percentage:n,message:r,cancellable:s};this._connection.sendProgress(Ps.WorkDoneProgress.type,this._token,i)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Ps.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ps.WorkDoneProgress.type,this._token,{kind:"end"})}};mi.Instances=new Map;var ju=class extends mi{constructor(e,n){super(e,n),this._source=new Ps.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ua=class{constructor(){}begin(){}report(){}done(){}},Fu=class extends Ua{constructor(){super(),this._source=new Ps.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function h$(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ua;let n=e.workDoneToken;return delete e.workDoneToken,new mi(t,n)}Rs.attachWorkDone=h$;var p$=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ps.WorkDoneProgressCancelNotification.type,n=>{let r=mi.Instances.get(n.token);(r instanceof ju||r instanceof Fu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ua:new mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,f$.generateUuid)();return this.connection.sendRequest(Ps.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new ju(this.connection,e))}else return Promise.resolve(new Fu)}};Rs.ProgressFeature=p$;var Km;(function(t){t.type=new Ps.ProgressType})(Km||(Km={}));var Xm=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Km.type,this._token,e)}};function m$(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Xm(t,n)}Rs.attachPartialResult=m$});var Xw=w(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.ConfigurationFeature=void 0;var g$=bt(),y$=Ql(),b$=t=>class extends t{getConfiguration(e){return e?y$.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(g$.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Bu.ConfigurationFeature=b$});var Jw=w(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.WorkspaceFoldersFeature=void 0;var Uu=bt(),v$=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Uu.Emitter,this.connection.onNotification(Uu.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Uu.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(Uu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Vu.WorkspaceFoldersFeature=v$});var Qw=w(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.CallHierarchyFeature=void 0;var Jm=bt(),T$=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Jm.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Jm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Jm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};zu.CallHierarchyFeature=T$});var Zm=w(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SemanticTokensBuilder=Cs.SemanticTokensDiff=Cs.SemanticTokensFeature=void 0;var Wu=bt(),_$=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Wu.SemanticTokensRefreshRequest.type),on:e=>{let n=Wu.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Wu.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Wu.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Cs.SemanticTokensFeature=_$;var Hu=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let s=e-1,i=n-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Cs.SemanticTokensDiff=Hu;var Qm=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,n,r,s,i){let o=e,a=n;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++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=n}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 Hu(this._prevData,this._data).computeDiff()}:this.build()}};Cs.SemanticTokensBuilder=Qm});var Zw=w(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ShowDocumentFeature=void 0;var S$=bt(),E$=t=>class extends t{showDocument(e){return this.connection.sendRequest(S$.ShowDocumentRequest.type,e)}};Gu.ShowDocumentFeature=E$});var ek=w(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.FileOperationsFeature=void 0;var _o=bt(),w$=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(_o.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(_o.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(_o.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(_o.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(_o.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(_o.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Yu.FileOperationsFeature=w$});var tk=w(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.LinkedEditingRangeFeature=void 0;var k$=bt(),N$=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(k$.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Ku.LinkedEditingRangeFeature=N$});var nk=w(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.TypeHierarchyFeature=void 0;var eg=bt(),P$=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(eg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=eg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=eg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Xu.TypeHierarchyFeature=P$});var sk=w(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.InlineValueFeature=void 0;var rk=bt(),R$=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(rk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(rk.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ju.InlineValueFeature=R$});var ok=w(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.FoldingRangeFeature=void 0;var ik=bt(),C$=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(ik.FoldingRangeRefreshRequest.type),on:e=>{let n=ik.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Qu.FoldingRangeFeature=C$});var ak=w(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.InlayHintFeature=void 0;var tg=bt(),D$=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(tg.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(tg.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(tg.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Zu.InlayHintFeature=D$});var ck=w(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.DiagnosticFeature=void 0;var Va=bt(),A$=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Va.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Va.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Va.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Va.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Va.WorkspaceDiagnosticRequest.partialResult,n)))}}};ed.DiagnosticFeature=A$});var rg=w(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.TextDocuments=void 0;var gi=bt(),ng=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new gi.Emitter,this._onDidOpen=new gi.Emitter,this._onDidClose=new gi.Emitter,this._onDidSave=new gi.Emitter,this._onWillSave=new gi.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=gi.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),n.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),gi.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};td.TextDocuments=ng});var ig=w(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.NotebookDocuments=So.NotebookSyncFeature=void 0;var Hn=bt(),lk=rg(),O$=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Hn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Hn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Hn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Hn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};So.NotebookSyncFeature=O$;var nd=class t{onDidOpenTextDocument(e){return this.openHandler=e,Hn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Hn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Hn.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}};nd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var sg=class{constructor(e){e instanceof lk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new lk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Hn.Emitter,this._onDidChange=new Hn.Emitter,this._onDidSave=new Hn.Emitter,this._onDidClose=new Hn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[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 n=new nd,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let E=c.cells;if(E.structure!==void 0){let _=E.structure.array;if(i.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),E.structure.didOpen!==void 0)for(let T of E.structure.didOpen)n.openTextDocument({textDocument:T}),l.push(T.uri);if(E.structure.didClose)for(let T of E.structure.didClose)n.closeTextDocument({textDocument:T}),u.push(T.uri)}if(E.data!==void 0){let _=new Map(E.data.map(T=>[T.document,T]));for(let T=0;T<=i.cells.length;T++){let k=_.get(i.cells[T].document);if(k!==void 0){let C=i.cells.splice(T,1,k);if(d.push({old:C[0],new:k}),_.delete(k.document),_.size===0)break}}}if(E.textContent!==void 0)for(let _ of E.textContent)n.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),f.push(_.document.uri)}this.updateCellMap(i);let h={notebookDocument:i};a&&(h.metadata={old:o,new:i.metadata});let y=[];for(let E of l)y.push(this.getNotebookCell(E));let m=[];for(let E of u)m.push(this.getNotebookCell(E));let b=[];for(let E of f)b.push(this.getNotebookCell(E));(y.length>0||m.length>0||d.length>0||b.length>0)&&(h.cells={added:y,removed:m,changed:{data:d,textContent:b}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),Hn.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};So.NotebookDocuments=sg});var uk=w(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.MonikerFeature=void 0;var I$=bt(),x$=t=>class extends t{get moniker(){return{on:e=>{let n=I$.MonikerRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};rd.MonikerFeature=x$});var dg=w(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.createConnection=De.combineFeatures=De.combineNotebooksFeatures=De.combineLanguagesFeatures=De.combineWorkspaceFeatures=De.combineWindowFeatures=De.combineClientFeatures=De.combineTracerFeatures=De.combineTelemetryFeatures=De.combineConsoleFeatures=De._NotebooksImpl=De._LanguagesImpl=De.BulkUnregistration=De.BulkRegistration=De.ErrorMessageTracker=void 0;var W=bt(),Gn=Ql(),ag=Ym(),ie=Kw(),M$=Xw(),$$=Jw(),L$=Qw(),q$=Zm(),j$=Zw(),F$=ek(),B$=tk(),U$=nk(),V$=sk(),z$=ok(),W$=ak(),H$=ck(),G$=ig(),Y$=uk();function og(t){if(t!==null)return t}var cg=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};De.ErrorMessageTracker=cg;var sd=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(W.MessageType.Error,e)}warn(e){this.send(W.MessageType.Warning,e)}info(e){this.send(W.MessageType.Info,e)}log(e){this.send(W.MessageType.Log,e)}debug(e){this.send(W.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(W.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,W.RAL)().console.error("Sending log message failed")})}},lg=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,...n){let r={type:W.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(og)}showWarningMessage(e,...n){let r={type:W.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(og)}showInformationMessage(e,...n){let r={type:W.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(og)}},dk=(0,j$.ShowDocumentFeature)((0,ie.ProgressFeature)(lg)),fk;(function(t){function e(){return new id}t.create=e})(fk||(De.BulkRegistration=fk={}));var id=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Gn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=ag.generateUuid();this._registrations.push({id:s,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},hk;(function(t){function e(){return new za(void 0,[])}t.create=e})(hk||(De.BulkUnregistration=hk={}));var za=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(W.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Gn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(W.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(n)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},od=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,n,r){return e instanceof id?this.registerMany(e):e instanceof za?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let s=Gn.string(n)?n:n.method,i=ag.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(W.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=Gn.string(e)?e:e.method,s=ag.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(W.RegistrationRequest.type,i).then(o=>W.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(W.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(W.RegistrationRequest.type,n).then(()=>new za(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ug=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 n(s){return s&&!!s.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(W.ApplyWorkspaceEditRequest.type,r)}},pk=(0,F$.FileOperationsFeature)((0,$$.WorkspaceFoldersFeature)((0,M$.ConfigurationFeature)(ug))),ad=class{constructor(){this._trace=W.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,n){this._trace!==W.Trace.Off&&this.connection.sendNotification(W.LogTraceNotification.type,{message:e,verbose:this._trace===W.Trace.Verbose?n:void 0}).catch(()=>{})}},cd=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(W.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},ld=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,ie.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ie.attachPartialResult)(this.connection,n)}};De._LanguagesImpl=ld;var mk=(0,z$.FoldingRangeFeature)((0,Y$.MonikerFeature)((0,H$.DiagnosticFeature)((0,W$.InlayHintFeature)((0,V$.InlineValueFeature)((0,U$.TypeHierarchyFeature)((0,B$.LinkedEditingRangeFeature)((0,q$.SemanticTokensFeature)((0,L$.CallHierarchyFeature)(ld))))))))),ud=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,ie.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ie.attachPartialResult)(this.connection,n)}};De._NotebooksImpl=ud;var gk=(0,G$.NotebookSyncFeature)(ud);function yk(t,e){return function(n){return e(t(n))}}De.combineConsoleFeatures=yk;function bk(t,e){return function(n){return e(t(n))}}De.combineTelemetryFeatures=bk;function vk(t,e){return function(n){return e(t(n))}}De.combineTracerFeatures=vk;function Tk(t,e){return function(n){return e(t(n))}}De.combineClientFeatures=Tk;function _k(t,e){return function(n){return e(t(n))}}De.combineWindowFeatures=_k;function Sk(t,e){return function(n){return e(t(n))}}De.combineWorkspaceFeatures=Sk;function Ek(t,e){return function(n){return e(t(n))}}De.combineLanguagesFeatures=Ek;function wk(t,e){return function(n){return e(t(n))}}De.combineNotebooksFeatures=wk;function K$(t,e){function n(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:n(t.console,e.console,yk),tracer:n(t.tracer,e.tracer,vk),telemetry:n(t.telemetry,e.telemetry,bk),client:n(t.client,e.client,Tk),window:n(t.window,e.window,_k),workspace:n(t.workspace,e.workspace,Sk),languages:n(t.languages,e.languages,Ek),notebooks:n(t.notebooks,e.notebooks,wk)}}De.combineFeatures=K$;function X$(t,e,n){let r=n&&n.console?new(n.console(sd)):new sd,s=t(r);r.rawAttach(s);let i=n&&n.tracer?new(n.tracer(ad)):new ad,o=n&&n.telemetry?new(n.telemetry(cd)):new cd,a=n&&n.client?new(n.client(od)):new od,c=n&&n.window?new(n.window(dk)):new dk,l=n&&n.workspace?new(n.workspace(pk)):new pk,u=n&&n.languages?new(n.languages(mk)):new mk,d=n&&n.notebooks?new(n.notebooks(gk)):new gk,f=[r,i,o,a,c,l,u,d];function h(_){return _ instanceof Promise?_:Gn.thenable(_)?new Promise((T,k)=>{_.then(C=>T(C),C=>k(C))}):Promise.resolve(_)}let y,m,b,E={listen:()=>s.listen(),sendRequest:(_,...T)=>s.sendRequest(Gn.string(_)?_:_.method,...T),onRequest:(_,T)=>s.onRequest(_,T),sendNotification:(_,T)=>{let k=Gn.string(_)?_:_.method;return s.sendNotification(k,T)},onNotification:(_,T)=>s.onNotification(_,T),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:_=>(m=_,{dispose:()=>{m=void 0}}),onInitialized:_=>s.onNotification(W.InitializedNotification.type,_),onShutdown:_=>(y=_,{dispose:()=>{y=void 0}}),onExit:_=>(b=_,{dispose:()=>{b=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:_=>s.onNotification(W.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>s.onNotification(W.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>s.onNotification(W.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>s.onNotification(W.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>s.onNotification(W.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>s.onNotification(W.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>s.onRequest(W.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>s.onNotification(W.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>s.sendNotification(W.PublishDiagnosticsNotification.type,_),onHover:_=>s.onRequest(W.HoverRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),onCompletion:_=>s.onRequest(W.CompletionRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onCompletionResolve:_=>s.onRequest(W.CompletionResolveRequest.type,_),onSignatureHelp:_=>s.onRequest(W.SignatureHelpRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),onDeclaration:_=>s.onRequest(W.DeclarationRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onDefinition:_=>s.onRequest(W.DefinitionRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onTypeDefinition:_=>s.onRequest(W.TypeDefinitionRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onImplementation:_=>s.onRequest(W.ImplementationRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onReferences:_=>s.onRequest(W.ReferencesRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onDocumentHighlight:_=>s.onRequest(W.DocumentHighlightRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onDocumentSymbol:_=>s.onRequest(W.DocumentSymbolRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onWorkspaceSymbol:_=>s.onRequest(W.WorkspaceSymbolRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onWorkspaceSymbolResolve:_=>s.onRequest(W.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>s.onRequest(W.CodeActionRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onCodeActionResolve:_=>s.onRequest(W.CodeActionResolveRequest.type,(T,k)=>_(T,k)),onCodeLens:_=>s.onRequest(W.CodeLensRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onCodeLensResolve:_=>s.onRequest(W.CodeLensResolveRequest.type,(T,k)=>_(T,k)),onDocumentFormatting:_=>s.onRequest(W.DocumentFormattingRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),onDocumentRangeFormatting:_=>s.onRequest(W.DocumentRangeFormattingRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),onDocumentOnTypeFormatting:_=>s.onRequest(W.DocumentOnTypeFormattingRequest.type,(T,k)=>_(T,k)),onRenameRequest:_=>s.onRequest(W.RenameRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),onPrepareRename:_=>s.onRequest(W.PrepareRenameRequest.type,(T,k)=>_(T,k)),onDocumentLinks:_=>s.onRequest(W.DocumentLinkRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onDocumentLinkResolve:_=>s.onRequest(W.DocumentLinkResolveRequest.type,(T,k)=>_(T,k)),onDocumentColor:_=>s.onRequest(W.DocumentColorRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onColorPresentation:_=>s.onRequest(W.ColorPresentationRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onFoldingRanges:_=>s.onRequest(W.FoldingRangeRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onSelectionRanges:_=>s.onRequest(W.SelectionRangeRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),(0,ie.attachPartialResult)(s,T))),onExecuteCommand:_=>s.onRequest(W.ExecuteCommandRequest.type,(T,k)=>_(T,k,(0,ie.attachWorkDone)(s,T),void 0)),dispose:()=>s.dispose()};for(let _ of f)_.attach(E);return s.onRequest(W.InitializeRequest.type,_=>{e.initialize(_),Gn.string(_.trace)&&(i.trace=W.Trace.fromString(_.trace));for(let T of f)T.initialize(_.capabilities);if(m){let T=m(_,new W.CancellationTokenSource().token,(0,ie.attachWorkDone)(s,_),void 0);return h(T).then(k=>{if(k instanceof W.ResponseError)return k;let C=k;C||(C={capabilities:{}});let $=C.capabilities;$||($={},C.capabilities=$),$.textDocumentSync===void 0||$.textDocumentSync===null?$.textDocumentSync=Gn.number(E.__textDocumentSync)?E.__textDocumentSync:W.TextDocumentSyncKind.None:!Gn.number($.textDocumentSync)&&!Gn.number($.textDocumentSync.change)&&($.textDocumentSync.change=Gn.number(E.__textDocumentSync)?E.__textDocumentSync:W.TextDocumentSyncKind.None);for(let B of f)B.fillServerCapabilities($);return C})}else{let T={capabilities:{textDocumentSync:W.TextDocumentSyncKind.None}};for(let k of f)k.fillServerCapabilities(T.capabilities);return T}}),s.onRequest(W.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new W.CancellationTokenSource().token)}),s.onNotification(W.ExitNotification.type,()=>{try{b&&b()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(W.SetTraceNotification.type,_=>{i.trace=W.Trace.fromString(_.value)}),E}De.createConnection=X$});var kk=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.resolveModulePath=vn.FileSystem=vn.resolveGlobalYarnPath=vn.resolveGlobalNodePath=vn.resolve=vn.uriToFilePath=void 0;var J$=require("url"),dr=require("path"),fg=require("fs"),gg=require("child_process");function Q$(t){let e=J$.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,s=n.length;r<s;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let i=n[0],o=n[1];i.length===0&&o.length>1&&o[1]===":"&&n.shift()}return dr.normalize(n.join("/"))}vn.uriToFilePath=Q$;function hg(){return process.platform==="win32"}function dd(t,e,n,r){let s="NODE_PATH",i=["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&&fg.existsSync(e)&&(l[s]?l[s]=e+dr.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,gg.fork)("",[],{cwd:n,env:l,execArgv:["-e",i]});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)}})}vn.resolve=dd;function pg(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(i=>n[i]=process.env[i]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};hg()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,gg.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){t&&t("'npm config get prefix' didn't return a value.");return}let o=i.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?hg()?dr.join(o,"node_modules"):dr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}vn.resolveGlobalNodePath=pg;function Z$(t){let e="yarn",n={encoding:"utf8"};hg()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,gg.spawnSync)(e,["global","dir","--json"],n),i=s.stdout;if(!i){t&&(t("'yarn global dir' didn't return a value."),s.stderr&&t(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return dr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}vn.resolveGlobalYarnPath=Z$;var mg;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!fg.existsSync(__filename.toUpperCase())||!fg.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(s,i){return n()?dr.normalize(i).indexOf(dr.normalize(s))===0:dr.normalize(i).toLowerCase().indexOf(dr.normalize(s).toLowerCase())===0}t.isParent=r})(mg||(vn.FileSystem=mg={}));function e1(t,e,n,r){return n?(dr.isAbsolute(n)||(n=dr.join(t,n)),dd(e,n,n,r).then(s=>mg.isParent(n,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>dd(e,pg(r),t,r))):dd(e,pg(r),t,r)}vn.resolveModulePath=e1});var yg=w((b3,Nk)=>{"use strict";Nk.exports=bt()});var Pk=w(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.InlineCompletionFeature=void 0;var t1=bt(),n1=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(t1.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};fd.InlineCompletionFeature=n1});var Dk=w(Zt=>{"use strict";var r1=Zt&&Zt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ck=Zt&&Zt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&r1(e,t,n)};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.ProposedFeatures=Zt.NotebookDocuments=Zt.TextDocuments=Zt.SemanticTokensBuilder=void 0;var s1=Zm();Object.defineProperty(Zt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return s1.SemanticTokensBuilder}});var i1=Pk();Ck(bt(),Zt);var o1=rg();Object.defineProperty(Zt,"TextDocuments",{enumerable:!0,get:function(){return o1.TextDocuments}});var a1=ig();Object.defineProperty(Zt,"NotebookDocuments",{enumerable:!0,get:function(){return a1.NotebookDocuments}});Ck(dg(),Zt);var Rk;(function(t){t.all={__brand:"features",languages:i1.InlineCompletionFeature}})(Rk||(Zt.ProposedFeatures=Rk={}))});var J=w(Yn=>{"use strict";var c1=Yn&&Yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xk=Yn&&Yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&c1(e,t,n)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createConnection=Yn.Files=void 0;var Ak=require("node:util"),bg=Ql(),l1=dg(),Wa=kk(),yi=yg();xk(yg(),Yn);xk(Dk(),Yn);var Ok;(function(t){t.uriToFilePath=Wa.uriToFilePath,t.resolveGlobalNodePath=Wa.resolveGlobalNodePath,t.resolveGlobalYarnPath=Wa.resolveGlobalYarnPath,t.resolve=Wa.resolve,t.resolveModulePath=Wa.resolveModulePath})(Ok||(Yn.Files=Ok={}));var Ik;function hd(){if(Ik!==void 0)try{Ik.end()}catch{}}var Eo=!1,Mk;function u1(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Mk=setInterval(()=>{try{process.kill(r,0)}catch{hd(),process.exit(Eo?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let s=r.split("=");s[0]===t&&e(s[1])}}}u1();var d1={initialize:t=>{let e=t.processId;bg.number(e)&&Mk===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Eo?0:1)}},3e3)},get shutdownReceived(){return Eo},set shutdownReceived(t){Eo=t},exit:t=>{hd(),process.exit(t)}};function f1(t,e,n,r){let s,i,o,a;return t!==void 0&&t.__brand==="features"&&(s=t,t=e,e=n,n=r),yi.ConnectionStrategy.is(t)||yi.ConnectionOptions.is(t)?a=t:(i=t,o=e,a=n),h1(i,o,a,s)}Yn.createConnection=f1;function h1(t,e,n,r){let s=!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 yi.IPCMessageReader(process),e=new yi.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!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 i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,yi.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,yi.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(bg.func(t.read)&&bg.func(t.on)){let c=t;c.on("end",()=>{hd(),process.exit(Eo?0:1)}),c.on("close",()=>{hd(),process.exit(Eo?0:1)})}let a=c=>{let l=(0,yi.createProtocolConnection)(t,e,c,n);return s&&p1(c),l};return(0,l1.createConnection)(a,d1,r)}function p1(t){function e(r){return r.map(s=>typeof s=="string"?s:(0,Ak.inspect)(s)).join(" ")}let n=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)t.error("Assertion failed");else{let[o,...a]=i;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=n.get(i)??0;o+=1,n.set(i,o),t.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?n.clear():n.delete(String(s))},console.debug=function(...s){t.log(e(s))},console.dir=function(s,i){t.log((0,Ak.inspect)(s,i))},console.log=function(...s){t.log(e(s))},console.error=function(...s){t.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),t.log(`${o}
|
|
37
|
-
${
|
|
38
|
-
`)}};
|
|
39
|
-
`)?
|
|
34
|
+
`,"\r"];var R_;(function(g){function P(D,M,ce,bt){return new pM(D,M,ce,bt)}g.create=P;function R(D){var M=D;return!!(A.defined(M)&&A.string(M.uri)&&(A.undefined(M.languageId)||A.string(M.languageId))&&A.uinteger(M.lineCount)&&A.func(M.getText)&&A.func(M.positionAt)&&A.func(M.offsetAt))}g.is=R;function _(D,M){for(var ce=D.getText(),bt=m(M,function(to,nu){var C_=to.range.start.line-nu.range.start.line;return C_===0?to.range.start.character-nu.range.start.character:C_}),Ze=ce.length,cr=bt.length-1;cr>=0;cr--){var lr=bt[cr],ri=D.offsetAt(lr.range.start),_e=D.offsetAt(lr.range.end);if(_e<=Ze)ce=ce.substring(0,ri)+lr.newText+ce.substring(_e,ce.length);else throw new Error("Overlapping edit");Ze=ri}return ce}g.applyEdits=_;function m(D,M){if(D.length<=1)return D;var ce=D.length/2|0,bt=D.slice(0,ce),Ze=D.slice(ce);m(bt,M),m(Ze,M);for(var cr=0,lr=0,ri=0;cr<bt.length&&lr<Ze.length;){var _e=M(bt[cr],Ze[lr]);_e<=0?D[ri++]=bt[cr++]:D[ri++]=Ze[lr++]}for(;cr<bt.length;)D[ri++]=bt[cr++];for(;lr<Ze.length;)D[ri++]=Ze[lr++];return D}})(R_||(e.TextDocument=R_={}));var pM=function(){function g(P,R,_,m){this._uri=P,this._languageId=R,this._version=_,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(g.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),g.prototype.getText=function(P){if(P){var R=this.offsetAt(P.start),_=this.offsetAt(P.end);return this._content.substring(R,_)}return this._content},g.prototype.update=function(P,R){this._content=P.text,this._version=R,this._lineOffsets=void 0},g.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var P=[],R=this._content,_=!0,m=0;m<R.length;m++){_&&(P.push(m),_=!1);var D=R.charAt(m);_=D==="\r"||D===`
|
|
35
|
+
`,D==="\r"&&m+1<R.length&&R.charAt(m+1)===`
|
|
36
|
+
`&&m++}_&&R.length>0&&P.push(R.length),this._lineOffsets=P}return this._lineOffsets},g.prototype.positionAt=function(P){P=Math.max(Math.min(P,this._content.length),0);var R=this.getLineOffsets(),_=0,m=R.length;if(m===0)return o.create(0,P);for(;_<m;){var D=Math.floor((_+m)/2);R[D]>P?m=D:_=D+1}var M=_-1;return o.create(M,P-R[M])},g.prototype.offsetAt=function(P){var R=this.getLineOffsets();if(P.line>=R.length)return this._content.length;if(P.line<0)return 0;var _=R[P.line],m=P.line+1<R.length?R[P.line+1]:this._content.length;return Math.max(Math.min(_+P.character,m),_)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var P=Object.prototype.toString;function R(_e){return typeof _e<"u"}g.defined=R;function _(_e){return typeof _e>"u"}g.undefined=_;function m(_e){return _e===!0||_e===!1}g.boolean=m;function D(_e){return P.call(_e)==="[object String]"}g.string=D;function M(_e){return P.call(_e)==="[object Number]"}g.number=M;function ce(_e,to,nu){return P.call(_e)==="[object Number]"&&to<=_e&&_e<=nu}g.numberRange=ce;function bt(_e){return P.call(_e)==="[object Number]"&&-2147483648<=_e&&_e<=2147483647}g.integer=bt;function Ze(_e){return P.call(_e)==="[object Number]"&&0<=_e&&_e<=2147483647}g.uinteger=Ze;function cr(_e){return P.call(_e)==="[object Function]"}g.func=cr;function lr(_e){return _e!==null&&typeof _e=="object"}g.objectLiteral=lr;function ri(_e,to){return Array.isArray(_e)&&_e.every(to)}g.typedArray=ri})(A||(A={}))})});var pt=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ProtocolNotificationType=yn.ProtocolNotificationType0=yn.ProtocolRequestType=yn.ProtocolRequestType0=yn.RegistrationType=yn.MessageDirection=void 0;var uo=ms(),uS;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(uS||(yn.MessageDirection=uS={}));var Bm=class{constructor(e){this.method=e}};yn.RegistrationType=Bm;var Um=class extends uo.RequestType0{constructor(e){super(e)}};yn.ProtocolRequestType0=Um;var Vm=class extends uo.RequestType{constructor(e){super(e,uo.ParameterStructures.byName)}};yn.ProtocolRequestType=Vm;var zm=class extends uo.NotificationType0{constructor(e){super(e)}};yn.ProtocolNotificationType0=zm;var Wm=class extends uo.NotificationType{constructor(e){super(e,uo.ParameterStructures.byName)}};yn.ProtocolNotificationType=Wm});var Pu=k(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.objectLiteral=Pt.typedArray=Pt.stringArray=Pt.array=Pt.func=Pt.error=Pt.number=Pt.string=Pt.boolean=void 0;function c1(t){return t===!0||t===!1}Pt.boolean=c1;function dS(t){return typeof t=="string"||t instanceof String}Pt.string=dS;function l1(t){return typeof t=="number"||t instanceof Number}Pt.number=l1;function u1(t){return t instanceof Error}Pt.error=u1;function d1(t){return typeof t=="function"}Pt.func=d1;function fS(t){return Array.isArray(t)}Pt.array=fS;function f1(t){return fS(t)&&t.every(e=>dS(e))}Pt.stringArray=f1;function h1(t,e){return Array.isArray(t)&&t.every(e)}Pt.typedArray=h1;function p1(t){return t!==null&&typeof t=="object"}Pt.objectLiteral=p1});var mS=k(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ImplementationRequest=void 0;var hS=pt(),pS;(function(t){t.method="textDocument/implementation",t.messageDirection=hS.MessageDirection.clientToServer,t.type=new hS.ProtocolRequestType(t.method)})(pS||(Ru.ImplementationRequest=pS={}))});var bS=k(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.TypeDefinitionRequest=void 0;var gS=pt(),yS;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=gS.MessageDirection.clientToServer,t.type=new gS.ProtocolRequestType(t.method)})(yS||(Cu.TypeDefinitionRequest=yS={}))});var _S=k(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DidChangeWorkspaceFoldersNotification=fo.WorkspaceFoldersRequest=void 0;var Du=pt(),vS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Du.MessageDirection.serverToClient,t.type=new Du.ProtocolRequestType0(t.method)})(vS||(fo.WorkspaceFoldersRequest=vS={}));var TS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Du.MessageDirection.clientToServer,t.type=new Du.ProtocolNotificationType(t.method)})(TS||(fo.DidChangeWorkspaceFoldersNotification=TS={}))});var wS=k(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.ConfigurationRequest=void 0;var SS=pt(),ES;(function(t){t.method="workspace/configuration",t.messageDirection=SS.MessageDirection.serverToClient,t.type=new SS.ProtocolRequestType(t.method)})(ES||(Au.ConfigurationRequest=ES={}))});var PS=k(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.ColorPresentationRequest=ho.DocumentColorRequest=void 0;var Ou=pt(),kS;(function(t){t.method="textDocument/documentColor",t.messageDirection=Ou.MessageDirection.clientToServer,t.type=new Ou.ProtocolRequestType(t.method)})(kS||(ho.DocumentColorRequest=kS={}));var NS;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Ou.MessageDirection.clientToServer,t.type=new Ou.ProtocolRequestType(t.method)})(NS||(ho.ColorPresentationRequest=NS={}))});var DS=k(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.FoldingRangeRefreshRequest=po.FoldingRangeRequest=void 0;var Iu=pt(),RS;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Iu.MessageDirection.clientToServer,t.type=new Iu.ProtocolRequestType(t.method)})(RS||(po.FoldingRangeRequest=RS={}));var CS;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Iu.MessageDirection.serverToClient,t.type=new Iu.ProtocolRequestType0(t.method)})(CS||(po.FoldingRangeRefreshRequest=CS={}))});var IS=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.DeclarationRequest=void 0;var AS=pt(),OS;(function(t){t.method="textDocument/declaration",t.messageDirection=AS.MessageDirection.clientToServer,t.type=new AS.ProtocolRequestType(t.method)})(OS||(xu.DeclarationRequest=OS={}))});var LS=k(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.SelectionRangeRequest=void 0;var xS=pt(),MS;(function(t){t.method="textDocument/selectionRange",t.messageDirection=xS.MessageDirection.clientToServer,t.type=new xS.ProtocolRequestType(t.method)})(MS||(Mu.SelectionRangeRequest=MS={}))});var FS=k(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.WorkDoneProgressCancelNotification=ki.WorkDoneProgressCreateRequest=ki.WorkDoneProgress=void 0;var m1=ms(),Lu=pt(),$S;(function(t){t.type=new m1.ProgressType;function e(n){return n===t.type}t.is=e})($S||(ki.WorkDoneProgress=$S={}));var qS;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Lu.MessageDirection.serverToClient,t.type=new Lu.ProtocolRequestType(t.method)})(qS||(ki.WorkDoneProgressCreateRequest=qS={}));var jS;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Lu.MessageDirection.clientToServer,t.type=new Lu.ProtocolNotificationType(t.method)})(jS||(ki.WorkDoneProgressCancelNotification=jS={}))});var zS=k(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.CallHierarchyOutgoingCallsRequest=Ni.CallHierarchyIncomingCallsRequest=Ni.CallHierarchyPrepareRequest=void 0;var mo=pt(),BS;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(BS||(Ni.CallHierarchyPrepareRequest=BS={}));var US;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(US||(Ni.CallHierarchyIncomingCallsRequest=US={}));var VS;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(VS||(Ni.CallHierarchyOutgoingCallsRequest=VS={}))});var XS=k(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.SemanticTokensRefreshRequest=bn.SemanticTokensRangeRequest=bn.SemanticTokensDeltaRequest=bn.SemanticTokensRequest=bn.SemanticTokensRegistrationType=bn.TokenFormat=void 0;var si=pt(),WS;(function(t){t.Relative="relative"})(WS||(bn.TokenFormat=WS={}));var qa;(function(t){t.method="textDocument/semanticTokens",t.type=new si.RegistrationType(t.method)})(qa||(bn.SemanticTokensRegistrationType=qa={}));var HS;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(HS||(bn.SemanticTokensRequest=HS={}));var GS;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(GS||(bn.SemanticTokensDeltaRequest=GS={}));var YS;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=qa.method})(YS||(bn.SemanticTokensRangeRequest=YS={}));var KS;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=si.MessageDirection.serverToClient,t.type=new si.ProtocolRequestType0(t.method)})(KS||(bn.SemanticTokensRefreshRequest=KS={}))});var ZS=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.ShowDocumentRequest=void 0;var JS=pt(),QS;(function(t){t.method="window/showDocument",t.messageDirection=JS.MessageDirection.serverToClient,t.type=new JS.ProtocolRequestType(t.method)})(QS||($u.ShowDocumentRequest=QS={}))});var nE=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.LinkedEditingRangeRequest=void 0;var eE=pt(),tE;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=eE.MessageDirection.clientToServer,t.type=new eE.ProtocolRequestType(t.method)})(tE||(qu.LinkedEditingRangeRequest=tE={}))});var uE=k(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.WillDeleteFilesRequest=Zt.DidDeleteFilesNotification=Zt.DidRenameFilesNotification=Zt.WillRenameFilesRequest=Zt.DidCreateFilesNotification=Zt.WillCreateFilesRequest=Zt.FileOperationPatternKind=void 0;var Vn=pt(),rE;(function(t){t.file="file",t.folder="folder"})(rE||(Zt.FileOperationPatternKind=rE={}));var iE;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(iE||(Zt.WillCreateFilesRequest=iE={}));var sE;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(sE||(Zt.DidCreateFilesNotification=sE={}));var oE;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(oE||(Zt.WillRenameFilesRequest=oE={}));var aE;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(aE||(Zt.DidRenameFilesNotification=aE={}));var cE;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolNotificationType(t.method)})(cE||(Zt.DidDeleteFilesNotification=cE={}));var lE;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Vn.MessageDirection.clientToServer,t.type=new Vn.ProtocolRequestType(t.method)})(lE||(Zt.WillDeleteFilesRequest=lE={}))});var mE=k(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.MonikerRequest=Pi.MonikerKind=Pi.UniquenessLevel=void 0;var dE=pt(),fE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(fE||(Pi.UniquenessLevel=fE={}));var hE;(function(t){t.$import="import",t.$export="export",t.local="local"})(hE||(Pi.MonikerKind=hE={}));var pE;(function(t){t.method="textDocument/moniker",t.messageDirection=dE.MessageDirection.clientToServer,t.type=new dE.ProtocolRequestType(t.method)})(pE||(Pi.MonikerRequest=pE={}))});var vE=k(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.TypeHierarchySubtypesRequest=Ri.TypeHierarchySupertypesRequest=Ri.TypeHierarchyPrepareRequest=void 0;var go=pt(),gE;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(gE||(Ri.TypeHierarchyPrepareRequest=gE={}));var yE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(yE||(Ri.TypeHierarchySupertypesRequest=yE={}));var bE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(bE||(Ri.TypeHierarchySubtypesRequest=bE={}))});var SE=k(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InlineValueRefreshRequest=yo.InlineValueRequest=void 0;var ju=pt(),TE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=ju.MessageDirection.clientToServer,t.type=new ju.ProtocolRequestType(t.method)})(TE||(yo.InlineValueRequest=TE={}));var _E;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=ju.MessageDirection.serverToClient,t.type=new ju.ProtocolRequestType0(t.method)})(_E||(yo.InlineValueRefreshRequest=_E={}))});var NE=k(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.InlayHintRefreshRequest=Ci.InlayHintResolveRequest=Ci.InlayHintRequest=void 0;var bo=pt(),EE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(EE||(Ci.InlayHintRequest=EE={}));var wE;(function(t){t.method="inlayHint/resolve",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(wE||(Ci.InlayHintResolveRequest=wE={}));var kE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(kE||(Ci.InlayHintRefreshRequest=kE={}))});var IE=k(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.DiagnosticRefreshRequest=zn.WorkspaceDiagnosticRequest=zn.DocumentDiagnosticRequest=zn.DocumentDiagnosticReportKind=zn.DiagnosticServerCancellationData=void 0;var OE=ms(),g1=Pu(),vo=pt(),PE;(function(t){function e(n){let r=n;return r&&g1.boolean(r.retriggerRequest)}t.is=e})(PE||(zn.DiagnosticServerCancellationData=PE={}));var RE;(function(t){t.Full="full",t.Unchanged="unchanged"})(RE||(zn.DocumentDiagnosticReportKind=RE={}));var CE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new OE.ProgressType})(CE||(zn.DocumentDiagnosticRequest=CE={}));var DE;(function(t){t.method="workspace/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new OE.ProgressType})(DE||(zn.WorkspaceDiagnosticRequest=DE={}));var AE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=vo.MessageDirection.serverToClient,t.type=new vo.ProtocolRequestType0(t.method)})(AE||(zn.DiagnosticRefreshRequest=AE={}))});var FE=k(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.DidCloseNotebookDocumentNotification=vt.DidSaveNotebookDocumentNotification=vt.DidChangeNotebookDocumentNotification=vt.NotebookCellArrayChange=vt.DidOpenNotebookDocumentNotification=vt.NotebookDocumentSyncRegistrationType=vt.NotebookDocument=vt.NotebookCell=vt.ExecutionSummary=vt.NotebookCellKind=void 0;var ja=Nu(),dr=Pu(),Ar=pt(),Hm;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Hm||(vt.NotebookCellKind=Hm={}));var Gm;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return dr.objectLiteral(s)&&ja.uinteger.is(s.executionOrder)&&(s.success===void 0||dr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Gm||(vt.ExecutionSummary=Gm={}));var Fu;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return dr.objectLiteral(o)&&Hm.is(o.kind)&&ja.DocumentUri.is(o.document)&&(o.metadata===void 0||dr.objectLiteral(o.metadata))}t.is=n;function r(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)&&!Gm.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;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(dr.objectLiteral(s)&&dr.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}})(Fu||(vt.NotebookCell=Fu={}));var xE;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return dr.objectLiteral(i)&&dr.string(i.uri)&&ja.integer.is(i.version)&&dr.typedArray(i.cells,Fu.is)}t.is=n})(xE||(vt.NotebookDocument=xE={}));var To;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.RegistrationType(t.method)})(To||(vt.NotebookDocumentSyncRegistrationType=To={}));var ME;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(ME||(vt.DidOpenNotebookDocumentNotification=ME={}));var LE;(function(t){function e(r){let i=r;return dr.objectLiteral(i)&&ja.uinteger.is(i.start)&&ja.uinteger.is(i.deleteCount)&&(i.cells===void 0||dr.typedArray(i.cells,Fu.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(LE||(vt.NotebookCellArrayChange=LE={}));var $E;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method),t.registrationMethod=To.method})($E||(vt.DidChangeNotebookDocumentNotification=$E={}));var qE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(qE||(vt.DidSaveNotebookDocumentNotification=qE={}));var jE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ar.MessageDirection.clientToServer,t.type=new Ar.ProtocolNotificationType(t.method),t.registrationMethod=To.method})(jE||(vt.DidCloseNotebookDocumentNotification=jE={}))});var VE=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.InlineCompletionRequest=void 0;var BE=pt(),UE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=BE.MessageDirection.clientToServer,t.type=new BE.ProtocolRequestType(t.method)})(UE||(Bu.InlineCompletionRequest=UE={}))});var nk=k(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.WorkspaceSymbolRequest=E.CodeActionResolveRequest=E.CodeActionRequest=E.DocumentSymbolRequest=E.DocumentHighlightRequest=E.ReferencesRequest=E.DefinitionRequest=E.SignatureHelpRequest=E.SignatureHelpTriggerKind=E.HoverRequest=E.CompletionResolveRequest=E.CompletionRequest=E.CompletionTriggerKind=E.PublishDiagnosticsNotification=E.WatchKind=E.RelativePattern=E.FileChangeType=E.DidChangeWatchedFilesNotification=E.WillSaveTextDocumentWaitUntilRequest=E.WillSaveTextDocumentNotification=E.TextDocumentSaveReason=E.DidSaveTextDocumentNotification=E.DidCloseTextDocumentNotification=E.DidChangeTextDocumentNotification=E.TextDocumentContentChangeEvent=E.DidOpenTextDocumentNotification=E.TextDocumentSyncKind=E.TelemetryEventNotification=E.LogMessageNotification=E.ShowMessageRequest=E.ShowMessageNotification=E.MessageType=E.DidChangeConfigurationNotification=E.ExitNotification=E.ShutdownRequest=E.InitializedNotification=E.InitializeErrorCodes=E.InitializeRequest=E.WorkDoneProgressOptions=E.TextDocumentRegistrationOptions=E.StaticRegistrationOptions=E.PositionEncodingKind=E.FailureHandlingKind=E.ResourceOperationKind=E.UnregistrationRequest=E.RegistrationRequest=E.DocumentSelector=E.NotebookCellTextDocumentFilter=E.NotebookDocumentFilter=E.TextDocumentFilter=void 0;E.MonikerRequest=E.MonikerKind=E.UniquenessLevel=E.WillDeleteFilesRequest=E.DidDeleteFilesNotification=E.WillRenameFilesRequest=E.DidRenameFilesNotification=E.WillCreateFilesRequest=E.DidCreateFilesNotification=E.FileOperationPatternKind=E.LinkedEditingRangeRequest=E.ShowDocumentRequest=E.SemanticTokensRegistrationType=E.SemanticTokensRefreshRequest=E.SemanticTokensRangeRequest=E.SemanticTokensDeltaRequest=E.SemanticTokensRequest=E.TokenFormat=E.CallHierarchyPrepareRequest=E.CallHierarchyOutgoingCallsRequest=E.CallHierarchyIncomingCallsRequest=E.WorkDoneProgressCancelNotification=E.WorkDoneProgressCreateRequest=E.WorkDoneProgress=E.SelectionRangeRequest=E.DeclarationRequest=E.FoldingRangeRefreshRequest=E.FoldingRangeRequest=E.ColorPresentationRequest=E.DocumentColorRequest=E.ConfigurationRequest=E.DidChangeWorkspaceFoldersNotification=E.WorkspaceFoldersRequest=E.TypeDefinitionRequest=E.ImplementationRequest=E.ApplyWorkspaceEditRequest=E.ExecuteCommandRequest=E.PrepareRenameRequest=E.RenameRequest=E.PrepareSupportDefaultBehavior=E.DocumentOnTypeFormattingRequest=E.DocumentRangesFormattingRequest=E.DocumentRangeFormattingRequest=E.DocumentFormattingRequest=E.DocumentLinkResolveRequest=E.DocumentLinkRequest=E.CodeLensRefreshRequest=E.CodeLensResolveRequest=E.CodeLensRequest=E.WorkspaceSymbolResolveRequest=void 0;E.InlineCompletionRequest=E.DidCloseNotebookDocumentNotification=E.DidSaveNotebookDocumentNotification=E.DidChangeNotebookDocumentNotification=E.NotebookCellArrayChange=E.DidOpenNotebookDocumentNotification=E.NotebookDocumentSyncRegistrationType=E.NotebookDocument=E.NotebookCell=E.ExecutionSummary=E.NotebookCellKind=E.DiagnosticRefreshRequest=E.WorkspaceDiagnosticRequest=E.DocumentDiagnosticRequest=E.DocumentDiagnosticReportKind=E.DiagnosticServerCancellationData=E.InlayHintRefreshRequest=E.InlayHintResolveRequest=E.InlayHintRequest=E.InlineValueRefreshRequest=E.InlineValueRequest=E.TypeHierarchySupertypesRequest=E.TypeHierarchySubtypesRequest=E.TypeHierarchyPrepareRequest=void 0;var U=pt(),zE=Nu(),$t=Pu(),y1=mS();Object.defineProperty(E,"ImplementationRequest",{enumerable:!0,get:function(){return y1.ImplementationRequest}});var b1=bS();Object.defineProperty(E,"TypeDefinitionRequest",{enumerable:!0,get:function(){return b1.TypeDefinitionRequest}});var Qw=_S();Object.defineProperty(E,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Qw.WorkspaceFoldersRequest}});Object.defineProperty(E,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Qw.DidChangeWorkspaceFoldersNotification}});var v1=wS();Object.defineProperty(E,"ConfigurationRequest",{enumerable:!0,get:function(){return v1.ConfigurationRequest}});var Zw=PS();Object.defineProperty(E,"DocumentColorRequest",{enumerable:!0,get:function(){return Zw.DocumentColorRequest}});Object.defineProperty(E,"ColorPresentationRequest",{enumerable:!0,get:function(){return Zw.ColorPresentationRequest}});var ek=DS();Object.defineProperty(E,"FoldingRangeRequest",{enumerable:!0,get:function(){return ek.FoldingRangeRequest}});Object.defineProperty(E,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return ek.FoldingRangeRefreshRequest}});var T1=IS();Object.defineProperty(E,"DeclarationRequest",{enumerable:!0,get:function(){return T1.DeclarationRequest}});var _1=LS();Object.defineProperty(E,"SelectionRangeRequest",{enumerable:!0,get:function(){return _1.SelectionRangeRequest}});var Qm=FS();Object.defineProperty(E,"WorkDoneProgress",{enumerable:!0,get:function(){return Qm.WorkDoneProgress}});Object.defineProperty(E,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Qm.WorkDoneProgressCreateRequest}});Object.defineProperty(E,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Qm.WorkDoneProgressCancelNotification}});var Zm=zS();Object.defineProperty(E,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Zm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(E,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Zm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(E,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Zm.CallHierarchyPrepareRequest}});var _o=XS();Object.defineProperty(E,"TokenFormat",{enumerable:!0,get:function(){return _o.TokenFormat}});Object.defineProperty(E,"SemanticTokensRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRequest}});Object.defineProperty(E,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return _o.SemanticTokensDeltaRequest}});Object.defineProperty(E,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRangeRequest}});Object.defineProperty(E,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return _o.SemanticTokensRefreshRequest}});Object.defineProperty(E,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return _o.SemanticTokensRegistrationType}});var S1=ZS();Object.defineProperty(E,"ShowDocumentRequest",{enumerable:!0,get:function(){return S1.ShowDocumentRequest}});var E1=nE();Object.defineProperty(E,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return E1.LinkedEditingRangeRequest}});var gs=uE();Object.defineProperty(E,"FileOperationPatternKind",{enumerable:!0,get:function(){return gs.FileOperationPatternKind}});Object.defineProperty(E,"DidCreateFilesNotification",{enumerable:!0,get:function(){return gs.DidCreateFilesNotification}});Object.defineProperty(E,"WillCreateFilesRequest",{enumerable:!0,get:function(){return gs.WillCreateFilesRequest}});Object.defineProperty(E,"DidRenameFilesNotification",{enumerable:!0,get:function(){return gs.DidRenameFilesNotification}});Object.defineProperty(E,"WillRenameFilesRequest",{enumerable:!0,get:function(){return gs.WillRenameFilesRequest}});Object.defineProperty(E,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return gs.DidDeleteFilesNotification}});Object.defineProperty(E,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return gs.WillDeleteFilesRequest}});var eg=mE();Object.defineProperty(E,"UniquenessLevel",{enumerable:!0,get:function(){return eg.UniquenessLevel}});Object.defineProperty(E,"MonikerKind",{enumerable:!0,get:function(){return eg.MonikerKind}});Object.defineProperty(E,"MonikerRequest",{enumerable:!0,get:function(){return eg.MonikerRequest}});var tg=vE();Object.defineProperty(E,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return tg.TypeHierarchyPrepareRequest}});Object.defineProperty(E,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return tg.TypeHierarchySubtypesRequest}});Object.defineProperty(E,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return tg.TypeHierarchySupertypesRequest}});var tk=SE();Object.defineProperty(E,"InlineValueRequest",{enumerable:!0,get:function(){return tk.InlineValueRequest}});Object.defineProperty(E,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return tk.InlineValueRefreshRequest}});var ng=NE();Object.defineProperty(E,"InlayHintRequest",{enumerable:!0,get:function(){return ng.InlayHintRequest}});Object.defineProperty(E,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ng.InlayHintResolveRequest}});Object.defineProperty(E,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ng.InlayHintRefreshRequest}});var Fa=IE();Object.defineProperty(E,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Fa.DiagnosticServerCancellationData}});Object.defineProperty(E,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Fa.DocumentDiagnosticReportKind}});Object.defineProperty(E,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Fa.DocumentDiagnosticRequest}});Object.defineProperty(E,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Fa.WorkspaceDiagnosticRequest}});Object.defineProperty(E,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Fa.DiagnosticRefreshRequest}});var Or=FE();Object.defineProperty(E,"NotebookCellKind",{enumerable:!0,get:function(){return Or.NotebookCellKind}});Object.defineProperty(E,"ExecutionSummary",{enumerable:!0,get:function(){return Or.ExecutionSummary}});Object.defineProperty(E,"NotebookCell",{enumerable:!0,get:function(){return Or.NotebookCell}});Object.defineProperty(E,"NotebookDocument",{enumerable:!0,get:function(){return Or.NotebookDocument}});Object.defineProperty(E,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Or.NotebookDocumentSyncRegistrationType}});Object.defineProperty(E,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Or.DidOpenNotebookDocumentNotification}});Object.defineProperty(E,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Or.NotebookCellArrayChange}});Object.defineProperty(E,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Or.DidChangeNotebookDocumentNotification}});Object.defineProperty(E,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Or.DidSaveNotebookDocumentNotification}});Object.defineProperty(E,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Or.DidCloseNotebookDocumentNotification}});var w1=VE();Object.defineProperty(E,"InlineCompletionRequest",{enumerable:!0,get:function(){return w1.InlineCompletionRequest}});var Ym;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(Ym||(E.TextDocumentFilter=Ym={}));var Km;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Km||(E.NotebookDocumentFilter=Km={}));var Xm;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Km.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(Xm||(E.NotebookCellTextDocumentFilter=Xm={}));var Jm;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!Ym.is(r)&&!Xm.is(r))return!1;return!0}t.is=e})(Jm||(E.DocumentSelector=Jm={}));var WE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(WE||(E.RegistrationRequest=WE={}));var HE;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(HE||(E.UnregistrationRequest=HE={}));var GE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(GE||(E.ResourceOperationKind=GE={}));var YE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(YE||(E.FailureHandlingKind=YE={}));var KE;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(KE||(E.PositionEncodingKind=KE={}));var XE;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(XE||(E.StaticRegistrationOptions=XE={}));var JE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Jm.is(r.documentSelector))}t.is=e})(JE||(E.TextDocumentRegistrationOptions=JE={}));var QE;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(QE||(E.WorkDoneProgressOptions=QE={}));var ZE;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ZE||(E.InitializeRequest=ZE={}));var ew;(function(t){t.unknownProtocolVersion=1})(ew||(E.InitializeErrorCodes=ew={}));var tw;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(tw||(E.InitializedNotification=tw={}));var nw;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(nw||(E.ShutdownRequest=nw={}));var rw;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(rw||(E.ExitNotification=rw={}));var iw;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(iw||(E.DidChangeConfigurationNotification=iw={}));var sw;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(sw||(E.MessageType=sw={}));var ow;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(ow||(E.ShowMessageNotification=ow={}));var aw;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(aw||(E.ShowMessageRequest=aw={}));var cw;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(cw||(E.LogMessageNotification=cw={}));var lw;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(lw||(E.TelemetryEventNotification=lw={}));var uw;(function(t){t.None=0,t.Full=1,t.Incremental=2})(uw||(E.TextDocumentSyncKind=uw={}));var dw;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(dw||(E.DidOpenTextDocumentNotification=dw={}));var fw;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(fw||(E.TextDocumentContentChangeEvent=fw={}));var hw;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(hw||(E.DidChangeTextDocumentNotification=hw={}));var pw;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(pw||(E.DidCloseTextDocumentNotification=pw={}));var mw;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(mw||(E.DidSaveTextDocumentNotification=mw={}));var gw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(gw||(E.TextDocumentSaveReason=gw={}));var yw;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(yw||(E.WillSaveTextDocumentNotification=yw={}));var bw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(bw||(E.WillSaveTextDocumentWaitUntilRequest=bw={}));var vw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(vw||(E.DidChangeWatchedFilesNotification=vw={}));var Tw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Tw||(E.FileChangeType=Tw={}));var _w;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(zE.URI.is(r.baseUri)||zE.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(_w||(E.RelativePattern=_w={}));var Sw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Sw||(E.WatchKind=Sw={}));var Ew;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(Ew||(E.PublishDiagnosticsNotification=Ew={}));var ww;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(ww||(E.CompletionTriggerKind=ww={}));var kw;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(kw||(E.CompletionRequest=kw={}));var Nw;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Nw||(E.CompletionResolveRequest=Nw={}));var Pw;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Pw||(E.HoverRequest=Pw={}));var Rw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Rw||(E.SignatureHelpTriggerKind=Rw={}));var Cw;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Cw||(E.SignatureHelpRequest=Cw={}));var Dw;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Dw||(E.DefinitionRequest=Dw={}));var Aw;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Aw||(E.ReferencesRequest=Aw={}));var Ow;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ow||(E.DocumentHighlightRequest=Ow={}));var Iw;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Iw||(E.DocumentSymbolRequest=Iw={}));var xw;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(xw||(E.CodeActionRequest=xw={}));var Mw;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mw||(E.CodeActionResolveRequest=Mw={}));var Lw;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Lw||(E.WorkspaceSymbolRequest=Lw={}));var $w;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($w||(E.WorkspaceSymbolResolveRequest=$w={}));var qw;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qw||(E.CodeLensRequest=qw={}));var jw;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jw||(E.CodeLensResolveRequest=jw={}));var Fw;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(Fw||(E.CodeLensRefreshRequest=Fw={}));var Bw;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Bw||(E.DocumentLinkRequest=Bw={}));var Uw;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Uw||(E.DocumentLinkResolveRequest=Uw={}));var Vw;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Vw||(E.DocumentFormattingRequest=Vw={}));var zw;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(zw||(E.DocumentRangeFormattingRequest=zw={}));var Ww;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ww||(E.DocumentRangesFormattingRequest=Ww={}));var Hw;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Hw||(E.DocumentOnTypeFormattingRequest=Hw={}));var Gw;(function(t){t.Identifier=1})(Gw||(E.PrepareSupportDefaultBehavior=Gw={}));var Yw;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Yw||(E.RenameRequest=Yw={}));var Kw;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Kw||(E.PrepareRenameRequest=Kw={}));var Xw;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Xw||(E.ExecuteCommandRequest=Xw={}));var Jw;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(Jw||(E.ApplyWorkspaceEditRequest=Jw={}))});var ik=k(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.createProtocolConnection=void 0;var rk=ms();function k1(t,e,n,r){return rk.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,rk.createMessageConnection)(t,e,n,r)}Uu.createProtocolConnection=k1});var ok=k(vn=>{"use strict";var N1=vn&&vn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Vu=vn&&vn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&N1(e,t,n)};Object.defineProperty(vn,"__esModule",{value:!0});vn.LSPErrorCodes=vn.createProtocolConnection=void 0;Vu(ms(),vn);Vu(Nu(),vn);Vu(pt(),vn);Vu(nk(),vn);var P1=ik();Object.defineProperty(vn,"createProtocolConnection",{enumerable:!0,get:function(){return P1.createProtocolConnection}});var sk;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(sk||(vn.LSPErrorCodes=sk={}))});var Tt=k(Ir=>{"use strict";var R1=Ir&&Ir.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ak=Ir&&Ir.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&R1(e,t,n)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.createProtocolConnection=void 0;var C1=Fm();ak(Fm(),Ir);ak(ok(),Ir);function D1(t,e,n,r){return(0,C1.createMessageConnection)(t,e,n,r)}Ir.createProtocolConnection=D1});var rg=k(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.generateUuid=Wn.parse=Wn.isUUID=Wn.v4=Wn.empty=void 0;var Ba=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ua=class t extends Ba{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(""))}};Ua._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ua._timeHighBits=["8","9","a","b"];Wn.empty=new Ba("00000000-0000-0000-0000-000000000000");function ck(){return new Ua}Wn.v4=ck;var A1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lk(t){return A1.test(t)}Wn.isUUID=lk;function O1(t){if(!lk(t))throw new Error("invalid uuid");return new Ba(t)}Wn.parse=O1;function I1(){return ck().asHex()}Wn.generateUuid=I1});var uk=k(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.attachPartialResult=Ai.ProgressFeature=Ai.attachWorkDone=void 0;var Di=Tt(),x1=rg(),ys=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Di.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(Di.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Di.WorkDoneProgress.type,this._token,{kind:"end"})}};ys.Instances=new Map;var zu=class extends ys{constructor(e,n){super(e,n),this._source=new Di.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Va=class{constructor(){}begin(){}report(){}done(){}},Wu=class extends Va{constructor(){super(),this._source=new Di.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function M1(t,e){if(e===void 0||e.workDoneToken===void 0)return new Va;let n=e.workDoneToken;return delete e.workDoneToken,new ys(t,n)}Ai.attachWorkDone=M1;var L1=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Di.WorkDoneProgressCancelNotification.type,n=>{let r=ys.Instances.get(n.token);(r instanceof zu||r instanceof Wu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Va:new ys(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,x1.generateUuid)();return this.connection.sendRequest(Di.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new zu(this.connection,e))}else return Promise.resolve(new Wu)}};Ai.ProgressFeature=L1;var ig;(function(t){t.type=new Di.ProgressType})(ig||(ig={}));var sg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(ig.type,this._token,e)}};function $1(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new sg(t,n)}Ai.attachPartialResult=$1});var dk=k(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.ConfigurationFeature=void 0;var q1=Tt(),j1=ru(),F1=t=>class extends t{getConfiguration(e){return e?j1.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(q1.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Hu.ConfigurationFeature=F1});var fk=k(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.WorkspaceFoldersFeature=void 0;var Gu=Tt(),B1=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Gu.Emitter,this.connection.onNotification(Gu.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Gu.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(Gu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Yu.WorkspaceFoldersFeature=B1});var hk=k(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.CallHierarchyFeature=void 0;var og=Tt(),U1=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(og.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=og.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=og.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ku.CallHierarchyFeature=U1});var cg=k(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.SemanticTokensBuilder=Oi.SemanticTokensDiff=Oi.SemanticTokensFeature=void 0;var Xu=Tt(),V1=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Xu.SemanticTokensRefreshRequest.type),on:e=>{let n=Xu.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Xu.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Xu.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Oi.SemanticTokensFeature=V1;var Ju=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Oi.SemanticTokensDiff=Ju;var ag=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,n,r,i,s){let o=e,a=n;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++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}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 Ju(this._prevData,this._data).computeDiff()}:this.build()}};Oi.SemanticTokensBuilder=ag});var pk=k(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.ShowDocumentFeature=void 0;var z1=Tt(),W1=t=>class extends t{showDocument(e){return this.connection.sendRequest(z1.ShowDocumentRequest.type,e)}};Qu.ShowDocumentFeature=W1});var mk=k(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.FileOperationsFeature=void 0;var So=Tt(),H1=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(So.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(So.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(So.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(So.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(So.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(So.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Zu.FileOperationsFeature=H1});var gk=k(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.LinkedEditingRangeFeature=void 0;var G1=Tt(),Y1=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(G1.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};ed.LinkedEditingRangeFeature=Y1});var yk=k(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.TypeHierarchyFeature=void 0;var lg=Tt(),K1=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(lg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=lg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=lg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};td.TypeHierarchyFeature=K1});var vk=k(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.InlineValueFeature=void 0;var bk=Tt(),X1=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(bk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(bk.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};nd.InlineValueFeature=X1});var _k=k(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.FoldingRangeFeature=void 0;var Tk=Tt(),J1=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Tk.FoldingRangeRefreshRequest.type),on:e=>{let n=Tk.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};rd.FoldingRangeFeature=J1});var Sk=k(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.InlayHintFeature=void 0;var ug=Tt(),Q1=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ug.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ug.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(ug.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};id.InlayHintFeature=Q1});var Ek=k(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.DiagnosticFeature=void 0;var za=Tt(),Z1=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(za.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(za.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(za.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(za.WorkspaceDiagnosticRequest.partialResult,n)))}}};sd.DiagnosticFeature=Z1});var fg=k(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.TextDocuments=void 0;var bs=Tt(),dg=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new bs.Emitter,this._onDidOpen=new bs.Emitter,this._onDidClose=new bs.Emitter,this._onDidSave=new bs.Emitter,this._onWillSave=new bs.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=bs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.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)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.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})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),bs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};od.TextDocuments=dg});var pg=k(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.NotebookDocuments=Eo.NotebookSyncFeature=void 0;var Hn=Tt(),wk=fg(),eL=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Hn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Hn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Hn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Hn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Eo.NotebookSyncFeature=eL;var ad=class t{onDidOpenTextDocument(e){return this.openHandler=e,Hn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Hn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Hn.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}};ad.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var hg=class{constructor(e){e instanceof wk.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new wk.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Hn.Emitter,this._onDidChange=new Hn.Emitter,this._onDidSave=new Hn.Emitter,this._onDidClose=new Hn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[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 n=new ad,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.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 b=S.structure.array;if(s.cells.splice(b.start,b.deleteCount,...b.cells!==void 0?b.cells:[]),S.structure.didOpen!==void 0)for(let v of S.structure.didOpen)n.openTextDocument({textDocument:v}),l.push(v.uri);if(S.structure.didClose)for(let v of S.structure.didClose)n.closeTextDocument({textDocument:v}),u.push(v.uri)}if(S.data!==void 0){let b=new Map(S.data.map(v=>[v.document,v]));for(let v=0;v<=s.cells.length;v++){let w=b.get(s.cells[v].document);if(w!==void 0){let C=s.cells.splice(v,1,w);if(d.push({old:C[0],new:w}),b.delete(w.document),b.size===0)break}}}if(S.textContent!==void 0)for(let b of S.textContent)n.changeTextDocument({textDocument:b.document,contentChanges:b.changes}),f.push(b.document.uri)}this.updateCellMap(s);let h={notebookDocument:s};a&&(h.metadata={old:o,new:s.metadata});let y=[];for(let S of l)y.push(this.getNotebookCell(S));let p=[];for(let S of u)p.push(this.getNotebookCell(S));let T=[];for(let S of f)T.push(this.getNotebookCell(S));(y.length>0||p.length>0||d.length>0||T.length>0)&&(h.cells={added:y,removed:p,changed:{data:d,textContent:T}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.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)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Hn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Eo.NotebookDocuments=hg});var kk=k(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.MonikerFeature=void 0;var tL=Tt(),nL=t=>class extends t{get moniker(){return{on:e=>{let n=tL.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};cd.MonikerFeature=nL});var Tg=k(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createConnection=Ae.combineFeatures=Ae.combineNotebooksFeatures=Ae.combineLanguagesFeatures=Ae.combineWorkspaceFeatures=Ae.combineWindowFeatures=Ae.combineClientFeatures=Ae.combineTracerFeatures=Ae.combineTelemetryFeatures=Ae.combineConsoleFeatures=Ae._NotebooksImpl=Ae._LanguagesImpl=Ae.BulkUnregistration=Ae.BulkRegistration=Ae.ErrorMessageTracker=void 0;var W=Tt(),Gn=ru(),gg=rg(),oe=uk(),rL=dk(),iL=fk(),sL=hk(),oL=cg(),aL=pk(),cL=mk(),lL=gk(),uL=yk(),dL=vk(),fL=_k(),hL=Sk(),pL=Ek(),mL=pg(),gL=kk();function mg(t){if(t!==null)return t}var yg=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ae.ErrorMessageTracker=yg;var ld=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(W.MessageType.Error,e)}warn(e){this.send(W.MessageType.Warning,e)}info(e){this.send(W.MessageType.Info,e)}log(e){this.send(W.MessageType.Log,e)}debug(e){this.send(W.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(W.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,W.RAL)().console.error("Sending log message failed")})}},bg=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,...n){let r={type:W.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(mg)}showWarningMessage(e,...n){let r={type:W.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(mg)}showInformationMessage(e,...n){let r={type:W.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(W.ShowMessageRequest.type,r).then(mg)}},Nk=(0,aL.ShowDocumentFeature)((0,oe.ProgressFeature)(bg)),Pk;(function(t){function e(){return new ud}t.create=e})(Pk||(Ae.BulkRegistration=Pk={}));var ud=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Gn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=gg.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Rk;(function(t){function e(){return new Wa(void 0,[])}t.create=e})(Rk||(Ae.BulkUnregistration=Rk={}));var Wa=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(W.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Gn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(W.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},dd=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,n,r){return e instanceof ud?this.registerMany(e):e instanceof Wa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Gn.string(n)?n:n.method,s=gg.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(W.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,n){let r=Gn.string(e)?e:e.method,i=gg.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(W.RegistrationRequest.type,s).then(o=>W.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(W.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(W.RegistrationRequest.type,n).then(()=>new Wa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},vg=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 n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(W.ApplyWorkspaceEditRequest.type,r)}},Ck=(0,cL.FileOperationsFeature)((0,iL.WorkspaceFoldersFeature)((0,rL.ConfigurationFeature)(vg))),fd=class{constructor(){this._trace=W.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,n){this._trace!==W.Trace.Off&&this.connection.sendNotification(W.LogTraceNotification.type,{message:e,verbose:this._trace===W.Trace.Verbose?n:void 0}).catch(()=>{})}},hd=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(W.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},pd=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,oe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,oe.attachPartialResult)(this.connection,n)}};Ae._LanguagesImpl=pd;var Dk=(0,fL.FoldingRangeFeature)((0,gL.MonikerFeature)((0,pL.DiagnosticFeature)((0,hL.InlayHintFeature)((0,dL.InlineValueFeature)((0,uL.TypeHierarchyFeature)((0,lL.LinkedEditingRangeFeature)((0,oL.SemanticTokensFeature)((0,sL.CallHierarchyFeature)(pd))))))))),md=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,oe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,oe.attachPartialResult)(this.connection,n)}};Ae._NotebooksImpl=md;var Ak=(0,mL.NotebookSyncFeature)(md);function Ok(t,e){return function(n){return e(t(n))}}Ae.combineConsoleFeatures=Ok;function Ik(t,e){return function(n){return e(t(n))}}Ae.combineTelemetryFeatures=Ik;function xk(t,e){return function(n){return e(t(n))}}Ae.combineTracerFeatures=xk;function Mk(t,e){return function(n){return e(t(n))}}Ae.combineClientFeatures=Mk;function Lk(t,e){return function(n){return e(t(n))}}Ae.combineWindowFeatures=Lk;function $k(t,e){return function(n){return e(t(n))}}Ae.combineWorkspaceFeatures=$k;function qk(t,e){return function(n){return e(t(n))}}Ae.combineLanguagesFeatures=qk;function jk(t,e){return function(n){return e(t(n))}}Ae.combineNotebooksFeatures=jk;function yL(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,Ok),tracer:n(t.tracer,e.tracer,xk),telemetry:n(t.telemetry,e.telemetry,Ik),client:n(t.client,e.client,Mk),window:n(t.window,e.window,Lk),workspace:n(t.workspace,e.workspace,$k),languages:n(t.languages,e.languages,qk),notebooks:n(t.notebooks,e.notebooks,jk)}}Ae.combineFeatures=yL;function bL(t,e,n){let r=n&&n.console?new(n.console(ld)):new ld,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(fd)):new fd,o=n&&n.telemetry?new(n.telemetry(hd)):new hd,a=n&&n.client?new(n.client(dd)):new dd,c=n&&n.window?new(n.window(Nk)):new Nk,l=n&&n.workspace?new(n.workspace(Ck)):new Ck,u=n&&n.languages?new(n.languages(Dk)):new Dk,d=n&&n.notebooks?new(n.notebooks(Ak)):new Ak,f=[r,s,o,a,c,l,u,d];function h(b){return b instanceof Promise?b:Gn.thenable(b)?new Promise((v,w)=>{b.then(C=>v(C),C=>w(C))}):Promise.resolve(b)}let y,p,T,S={listen:()=>i.listen(),sendRequest:(b,...v)=>i.sendRequest(Gn.string(b)?b:b.method,...v),onRequest:(b,v)=>i.onRequest(b,v),sendNotification:(b,v)=>{let w=Gn.string(b)?b:b.method;return i.sendNotification(w,v)},onNotification:(b,v)=>i.onNotification(b,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:b=>(p=b,{dispose:()=>{p=void 0}}),onInitialized:b=>i.onNotification(W.InitializedNotification.type,b),onShutdown:b=>(y=b,{dispose:()=>{y=void 0}}),onExit:b=>(T=b,{dispose:()=>{T=void 0}}),get console(){return r},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:b=>i.onNotification(W.DidChangeConfigurationNotification.type,b),onDidChangeWatchedFiles:b=>i.onNotification(W.DidChangeWatchedFilesNotification.type,b),__textDocumentSync:void 0,onDidOpenTextDocument:b=>i.onNotification(W.DidOpenTextDocumentNotification.type,b),onDidChangeTextDocument:b=>i.onNotification(W.DidChangeTextDocumentNotification.type,b),onDidCloseTextDocument:b=>i.onNotification(W.DidCloseTextDocumentNotification.type,b),onWillSaveTextDocument:b=>i.onNotification(W.WillSaveTextDocumentNotification.type,b),onWillSaveTextDocumentWaitUntil:b=>i.onRequest(W.WillSaveTextDocumentWaitUntilRequest.type,b),onDidSaveTextDocument:b=>i.onNotification(W.DidSaveTextDocumentNotification.type,b),sendDiagnostics:b=>i.sendNotification(W.PublishDiagnosticsNotification.type,b),onHover:b=>i.onRequest(W.HoverRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),onCompletion:b=>i.onRequest(W.CompletionRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onCompletionResolve:b=>i.onRequest(W.CompletionResolveRequest.type,b),onSignatureHelp:b=>i.onRequest(W.SignatureHelpRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),onDeclaration:b=>i.onRequest(W.DeclarationRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onDefinition:b=>i.onRequest(W.DefinitionRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onTypeDefinition:b=>i.onRequest(W.TypeDefinitionRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onImplementation:b=>i.onRequest(W.ImplementationRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onReferences:b=>i.onRequest(W.ReferencesRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onDocumentHighlight:b=>i.onRequest(W.DocumentHighlightRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onDocumentSymbol:b=>i.onRequest(W.DocumentSymbolRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onWorkspaceSymbol:b=>i.onRequest(W.WorkspaceSymbolRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:b=>i.onRequest(W.WorkspaceSymbolResolveRequest.type,b),onCodeAction:b=>i.onRequest(W.CodeActionRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onCodeActionResolve:b=>i.onRequest(W.CodeActionResolveRequest.type,(v,w)=>b(v,w)),onCodeLens:b=>i.onRequest(W.CodeLensRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onCodeLensResolve:b=>i.onRequest(W.CodeLensResolveRequest.type,(v,w)=>b(v,w)),onDocumentFormatting:b=>i.onRequest(W.DocumentFormattingRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:b=>i.onRequest(W.DocumentRangeFormattingRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:b=>i.onRequest(W.DocumentOnTypeFormattingRequest.type,(v,w)=>b(v,w)),onRenameRequest:b=>i.onRequest(W.RenameRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),onPrepareRename:b=>i.onRequest(W.PrepareRenameRequest.type,(v,w)=>b(v,w)),onDocumentLinks:b=>i.onRequest(W.DocumentLinkRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onDocumentLinkResolve:b=>i.onRequest(W.DocumentLinkResolveRequest.type,(v,w)=>b(v,w)),onDocumentColor:b=>i.onRequest(W.DocumentColorRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onColorPresentation:b=>i.onRequest(W.ColorPresentationRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onFoldingRanges:b=>i.onRequest(W.FoldingRangeRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onSelectionRanges:b=>i.onRequest(W.SelectionRangeRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),(0,oe.attachPartialResult)(i,v))),onExecuteCommand:b=>i.onRequest(W.ExecuteCommandRequest.type,(v,w)=>b(v,w,(0,oe.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let b of f)b.attach(S);return i.onRequest(W.InitializeRequest.type,b=>{e.initialize(b),Gn.string(b.trace)&&(s.trace=W.Trace.fromString(b.trace));for(let v of f)v.initialize(b.capabilities);if(p){let v=p(b,new W.CancellationTokenSource().token,(0,oe.attachWorkDone)(i,b),void 0);return h(v).then(w=>{if(w instanceof W.ResponseError)return w;let C=w;C||(C={capabilities:{}});let L=C.capabilities;L||(L={},C.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Gn.number(S.__textDocumentSync)?S.__textDocumentSync:W.TextDocumentSyncKind.None:!Gn.number(L.textDocumentSync)&&!Gn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Gn.number(S.__textDocumentSync)?S.__textDocumentSync:W.TextDocumentSyncKind.None);for(let B of f)B.fillServerCapabilities(L);return C})}else{let v={capabilities:{textDocumentSync:W.TextDocumentSyncKind.None}};for(let w of f)w.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(W.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new W.CancellationTokenSource().token)}),i.onNotification(W.ExitNotification.type,()=>{try{T&&T()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(W.SetTraceNotification.type,b=>{s.trace=W.Trace.fromString(b.value)}),S}Ae.createConnection=bL});var Fk=k(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.resolveModulePath=Tn.FileSystem=Tn.resolveGlobalYarnPath=Tn.resolveGlobalNodePath=Tn.resolve=Tn.uriToFilePath=void 0;var vL=require("url"),fr=require("path"),_g=require("fs"),kg=require("child_process");function TL(t){let e=vL.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return fr.normalize(n.join("/"))}Tn.uriToFilePath=TL;function Sg(){return process.platform==="win32"}function gd(t,e,n,r){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&&_g.existsSync(e)&&(l[i]?l[i]=e+fr.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,kg.fork)("",[],{cwd:n,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)}})}Tn.resolve=gd;function Eg(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Sg()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,kg.spawnSync)(e,["config","get","prefix"],r).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?Sg()?fr.join(o,"node_modules"):fr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Tn.resolveGlobalNodePath=Eg;function _L(t){let e="yarn",n={encoding:"utf8"};Sg()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,kg.spawnSync)(e,["global","dir","--json"],n),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 fr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Tn.resolveGlobalYarnPath=_L;var wg;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!_g.existsSync(__filename.toUpperCase())||!_g.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?fr.normalize(s).indexOf(fr.normalize(i))===0:fr.normalize(s).toLowerCase().indexOf(fr.normalize(i).toLowerCase())===0}t.isParent=r})(wg||(Tn.FileSystem=wg={}));function SL(t,e,n,r){return n?(fr.isAbsolute(n)||(n=fr.join(t,n)),gd(e,n,n,r).then(i=>wg.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>gd(e,Eg(r),t,r))):gd(e,Eg(r),t,r)}Tn.resolveModulePath=SL});var Ng=k((Z3,Bk)=>{"use strict";Bk.exports=Tt()});var Uk=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.InlineCompletionFeature=void 0;var EL=Tt(),wL=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(EL.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};yd.InlineCompletionFeature=wL});var Wk=k(en=>{"use strict";var kL=en&&en.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),zk=en&&en.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kL(e,t,n)};Object.defineProperty(en,"__esModule",{value:!0});en.ProposedFeatures=en.NotebookDocuments=en.TextDocuments=en.SemanticTokensBuilder=void 0;var NL=cg();Object.defineProperty(en,"SemanticTokensBuilder",{enumerable:!0,get:function(){return NL.SemanticTokensBuilder}});var PL=Uk();zk(Tt(),en);var RL=fg();Object.defineProperty(en,"TextDocuments",{enumerable:!0,get:function(){return RL.TextDocuments}});var CL=pg();Object.defineProperty(en,"NotebookDocuments",{enumerable:!0,get:function(){return CL.NotebookDocuments}});zk(Tg(),en);var Vk;(function(t){t.all={__brand:"features",languages:PL.InlineCompletionFeature}})(Vk||(en.ProposedFeatures=Vk={}))});var J=k(Yn=>{"use strict";var DL=Yn&&Yn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Kk=Yn&&Yn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&DL(e,t,n)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createConnection=Yn.Files=void 0;var Hk=require("node:util"),Pg=ru(),AL=Tg(),Ha=Fk(),vs=Ng();Kk(Ng(),Yn);Kk(Wk(),Yn);var Gk;(function(t){t.uriToFilePath=Ha.uriToFilePath,t.resolveGlobalNodePath=Ha.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ha.resolveGlobalYarnPath,t.resolve=Ha.resolve,t.resolveModulePath=Ha.resolveModulePath})(Gk||(Yn.Files=Gk={}));var Yk;function bd(){if(Yk!==void 0)try{Yk.end()}catch{}}var wo=!1,Xk;function OL(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Xk=setInterval(()=>{try{process.kill(r,0)}catch{bd(),process.exit(wo?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}OL();var IL={initialize:t=>{let e=t.processId;Pg.number(e)&&Xk===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(wo?0:1)}},3e3)},get shutdownReceived(){return wo},set shutdownReceived(t){wo=t},exit:t=>{bd(),process.exit(t)}};function xL(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),vs.ConnectionStrategy.is(t)||vs.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),ML(s,o,a,i)}Yn.createConnection=xL;function ML(t,e,n,r){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 vs.IPCMessageReader(process),e=new vs.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,vs.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,vs.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(Pg.func(t.read)&&Pg.func(t.on)){let c=t;c.on("end",()=>{bd(),process.exit(wo?0:1)}),c.on("close",()=>{bd(),process.exit(wo?0:1)})}let a=c=>{let l=(0,vs.createProtocolConnection)(t,e,c,n);return i&&LL(c),l};return(0,AL.createConnection)(a,IL,r)}function LL(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Hk.inspect)(i)).join(" ")}let n=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=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Hk.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 Qk=k((i9,Jk)=>{"use strict";Jk.exports=J()});var Ne=k(Ht=>{"use strict";var iy=Symbol.for("yaml.alias"),qR=Symbol.for("yaml.document"),Sf=Symbol.for("yaml.map"),jR=Symbol.for("yaml.pair"),sy=Symbol.for("yaml.scalar"),Ef=Symbol.for("yaml.seq"),di=Symbol.for("yaml.node.type"),q$=t=>!!t&&typeof t=="object"&&t[di]===iy,j$=t=>!!t&&typeof t=="object"&&t[di]===qR,F$=t=>!!t&&typeof t=="object"&&t[di]===Sf,B$=t=>!!t&&typeof t=="object"&&t[di]===jR,FR=t=>!!t&&typeof t=="object"&&t[di]===sy,U$=t=>!!t&&typeof t=="object"&&t[di]===Ef;function BR(t){if(t&&typeof t=="object")switch(t[di]){case Sf:case Ef:return!0}return!1}function V$(t){if(t&&typeof t=="object")switch(t[di]){case iy:case Sf:case sy:case Ef:return!0}return!1}var z$=t=>(FR(t)||BR(t))&&!!t.anchor;Ht.ALIAS=iy;Ht.DOC=qR;Ht.MAP=Sf;Ht.NODE_TYPE=di;Ht.PAIR=jR;Ht.SCALAR=sy;Ht.SEQ=Ef;Ht.hasAnchor=z$;Ht.isAlias=q$;Ht.isCollection=BR;Ht.isDocument=j$;Ht.isMap=F$;Ht.isNode=V$;Ht.isPair=B$;Ht.isScalar=FR;Ht.isSeq=U$});var fc=k(oy=>{"use strict";var It=Ne(),Pn=Symbol("break visit"),UR=Symbol("skip children"),Wr=Symbol("remove node");function wf(t,e){let n=VR(e);It.isDocument(t)?Uo(null,t.contents,n,Object.freeze([t]))===Wr&&(t.contents=null):Uo(null,t,n,Object.freeze([]))}wf.BREAK=Pn;wf.SKIP=UR;wf.REMOVE=Wr;function Uo(t,e,n,r){let i=zR(t,e,n,r);if(It.isNode(i)||It.isPair(i))return WR(t,r,i),Uo(t,i,n,r);if(typeof i!="symbol"){if(It.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=Uo(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Pn)return Pn;o===Wr&&(e.items.splice(s,1),s-=1)}}}else if(It.isPair(e)){r=Object.freeze(r.concat(e));let s=Uo("key",e.key,n,r);if(s===Pn)return Pn;s===Wr&&(e.key=null);let o=Uo("value",e.value,n,r);if(o===Pn)return Pn;o===Wr&&(e.value=null)}}return i}async function kf(t,e){let n=VR(e);It.isDocument(t)?await Vo(null,t.contents,n,Object.freeze([t]))===Wr&&(t.contents=null):await Vo(null,t,n,Object.freeze([]))}kf.BREAK=Pn;kf.SKIP=UR;kf.REMOVE=Wr;async function Vo(t,e,n,r){let i=await zR(t,e,n,r);if(It.isNode(i)||It.isPair(i))return WR(t,r,i),Vo(t,i,n,r);if(typeof i!="symbol"){if(It.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=await Vo(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Pn)return Pn;o===Wr&&(e.items.splice(s,1),s-=1)}}}else if(It.isPair(e)){r=Object.freeze(r.concat(e));let s=await Vo("key",e.key,n,r);if(s===Pn)return Pn;s===Wr&&(e.key=null);let o=await Vo("value",e.value,n,r);if(o===Pn)return Pn;o===Wr&&(e.value=null)}}return i}function VR(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 zR(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(It.isMap(e))return n.Map?.(t,e,r);if(It.isSeq(e))return n.Seq?.(t,e,r);if(It.isPair(e))return n.Pair?.(t,e,r);if(It.isScalar(e))return n.Scalar?.(t,e,r);if(It.isAlias(e))return n.Alias?.(t,e,r)}function WR(t,e,n){let r=e[e.length-1];if(It.isCollection(r))r.items[t]=n;else if(It.isPair(r))t==="key"?r.key=n:r.value=n;else if(It.isDocument(r))r.contents=n;else{let i=It.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}oy.visit=wf;oy.visitAsync=kf});var ay=k(GR=>{"use strict";var HR=Ne(),W$=fc(),H$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},G$=t=>t.replace(/[!,[\]{}]/g,e=>H$[e]),hc=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}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,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+G$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&HR.isNode(e.contents)){let s={};W$.visit(e.contents,(o,a)=>{HR.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
|
38
|
+
`)}};hc.defaultYaml={explicit:!1,version:"1.2"};hc.defaultTags={"!!":"tag:yaml.org,2002:"};GR.Directives=hc});var Nf=k(pc=>{"use strict";var YR=Ne(),Y$=fc();function K$(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function KR(t){let e=new Set;return Y$.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function XR(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function X$(t,e){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i||(i=KR(t));let o=XR(e,i);return i.add(o),o},setAnchors:()=>{for(let s of n){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(YR.isScalar(o.node)||YR.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:r}}pc.anchorIsValid=K$;pc.anchorNames=KR;pc.createNodeAnchors=X$;pc.findNewAnchor=XR});var cy=k(JR=>{"use strict";function mc(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let o=r[i],a=mc(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),o=mc(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(let i of Array.from(r)){let s=mc(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let o=mc(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}JR.applyReviver=mc});var Bi=k(ZR=>{"use strict";var J$=Ne();function QR(t,e,n){if(Array.isArray(t))return t.map((r,i)=>QR(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!J$.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}ZR.toJS=QR});var Pf=k(t0=>{"use strict";var Q$=cy(),e0=Ne(),Z$=Bi(),ly=class{constructor(e){Object.defineProperty(this,e0.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:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!e0.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Z$.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?Q$.applyReviver(s,{"":a},"",a):a}};t0.NodeBase=ly});var gc=k(r0=>{"use strict";var eq=Nf(),n0=fc(),Rf=Ne(),tq=Pf(),nq=Bi(),uy=class extends tq.NodeBase{constructor(e){super(Rf.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return n0.visit(e,{Node:(r,i)=>{if(i===this)return n0.visit.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,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=r.get(o);if(a||(nq.toJS(o,null,n),a=r.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=Cf(i,o,r)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(eq.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 Cf(t,e,n){if(Rf.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Rf.isCollection(e)){let r=0;for(let i of e.items){let s=Cf(t,i,n);s>r&&(r=s)}return r}else if(Rf.isPair(e)){let r=Cf(t,e.key,n),i=Cf(t,e.value,n);return Math.max(r,i)}return 1}r0.Alias=uy});var Ct=k(dy=>{"use strict";var rq=Ne(),iq=Pf(),sq=Bi(),oq=t=>!t||typeof t!="function"&&typeof t!="object",Ui=class extends iq.NodeBase{constructor(e){super(rq.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:sq.toJS(this.value,e,n)}toString(){return String(this.value)}};Ui.BLOCK_FOLDED="BLOCK_FOLDED";Ui.BLOCK_LITERAL="BLOCK_LITERAL";Ui.PLAIN="PLAIN";Ui.QUOTE_DOUBLE="QUOTE_DOUBLE";Ui.QUOTE_SINGLE="QUOTE_SINGLE";dy.Scalar=Ui;dy.isScalarValue=oq});var yc=k(s0=>{"use strict";var aq=gc(),Ns=Ne(),i0=Ct(),cq="tag:yaml.org,2002:";function lq(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function uq(t,e,n){if(Ns.isDocument(t)&&(t=t.contents),Ns.isNode(t))return t;if(Ns.isPair(t)){let d=n.schema[Ns.MAP].createNode?.(n.schema,null,n);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:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new aq.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=cq+e.slice(2));let l=lq(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new i0.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Ns.MAP]:Symbol.iterator in Object(t)?o[Ns.SEQ]:o[Ns.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new i0.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}s0.createNode=uq});var Af=k(Df=>{"use strict";var dq=yc(),Hr=Ne(),fq=Pf();function fy(t,e,n){let r=n;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]=r,r=o}else r=new Map([[s,r]])}return dq.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var o0=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,hy=class extends fq.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Hr.isNode(r)||Hr.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(o0(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(Hr.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,fy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(Hr.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&Hr.isScalar(s)?s.value:s:Hr.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Hr.isPair(n))return!1;let r=n.value;return r==null||e&&Hr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return Hr.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(Hr.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,fy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};Df.Collection=hy;Df.collectionFromPath=fy;Df.isEmptyPath=o0});var bc=k(Of=>{"use strict";var hq=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function py(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var pq=(t,e,n)=>t.endsWith(`
|
|
39
|
+
`)?py(n,e):n.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)n===
|
|
43
|
-
`&&h!==" "){let
|
|
44
|
-
`&&
|
|
45
|
-
${e}${t.slice(0,C)}`:(n===
|
|
46
|
-
${e}${t.slice(
|
|
47
|
-
`);r=e,
|
|
48
|
-
`){if(
|
|
41
|
+
`+py(n,e):(t.endsWith(" ")?"":" ")+n;Of.indentComment=py;Of.lineComment=pq;Of.stringifyComment=hq});var c0=k(vc=>{"use strict";var mq="flow",my="block",If="quoted";function gq(t,e,n="flow",{indentAtStart:r,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 r=="number"&&(r>i-Math.max(2,s)?l.push(0):d=i-r);let f,h,y=!1,p=-1,T=-1,S=-1;n===my&&(p=a0(t,p,e.length),p!==-1&&(d=p+c));for(let v;v=t[p+=1];){if(n===If&&v==="\\"){switch(T=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}S=p}if(v===`
|
|
42
|
+
`)n===my&&(p=a0(t,p,e.length)),d=p+e.length+c,f=void 0;else{if(v===" "&&h&&h!==" "&&h!==`
|
|
43
|
+
`&&h!==" "){let w=t[p+1];w&&w!==" "&&w!==`
|
|
44
|
+
`&&w!==" "&&(f=p)}if(p>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===If){for(;h===" "||h===" ";)h=v,v=t[p+=1],y=!0;let w=p>S+1?p-2:T-1;if(u[w])return t;l.push(w),u[w]=!0,d=w+c,f=void 0}else y=!0}h=v}if(y&&a&&a(),l.length===0)return t;o&&o();let b=t.slice(0,l[0]);for(let v=0;v<l.length;++v){let w=l[v],C=l[v+1]||t.length;w===0?b=`
|
|
45
|
+
${e}${t.slice(0,C)}`:(n===If&&u[w]&&(b+=`${t[w]}\\`),b+=`
|
|
46
|
+
${e}${t.slice(w+1,C)}`)}return b}function a0(t,e,n){let r=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
47
|
+
`);r=e,i=e+1,s=t[i]}return r}vc.FOLD_BLOCK=my;vc.FOLD_FLOW=mq;vc.FOLD_QUOTED=If;vc.foldFlowLines=gq});var _c=k(l0=>{"use strict";var br=Ct(),Vi=c0(),Mf=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Lf=t=>/^(%|---|\.\.\.)/m.test(t);function yq(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
|
|
48
|
+
`){if(s-o>r)return!0;if(o=s+1,i-o<=r)return!1}return!0}function Tc(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Lf(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let u=n.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+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
51
|
-
`,c+=2;o+=
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
53
|
-
${n}`)+"'";return e.implicitKey?r:
|
|
51
|
+
`,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:Vi.foldFlowLines(o,s,Vi.FOLD_QUOTED,Mf(e,!1))}function gy(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Tc(t,e);let n=e.indent||(Lf(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${n}`)+"'";return e.implicitKey?r:Vi.foldFlowLines(r,n,Vi.FOLD_FLOW,Mf(e,!1))}function zo(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=Tc;else{let i=t.includes('"'),s=t.includes("'");i&&!s?r=gy:s&&!i?r=Tc:r=n?gy:Tc}return r(t,e)}var yy;try{yy=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{yy=/\n+(?!\n|$)/g}function xf({comment:t,type:e,value:n},r,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return zo(n,r);let l=r.indent||(r.forceBlockIndent||Lf(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===br.Scalar.BLOCK_FOLDED?!1:e===br.Scalar.BLOCK_LITERAL?!0:!yq(n,c,l.length);if(!n)return u?`|
|
|
57
57
|
`:`>
|
|
58
58
|
`;let d,f;for(f=n.length;f>0;--f){let C=n[f-1];if(C!==`
|
|
59
59
|
`&&C!==" "&&C!==" ")break}let h=n.substring(f),y=h.indexOf(`
|
|
60
|
-
`);y===-1?d="-":n===h||y!==h.length-1?(d="+",
|
|
61
|
-
`&&(h=h.slice(0,-1)),h=h.replace(
|
|
62
|
-
`)
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`)
|
|
64
|
-
${l}${q}`}return n=n.replace(/\n+/g,`$&${l}`),`|${
|
|
65
|
-
${l}${
|
|
66
|
-
`)||u&&/[[\]{},]/.test(
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
69
|
-
${c}`);if(o){let f=
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(
|
|
72
|
-
`:"",
|
|
73
|
-
${
|
|
74
|
-
`&&(
|
|
60
|
+
`);y===-1?d="-":n===h||y!==h.length-1?(d="+",s&&s()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
61
|
+
`&&(h=h.slice(0,-1)),h=h.replace(yy,`$&${l}`));let p=!1,T,S=-1;for(T=0;T<n.length;++T){let C=n[T];if(C===" ")p=!0;else if(C===`
|
|
62
|
+
`)S=T;else break}let b=n.substring(0,S<T?S+1:T);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let w=(p?l?"2":"1":"")+d;if(t&&(w+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=n.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,B=Mf(r,!0);o!=="folded"&&e!==br.Scalar.BLOCK_FOLDED&&(B.onOverflow=()=>{L=!0});let q=Vi.foldFlowLines(`${b}${C}${h}`,l,Vi.FOLD_BLOCK,B);if(!L)return`>${w}
|
|
64
|
+
${l}${q}`}return n=n.replace(/\n+/g,`$&${l}`),`|${w}
|
|
65
|
+
${l}${b}${n}${h}`}function bq(t,e,n,r){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(s))return zo(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
67
|
+
`)?zo(s,e):xf(t,e,n,r);if(!a&&!u&&i!==br.Scalar.PLAIN&&s.includes(`
|
|
68
|
+
`))return xf(t,e,n,r);if(Lf(s)){if(c==="")return e.forceBlockIndent=!0,xf(t,e,n,r);if(a&&c===l)return zo(s,e)}let d=s.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(d),{compat:h,tags:y}=e.doc.schema;if(y.some(f)||h?.some(f))return zo(s,e)}return a?d:Vi.foldFlowLines(d,c,Vi.FOLD_FLOW,Mf(e,!1))}function vq(t,e,n,r){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==br.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=br.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case br.Scalar.BLOCK_FOLDED:case br.Scalar.BLOCK_LITERAL:return i||s?zo(o.value,e):xf(o,e,n,r);case br.Scalar.QUOTE_DOUBLE:return Tc(o.value,e);case br.Scalar.QUOTE_SINGLE:return gy(o.value,e);case br.Scalar.PLAIN:return bq(o,e,n,r);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}l0.stringifyString=vq});var Sc=k(by=>{"use strict";var Tq=Nf(),zi=Ne(),_q=bc(),Sq=_c();function Eq(t,e){let n=Object.assign({blockQuote:!0,commentString:_q.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),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function wq(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 n,r;if(zi.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function kq(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(zi.isScalar(t)||zi.isCollection(t))&&t.anchor;s&&Tq.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Nq(t,e,n,r){if(zi.isPair(t))return t.toString(e,n,r);if(zi.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=zi.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=wq(e.doc.schema.tags,s));let o=kq(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,n,r):zi.isScalar(s)?Sq.stringifyString(s,e,n,r):s.toString(e,n,r);return o?zi.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}by.createStringifyContext=Eq;by.stringify=Nq});var h0=k(f0=>{"use strict";var fi=Ne(),u0=Ct(),d0=Sc(),Ec=bc();function Pq({key:t,value:e},n,r,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=fi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(fi.isCollection(t)||!fi.isNode(t)&&typeof t=="object"){let B="With simple keys, collection cannot be used as a key value";throw new Error(B)}}let h=!d&&(!t||f&&e==null&&!n.inFlow||fi.isCollection(t)||(fi.isScalar(t)?t.type===u0.Scalar.BLOCK_FOLDED||t.type===u0.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:a+c});let y=!1,p=!1,T=d0.stringify(t,n,()=>y=!0,()=>p=!0);if(!h&&!n.inFlow&&T.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return y&&r&&r(),T===""?"?":h?`? ${T}`:T}else if(s&&!d||e==null&&h)return T=`? ${T}`,f&&!y?T+=Ec.lineComment(T,n.indent,l(f)):p&&i&&i(),T;y&&(f=null),h?(f&&(T+=Ec.lineComment(T,n.indent,l(f))),T=`? ${T}
|
|
71
|
+
${a}:`):(T=`${T}:`,f&&(T+=Ec.lineComment(T,n.indent,l(f))));let S,b,v;fi.isNode(e)?(S=!!e.spaceBefore,b=e.commentBefore,v=e.comment):(S=!1,b=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&fi.isScalar(e)&&(n.indentAtStart=T.length+1),p=!1,!u&&c.length>=2&&!n.inFlow&&!h&&fi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let w=!1,C=d0.stringify(e,n,()=>w=!0,()=>p=!0),L=" ";if(f||S||b){if(L=S?`
|
|
72
|
+
`:"",b){let B=l(b);L+=`
|
|
73
|
+
${Ec.indentComment(B,n.indent)}`}C===""&&!n.inFlow?L===`
|
|
74
|
+
`&&(L=`
|
|
75
75
|
|
|
76
|
-
`)
|
|
77
|
-
${n.indent}`}else if(!h&&
|
|
78
|
-
`),
|
|
76
|
+
`):L+=`
|
|
77
|
+
${n.indent}`}else if(!h&&fi.isCollection(e)){let B=C[0],q=C.indexOf(`
|
|
78
|
+
`),ae=q!==-1,We=n.inFlow??e.flow??e.items.length===0;if(ae||!We){let Dt=!1;if(ae&&(B==="&"||B==="!")){let ge=C.indexOf(" ");B==="&"&&ge!==-1&&ge<q&&C[ge+1]==="!"&&(ge=C.indexOf(" ",ge+1)),(ge===-1||q<ge)&&(Dt=!0)}Dt||(L=`
|
|
79
79
|
${n.indent}`)}}else(C===""||C[0]===`
|
|
80
|
-
`)&&(
|
|
81
|
-
${c}${
|
|
80
|
+
`)&&(L="");return T+=L+C,n.inFlow?w&&r&&r():v&&!w?T+=Ec.lineComment(T,n.indent,l(v)):p&&i&&i(),T}f0.stringifyPair=Pq});var Ty=k(vy=>{"use strict";function Rq(t,...e){t==="debug"&&console.log(...e)}function Cq(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}vy.debug=Rq;vy.warn=Cq});var Ff=k(jf=>{"use strict";var wc=Ne(),p0=Ct(),$f="<<",qf={identify:t=>t===$f||typeof t=="symbol"&&t.description===$f,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new p0.Scalar(Symbol($f)),{addToJSMap:m0}),stringify:()=>$f},Dq=(t,e)=>(qf.identify(e)||wc.isScalar(e)&&(!e.type||e.type===p0.Scalar.PLAIN)&&qf.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===qf.tag&&n.default);function m0(t,e,n){if(n=t&&wc.isAlias(n)?n.resolve(t.doc):n,wc.isSeq(n))for(let r of n.items)_y(t,e,r);else if(Array.isArray(n))for(let r of n)_y(t,e,r);else _y(t,e,n)}function _y(t,e,n){let r=t&&wc.isAlias(n)?n.resolve(t.doc):n;if(!wc.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.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}jf.addMergeToJSMap=m0;jf.isMergeKey=Dq;jf.merge=qf});var Ey=k(b0=>{"use strict";var Aq=Ty(),g0=Ff(),Oq=Sc(),y0=Ne(),Sy=Bi();function Iq(t,e,{key:n,value:r}){if(y0.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(g0.isMergeKey(t,n))g0.addMergeToJSMap(t,e,r);else{let i=Sy.toJS(n,"",t);if(e instanceof Map)e.set(i,Sy.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=xq(n,i,t),o=Sy.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function xq(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(y0.isNode(t)&&n?.doc){let r=Oq.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),Aq.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}b0.addPairToJSMap=Iq});var Wi=k(wy=>{"use strict";var v0=yc(),Mq=h0(),Lq=Ey(),Bf=Ne();function $q(t,e,n){let r=v0.createNode(t,void 0,n),i=v0.createNode(e,void 0,n);return new Uf(r,i)}var Uf=class t{constructor(e,n=null){Object.defineProperty(this,Bf.NODE_TYPE,{value:Bf.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Bf.isNode(n)&&(n=n.clone(e)),Bf.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Lq.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Mq.stringifyPair(this,e,n,r):JSON.stringify(this)}};wy.Pair=Uf;wy.createPair=$q});var ky=k(_0=>{"use strict";var Ps=Ne(),T0=Sc(),Vf=bc();function qq(t,e,n){return(e.inFlow??t.flow?Fq:jq)(t,e,n)}function jq({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),d=!1,f=[];for(let y=0;y<e.length;++y){let p=e[y],T=null;if(Ps.isNode(p))!d&&p.spaceBefore&&f.push(""),zf(n,f,p.commentBefore,d),p.comment&&(T=p.comment);else if(Ps.isPair(p)){let b=Ps.isNode(p.key)?p.key:null;b&&(!d&&b.spaceBefore&&f.push(""),zf(n,f,b.commentBefore,d))}d=!1;let S=T0.stringify(p,u,()=>T=null,()=>d=!0);T&&(S+=Vf.lineComment(S,s,l(T))),d&&T&&(d=!1),f.push(r+S)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let y=1;y<f.length;++y){let p=f[y];h+=p?`
|
|
81
|
+
${c}${p}`:`
|
|
82
82
|
`}}return t?(h+=`
|
|
83
|
-
|
|
84
|
-
`))&&(l=!0),d.push(
|
|
85
|
-
${
|
|
83
|
+
`+Vf.indentComment(l(t),c),a&&a()):d&&o&&o(),h}function Fq({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let y=0;y<t.length;++y){let p=t[y],T=null;if(Ps.isNode(p))p.spaceBefore&&d.push(""),zf(e,d,p.commentBefore,!1),p.comment&&(T=p.comment);else if(Ps.isPair(p)){let b=Ps.isNode(p.key)?p.key:null;b&&(b.spaceBefore&&d.push(""),zf(e,d,b.commentBefore,!1),b.comment&&(l=!0));let v=Ps.isNode(p.value)?p.value:null;v?(v.comment&&(T=v.comment),v.commentBefore&&(l=!0)):p.value==null&&b?.comment&&(T=b.comment)}T&&(l=!0);let S=T0.stringify(p,c,()=>T=null);y<t.length-1&&(S+=","),T&&(S+=Vf.lineComment(S,r,a(T))),!l&&(d.length>u||S.includes(`
|
|
84
|
+
`))&&(l=!0),d.push(S),u=d.length}let{start:f,end:h}=n;if(d.length===0)return f+h;if(!l){let y=d.reduce((p,T)=>p+T.length+2,2);l=e.options.lineWidth>0&&y>e.options.lineWidth}if(l){let y=f;for(let p of d)y+=p?`
|
|
85
|
+
${s}${i}${p}`:`
|
|
86
86
|
`;return`${y}
|
|
87
|
-
${
|
|
88
|
-
`:" ")}return
|
|
89
|
-
${
|
|
90
|
-
${i.comment}`:r.comment}r=s}t.items[n]=Hf.isPair(r)?r:new Py.Pair(r)}}else e("Expected a sequence for this tag");return t}function N0(t,e,n){let{replacer:r}=n,s=new Jq.YAMLSeq(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),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;s.items.push(Py.createPair(a,c,n))}return s}var Qq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k0,createNode:N0};Gf.createPairs=N0;Gf.pairs=Qq;Gf.resolvePairs=k0});var Dy=w(Cy=>{"use strict";var P0=ke(),Ry=js(),Ec=Ws(),Zq=Hs(),R0=Yf(),Pi=class t extends Zq.YAMLSeq{constructor(){super(),this.add=Ec.YAMLMap.prototype.add.bind(this),this.delete=Ec.YAMLMap.prototype.delete.bind(this),this.get=Ec.YAMLMap.prototype.get.bind(this),this.has=Ec.YAMLMap.prototype.has.bind(this),this.set=Ec.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(P0.isPair(s)?(i=Ry.toJS(s.key,"",n),o=Ry.toJS(s.value,i,n)):i=Ry.toJS(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){let s=R0.createPairs(e,n,r),i=new this;return i.items=s.items,i}};Pi.tag="tag:yaml.org,2002:omap";var ej={collection:"seq",identify:t=>t instanceof Map,nodeClass:Pi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=R0.resolvePairs(t,e),r=[];for(let{key:s}of n.items)P0.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Pi,n)},createNode:(t,e,n)=>Pi.from(t,e,n)};Cy.YAMLOMap=Pi;Cy.omap=ej});var I0=w(Ay=>{"use strict";var C0=Ct();function D0({value:t,source:e},n){return e&&(t?A0:O0).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var A0={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 C0.Scalar(!0),stringify:D0},O0={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 C0.Scalar(!1),stringify:D0};Ay.falseTag=O0;Ay.trueTag=A0});var x0=w(Kf=>{"use strict";var tj=Ct(),Oy=Ho(),nj={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:Oy.stringifyNumber},rj={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():Oy.stringifyNumber(t)}},sj={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 tj.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Oy.stringifyNumber};Kf.float=sj;Kf.floatExp=rj;Kf.floatNaN=nj});var $0=w(kc=>{"use strict";var M0=Ho(),wc=t=>typeof t=="bigint"||Number.isInteger(t);function Xf(t,e,n,{intAsBigInt:r}){let s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return s==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return s==="-"?-1*i:i}function Iy(t,e,n){let{value:r}=t;if(wc(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return M0.stringifyNumber(t)}var ij={identify:wc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Xf(t,2,2,n),stringify:t=>Iy(t,2,"0b")},oj={identify:wc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Xf(t,1,8,n),stringify:t=>Iy(t,8,"0")},aj={identify:wc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Xf(t,0,10,n),stringify:M0.stringifyNumber},cj={identify:wc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Xf(t,2,16,n),stringify:t=>Iy(t,16,"0x")};kc.int=aj;kc.intBin=ij;kc.intHex=cj;kc.intOct=oj});var My=w(xy=>{"use strict";var Zf=ke(),Jf=Vs(),Qf=Ws(),Ri=class t extends Qf.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Zf.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Jf.Pair(e.key,null):n=new Jf.Pair(e,null),Qf.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Qf.findPair(this.items,e);return!n&&Zf.isPair(r)?Zf.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Qf.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Jf.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(Jf.createPair(o,null,r));return i}};Ri.tag="tag:yaml.org,2002:set";var lj={collection:"map",identify:t=>t instanceof Set,nodeClass:Ri,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ri.from(t,e,n),resolve(t,e){if(Zf.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ri,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};xy.YAMLSet=Ri;xy.set=lj});var Ly=w(eh=>{"use strict";var uj=Ho();function $y(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function L0(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return uj.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var dj={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:n})=>$y(t,n),stringify:L0},fj={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=>$y(t,!1),stringify:L0},q0={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(q0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=$y(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$/,"")};eh.floatTime=fj;eh.intTime=dj;eh.timestamp=q0});var B0=w(F0=>{"use strict";var hj=zo(),pj=Bf(),mj=Wo(),gj=Sc(),yj=Ny(),j0=I0(),qy=x0(),th=$0(),bj=If(),vj=Dy(),Tj=Yf(),_j=My(),jy=Ly(),Sj=[hj.map,mj.seq,gj.string,pj.nullTag,j0.trueTag,j0.falseTag,th.intBin,th.intOct,th.int,th.intHex,qy.floatNaN,qy.floatExp,qy.float,yj.binary,bj.merge,vj.omap,Tj.pairs,_j.set,jy.intTime,jy.floatTime,jy.timestamp];F0.schema=Sj});var J0=w(Uy=>{"use strict";var W0=zo(),Ej=Bf(),H0=Wo(),wj=Sc(),kj=by(),Fy=Ty(),By=Sy(),Nj=T0(),Pj=E0(),G0=Ny(),Nc=If(),Y0=Dy(),K0=Yf(),U0=B0(),X0=My(),nh=Ly(),V0=new Map([["core",Nj.schema],["failsafe",[W0.map,H0.seq,wj.string]],["json",Pj.schema],["yaml11",U0.schema],["yaml-1.1",U0.schema]]),z0={binary:G0.binary,bool:kj.boolTag,float:Fy.float,floatExp:Fy.floatExp,floatNaN:Fy.floatNaN,floatTime:nh.floatTime,int:By.int,intHex:By.intHex,intOct:By.intOct,intTime:nh.intTime,map:W0.map,merge:Nc.merge,null:Ej.nullTag,omap:Y0.omap,pairs:K0.pairs,seq:H0.seq,set:X0.set,timestamp:nh.timestamp},Rj={"tag:yaml.org,2002:binary":G0.binary,"tag:yaml.org,2002:merge":Nc.merge,"tag:yaml.org,2002:omap":Y0.omap,"tag:yaml.org,2002:pairs":K0.pairs,"tag:yaml.org,2002:set":X0.set,"tag:yaml.org,2002:timestamp":nh.timestamp};function Cj(t,e,n){let r=V0.get(e);if(r&&!t)return n&&!r.includes(Nc.merge)?r.concat(Nc.merge):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{let i=Array.from(V0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(Nc.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?z0[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(z0).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}Uy.coreKnownTags=Rj;Uy.getTags=Cj});var Wy=w(Q0=>{"use strict";var Vy=ke(),Dj=zo(),Aj=Wo(),Oj=Sc(),rh=J0(),Ij=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,zy=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?rh.getTags(e,"compat"):e?rh.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?rh.coreKnownTags:{},this.tags=rh.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Vy.MAP,{value:Dj.map}),Object.defineProperty(this,Vy.SCALAR,{value:Oj.string}),Object.defineProperty(this,Vy.SEQ,{value:Aj.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ij:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Q0.Schema=zy});var eC=w(Z0=>{"use strict";var xj=ke(),Hy=bc(),Pc=pc();function Mj(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let s=Hy.createStringifyContext(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=i(t.commentBefore);n.unshift(Pc.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(xj.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=i(t.contents.commentBefore);n.push(Pc.indentComment(u,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=Hy.stringify(t.contents,s,()=>a=null,c);a&&(l+=Pc.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(Hy.stringify(t.contents,s));if(t.directives?.docEnd)if(t.comment){let c=i(t.comment);c.includes(`
|
|
91
|
-
`)?(n.push("..."),n.push(
|
|
87
|
+
${i}${h}`}else return`${f}${o}${d.join(" ")}${o}${h}`}function zf({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Vf.indentComment(e(r),t);n.push(s.trimStart())}}_0.stringifyCollection=qq});var Gi=k(Py=>{"use strict";var Bq=ky(),Uq=Ey(),Vq=Af(),Hi=Ne(),Wf=Wi(),zq=Ct();function kc(t,e){let n=Hi.isScalar(e)?e.value:e;for(let r of t)if(Hi.isPair(r)&&(r.key===e||r.key===n||Hi.isScalar(r.key)&&r.key.value===n))return r}var Ny=class extends Vq.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Hi.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&o.items.push(Wf.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;Hi.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Wf.Pair(e,e?.value):r=new Wf.Pair(e.key,e.value);let i=kc(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Hi.isScalar(i.value)&&zq.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=kc(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=kc(this.items,e)?.value;return(!n&&Hi.isScalar(i)?i.value:i)??void 0}has(e){return!!kc(this.items,e)}set(e,n){this.add(new Wf.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)Uq.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Hi.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})),Bq.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};Py.YAMLMap=Ny;Py.findPair=kc});var Wo=k(E0=>{"use strict";var Wq=Ne(),S0=Gi(),Hq={collection:"map",default:!0,nodeClass:S0.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Wq.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>S0.YAMLMap.from(t,e,n)};E0.map=Hq});var Yi=k(w0=>{"use strict";var Gq=yc(),Yq=ky(),Kq=Af(),Gf=Ne(),Xq=Ct(),Jq=Bi(),Ry=class extends Kq.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Gf.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Hf(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Hf(e);if(typeof r!="number")return;let i=this.items[r];return!n&&Gf.isScalar(i)?i.value:i}has(e){let n=Hf(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=Hf(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];Gf.isScalar(i)&&Xq.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Jq.toJS(s,String(i++),n));return r}toString(e,n,r){return e?Yq.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}s.items.push(Gq.createNode(a,void 0,r))}}return s}};function Hf(t){let e=Gf.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}w0.YAMLSeq=Ry});var Ho=k(N0=>{"use strict";var Qq=Ne(),k0=Yi(),Zq={collection:"seq",default:!0,nodeClass:k0.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Qq.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>k0.YAMLSeq.from(t,e,n)};N0.seq=Zq});var Nc=k(P0=>{"use strict";var ej=_c(),tj={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),ej.stringifyString(t,e,n,r)}};P0.string=tj});var Yf=k(D0=>{"use strict";var R0=Ct(),C0={identify:t=>t==null,createNode:()=>new R0.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new R0.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&C0.test.test(t)?t:e.options.nullStr};D0.nullTag=C0});var Cy=k(O0=>{"use strict";var nj=Ct(),A0={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new nj.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&A0.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};O0.boolTag=A0});var Go=k(I0=>{"use strict";function rj({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="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}I0.stringifyNumber=rj});var Ay=k(Kf=>{"use strict";var ij=Ct(),Dy=Go(),sj={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:Dy.stringifyNumber},oj={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():Dy.stringifyNumber(t)}},aj={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 ij.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Dy.stringifyNumber};Kf.float=aj;Kf.floatExp=oj;Kf.floatNaN=sj});var Iy=k(Jf=>{"use strict";var x0=Go(),Xf=t=>typeof t=="bigint"||Number.isInteger(t),Oy=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function M0(t,e,n){let{value:r}=t;return Xf(r)&&r>=0?n+r.toString(e):x0.stringifyNumber(t)}var cj={identify:t=>Xf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Oy(t,2,8,n),stringify:t=>M0(t,8,"0o")},lj={identify:Xf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Oy(t,0,10,n),stringify:x0.stringifyNumber},uj={identify:t=>Xf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Oy(t,2,16,n),stringify:t=>M0(t,16,"0x")};Jf.int=lj;Jf.intHex=uj;Jf.intOct=cj});var $0=k(L0=>{"use strict";var dj=Wo(),fj=Yf(),hj=Ho(),pj=Nc(),mj=Cy(),xy=Ay(),My=Iy(),gj=[dj.map,hj.seq,pj.string,fj.nullTag,mj.boolTag,My.intOct,My.int,My.intHex,xy.floatNaN,xy.floatExp,xy.float];L0.schema=gj});var F0=k(j0=>{"use strict";var yj=Ct(),bj=Wo(),vj=Ho();function q0(t){return typeof t=="bigint"||Number.isInteger(t)}var Qf=({value:t})=>JSON.stringify(t),Tj=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Qf},{identify:t=>t==null,createNode:()=>new yj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qf},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Qf},{identify:q0,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>q0(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:Qf}],_j={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Sj=[bj.map,vj.seq].concat(Tj,_j);j0.schema=Sj});var $y=k(B0=>{"use strict";var Ly=Ct(),Ej=_c(),wj={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 n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,s){let o=n,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=Ly.Scalar.BLOCK_LITERAL),e!==Ly.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.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===Ly.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return Ej.stringifyString({comment:t,type:e,value:a},r,i,s)}};B0.binary=wj});var th=k(eh=>{"use strict";var Zf=Ne(),qy=Wi(),kj=Ct(),Nj=Yi();function U0(t,e){if(Zf.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!Zf.isPair(r)){if(Zf.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new qy.Pair(new kj.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
89
|
+
${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
|
|
90
|
+
${s.comment}`:r.comment}r=i}t.items[n]=Zf.isPair(r)?r:new qy.Pair(r)}}else e("Expected a sequence for this tag");return t}function V0(t,e,n){let{replacer:r}=n,i=new Nj.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 r=="function"&&(o=r.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(qy.createPair(a,c,n))}return i}var Pj={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:U0,createNode:V0};eh.createPairs=V0;eh.pairs=Pj;eh.resolvePairs=U0});var By=k(Fy=>{"use strict";var z0=Ne(),jy=Bi(),Pc=Gi(),Rj=Yi(),W0=th(),Rs=class t extends Rj.YAMLSeq{constructor(){super(),this.add=Pc.YAMLMap.prototype.add.bind(this),this.delete=Pc.YAMLMap.prototype.delete.bind(this),this.get=Pc.YAMLMap.prototype.get.bind(this),this.has=Pc.YAMLMap.prototype.has.bind(this),this.set=Pc.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(z0.isPair(i)?(s=jy.toJS(i.key,"",n),o=jy.toJS(i.value,s,n)):s=jy.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=W0.createPairs(e,n,r),s=new this;return s.items=i.items,s}};Rs.tag="tag:yaml.org,2002:omap";var Cj={collection:"seq",identify:t=>t instanceof Map,nodeClass:Rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=W0.resolvePairs(t,e),r=[];for(let{key:i}of n.items)z0.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Rs,n)},createNode:(t,e,n)=>Rs.from(t,e,n)};Fy.YAMLOMap=Rs;Fy.omap=Cj});var X0=k(Uy=>{"use strict";var H0=Ct();function G0({value:t,source:e},n){return e&&(t?Y0:K0).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Y0={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 H0.Scalar(!0),stringify:G0},K0={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 H0.Scalar(!1),stringify:G0};Uy.falseTag=K0;Uy.trueTag=Y0});var J0=k(nh=>{"use strict";var Dj=Ct(),Vy=Go(),Aj={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:Vy.stringifyNumber},Oj={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():Vy.stringifyNumber(t)}},Ij={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 Dj.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Vy.stringifyNumber};nh.float=Ij;nh.floatExp=Oj;nh.floatNaN=Aj});var Z0=k(Cc=>{"use strict";var Q0=Go(),Rc=t=>typeof t=="bigint"||Number.isInteger(t);function rh(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){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,n);return i==="-"?-1*s:s}function zy(t,e,n){let{value:r}=t;if(Rc(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return Q0.stringifyNumber(t)}var xj={identify:Rc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>rh(t,2,2,n),stringify:t=>zy(t,2,"0b")},Mj={identify:Rc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>rh(t,1,8,n),stringify:t=>zy(t,8,"0")},Lj={identify:Rc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>rh(t,0,10,n),stringify:Q0.stringifyNumber},$j={identify:Rc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>rh(t,2,16,n),stringify:t=>zy(t,16,"0x")};Cc.int=Lj;Cc.intBin=xj;Cc.intHex=$j;Cc.intOct=Mj});var Hy=k(Wy=>{"use strict";var oh=Ne(),ih=Wi(),sh=Gi(),Cs=class t extends sh.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;oh.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ih.Pair(e.key,null):n=new ih.Pair(e,null),sh.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=sh.findPair(this.items,e);return!n&&oh.isPair(r)?oh.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=sh.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new ih.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(ih.createPair(o,null,r));return s}};Cs.tag="tag:yaml.org,2002:set";var qj={collection:"map",identify:t=>t instanceof Set,nodeClass:Cs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Cs.from(t,e,n),resolve(t,e){if(oh.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Cs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Wy.YAMLSet=Cs;Wy.set=qj});var Yy=k(ah=>{"use strict";var jj=Go();function Gy(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function eC(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return jj.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(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))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Fj={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:n})=>Gy(t,n),stringify:eC},Bj={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=>Gy(t,!1),stringify:eC},tC={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(tC.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Gy(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=Bj;ah.intTime=Fj;ah.timestamp=tC});var iC=k(rC=>{"use strict";var Uj=Wo(),Vj=Yf(),zj=Ho(),Wj=Nc(),Hj=$y(),nC=X0(),Ky=J0(),ch=Z0(),Gj=Ff(),Yj=By(),Kj=th(),Xj=Hy(),Xy=Yy(),Jj=[Uj.map,zj.seq,Wj.string,Vj.nullTag,nC.trueTag,nC.falseTag,ch.intBin,ch.intOct,ch.int,ch.intHex,Ky.floatNaN,Ky.floatExp,Ky.float,Hj.binary,Gj.merge,Yj.omap,Kj.pairs,Xj.set,Xy.intTime,Xy.floatTime,Xy.timestamp];rC.schema=Jj});var pC=k(Zy=>{"use strict";var cC=Wo(),Qj=Yf(),lC=Ho(),Zj=Nc(),eF=Cy(),Jy=Ay(),Qy=Iy(),tF=$0(),nF=F0(),uC=$y(),Dc=Ff(),dC=By(),fC=th(),sC=iC(),hC=Hy(),lh=Yy(),oC=new Map([["core",tF.schema],["failsafe",[cC.map,lC.seq,Zj.string]],["json",nF.schema],["yaml11",sC.schema],["yaml-1.1",sC.schema]]),aC={binary:uC.binary,bool:eF.boolTag,float:Jy.float,floatExp:Jy.floatExp,floatNaN:Jy.floatNaN,floatTime:lh.floatTime,int:Qy.int,intHex:Qy.intHex,intOct:Qy.intOct,intTime:lh.intTime,map:cC.map,merge:Dc.merge,null:Qj.nullTag,omap:dC.omap,pairs:fC.pairs,seq:lC.seq,set:hC.set,timestamp:lh.timestamp},rF={"tag:yaml.org,2002:binary":uC.binary,"tag:yaml.org,2002:merge":Dc.merge,"tag:yaml.org,2002:omap":dC.omap,"tag:yaml.org,2002:pairs":fC.pairs,"tag:yaml.org,2002:set":hC.set,"tag:yaml.org,2002:timestamp":lh.timestamp};function iF(t,e,n){let r=oC.get(e);if(r&&!t)return n&&!r.includes(Dc.merge)?r.concat(Dc.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(oC.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 n&&(i=i.concat(Dc.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?aC[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(aC).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},[])}Zy.coreKnownTags=rF;Zy.getTags=iF});var nb=k(mC=>{"use strict";var eb=Ne(),sF=Wo(),oF=Ho(),aF=Nc(),uh=pC(),cF=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,tb=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?uh.getTags(e,"compat"):e?uh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?uh.coreKnownTags:{},this.tags=uh.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,eb.MAP,{value:sF.map}),Object.defineProperty(this,eb.SCALAR,{value:aF.string}),Object.defineProperty(this,eb.SEQ,{value:oF.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?cF:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};mC.Schema=tb});var yC=k(gC=>{"use strict";var lF=Ne(),rb=Sc(),Ac=bc();function uF(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=rb.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(Ac.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(lF.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Ac.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=rb.stringify(t.contents,i,()=>a=null,c);a&&(l+=Ac.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(rb.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
91
|
+
`)?(n.push("..."),n.push(Ac.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Ac.indentComment(s(c),"")))}return n.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}
|
|
94
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c&&c.line===r&&c.col>
|
|
93
|
+
`}gC.stringifyDocument=uF});var Oc=k(bC=>{"use strict";var dF=gc(),Yo=Af(),Xn=Ne(),fF=Wi(),hF=Bi(),pF=nb(),mF=yC(),ib=Nf(),gF=cy(),yF=yc(),sb=ay(),ob=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xn.NODE_TYPE,{value:Xn.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new sb.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[Xn.NODE_TYPE]:{value:Xn.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=Xn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ko(this.contents)&&this.contents.add(e)}addIn(e,n){Ko(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=ib.anchorNames(this);e.anchor=!n||r.has(n)?ib.findNewAnchor(n||"a",r):n}return new dF.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let T=b=>typeof b=="number"||b instanceof String||b instanceof Number,S=n.filter(T).map(String);S.length>0&&(n=n.concat(S)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:h}=ib.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},p=yF.createNode(e,u,y);return a&&Xn.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new fF.Pair(i,s)}delete(e){return Ko(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Yo.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ko(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Xn.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Yo.isEmptyPath(e)?!n&&Xn.isScalar(this.contents)?this.contents.value:this.contents:Xn.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Xn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Yo.isEmptyPath(e)?this.contents!==void 0:Xn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Yo.collectionFromPath(this.schema,[e],n):Ko(this.contents)&&this.contents.set(e,n)}setIn(e,n){Yo.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Yo.collectionFromPath(this.schema,Array.from(e),n):Ko(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new sb.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new sb.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=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(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new pF.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=hF.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?gF.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return mF.stringifyDocument(this,e)}};function Ko(t){if(Xn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}bC.Document=ob});var Mc=k(xc=>{"use strict";var Ic=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},ab=class extends Ic{constructor(e,n,r){super("YAMLParseError",e,n,r)}},cb=class extends Ic{constructor(e,n,r){super("YAMLWarning",e,n,r)}},bF=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).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"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
94
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c&&c.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.message+=`:
|
|
95
95
|
|
|
96
96
|
${o}
|
|
97
97
|
${l}
|
|
98
|
-
`}};
|
|
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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(
|
|
100
|
-
`+
|
|
101
|
-
`+
|
|
102
|
-
|
|
103
|
-
`+B:q.comment=B
|
|
104
|
-
`+
|
|
105
|
-
`+
|
|
106
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
107
|
-
`;for(let
|
|
108
|
-
`):
|
|
98
|
+
`}};xc.YAMLError=Ic;xc.YAMLParseError=ab;xc.YAMLWarning=cb;xc.prettifyError=bF});var Lc=k(vC=>{"use strict";function vF(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",h=!1,y=!1,p=null,T=null,S=null,b=null,v=null,w=null,C=null;for(let q of t)switch(y&&(q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&s(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),p&&(l&&q.type!=="comment"&&q.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),q.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&q.source.includes(" ")&&(p=q),u=!0;break;case"comment":{u||s(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ae=q.source.substring(1)||" ";d?d+=f+ae:d=ae,f="",l=!1;break}case"newline":l?d?d+=q.source:c=!0:f+=q.source,l=!0,h=!0,(T||S)&&(b=q),u=!0;break;case"anchor":T&&s(q,"MULTIPLE_ANCHORS","A node can have at most one anchor"),q.source.endsWith(":")&&s(q.offset+q.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=q,C===null&&(C=q.offset),l=!1,u=!1,y=!0;break;case"tag":{S&&s(q,"MULTIPLE_TAGS","A node can have at most one tag"),S=q,C===null&&(C=q.offset),l=!1,u=!1,y=!0;break}case n:(T||S)&&s(q,"BAD_PROP_ORDER",`Anchors and tags must be after the ${q.source} indicator`),w&&s(q,"UNEXPECTED_TOKEN",`Unexpected ${q.source} in ${e??"collection"}`),w=q,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(q,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=q,l=!1,u=!1;break}default:s(q,"UNEXPECTED_TOKEN",`Unexpected ${q.type} token`),l=!1,u=!1}let L=t[t.length-1],B=L?L.offset+L.source.length:i;return y&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:w,spaceBefore:c,comment:d,hasNewline:h,anchor:T,tag:S,newlineAfterProp:b,end:B,start:C??B}}vC.resolveProps=vF});var dh=k(TC=>{"use strict";function lb(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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(lb(e.key)||lb(e.value))return!0}return!1;default:return!0}}TC.containsNewline=lb});var ub=k(_C=>{"use strict";var TF=dh();function _F(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&TF.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}_C.flowIndentCheck=_F});var db=k(EC=>{"use strict";var SC=Ne();function SF(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,o)=>s===o||SC.isScalar(s)&&SC.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}EC.mapIncludes=SF});var CC=k(RC=>{"use strict";var wC=Wi(),EF=Gi(),kC=Lc(),wF=dh(),NC=ub(),kF=db(),PC="All mapping items must start at the same column";function NF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??EF.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:h,value:y}=u,p=kC.resolveProps(d,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),T=!p.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!==r.indent&&i(c,"BAD_INDENT",PC)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||wF.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(c,"BAD_INDENT",PC);n.atKey=!0;let S=p.end,b=f?t(n,f,p,i):e(n,S,d,null,p,i);n.schema.compat&&NC.flowIndentCheck(r.indent,f,i),n.atKey=!1,kF.mapIncludes(n,a.items,b)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let v=kC.resolveProps(h??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=v.end,v.found){T&&(y?.type==="block-map"&&!v.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<v.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let w=y?t(n,y,v,i):e(n,c,h,null,v,i);n.schema.compat&&NC.flowIndentCheck(r.indent,y,i),c=w.range[2];let C=new wC.Pair(b,w);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{T&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(b.comment?b.comment+=`
|
|
101
|
+
`+v.comment:b.comment=v.comment);let w=new wC.Pair(b);n.options.keepSourceTokens&&(w.srcToken=u),a.items.push(w)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}RC.resolveBlockMap=NF});var AC=k(DC=>{"use strict";var PF=Yi(),RF=Lc(),CF=ub();function DF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??PF.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=RF.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.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 h=d?t(n,d,f,i):e(n,f.end,u,null,f,i);n.schema.compat&&CF.flowIndentCheck(r.indent,d,i),c=h.range[2],a.items.push(h)}return a.range=[r.offset,c,l??c],a}DC.resolveBlockSeq=DF});var Xo=k(OC=>{"use strict";function AF(t,e,n,r){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":{n&&!s&&r(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:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}OC.resolveEnd=AF});var LC=k(MC=>{"use strict";var OF=Ne(),IF=Wi(),IC=Gi(),xF=Yi(),MF=Xo(),xC=Lc(),LF=dh(),$F=db(),fb="Block collections are not allowed within flow collections",hb=t=>t&&(t.type==="block-map"||t.type==="block-seq");function qF({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?IC.YAMLMap:xF.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let T=0;T<r.items.length;++T){let S=r.items[T],{start:b,key:v,sep:w,value:C}=S,L=xC.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:v??w?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!w&&!C){T===0&&L.comma?i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):T<r.items.length-1&&i(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(l.comment?l.comment+=`
|
|
102
|
+
`+L.comment:l.comment=L.comment),d=L.end;continue}!o&&n.options.strict&&LF.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)L.comma&&i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||i(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let B="";e:for(let q of b)switch(q.type){case"comma":case"space":break;case"comment":B=q.source.substring(1);break e;default:break e}if(B){let q=l.items[l.items.length-1];OF.isPair(q)&&(q=q.value??q.key),q.comment?q.comment+=`
|
|
103
|
+
`+B:q.comment=B,L.comment=L.comment.substring(B.length+1)}}if(!o&&!w&&!L.found){let B=C?t(n,C,L,i):e(n,L.end,w,null,L,i);l.items.push(B),d=B.range[2],hb(C)&&i(B.range,"BLOCK_IN_FLOW",fb)}else{n.atKey=!0;let B=L.end,q=v?t(n,v,L,i):e(n,B,b,null,L,i);hb(v)&&i(q.range,"BLOCK_IN_FLOW",fb),n.atKey=!1;let ae=xC.resolveProps(w??[],{flow:a,indicator:"map-value-ind",next:C,offset:q.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(ae.found){if(!o&&!L.found&&n.options.strict){if(w)for(let ge of w){if(ge===ae.found)break;if(ge.type==="newline"){i(ge,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<ae.found.offset-1024&&i(ae.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(ae.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let We=C?t(n,C,ae,i):ae.found?e(n,ae.end,w,null,ae,i):null;We?hb(C)&&i(We.range,"BLOCK_IN_FLOW",fb):ae.comment&&(q.comment?q.comment+=`
|
|
104
|
+
`+ae.comment:q.comment=ae.comment);let Dt=new IF.Pair(q,We);if(n.options.keepSourceTokens&&(Dt.srcToken=S),o){let ge=l;$F.mapIncludes(n,ge.items,q)&&i(B,"DUPLICATE_KEY","Map keys must be unique"),ge.items.push(Dt)}else{let ge=new IC.YAMLMap(n.schema);ge.flow=!0,ge.items.push(Dt);let Un=(We??q).range;ge.range=[q.range[0],Un[1],Un[2]],l.items.push(ge)}d=We?We.range[2]:ae.end}}let f=o?"}":"]",[h,...y]=r.end,p=d;if(h&&h.source===f)p=h.offset+h.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),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){let T=MF.resolveEnd(y,p,n.options.strict,i);T.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+T.comment:l.comment=T.comment),l.range=[r.offset,p,T.offset]}else l.range=[r.offset,p,p];return l}MC.resolveFlowCollection=qF});var qC=k($C=>{"use strict";var jF=Ne(),FF=Ct(),BF=Gi(),UF=Yi(),VF=CC(),zF=AC(),WF=LC();function pb(t,e,n,r,i,s){let o=n.type==="block-map"?VF.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?zF.resolveBlockSeq(t,e,n,r,s):WF.resolveFlowCollection(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function HF(t,e,n,r,i){let s=r.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=r,y=f&&s?f.offset>s.offset?f:s:f??s;y&&(!h||h.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===BF.YAMLMap.tagName&&a==="map"||o===UF.YAMLSeq.tagName&&a==="seq")return pb(t,e,n,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),pb(t,e,n,i,o)}let l=pb(t,e,n,i,o,c),u=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,d=jF.isNode(u)?u:new FF.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}$C.composeCollection=HF});var gb=k(jC=>{"use strict";var mb=Ct();function GF(t,e,n){let r=e.offset,i=YF(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?mb.Scalar.BLOCK_FOLDED:mb.Scalar.BLOCK_LITERAL,o=e.source?KF(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let T=o[p][1];if(T===""||T==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`
|
|
106
|
+
`.repeat(Math.max(1,o.length-1)):"",T=r+i.length;return e.source&&(T+=e.source.length),{value:p,type:s,comment:i.comment,range:[r,T,T]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let p=0;p<a;++p){let[T,S]=o[p];if(S===""||S==="\r")i.indent===0&&T.length>c&&(c=T.length);else{T.length<c&&n(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=p,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=T.length+S.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>c&&(a=p+1);let d="",f="",h=!1;for(let p=0;p<u;++p)d+=o[p][0].slice(c)+`
|
|
107
|
+
`;for(let p=u;p<a;++p){let[T,S]=o[p];l+=T.length+S.length+1;let b=S[S.length-1]==="\r";if(b&&(S=S.slice(0,-1)),S&&T.length<c){let w=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-S.length-(b?2:1),"BAD_INDENT",w),T=""}s===mb.Scalar.BLOCK_LITERAL?(d+=f+T.slice(c)+S,f=`
|
|
108
|
+
`):T.length>c||S[0]===" "?(f===" "?f=`
|
|
109
109
|
`:!h&&f===`
|
|
110
110
|
`&&(f=`
|
|
111
111
|
|
|
112
|
-
`),d+=f+
|
|
113
|
-
`,h=!0):
|
|
112
|
+
`),d+=f+T.slice(c)+S,f=`
|
|
113
|
+
`,h=!0):S===""?f===`
|
|
114
114
|
`?d+=`
|
|
115
115
|
`:f=`
|
|
116
|
-
`:(d+=f+
|
|
117
|
-
`+o[
|
|
116
|
+
`:(d+=f+S,f=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)d+=`
|
|
117
|
+
`+o[p][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let y=r+
|
|
120
|
+
`}let y=r+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[r,y,y]}}function YF({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(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 h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let y=Number(h);!o&&y?o=y:c===-1&&(c=t+f)}}c!==-1&&r(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 h=e[f];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let y=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",y);let p=h.source;p&&typeof p=="string"&&(d+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function KF(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}jC.resolveBlockScalar=GF});var bb=k(BC=>{"use strict";var yb=Ct(),XF=Xo();function JF(t,e,n){let{offset:r,type:i,source:s,end:o}=t,a,c,l=(f,h,y)=>n(r+f,h,y);switch(i){case"scalar":a=yb.Scalar.PLAIN,c=QF(s,l);break;case"single-quoted-scalar":a=yb.Scalar.QUOTE_SINGLE,c=ZF(s,l);break;case"double-quoted-scalar":a=yb.Scalar.QUOTE_DOUBLE,c=eB(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=XF.resolveEnd(o,u,e,n);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function QF(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),FC(t)}function ZF(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),FC(t.slice(1,-1)).replace(/''/g,"'")}function FC(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let
|
|
123
|
-
`?s
|
|
124
|
-
`:(s
|
|
125
|
-
`))if(
|
|
126
|
-
`){let{fold:
|
|
127
|
-
`)for(
|
|
128
|
-
`)for(
|
|
122
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let i=r[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?s===`
|
|
123
|
+
`?i+=s:s=`
|
|
124
|
+
`:(i+=s+r[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),i+s+(r?.[1]??"")}function eB(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
|
|
125
|
+
`))if(i===`
|
|
126
|
+
`){let{fold:s,offset:o}=tB(t,r);n+=s,r=o}else if(i==="\\"){let s=t[++r],o=nB[s];if(o)n+=o;else if(s===`
|
|
127
|
+
`)for(s=t[r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="\r"&&t[r+1]===`
|
|
128
|
+
`)for(s=t[++r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];n+=rB(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let s=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
|
|
129
129
|
`&&!(o==="\r"&&t[r+2]===`
|
|
130
|
-
`)&&(n+=r>
|
|
130
|
+
`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function tB(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
131
131
|
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
132
132
|
`);)r===`
|
|
133
133
|
`&&(n+=`
|
|
134
|
-
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var nB={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 rB(t,e,n,r){let i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}BC.resolveFlowScalar=JF});var zC=k(VC=>{"use strict";var Ds=Ne(),UC=Ct(),iB=gb(),sB=bb();function oB(t,e,n,r){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?iB.resolveBlockScalar(t,e,r):sB.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ds.SCALAR]:c?l=aB(t.schema,i,c,n,r):e.type==="scalar"?l=cB(t,i,e,r):l=t.schema[Ds.SCALAR];let u;try{let d=l.resolve(i,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);u=Ds.isScalar(d)?d:new UC.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(n??e,"TAG_RESOLVE_FAILED",f),u=new UC.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 aB(t,e,n,r,i){if(n==="!")return t[Ds.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)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[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Ds.SCALAR])}function cB({atKey:t,directives:e,schema:n},r,i,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Ds.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Ds.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}VC.composeScalar=oB});var HC=k(WC=>{"use strict";function lB(t,e,n){if(e){n===null&&(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}WC.emptyScalarPosition=lB});var KC=k(Tb=>{"use strict";var uB=gc(),dB=Ne(),fB=qC(),GC=zC(),hB=Xo(),pB=HC(),mB={composeNode:YC,composeEmptyNode:vb};function YC(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=gB(t,e,r),(a||c)&&r(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=GC.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=fB.composeCollection(mB,t,e,n,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=vb(t,e.offset,void 0,null,n,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!dB.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(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 vb(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:pB.emptyScalarPosition(e,n,r),indent:-1,source:""},d=GC.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 gB({options:t},{offset:e,source:n,end:r},i){let s=new uB.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=hB.resolveEnd(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Tb.composeEmptyNode=vb;Tb.composeNode=YC});var QC=k(JC=>{"use strict";var yB=Oc(),XC=KC(),bB=Xo(),vB=Lc();function TB(t,e,{offset:n,start:r,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new yB.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=vB.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,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?XC.composeNode(l,i,u,o):XC.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=bB.resolveEnd(s,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}JC.composeDoc=TB});var Sb=k(tD=>{"use strict";var _B=ay(),SB=Oc(),$c=Mc(),ZC=Ne(),EB=QC(),wB=Xo();function qc(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:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function eD(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":r?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(
|
|
139
|
-
${r}`:r;else if(
|
|
140
|
-
${a}`:r}else{let o=
|
|
141
|
-
${o}`:r}}n?(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:
|
|
142
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new
|
|
138
|
+
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var _b=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let o=qc(n);s?this.warnings.push(new $c.YAMLWarning(o,r,i)):this.errors.push(new $c.YAMLParseError(o,r,i))},this.directives=new _B.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=eD(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(ZC.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];ZC.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
|
|
140
|
+
${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r}
|
|
141
|
+
${o}`:r}}n?(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:eD(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let s=qc(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=EB.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new $c.YAMLParseError(qc(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new $c.YAMLParseError(qc(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=wB.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
142
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new $c.YAMLParseError(qc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new SB.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};tD.Composer=_b});var iD=k(fh=>{"use strict";var kB=gb(),NB=bb(),PB=Mc(),nD=_c();function RB(t,e=!0,n){if(t){let r=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new PB.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return NB.resolveFlowScalar(t,e,r);case"block-scalar":return kB.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function CB(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=nD.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,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
|
-
`,f=[{type:"block-scalar-header",offset:
|
|
146
|
-
`}),{type:"block-scalar",offset:
|
|
147
|
-
`),r=e.substring(0,n),
|
|
148
|
-
`;if(t.type==="block-scalar"){let
|
|
149
|
-
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:
|
|
150
|
-
`};delete t.items,Object.assign(t,{type:n,source:e,end:[
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return rD(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:s,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function DB(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=nD.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":AB(t,c);break;case'"':Eb(t,c,"double-quoted-scalar");break;case"'":Eb(t,c,"single-quoted-scalar");break;default:Eb(t,c,"scalar")}}function AB(t,e){let n=e.indexOf(`
|
|
147
|
+
`),r=e.substring(0,n),i=e.substring(n+1)+`
|
|
148
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];rD(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function rD(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function Eb(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
150
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}fh.createScalarToken=CB;fh.resolveAsScalar=RB;fh.setScalarValue=DB});var oD=k(sD=>{"use strict";var OB=t=>"type"in t?ph(t):hh(t);function ph(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=ph(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=hh(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=hh(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=hh(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function hh({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=ph(e)),n)for(let s of n)i+=s.source;return r&&(i+=ph(r)),i}sD.stringify=OB});var uD=k(lD=>{"use strict";var wb=Symbol("break visit"),IB=Symbol("skip children"),aD=Symbol("remove item");function As(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),cD(Object.freeze([]),t,e)}As.BREAK=wb;As.SKIP=IB;As.REMOVE=aD;As.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};As.parentCollection=(t,e)=>{let n=As.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function cD(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=cD(Object.freeze(t.concat([[i,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===wb)return wb;a===aD&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}lD.visit=As});var mh=k(Rn=>{"use strict";var kb=iD(),xB=oD(),MB=uD(),Nb="\uFEFF",Pb="",Rb="",Cb="",LB=t=>!!t&&"items"in t,$B=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function qB(t){switch(t){case Nb:return"<BOM>";case Pb:return"<DOC>";case Rb:return"<FLOW_END>";case Cb:return"<SCALAR>";default:return JSON.stringify(t)}}function jB(t){switch(t){case Nb:return"byte-order-mark";case Pb:return"doc-mode";case Rb:return"flow-error-end";case Cb:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
151
151
|
`:case`\r
|
|
152
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
153
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
154
|
-
\r `),
|
|
152
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Rn.createScalarToken=kb.createScalarToken;Rn.resolveAsScalar=kb.resolveAsScalar;Rn.setScalarValue=kb.setScalarValue;Rn.stringify=xB.stringify;Rn.visit=MB.visit;Rn.BOM=Nb;Rn.DOCUMENT=Pb;Rn.FLOW_END=Rb;Rn.SCALAR=Cb;Rn.isCollection=LB;Rn.isScalar=$B;Rn.prettyToken=qB;Rn.tokenType=jB});var Ob=k(fD=>{"use strict";var jc=mh();function vr(t){switch(t){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var dD=new Set("0123456789ABCDEFabcdef"),FB=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),gh=new Set(",[]{}"),BB=new Set(` ,[]{}
|
|
154
|
+
\r `),Db=t=>!t||BB.has(t),Ab=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
155
155
|
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
156
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let
|
|
157
|
-
`||!
|
|
156
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===`
|
|
157
|
+
`||!i&&!this.atEnd)return e+r+1}return n===`
|
|
158
158
|
`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&vr(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
159
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
160
|
-
`,this.pos);if(
|
|
161
|
-
`,
|
|
162
|
-
`:e=
|
|
163
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let
|
|
164
|
-
`,
|
|
165
|
-
`;)r=this.buffer[++
|
|
166
|
-
`&&
|
|
167
|
-
`?(r+=1,
|
|
168
|
-
`,
|
|
169
|
-
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&
|
|
159
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===jc.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let s=e[r-1];if(s===" "||s===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield jc.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&vr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!vr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&vr(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Db),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&vr(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield jc.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Db),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||vr(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
|
|
160
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
|
|
161
|
+
`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>vr(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
|
|
162
|
+
`:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
163
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
164
|
+
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
165
|
+
`;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
166
|
+
`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield jc.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(vr(s)||e&&gh.has(s))break;n=r}else if(vr(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
|
|
167
|
+
`?(r+=1,i=`
|
|
168
|
+
`,s=this.buffer[r+1]):n=r),s==="#"||e&&gh.has(s))break;if(i===`
|
|
169
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&gh.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield jc.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Db))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,n=this.charAt(1);if(vr(n)||e&&gh.has(n))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,n=this.buffer[e];for(;!vr(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(FB.has(n))n=this.buffer[++e];else if(n==="%"&&dD.has(this.buffer[e+1])&&dD.has(this.buffer[e+2]))n=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 n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};fD.Lexer=Ab});var xb=k(hD=>{"use strict";var Ib=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<e?n=s+1:r=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};hD.LineCounter=Ib});var Lb=k(bD=>{"use strict";var pD=mh(),UB=Ob();function Os(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function mD(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 yD(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 yh(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 Jo(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 gD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Os(e.start,"explicit-key-ind")&&!Os(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,yD(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 Mb=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 UB.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",pD.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=pD.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&gD(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&mD(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.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":{mD(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=yh(this.peek(2)),r=Jo(n),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:r,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 n=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
173
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let
|
|
173
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.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=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Os(n.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(yD(n.key)&&!Os(n.sep,"newline")){let o=Jo(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Os(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Jo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Os(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Os(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=yh(r),s=Jo(i);gD(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 n=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
175
|
-
`,n)+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 n=uh(e),r=Xo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=uh(e),r=Xo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.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())}}};tD.Parser=wb});var oD=w(Lc=>{"use strict";var nD=db(),pB=Rc(),$c=Ac(),mB=ly(),gB=ke(),yB=Eb(),rD=kb();function sD(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new yB.LineCounter||null,prettyErrors:e}}function bB(t,e={}){let{lineCounter:n,prettyErrors:r}=sD(e),s=new rD.Parser(n?.addNewLine),i=new nD.Composer(e),o=Array.from(i.compose(s.parse(t)));if(r&&n)for(let a of o)a.errors.forEach($c.prettifyError(t,n)),a.warnings.forEach($c.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function iD(t,e={}){let{lineCounter:n,prettyErrors:r}=sD(e),s=new rD.Parser(n?.addNewLine),i=new nD.Composer(e),o=null;for(let a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new $c.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach($c.prettifyError(t,n)),o.warnings.forEach($c.prettifyError(t,n))),o}function vB(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let s=iD(t,n);if(!s)return null;if(s.warnings.forEach(i=>mB.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function TB(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){let{keepUndefined:s}=n??e??{};if(!s)return}return gB.isDocument(t)&&!r?t.toString(n):new pB.Document(t,r,n).toString(n)}Lc.parse=vB;Lc.parseAllDocuments=bB;Lc.parseDocument=iD;Lc.stringify=TB});var Pb=w(je=>{"use strict";var _B=db(),SB=Rc(),EB=Wy(),Nb=Ac(),wB=fc(),Gs=ke(),kB=Vs(),NB=Ct(),PB=Ws(),RB=Hs(),CB=ch(),DB=_b(),AB=Eb(),OB=kb(),dh=oD(),aD=cc();je.Composer=_B.Composer;je.Document=SB.Document;je.Schema=EB.Schema;je.YAMLError=Nb.YAMLError;je.YAMLParseError=Nb.YAMLParseError;je.YAMLWarning=Nb.YAMLWarning;je.Alias=wB.Alias;je.isAlias=Gs.isAlias;je.isCollection=Gs.isCollection;je.isDocument=Gs.isDocument;je.isMap=Gs.isMap;je.isNode=Gs.isNode;je.isPair=Gs.isPair;je.isScalar=Gs.isScalar;je.isSeq=Gs.isSeq;je.Pair=kB.Pair;je.Scalar=NB.Scalar;je.YAMLMap=PB.YAMLMap;je.YAMLSeq=RB.YAMLSeq;je.CST=CB;je.Lexer=DB.Lexer;je.LineCounter=AB.LineCounter;je.Parser=OB.Parser;je.parse=dh.parse;je.parseAllDocuments=dh.parseAllDocuments;je.parseDocument=dh.parseDocument;je.stringify=dh.stringify;je.visit=aD.visit;je.visitAsync=aD.visitAsync});var fD=w((Rre,dD)=>{"use strict";dD.exports=lD;function lD(t,e,n){t instanceof RegExp&&(t=cD(t,n)),e instanceof RegExp&&(e=cD(e,n));var r=uD(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function cD(t,e){var n=e.match(t);return n?n[0]:null}lD.range=uD;function uD(t,e,n){var r,s,i,o,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],i=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var TD=w((Cre,vD)=>{var hD=fD();vD.exports=MB;var pD="\0SLASH"+Math.random()+"\0",mD="\0OPEN"+Math.random()+"\0",Cb="\0CLOSE"+Math.random()+"\0",gD="\0COMMA"+Math.random()+"\0",yD="\0PERIOD"+Math.random()+"\0";function Rb(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function IB(t){return t.split("\\\\").join(pD).split("\\{").join(mD).split("\\}").join(Cb).split("\\,").join(gD).split("\\.").join(yD)}function xB(t){return t.split(pD).join("\\").split(mD).join("{").split(Cb).join("}").split(gD).join(",").split(yD).join(".")}function bD(t){if(!t)return[""];var e=[],n=hD("{","}",t);if(!n)return t.split(",");var r=n.pre,s=n.body,i=n.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=bD(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function MB(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),qc(IB(t),!0).map(xB)):[]}function $B(t){return"{"+t+"}"}function LB(t){return/^-?0\d/.test(t)}function qB(t,e){return t<=e}function jB(t,e){return t>=e}function qc(t,e){var n=[],r=hD("{","}",t);if(!r)return[t];var s=r.pre,i=r.post.length?qc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];n.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Cb+r.post,qc(t)):[t];var f;if(u)f=r.body.split(/\.\./);else if(f=bD(r.body),f.length===1&&(f=qc(f[0],!1).map($B),f.length===1))return i.map(function(Ve){return r.pre+f[0]+Ve});var h;if(u){var y=Rb(f[0]),m=Rb(f[1]),b=Math.max(f[0].length,f[1].length),E=f.length==3?Math.abs(Rb(f[2])):1,_=qB,T=m<y;T&&(E*=-1,_=jB);var k=f.some(LB);h=[];for(var C=y;_(C,m);C+=E){var $;if(l)$=String.fromCharCode(C),$==="\\"&&($="");else if($=String(C),k){var B=b-$.length;if(B>0){var q=new Array(B+1).join("0");C<0?$="-"+q+$.slice(1):$=q+$}}h.push($)}}else{h=[];for(var oe=0;oe<f.length;oe++)h.push.apply(h,qc(f[oe],!1))}for(var oe=0;oe<h.length;oe++)for(var o=0;o<i.length;o++){var a=s+h[oe]+i[o];(!e||u||a)&&n.push(a)}}return n}});var nl=w(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.regexpCode=Re.getEsmExportName=Re.getProperty=Re.safeStringify=Re.stringify=Re.strConcat=Re.addCodeArg=Re.str=Re._=Re.nil=Re._Code=Re.Name=Re.IDENTIFIER=Re._CodeOrName=void 0;var el=class{};Re._CodeOrName=el;Re.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Mi=class extends el{constructor(e){if(super(),!Re.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}}};Re.Name=Mi;var Zn=class extends el{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((n,r)=>`${n}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,r)=>(r instanceof Mi&&(n[r.str]=(n[r.str]||0)+1),n),{})}};Re._Code=Zn;Re.nil=new Zn("");function aA(t,...e){let n=[t[0]],r=0;for(;r<e.length;)Yb(n,e[r]),n.push(t[++r]);return new Zn(n)}Re._=aA;var Gb=new Zn("+");function cA(t,...e){let n=[tl(t[0])],r=0;for(;r<e.length;)n.push(Gb),Yb(n,e[r]),n.push(Gb,tl(t[++r]));return GU(n),new Zn(n)}Re.str=cA;function Yb(t,e){e instanceof Zn?t.push(...e._items):e instanceof Mi?t.push(e):t.push(XU(e))}Re.addCodeArg=Yb;function GU(t){let e=1;for(;e<t.length-1;){if(t[e]===Gb){let n=YU(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function YU(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Mi||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 Mi))return`"${t}${e.slice(1)}`}function KU(t,e){return e.emptyStr()?t:t.emptyStr()?e:cA`${t}${e}`}Re.strConcat=KU;function XU(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:tl(Array.isArray(t)?t.join(","):t)}function JU(t){return new Zn(tl(t))}Re.stringify=JU;function tl(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Re.safeStringify=tl;function QU(t){return typeof t=="string"&&Re.IDENTIFIER.test(t)?new Zn(`.${t}`):aA`[${t}]`}Re.getProperty=QU;function ZU(t){if(typeof t=="string"&&Re.IDENTIFIER.test(t))return new Zn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Re.getEsmExportName=ZU;function eV(t){return new Zn(t.toString())}Re.regexpCode=eV});var Jb=w(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ValueScope=Cn.ValueScopeName=Cn.Scope=Cn.varKinds=Cn.UsedValueState=void 0;var Rn=nl(),Kb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ah;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ah||(Cn.UsedValueState=Ah={}));Cn.varKinds={const:new Rn.Name("const"),let:new Rn.Name("let"),var:new Rn.Name("var")};var Oh=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Rn.Name?e:this.name(e)}name(e){return new Rn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,r;if(!((r=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||r===void 0)&&r.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}}};Cn.Scope=Oh;var Ih=class extends Rn.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,Rn._)`.${new Rn.Name(n)}[${r}]`}};Cn.ValueScopeName=Ih;var tV=(0,Rn._)`\n`,Xb=class extends Oh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?tV:Rn.nil}}get(){return this._scope}name(e){return new Ih(e,this._newName(e))}value(e,n){var r;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=n.key)!==null&&r!==void 0?r:n.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=n.ref,s.setValue(n,{property:i,itemIndex:l}),s}getValue(e,n){let r=this._values[e];if(r)return r.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,Rn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,n,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},n,r)}_reduceValues(e,n,r={},s){let i=Rn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Ah.Started);let u=n(l);if(u){let d=this.opts.es5?Cn.varKinds.var:Cn.varKinds.const;i=(0,Rn._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,Rn._)`${i}${u}${this.opts._n}`;else throw new Kb(l);c.set(l,Ah.Completed)})}return i}};Cn.ValueScope=Xb});var ue=w(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.or=he.and=he.not=he.CodeGen=he.operators=he.varKinds=he.ValueScopeName=he.ValueScope=he.Scope=he.Name=he.regexpCode=he.stringify=he.getProperty=he.nil=he.strConcat=he.str=he._=void 0;var Se=nl(),wr=Jb(),Qs=nl();Object.defineProperty(he,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(he,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(he,"strConcat",{enumerable:!0,get:function(){return Qs.strConcat}});Object.defineProperty(he,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(he,"getProperty",{enumerable:!0,get:function(){return Qs.getProperty}});Object.defineProperty(he,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(he,"regexpCode",{enumerable:!0,get:function(){return Qs.regexpCode}});Object.defineProperty(he,"Name",{enumerable:!0,get:function(){return Qs.Name}});var Lh=Jb();Object.defineProperty(he,"Scope",{enumerable:!0,get:function(){return Lh.Scope}});Object.defineProperty(he,"ValueScope",{enumerable:!0,get:function(){return Lh.ValueScope}});Object.defineProperty(he,"ValueScopeName",{enumerable:!0,get:function(){return Lh.ValueScopeName}});Object.defineProperty(he,"varKinds",{enumerable:!0,get:function(){return Lh.varKinds}});he.operators={GT:new Se._Code(">"),GTE:new Se._Code(">="),LT:new Se._Code("<"),LTE:new Se._Code("<="),EQ:new Se._Code("==="),NEQ:new Se._Code("!=="),NOT:new Se._Code("!"),OR:new Se._Code("||"),AND:new Se._Code("&&"),ADD:new Se._Code("+")};var fs=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},Qb=class extends fs{constructor(e,n,r){super(),this.varKind=e,this.name=n,this.rhs=r}render({es5:e,_n:n}){let r=e?wr.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=la(this.rhs,e,n)),this}get names(){return this.rhs instanceof Se._CodeOrName?this.rhs.names:{}}},xh=class extends fs{constructor(e,n,r){super(),this.lhs=e,this.rhs=n,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof Se.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=la(this.rhs,e,n),this}get names(){let e=this.lhs instanceof Se.Name?{}:{...this.lhs.names};return $h(e,this.rhs)}},Zb=class extends xh{constructor(e,n,r,s){super(e,r,s),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},ev=class extends fs{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},tv=class extends fs{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},nv=class extends fs{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},rv=class extends fs{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=la(this.code,e,n),this}get names(){return this.code instanceof Se._CodeOrName?this.code.names:{}}},rl=class extends fs{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,r)=>n+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let r=e[n].optimizeNodes();Array.isArray(r)?e.splice(n,1,...r):r?e[n]=r:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,n)||(nV(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>qi(e,n.names),{})}},hs=class extends rl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},sv=class extends rl{},ca=class extends hs{};ca.kind="else";var $i=class t extends hs{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new ca(r):r}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(lA(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=la(this.condition,e,n),this}get names(){let e=super.names;return $h(e,this.condition),this.else&&qi(e,this.else.names),e}};$i.kind="if";var Li=class extends hs{};Li.kind="for";var iv=class extends Li{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=la(this.iteration,e,n),this}get names(){return qi(super.names,this.iteration.names)}},ov=class extends Li{constructor(e,n,r,s){super(),this.varKind=e,this.name=n,this.from=r,this.to=s}render(e){let n=e.es5?wr.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${n} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=$h(super.names,this.from);return $h(e,this.to)}},Mh=class extends Li{constructor(e,n,r,s){super(),this.loop=e,this.varKind=n,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=la(this.iterable,e,n),this}get names(){return qi(super.names,this.iterable.names)}},sl=class extends hs{constructor(e,n,r){super(),this.name=e,this.args=n,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};sl.kind="func";var il=class extends rl{render(e){return"return "+super.render(e)}};il.kind="return";var av=class extends hs{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var r,s;return super.optimizeNames(e,n),(r=this.catch)===null||r===void 0||r.optimizeNames(e,n),(s=this.finally)===null||s===void 0||s.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&qi(e,this.catch.names),this.finally&&qi(e,this.finally.names),e}},ol=class extends hs{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ol.kind="catch";var al=class extends hs{render(e){return"finally"+super.render(e)}};al.kind="finally";var cv=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
176
|
-
`:""},this._extScope=e,this._scope=new wr.Scope({parent:e}),this._nodes=[new sv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let r=this._extScope.value(e,n);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,r,s){let i=this._scope.toName(n);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new Qb(e,i,r)),i}const(e,n,r){return this._def(wr.varKinds.const,e,n,r)}let(e,n,r){return this._def(wr.varKinds.let,e,n,r)}var(e,n,r){return this._def(wr.varKinds.var,e,n,r)}assign(e,n,r){return this._leafNode(new xh(e,n,r))}add(e,n){return this._leafNode(new Zb(e,he.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Se.nil&&this._leafNode(new rv(e)),this}object(...e){let n=["{"];for(let[r,s]of e)n.length>1&&n.push(","),n.push(r),(r!==s||this.opts.es5)&&(n.push(":"),(0,Se.addCodeArg)(n,s));return n.push("}"),new Se._Code(n)}if(e,n,r){if(this._blockNode(new $i(e)),n&&r)this.code(n).else().code(r).endIf();else if(n)this.code(n).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new $i(e))}else(){return this._elseNode(new ca)}endIf(){return this._endBlockNode($i,ca)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new iv(e),n)}forRange(e,n,r,s,i=this.opts.es5?wr.varKinds.var:wr.varKinds.let){let o=this._scope.toName(e);return this._for(new ov(i,o,n,r),()=>s(o))}forOf(e,n,r,s=wr.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=n instanceof Se.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Se._)`${o}.length`,a=>{this.var(i,(0,Se._)`${o}[${a}]`),r(i)})}return this._for(new Mh("of",s,i,n),()=>r(i))}forIn(e,n,r,s=this.opts.es5?wr.varKinds.var:wr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Se._)`Object.keys(${n})`,r);let i=this._scope.toName(e);return this._for(new Mh("in",s,i,n),()=>r(i))}endFor(){return this._endBlockNode(Li)}label(e){return this._leafNode(new ev(e))}break(e){return this._leafNode(new tv(e))}return(e){let n=new il;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(il)}try(e,n,r){if(!n&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new av;if(this._blockNode(s),this.code(e),n){let i=this.name("e");this._currNode=s.catch=new ol(i),n(i)}return r&&(this._currNode=s.finally=new al,this.code(r)),this._endBlockNode(ol,al)}throw(e){return this._leafNode(new nv(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-n;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Se.nil,r,s){return this._blockNode(new sl(e,n,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(sl)}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,n){let r=this._currNode;if(r instanceof e||n&&r instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof $i))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};he.CodeGen=cv;function qi(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function $h(t,e){return e instanceof Se._CodeOrName?qi(t,e.names):t}function la(t,e,n){if(t instanceof Se.Name)return r(t);if(!s(t))return t;return new Se._Code(t._items.reduce((i,o)=>(o instanceof Se.Name&&(o=r(o)),o instanceof Se._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=n[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof Se._Code&&i._items.some(o=>o instanceof Se.Name&&e[o.str]===1&&n[o.str]!==void 0)}}function nV(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function lA(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Se._)`!${lv(t)}`}he.not=lA;var rV=uA(he.operators.AND);function sV(...t){return t.reduce(rV)}he.and=sV;var iV=uA(he.operators.OR);function oV(...t){return t.reduce(iV)}he.or=oV;function uA(t){return(e,n)=>e===Se.nil?n:n===Se.nil?e:(0,Se._)`${lv(e)} ${t} ${lv(n)}`}function lv(t){return t instanceof Se.Name?t:(0,Se._)`(${t})`}});var be=w(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.checkStrictMode=pe.getErrorPath=pe.Type=pe.useFunc=pe.setEvaluated=pe.evaluatedPropsToName=pe.mergeEvaluated=pe.eachItem=pe.unescapeJsonPointer=pe.escapeJsonPointer=pe.escapeFragment=pe.unescapeFragment=pe.schemaRefOrVal=pe.schemaHasRulesButRef=pe.schemaHasRules=pe.checkUnknownRules=pe.alwaysValidSchema=pe.toHash=void 0;var Je=ue(),aV=nl();function cV(t){let e={};for(let n of t)e[n]=!0;return e}pe.toHash=cV;function lV(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(hA(t,e),!pA(e,t.self.RULES.all))}pe.alwaysValidSchema=lV;function hA(t,e=t.schema){let{opts:n,self:r}=t;if(!n.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||yA(t,`unknown keyword: "${i}"`)}pe.checkUnknownRules=hA;function pA(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}pe.schemaHasRules=pA;function uV(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}pe.schemaHasRulesButRef=uV;function dV({topSchemaRef:t,schemaPath:e},n,r,s){if(!s){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Je._)`${n}`}return(0,Je._)`${t}${e}${(0,Je.getProperty)(r)}`}pe.schemaRefOrVal=dV;function fV(t){return mA(decodeURIComponent(t))}pe.unescapeFragment=fV;function hV(t){return encodeURIComponent(dv(t))}pe.escapeFragment=hV;function dv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}pe.escapeJsonPointer=dv;function mA(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}pe.unescapeJsonPointer=mA;function pV(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}pe.eachItem=pV;function dA({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Je.Name?(i instanceof Je.Name?t(s,i,o):e(s,i,o),o):i instanceof Je.Name?(e(s,o,i),i):n(i,o);return a===Je.Name&&!(c instanceof Je.Name)?r(s,c):c}}pe.mergeEvaluated={props:dA({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Je._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Je._)`${n} || {}`).code((0,Je._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Je._)`${n} || {}`),fv(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:gA}),items:dA({mergeNames:(t,e,n)=>t.if((0,Je._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Je._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Je._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Je._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function gA(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Je._)`{}`);return e!==void 0&&fv(t,n,e),n}pe.evaluatedPropsToName=gA;function fv(t,e,n){Object.keys(n).forEach(r=>t.assign((0,Je._)`${e}${(0,Je.getProperty)(r)}`,!0))}pe.setEvaluated=fv;var fA={};function mV(t,e){return t.scopeValue("func",{ref:e,code:fA[e.code]||(fA[e.code]=new aV._Code(e.code))})}pe.useFunc=mV;var uv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(uv||(pe.Type=uv={}));function gV(t,e,n){if(t instanceof Je.Name){let r=e===uv.Num;return n?r?(0,Je._)`"[" + ${t} + "]"`:(0,Je._)`"['" + ${t} + "']"`:r?(0,Je._)`"/" + ${t}`:(0,Je._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Je.getProperty)(t).toString():"/"+dv(t)}pe.getErrorPath=gV;function yA(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}pe.checkStrictMode=yA});var er=w(hv=>{"use strict";Object.defineProperty(hv,"__esModule",{value:!0});var rn=ue(),yV={data:new rn.Name("data"),valCxt:new rn.Name("valCxt"),instancePath:new rn.Name("instancePath"),parentData:new rn.Name("parentData"),parentDataProperty:new rn.Name("parentDataProperty"),rootData:new rn.Name("rootData"),dynamicAnchors:new rn.Name("dynamicAnchors"),vErrors:new rn.Name("vErrors"),errors:new rn.Name("errors"),this:new rn.Name("this"),self:new rn.Name("self"),scope:new rn.Name("scope"),json:new rn.Name("json"),jsonPos:new rn.Name("jsonPos"),jsonLen:new rn.Name("jsonLen"),jsonPart:new rn.Name("jsonPart")};hv.default=yV});var cl=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.extendErrors=sn.resetErrorsCount=sn.reportExtraError=sn.reportError=sn.keyword$DataError=sn.keywordError=void 0;var Ne=ue(),qh=be(),hn=er();sn.keywordError={message:({keyword:t})=>(0,Ne.str)`must pass "${t}" keyword validation`};sn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ne.str)`"${t}" keyword must be ${e} ($data)`:(0,Ne.str)`"${t}" keyword is invalid ($data)`};function bV(t,e=sn.keywordError,n,r){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,c=TA(t,e,n);r??(o||a)?bA(i,c):vA(s,(0,Ne._)`[${c}]`)}sn.reportError=bV;function vV(t,e=sn.keywordError,n){let{it:r}=t,{gen:s,compositeRule:i,allErrors:o}=r,a=TA(t,e,n);bA(s,a),i||o||vA(r,hn.default.vErrors)}sn.reportExtraError=vV;function TV(t,e){t.assign(hn.default.errors,e),t.if((0,Ne._)`${hn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ne._)`${hn.default.vErrors}.length`,e),()=>t.assign(hn.default.vErrors,null)))}sn.resetErrorsCount=TV;function _V({gen:t,keyword:e,schemaValue:n,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,hn.default.errors,a=>{t.const(o,(0,Ne._)`${hn.default.vErrors}[${a}]`),t.if((0,Ne._)`${o}.instancePath === undefined`,()=>t.assign((0,Ne._)`${o}.instancePath`,(0,Ne.strConcat)(hn.default.instancePath,i.errorPath))),t.assign((0,Ne._)`${o}.schemaPath`,(0,Ne.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,Ne._)`${o}.schema`,n),t.assign((0,Ne._)`${o}.data`,r))})}sn.extendErrors=_V;function bA(t,e){let n=t.const("err",e);t.if((0,Ne._)`${hn.default.vErrors} === null`,()=>t.assign(hn.default.vErrors,(0,Ne._)`[${n}]`),(0,Ne._)`${hn.default.vErrors}.push(${n})`),t.code((0,Ne._)`${hn.default.errors}++`)}function vA(t,e){let{gen:n,validateName:r,schemaEnv:s}=t;s.$async?n.throw((0,Ne._)`new ${t.ValidationError}(${e})`):(n.assign((0,Ne._)`${r}.errors`,e),n.return(!1))}var ji={keyword:new Ne.Name("keyword"),schemaPath:new Ne.Name("schemaPath"),params:new Ne.Name("params"),propertyName:new Ne.Name("propertyName"),message:new Ne.Name("message"),schema:new Ne.Name("schema"),parentSchema:new Ne.Name("parentSchema")};function TA(t,e,n){let{createErrors:r}=t.it;return r===!1?(0,Ne._)`{}`:SV(t,e,n)}function SV(t,e,n={}){let{gen:r,it:s}=t,i=[EV(s,n),wV(t,n)];return kV(t,e,i),r.object(...i)}function EV({errorPath:t},{instancePath:e}){let n=e?(0,Ne.str)`${t}${(0,qh.getErrorPath)(e,qh.Type.Str)}`:t;return[hn.default.instancePath,(0,Ne.strConcat)(hn.default.instancePath,n)]}function wV({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:r}){let s=r?e:(0,Ne.str)`${e}/${t}`;return n&&(s=(0,Ne.str)`${s}${(0,qh.getErrorPath)(n,qh.Type.Str)}`),[ji.schemaPath,s]}function kV(t,{params:e,message:n},r){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([ji.keyword,s],[ji.params,typeof e=="function"?e(t):e||(0,Ne._)`{}`]),c.messages&&r.push([ji.message,typeof n=="function"?n(t):n]),c.verbose&&r.push([ji.schema,o],[ji.parentSchema,(0,Ne._)`${u}${d}`],[hn.default.data,i]),l&&r.push([ji.propertyName,l])}});var SA=w(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.boolOrEmptySchema=ua.topBoolOrEmptySchema=void 0;var NV=cl(),PV=ue(),RV=er(),CV={message:"boolean schema is false"};function DV(t){let{gen:e,schema:n,validateName:r}=t;n===!1?_A(t,!1):typeof n=="object"&&n.$async===!0?e.return(RV.default.data):(e.assign((0,PV._)`${r}.errors`,null),e.return(!0))}ua.topBoolOrEmptySchema=DV;function AV(t,e){let{gen:n,schema:r}=t;r===!1?(n.var(e,!1),_A(t)):n.var(e,!0)}ua.boolOrEmptySchema=AV;function _A(t,e){let{gen:n,data:r}=t,s={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,NV.reportError)(s,CV,void 0,e)}});var pv=w(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.getRules=da.isJSONType=void 0;var OV=["string","number","integer","boolean","null","object","array"],IV=new Set(OV);function xV(t){return typeof t=="string"&&IV.has(t)}da.isJSONType=xV;function MV(){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:{}}}da.getRules=MV});var mv=w(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.shouldUseRule=Zs.shouldUseGroup=Zs.schemaHasRulesForType=void 0;function $V({schema:t,self:e},n){let r=e.RULES.types[n];return r&&r!==!0&&EA(t,r)}Zs.schemaHasRulesForType=$V;function EA(t,e){return e.rules.some(n=>wA(t,n))}Zs.shouldUseGroup=EA;function wA(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(r=>t[r]!==void 0))}Zs.shouldUseRule=wA});var ll=w(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.reportTypeError=on.checkDataTypes=on.checkDataType=on.coerceAndCheckDataType=on.getJSONTypes=on.getSchemaTypes=on.DataType=void 0;var LV=pv(),qV=mv(),jV=cl(),de=ue(),kA=be(),fa;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(fa||(on.DataType=fa={}));function FV(t){let e=NA(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}on.getSchemaTypes=FV;function NA(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(LV.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}on.getJSONTypes=NA;function BV(t,e){let{gen:n,data:r,opts:s}=t,i=UV(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,qV.schemaHasRulesForType)(t,e[0]));if(o){let a=yv(e,r,s.strictNumbers,fa.Wrong);n.if(a,()=>{i.length?VV(t,e,i):bv(t)})}return o}on.coerceAndCheckDataType=BV;var PA=new Set(["string","number","integer","boolean","null"]);function UV(t,e){return e?t.filter(n=>PA.has(n)||e==="array"&&n==="array"):[]}function VV(t,e,n){let{gen:r,data:s,opts:i}=t,o=r.let("dataType",(0,de._)`typeof ${s}`),a=r.let("coerced",(0,de._)`undefined`);i.coerceTypes==="array"&&r.if((0,de._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,de._)`${s}[0]`).assign(o,(0,de._)`typeof ${s}`).if(yv(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,de._)`${a} !== undefined`);for(let l of n)(PA.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),bv(t),r.endIf(),r.if((0,de._)`${a} !== undefined`,()=>{r.assign(s,a),zV(t,a)});function c(l){switch(l){case"string":r.elseIf((0,de._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,de._)`"" + ${s}`).elseIf((0,de._)`${s} === null`).assign(a,(0,de._)`""`);return;case"number":r.elseIf((0,de._)`${o} == "boolean" || ${s} === null
|
|
177
|
-
|| (${o} == "string" && ${
|
|
178
|
-
|| (${o} === "string" && ${
|
|
179
|
-
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,de._)`[${s}]`)}}}function zV({gen:t,parentData:e,parentDataProperty:n},r){t.if((0,de._)`${e} !== undefined`,()=>t.assign((0,de._)`${e}[${n}]`,r))}function gv(t,e,n,r=fa.Correct){let s=r===fa.Correct?de.operators.EQ:de.operators.NEQ,i;switch(t){case"null":return(0,de._)`${e} ${s} null`;case"array":i=(0,de._)`Array.isArray(${e})`;break;case"object":i=(0,de._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,de._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,de._)`typeof ${e} ${s} ${t}`}return r===fa.Correct?i:(0,de.not)(i);function o(a=de.nil){return(0,de.and)((0,de._)`typeof ${e} == "number"`,a,n?(0,de._)`isFinite(${e})`:de.nil)}}on.checkDataType=gv;function yv(t,e,n,r){if(t.length===1)return gv(t[0],e,n,r);let s,i=(0,kA.toHash)(t);if(i.array&&i.object){let o=(0,de._)`typeof ${e} != "object"`;s=i.null?o:(0,de._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=de.nil;i.number&&delete i.integer;for(let o in i)s=(0,de.and)(s,gv(o,e,n,r));return s}on.checkDataTypes=yv;var WV={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,de._)`{type: ${t}}`:(0,de._)`{type: ${e}}`};function bv(t){let e=HV(t);(0,jV.reportError)(e,WV)}on.reportTypeError=bv;function HV(t){let{gen:e,data:n,schema:r}=t,s=(0,kA.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:n,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:t}}});var CA=w(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.assignDefaults=void 0;var ha=ue(),GV=be();function YV(t,e){let{properties:n,items:r}=t.schema;if(e==="object"&&n)for(let s in n)RA(t,s,n[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>RA(t,i,s.default))}jh.assignDefaults=YV;function RA(t,e,n){let{gen:r,compositeRule:s,data:i,opts:o}=t;if(n===void 0)return;let a=(0,ha._)`${i}${(0,ha.getProperty)(e)}`;if(s){(0,GV.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,ha._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,ha._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,ha._)`${a} = ${(0,ha.stringify)(n)}`)}});var tr=w(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.validateUnion=Ge.validateArray=Ge.usePattern=Ge.callValidateCode=Ge.schemaProperties=Ge.allSchemaProperties=Ge.noPropertyInData=Ge.propertyInData=Ge.isOwnProperty=Ge.hasPropFunc=Ge.reportMissingProp=Ge.checkMissingProp=Ge.checkReportMissingProp=void 0;var ct=ue(),vv=be(),ei=er(),KV=be();function XV(t,e){let{gen:n,data:r,it:s}=t;n.if(_v(n,r,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ct._)`${e}`},!0),t.error()})}Ge.checkReportMissingProp=XV;function JV({gen:t,data:e,it:{opts:n}},r,s){return(0,ct.or)(...r.map(i=>(0,ct.and)(_v(t,e,i,n.ownProperties),(0,ct._)`${s} = ${i}`)))}Ge.checkMissingProp=JV;function QV(t,e){t.setParams({missingProperty:e},!0),t.error()}Ge.reportMissingProp=QV;function DA(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ct._)`Object.prototype.hasOwnProperty`})}Ge.hasPropFunc=DA;function Tv(t,e,n){return(0,ct._)`${DA(t)}.call(${e}, ${n})`}Ge.isOwnProperty=Tv;function ZV(t,e,n,r){let s=(0,ct._)`${e}${(0,ct.getProperty)(n)} !== undefined`;return r?(0,ct._)`${s} && ${Tv(t,e,n)}`:s}Ge.propertyInData=ZV;function _v(t,e,n,r){let s=(0,ct._)`${e}${(0,ct.getProperty)(n)} === undefined`;return r?(0,ct.or)(s,(0,ct.not)(Tv(t,e,n))):s}Ge.noPropertyInData=_v;function AA(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ge.allSchemaProperties=AA;function e2(t,e){return AA(e).filter(n=>!(0,vv.alwaysValidSchema)(t,e[n]))}Ge.schemaProperties=e2;function t2({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,ct._)`${t}, ${e}, ${r}${s}`:e,d=[[ei.default.instancePath,(0,ct.strConcat)(ei.default.instancePath,i)],[ei.default.parentData,o.parentData],[ei.default.parentDataProperty,o.parentDataProperty],[ei.default.rootData,ei.default.rootData]];o.opts.dynamicRef&&d.push([ei.default.dynamicAnchors,ei.default.dynamicAnchors]);let f=(0,ct._)`${u}, ${n.object(...d)}`;return c!==ct.nil?(0,ct._)`${a}.call(${c}, ${f})`:(0,ct._)`${a}(${f})`}Ge.callValidateCode=t2;var n2=(0,ct._)`new RegExp`;function r2({gen:t,it:{opts:e}},n){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(n,r);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ct._)`${s.code==="new RegExp"?n2:(0,KV.useFunc)(t,s)}(${n}, ${r})`})}Ge.usePattern=r2;function s2(t){let{gen:e,data:n,keyword:r,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,ct._)`${n}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:vv.Type.Num},i),e.if((0,ct.not)(i),a)})}}Ge.validateArray=s2;function i2(t){let{gen:e,schema:n,keyword:r,it:s}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,vv.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>n.forEach((c,l)=>{let u=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ct._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ct.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ge.validateUnion=i2});var xA=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.validateKeywordUsage=Yr.validSchemaType=Yr.funcKeywordCode=Yr.macroKeywordCode=void 0;var pn=ue(),Fi=er(),o2=tr(),a2=cl();function c2(t,e){let{gen:n,keyword:r,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),c=IA(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=n.name("valid");t.subschema({schema:a,schemaPath:pn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Yr.macroKeywordCode=c2;function l2(t,e){var n;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=t;d2(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=IA(r,s,l),d=r.let("valid");t.block$data(d,f),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function f(){if(e.errors===!1)m(),e.modifying&&OA(t),b(()=>t.error());else{let E=e.async?h():y();e.modifying&&OA(t),b(()=>u2(t,E))}}function h(){let E=r.let("ruleErrs",null);return r.try(()=>m((0,pn._)`await `),_=>r.assign(d,!1).if((0,pn._)`${_} instanceof ${c.ValidationError}`,()=>r.assign(E,(0,pn._)`${_}.errors`),()=>r.throw(_))),E}function y(){let E=(0,pn._)`${u}.errors`;return r.assign(E,null),m(pn.nil),E}function m(E=e.async?(0,pn._)`await `:pn.nil){let _=c.opts.passContext?Fi.default.this:Fi.default.self,T=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,pn._)`${E}${(0,o2.callValidateCode)(t,u,_,T)}`,e.modifying)}function b(E){var _;r.if((0,pn.not)((_=e.valid)!==null&&_!==void 0?_:d),E)}}Yr.funcKeywordCode=l2;function OA(t){let{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,pn._)`${r.parentData}[${r.parentDataProperty}]`))}function u2(t,e){let{gen:n}=t;n.if((0,pn._)`Array.isArray(${e})`,()=>{n.assign(Fi.default.vErrors,(0,pn._)`${Fi.default.vErrors} === null ? ${e} : ${Fi.default.vErrors}.concat(${e})`).assign(Fi.default.errors,(0,pn._)`${Fi.default.vErrors}.length`),(0,a2.extendErrors)(t)},()=>t.error())}function d2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function IA(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,pn.stringify)(n)})}function f2(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Yr.validSchemaType=f2;function h2({schema:t,opts:e,self:n,errSchemaPath:r},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Yr.validateKeywordUsage=h2});var $A=w(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.extendSubschemaMode=ti.extendSubschemaData=ti.getSubschema=void 0;var Kr=ue(),MA=be();function p2(t,{keyword:e,schemaProp:n,schema:r,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return n===void 0?{schema:a,schemaPath:(0,Kr._)`${t.schemaPath}${(0,Kr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[n],schemaPath:(0,Kr._)`${t.schemaPath}${(0,Kr.getProperty)(e)}${(0,Kr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,MA.escapeFragment)(n)}`}}if(r!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}ti.getSubschema=p2;function m2(t,e,{dataProp:n,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Kr._)`${e.data}${(0,Kr.getProperty)(n)}`,!0);c(f),t.errorPath=(0,Kr.str)`${l}${(0,MA.getErrorPath)(n,r,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Kr._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(s!==void 0){let l=s instanceof Kr.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);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]}}ti.extendSubschemaData=m2;function g2(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(t.compositeRule=r),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=n}ti.extendSubschemaMode=g2});var Sv=w((Use,LA)=>{"use strict";LA.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}});var jA=w((Vse,qA)=>{"use strict";var ni=qA.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},s=n.post||function(){};Fh(e,r,s,t,"",t)};ni.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ni.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ni.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ni.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 Fh(t,e,n,r,s,i,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,s,i,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in ni.arrayKeywords)for(var f=0;f<d.length;f++)Fh(t,e,n,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in ni.propsKeywords){if(d&&typeof d=="object")for(var h in d)Fh(t,e,n,d[h],s+"/"+u+"/"+y2(h),i,s,u,r,h)}else(u in ni.keywords||t.allKeys&&!(u in ni.skipKeywords))&&Fh(t,e,n,d,s+"/"+u,i,s,u,r)}n(r,s,i,o,a,c,l)}}function y2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ul=w(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getSchemaRefs=Dn.resolveUrl=Dn.normalizeId=Dn._getFullPath=Dn.getFullPath=Dn.inlineRef=void 0;var b2=be(),v2=Sv(),T2=jA(),_2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function S2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ev(t):e?FA(t)<=e:!1}Dn.inlineRef=S2;var E2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ev(t){for(let e in t){if(E2.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(Ev)||typeof n=="object"&&Ev(n))return!0}return!1}function FA(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!_2.has(n)&&(typeof t[n]=="object"&&(0,b2.eachItem)(t[n],r=>e+=FA(r)),e===1/0))return 1/0}return e}function BA(t,e="",n){n!==!1&&(e=pa(e));let r=t.parse(e);return UA(t,r)}Dn.getFullPath=BA;function UA(t,e){return t.serialize(e).split("#")[0]+"#"}Dn._getFullPath=UA;var w2=/#\/?$/;function pa(t){return t?t.replace(w2,""):""}Dn.normalizeId=pa;function k2(t,e,n){return n=pa(n),t.resolve(e,n)}Dn.resolveUrl=k2;var N2=/^[a-z_][-a-z0-9._]*$/i;function P2(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,s=pa(t[n]||e),i={"":s},o=BA(r,s,!1),a={},c=new Set;return T2(t,{allKeys:!0},(d,f,h,y)=>{if(y===void 0)return;let m=o+f,b=i[y];typeof d[n]=="string"&&(b=E.call(this,d[n])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),i[f]=b;function E(T){let k=this.opts.uriResolver.resolve;if(T=pa(b?k(b,T):T),c.has(T))throw u(T);c.add(T);let C=this.refs[T];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,T):T!==pa(m)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=m),T}function _(T){if(typeof T=="string"){if(!N2.test(T))throw new Error(`invalid anchor "${T}"`);E.call(this,`#${T}`)}}}),a;function l(d,f,h){if(f!==void 0&&!v2(d,f))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Dn.getSchemaRefs=P2});var hl=w(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.getData=ri.KeywordCxt=ri.validateFunctionCode=void 0;var GA=SA(),VA=ll(),kv=mv(),Bh=ll(),R2=CA(),fl=xA(),wv=$A(),Q=ue(),se=er(),C2=ul(),ps=be(),dl=cl();function D2(t){if(XA(t)&&(JA(t),KA(t))){I2(t);return}YA(t,()=>(0,GA.topBoolOrEmptySchema)(t))}ri.validateFunctionCode=D2;function YA({gen:t,validateName:e,schema:n,schemaEnv:r,opts:s},i){s.code.es5?t.func(e,(0,Q._)`${se.default.data}, ${se.default.valCxt}`,r.$async,()=>{t.code((0,Q._)`"use strict"; ${zA(n,s)}`),O2(t,s),t.code(i)}):t.func(e,(0,Q._)`${se.default.data}, ${A2(s)}`,r.$async,()=>t.code(zA(n,s)).code(i))}function A2(t){return(0,Q._)`{${se.default.instancePath}="", ${se.default.parentData}, ${se.default.parentDataProperty}, ${se.default.rootData}=${se.default.data}${t.dynamicRef?(0,Q._)`, ${se.default.dynamicAnchors}={}`:Q.nil}}={}`}function O2(t,e){t.if(se.default.valCxt,()=>{t.var(se.default.instancePath,(0,Q._)`${se.default.valCxt}.${se.default.instancePath}`),t.var(se.default.parentData,(0,Q._)`${se.default.valCxt}.${se.default.parentData}`),t.var(se.default.parentDataProperty,(0,Q._)`${se.default.valCxt}.${se.default.parentDataProperty}`),t.var(se.default.rootData,(0,Q._)`${se.default.valCxt}.${se.default.rootData}`),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,Q._)`${se.default.valCxt}.${se.default.dynamicAnchors}`)},()=>{t.var(se.default.instancePath,(0,Q._)`""`),t.var(se.default.parentData,(0,Q._)`undefined`),t.var(se.default.parentDataProperty,(0,Q._)`undefined`),t.var(se.default.rootData,se.default.data),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,Q._)`{}`)})}function I2(t){let{schema:e,opts:n,gen:r}=t;YA(t,()=>{n.$comment&&e.$comment&&ZA(t),q2(t),r.let(se.default.vErrors,null),r.let(se.default.errors,0),n.unevaluated&&x2(t),QA(t),B2(t)})}function x2(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Q._)`${n}.evaluated`),e.if((0,Q._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Q._)`${t.evaluated}.props`,(0,Q._)`undefined`)),e.if((0,Q._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Q._)`${t.evaluated}.items`,(0,Q._)`undefined`))}function zA(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Q._)`/*# sourceURL=${n} */`:Q.nil}function M2(t,e){if(XA(t)&&(JA(t),KA(t))){$2(t,e);return}(0,GA.boolOrEmptySchema)(t,e)}function KA({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function XA(t){return typeof t.schema!="boolean"}function $2(t,e){let{schema:n,gen:r,opts:s}=t;s.$comment&&n.$comment&&ZA(t),j2(t),F2(t);let i=r.const("_errs",se.default.errors);QA(t,i),r.var(e,(0,Q._)`${i} === ${se.default.errors}`)}function JA(t){(0,ps.checkUnknownRules)(t),L2(t)}function QA(t,e){if(t.opts.jtd)return WA(t,[],!1,e);let n=(0,VA.getSchemaTypes)(t.schema),r=(0,VA.coerceAndCheckDataType)(t,n);WA(t,n,!r,e)}function L2(t){let{schema:e,errSchemaPath:n,opts:r,self:s}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,ps.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function q2(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,ps.checkStrictMode)(t,"default is ignored in the schema root")}function j2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,C2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function F2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ZA({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:s}){let i=n.$comment;if(s.$comment===!0)t.code((0,Q._)`${se.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,Q.str)`${r}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Q._)`${se.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function B2(t){let{gen:e,schemaEnv:n,validateName:r,ValidationError:s,opts:i}=t;n.$async?e.if((0,Q._)`${se.default.errors} === 0`,()=>e.return(se.default.data),()=>e.throw((0,Q._)`new ${s}(${se.default.vErrors})`)):(e.assign((0,Q._)`${r}.errors`,se.default.vErrors),i.unevaluated&&U2(t),e.return((0,Q._)`${se.default.errors} === 0`))}function U2({gen:t,evaluated:e,props:n,items:r}){n instanceof Q.Name&&t.assign((0,Q._)`${e}.props`,n),r instanceof Q.Name&&t.assign((0,Q._)`${e}.items`,r)}function WA(t,e,n,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,ps.schemaHasRulesButRef)(i,u))){s.block(()=>tO(t,"$ref",u.all.$ref.definition));return}c.jtd||V2(t,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,kv.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Bh.checkDataType)(f.type,o,c.strictNumbers)),HA(t,f),e.length===1&&e[0]===f.type&&n&&(s.else(),(0,Bh.reportTypeError)(t)),s.endIf()):HA(t,f),a||s.if((0,Q._)`${se.default.errors} === ${r||0}`))}}function HA(t,e){let{gen:n,schema:r,opts:{useDefaults:s}}=t;s&&(0,R2.assignDefaults)(t,e.type),n.block(()=>{for(let i of e.rules)(0,kv.shouldUseRule)(r,i)&&tO(t,i.keyword,i.definition,e.type)})}function V2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(z2(t,e),t.opts.allowUnionTypes||W2(t,e),H2(t,t.dataTypes))}function z2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{eO(t.dataTypes,n)||Nv(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Y2(t,e)}}function W2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Nv(t,"use allowUnionTypes to allow union type keyword")}function H2(t,e){let n=t.self.RULES.all;for(let r in n){let s=n[r];if(typeof s=="object"&&(0,kv.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>G2(e,o))&&Nv(t,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function G2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function eO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Y2(t,e){let n=[];for(let r of t.dataTypes)eO(e,r)?n.push(r):e.includes("integer")&&r==="number"&&n.push("integer");t.dataTypes=n}function Nv(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,ps.checkStrictMode)(t,e,t.opts.strictTypes)}var Uh=class{constructor(e,n,r){if((0,fl.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ps.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",nO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,fl.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",se.default.errors))}result(e,n,r){this.failResult((0,Q.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Q.not)(e),void 0,n)}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:n}=this;this.fail((0,Q._)`${n} !== undefined && (${(0,Q.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?dl.reportExtraError:dl.reportError)(this,this.def.error,n)}$dataError(){(0,dl.reportError)(this,this.def.$dataError||dl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,dl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=Q.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=Q.nil,n=Q.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,Q.or)((0,Q._)`${s} === undefined`,n)),e!==Q.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Q.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:r,def:s,it:i}=this;return(0,Q.or)(o(),a());function o(){if(r.length){if(!(n instanceof Q.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,Q._)`${(0,Bh.checkDataTypes)(c,n,i.opts.strictNumbers,Bh.DataType.Wrong)}`}return Q.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,Q._)`!${c}(${n})`}return Q.nil}}subschema(e,n){let r=(0,wv.getSubschema)(this.it,e);(0,wv.extendSubschemaData)(r,this.it,e),(0,wv.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return M2(s,n),s}mergeEvaluated(e,n){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=ps.mergeEvaluated.props(s,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=ps.mergeEvaluated.items(s,e.items,r.items,n)))}mergeValidEvaluated(e,n){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(n,()=>this.mergeEvaluated(e,Q.Name)),!0}};ri.KeywordCxt=Uh;function tO(t,e,n,r){let s=new Uh(t,n,e);"code"in n?n.code(s,r):s.$data&&n.validate?(0,fl.funcKeywordCode)(s,n):"macro"in n?(0,fl.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,fl.funcKeywordCode)(s,n)}var K2=/^\/(?:[^~]|~0|~1)*$/,X2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function nO(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let s,i;if(t==="")return se.default.rootData;if(t[0]==="/"){if(!K2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=se.default.rootData}else{let l=X2.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return r[e-u]}if(u>e)throw new Error(c("data",u));if(i=n[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,Q._)`${i}${(0,Q.getProperty)((0,ps.unescapeJsonPointer)(l))}`,o=(0,Q._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ri.getData=nO});var Vh=w(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});var Pv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Rv.default=Pv});var pl=w(Av=>{"use strict";Object.defineProperty(Av,"__esModule",{value:!0});var Cv=ul(),Dv=class extends Error{constructor(e,n,r,s){super(s||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,Cv.resolveUrl)(e,n,r),this.missingSchema=(0,Cv.normalizeId)((0,Cv.getFullPath)(e,this.missingRef))}};Av.default=Dv});var ml=w(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.resolveSchema=nr.getCompilingSchema=nr.resolveRef=nr.compileSchema=nr.SchemaEnv=void 0;var kr=ue(),J2=Vh(),Bi=er(),Nr=ul(),rO=be(),Q2=hl(),ma=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Nr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};nr.SchemaEnv=ma;function Iv(t){let e=sO.call(this,t);if(e)return e;let n=(0,Nr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new kr.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:J2.default,code:(0,kr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Bi.default.data,parentData:Bi.default.parentData,parentDataProperty:Bi.default.parentDataProperty,dataNames:[Bi.default.data],dataPathArr:[kr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,kr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:kr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,kr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Q2.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Bi.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Bi.default.self}`,`${Bi.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:m}=l;h.evaluated={props:y instanceof kr.Name?void 0:y,items:m instanceof kr.Name?void 0:m,dynamicProps:y instanceof kr.Name,dynamicItems:m instanceof kr.Name},h.source&&(h.source.evaluated=(0,kr.stringify)(h.evaluated))}return t.validate=h,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)}}nr.compileSchema=Iv;function Z2(t,e,n){var r;n=(0,Nr.resolveUrl)(this.opts.uriResolver,e,n);let s=t.refs[n];if(s)return s;let i=nz.call(this,t,n);if(i===void 0){let o=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(i=new ma({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[n]=ez.call(this,i)}nr.resolveRef=Z2;function ez(t){return(0,Nr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Iv.call(this,t)}function sO(t){for(let e of this._compilations)if(tz(e,t))return e}nr.getCompilingSchema=sO;function tz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function nz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||zh.call(this,t,e)}function zh(t,e){let n=this.opts.uriResolver.parse(e),r=(0,Nr._getFullPath)(this.opts.uriResolver,n),s=(0,Nr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===s)return Ov.call(this,n,t);let i=(0,Nr.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=zh.call(this,t,o);return typeof a?.schema!="object"?void 0:Ov.call(this,n,a)}if(typeof o?.schema=="object"){if(o.validate||Iv.call(this,o),i===(0,Nr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Nr.resolveUrl)(this.opts.uriResolver,s,l)),new ma({schema:a,schemaId:c,root:t,baseId:s})}return Ov.call(this,n,o)}}nr.resolveSchema=zh;var rz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ov(t,{baseId:e,schema:n,root:r}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let c=n[(0,rO.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!rz.has(a)&&l&&(e=(0,Nr.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,rO.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Nr.resolveUrl)(this.opts.uriResolver,e,n.$ref);i=zh.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new ma({schema:n,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var iO=w((Kse,sz)=>{sz.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 aO=w((Xse,oO)=>{"use strict";var iz={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};oO.exports={HEX:iz}});var mO=w((Jse,pO)=>{"use strict";var{HEX:oz}=aO(),az=/^(?:(?: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 dO(t){if(hO(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(az)||[],[n]=e;return n?{host:lz(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function xv(t,e=!1){let n="",r=!0;for(let s of t){if(oz[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(n+=s)}return e&&n.length===0&&(n="0"),n}function cz(t){let e=0,n={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=xv(s);if(l!==void 0)r.push(l);else return n.error=!0,!1}s.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++,r.push(":"),e>7){n.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?n.zone=s.join(""):a?r.push(s.join("")):r.push(xv(s))),n.address=r.join(""),n}function fO(t){if(hO(t,":")<2)return{host:t,isIPV6:!1};let e=cz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,r=e.address;return e.zone&&(n+="%"+e.zone,r+="%25"+e.zone),{host:n,escapedHost:r,isIPV6:!0}}}function lz(t,e){let n="",r=!0,s=t.length;for(let i=0;i<s;i++){let o=t[i];o==="0"&&r?(i+1<=s&&t[i+1]===e||i+1===s)&&(n+=o,r=!1):(o===e?r=!0:r=!1,n+=o)}return n}function hO(t,e){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}var cO=/^\.\.?\//u,lO=/^\/\.(?:\/|$)/u,uO=/^\/\.\.(?:\/|$)/u,uz=/^\/?(?:.|\n)*?(?=\/|$)/u;function dz(t){let e=[];for(;t.length;)if(t.match(cO))t=t.replace(cO,"");else if(t.match(lO))t=t.replace(lO,"/");else if(t.match(uO))t=t.replace(uO,"/"),e.pop();else if(t==="."||t==="..")t="";else{let n=t.match(uz);if(n){let r=n[0];t=t.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function fz(t,e){let n=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=n(t.scheme)),t.userinfo!==void 0&&(t.userinfo=n(t.userinfo)),t.host!==void 0&&(t.host=n(t.host)),t.path!==void 0&&(t.path=n(t.path)),t.query!==void 0&&(t.query=n(t.query)),t.fragment!==void 0&&(t.fragment=n(t.fragment)),t}function hz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host),r=dO(n);if(r.isIPV4)n=r.host;else{let s=fO(r.host);s.isIPV6===!0?n=`[${s.escapedHost}]`:n=t.host}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}pO.exports={recomposeAuthority:hz,normalizeComponentEncoding:fz,removeDotSegments:dz,normalizeIPv4:dO,normalizeIPv6:fO,stringArrayToHexStripped:xv}});var _O=w((Qse,TO)=>{"use strict";var pz=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,mz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function gO(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function yO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function bO(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 gz(t){return t.secure=gO(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function yz(t){if((t.port===(gO(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,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function bz(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(mz);if(n){let r=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let s=`${r}:${e.nid||t.nid}`,i=Mv[s];t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function vz(t,e){let n=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),s=`${n}:${e.nid||r}`,i=Mv[s];i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function Tz(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!pz.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function _z(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var vO={scheme:"http",domainHost:!0,parse:yO,serialize:bO},Sz={scheme:"https",domainHost:vO.domainHost,parse:yO,serialize:bO},Wh={scheme:"ws",domainHost:!0,parse:gz,serialize:yz},Ez={scheme:"wss",domainHost:Wh.domainHost,parse:Wh.parse,serialize:Wh.serialize},wz={scheme:"urn",parse:bz,serialize:vz,skipNormalize:!0},kz={scheme:"urn:uuid",parse:Tz,serialize:_z,skipNormalize:!0},Mv={http:vO,https:Sz,ws:Wh,wss:Ez,urn:wz,"urn:uuid":kz};TO.exports=Mv});var EO=w((Zse,Gh)=>{"use strict";var{normalizeIPv6:Nz,normalizeIPv4:Pz,removeDotSegments:gl,recomposeAuthority:Rz,normalizeComponentEncoding:Hh}=mO(),$v=_O();function Cz(t,e){return typeof t=="string"?t=Xr(ms(t,e),e):typeof t=="object"&&(t=ms(Xr(t,e),e)),t}function Dz(t,e,n){let r=Object.assign({scheme:"null"},n),s=SO(ms(t,r),ms(e,r),r,!0);return Xr(s,{...r,skipEscape:!0})}function SO(t,e,n,r){let s={};return r||(t=ms(Xr(t,n),n),e=ms(Xr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=gl(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=gl(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=gl(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=gl(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function Az(t,e,n){return typeof t=="string"?(t=unescape(t),t=Xr(Hh(ms(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=Xr(Hh(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Xr(Hh(ms(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=Xr(Hh(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Xr(t,e){let n={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:""},r=Object.assign({},e),s=[],i=$v[(r.scheme||n.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&s.push(n.scheme,":");let o=Rz(n);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),n.path&&n.path.charAt(0)!=="/"&&s.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=gl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return n.query!==void 0&&s.push("?",n.query),n.fragment!==void 0&&s.push("#",n.fragment),s.join("")}var Oz=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function Iz(t){let e=0;for(let n=0,r=t.length;n<r;++n)if(e=t.charCodeAt(n),e>126||Oz[e])return!0;return!1}var xz=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ms(t,e){let n=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=t.indexOf("%")!==-1,i=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let o=t.match(xz);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=Pz(r.host);if(c.isIPV4===!1){let l=Nz(c.host);r.host=l.host.toLowerCase(),i=l.isIPV6}else r.host=c.host,i=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");let a=$v[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&i===!1&&Iz(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),s&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}var Lv={SCHEMES:$v,normalize:Cz,resolve:Dz,resolveComponents:SO,equal:Az,serialize:Xr,parse:ms};Gh.exports=Lv;Gh.exports.default=Lv;Gh.exports.fastUri=Lv});var kO=w(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var wO=EO();wO.code='require("ajv/dist/runtime/uri").default';qv.default=wO});var IO=w(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.CodeGen=Gt.Name=Gt.nil=Gt.stringify=Gt.str=Gt._=Gt.KeywordCxt=void 0;var Mz=hl();Object.defineProperty(Gt,"KeywordCxt",{enumerable:!0,get:function(){return Mz.KeywordCxt}});var ga=ue();Object.defineProperty(Gt,"_",{enumerable:!0,get:function(){return ga._}});Object.defineProperty(Gt,"str",{enumerable:!0,get:function(){return ga.str}});Object.defineProperty(Gt,"stringify",{enumerable:!0,get:function(){return ga.stringify}});Object.defineProperty(Gt,"nil",{enumerable:!0,get:function(){return ga.nil}});Object.defineProperty(Gt,"Name",{enumerable:!0,get:function(){return ga.Name}});Object.defineProperty(Gt,"CodeGen",{enumerable:!0,get:function(){return ga.CodeGen}});var $z=Vh(),DO=pl(),Lz=pv(),yl=ml(),qz=ue(),bl=ul(),Yh=ll(),Fv=be(),NO=iO(),jz=kO(),AO=(t,e)=>new RegExp(t,e);AO.code="new RegExp";var Fz=["removeAdditional","useDefaults","coerceTypes"],Bz=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Uz={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."},Vz={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},PO=200;function zz(t){var e,n,r,s,i,o,a,c,l,u,d,f,h,y,m,b,E,_,T,k,C,$,B,q,oe;let Ve=t.strict,Dt=(e=t.code)===null||e===void 0?void 0:e.optimize,me=Dt===!0||Dt===void 0?1:Dt||0,Un=(r=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:AO,gs=(s=t.uriResolver)!==null&&s!==void 0?s:jz.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:Ve)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Ve)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Ve)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&f!==void 0?f:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:Ve)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:me,regExp:Un}:{optimize:me,regExp:Un},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:PO,loopEnum:(b=t.loopEnum)!==null&&b!==void 0?b:PO,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(k=t.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:($=t.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(B=t.validateFormats)!==null&&B!==void 0?B:!0,unicodeRegExp:(q=t.unicodeRegExp)!==null&&q!==void 0?q:!0,int32range:(oe=t.int32range)!==null&&oe!==void 0?oe:!0,uriResolver:gs}}var vl=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zz(e)};let{es5:n,lines:r}=this.opts.code;this.scope=new qz.ValueScope({scope:{},prefixes:Bz,es5:n,lines:r}),this.logger=Xz(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Lz.getRules)(),RO.call(this,Uz,e,"NOT SUPPORTED"),RO.call(this,Vz,e,"DEPRECATED","warn"),this._metaOpts=Yz.call(this),e.formats&&Hz.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Gz.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Wz.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:r}=this.opts,s=NO;r==="id"&&(s={...NO},s.id=s.$id,delete s.$id),n&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(n);return"$async"in r||(this.errors=r.errors),s}compile(e,n){let r=this._addSchema(e,n);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,n);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof DO.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 i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,n)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,n,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return n=(0,bl.normalizeId)(n||i),this._checkUnique(n),this.schemas[n]=this._addSchema(e,r,n,s,!0),this}addMetaSchema(e,n,r=this.opts.validateSchema){return this.addSchema(e,n,!0,r),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&n){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let n;for(;typeof(n=CO.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:r}=this.opts,s=new yl.SchemaEnv({schema:{},schemaId:r});if(n=yl.resolveSchema.call(this,s,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}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 n=CO.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let r=e[this.opts.schemaId];return r&&(r=(0,bl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let r;if(typeof e=="string")r=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=r);else if(typeof e=="object"&&n===void 0){if(n=e,r=n.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Qz.call(this,r,n),!n)return(0,Fv.eachItem)(r,i=>jv.call(this,i)),this;eW.call(this,n);let s={...n,type:(0,Yh.getJSONTypes)(n.type),schemaType:(0,Yh.getJSONTypes)(n.schemaType)};return(0,Fv.eachItem)(r,s.type.length===0?i=>jv.call(this,i,s):i=>s.type.forEach(o=>jv.call(this,i,s,o))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let r of n.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+n+i)}$dataMetaSchema(e,n){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of n){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=OO(u))}}return e}_removeAllSchemas(e,n){for(let r in e){let s=e[r];(!n||n.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,n,r,s=this.opts.validateSchema,i=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;r=(0,bl.normalizeId)(o||r);let l=bl.getSchemaRefs.call(this,e,r);return c=new yl.SchemaEnv({schema:e,schemaId:a,meta:n,baseId:r,localRefs:l}),this._cache.set(c.schema,c),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),s&&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):yl.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{yl.compileSchema.call(this,e)}finally{this.opts=n}}};vl.ValidationError=$z.default;vl.MissingRefError=DO.default;Gt.default=vl;function RO(t,e,n,r="error"){for(let s in t){let i=s;i in e&&this.logger[r](`${n}: option ${s}. ${t[i]}`)}}function CO(t){return t=(0,bl.normalizeId)(t),this.schemas[t]||this.refs[t]}function Wz(){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 Hz(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Gz(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 n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function Yz(){let t={...this.opts};for(let e of Fz)delete t[e];return t}var Kz={log(){},warn(){},error(){}};function Xz(t){if(t===!1)return Kz;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 Jz=/^[a-z_$][a-z0-9_$:-]*$/i;function Qz(t,e){let{RULES:n}=this;if((0,Fv.eachItem)(t,r=>{if(n.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!Jz.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function jv(t,e,n){var r;let s=e?.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===n);if(o||(o={type:n,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Yh.getJSONTypes)(e.type),schemaType:(0,Yh.getJSONTypes)(e.schemaType)}};e.before?Zz.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function Zz(t,e,n){let r=t.rules.findIndex(s=>s.keyword===n);r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function eW(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=OO(e)),t.validateSchema=this.compile(e,!0))}var tW={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function OO(t){return{anyOf:[t,tW]}}});var xO=w(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var nW={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Bv.default=nW});var Jh=w(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.callRef=Ui.getValidate=void 0;var rW=pl(),MO=tr(),An=ue(),ya=er(),$O=ml(),Kh=be(),sW={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:r}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((n==="#"||n==="#/")&&s===l.baseId)return d();let u=$O.resolveRef.call(c,l,s,n);if(u===void 0)throw new rW.default(r.opts.uriResolver,s,n);if(u instanceof $O.SchemaEnv)return f(u);return h(u);function d(){if(i===l)return Xh(t,o,i,i.$async);let y=e.scopeValue("root",{ref:l});return Xh(t,(0,An._)`${y}.validate`,l,l.$async)}function f(y){let m=LO(t,y);Xh(t,m,y,y.$async)}function h(y){let m=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,An.stringify)(y)}:{ref:y}),b=e.name("valid"),E=t.subschema({schema:y,dataTypes:[],schemaPath:An.nil,topSchemaRef:m,errSchemaPath:n},b);t.mergeEvaluated(E),t.ok(b)}}};function LO(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,An._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Ui.getValidate=LO;function Xh(t,e,n,r){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?ya.default.this:An.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=s.let("valid");s.try(()=>{s.code((0,An._)`await ${(0,MO.callValidateCode)(t,e,l)}`),h(e),o||s.assign(y,!0)},m=>{s.if((0,An._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),f(m),o||s.assign(y,!1)}),t.ok(y)}function d(){t.result((0,MO.callValidateCode)(t,e,l),()=>h(e),()=>f(e))}function f(y){let m=(0,An._)`${y}.errors`;s.assign(ya.default.vErrors,(0,An._)`${ya.default.vErrors} === null ? ${m} : ${ya.default.vErrors}.concat(${m})`),s.assign(ya.default.errors,(0,An._)`${ya.default.vErrors}.length`)}function h(y){var m;if(!i.opts.unevaluated)return;let b=(m=n?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=Kh.mergeEvaluated.props(s,b.props,i.props));else{let E=s.var("props",(0,An._)`${y}.evaluated.props`);i.props=Kh.mergeEvaluated.props(s,E,i.props,An.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=Kh.mergeEvaluated.items(s,b.items,i.items));else{let E=s.var("items",(0,An._)`${y}.evaluated.items`);i.items=Kh.mergeEvaluated.items(s,E,i.items,An.Name)}}}Ui.callRef=Xh;Ui.default=sW});var qO=w(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var iW=xO(),oW=Jh(),aW=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",iW.default,oW.default];Uv.default=aW});var jO=w(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var Qh=ue(),si=Qh.operators,Zh={maximum:{okStr:"<=",ok:si.LTE,fail:si.GT},minimum:{okStr:">=",ok:si.GTE,fail:si.LT},exclusiveMaximum:{okStr:"<",ok:si.LT,fail:si.GTE},exclusiveMinimum:{okStr:">",ok:si.GT,fail:si.LTE}},cW={message:({keyword:t,schemaCode:e})=>(0,Qh.str)`must be ${Zh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Qh._)`{comparison: ${Zh[t].okStr}, limit: ${e}}`},lW={keyword:Object.keys(Zh),type:"number",schemaType:"number",$data:!0,error:cW,code(t){let{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,Qh._)`${n} ${Zh[e].fail} ${r} || isNaN(${n})`)}};Vv.default=lW});var FO=w(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var Tl=ue(),uW={message:({schemaCode:t})=>(0,Tl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Tl._)`{multipleOf: ${t}}`},dW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:uW,code(t){let{gen:e,data:n,schemaCode:r,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,Tl._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Tl._)`${o} !== parseInt(${o})`;t.fail$data((0,Tl._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};zv.default=dW});var UO=w(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});function BO(t){let e=t.length,n=0,r=0,s;for(;r<e;)n++,s=t.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=t.charCodeAt(r),(s&64512)===56320&&r++);return n}Wv.default=BO;BO.code='require("ajv/dist/runtime/ucs2length").default'});var VO=w(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});var Vi=ue(),fW=be(),hW=UO(),pW={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,Vi.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,Vi._)`{limit: ${t}}`},mW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:pW,code(t){let{keyword:e,data:n,schemaCode:r,it:s}=t,i=e==="maxLength"?Vi.operators.GT:Vi.operators.LT,o=s.opts.unicode===!1?(0,Vi._)`${n}.length`:(0,Vi._)`${(0,fW.useFunc)(t.gen,hW.default)}(${n})`;t.fail$data((0,Vi._)`${o} ${i} ${r}`)}};Hv.default=mW});var zO=w(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var gW=tr(),ep=ue(),yW={message:({schemaCode:t})=>(0,ep.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ep._)`{pattern: ${t}}`},bW={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:yW,code(t){let{data:e,$data:n,schema:r,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=n?(0,ep._)`(new RegExp(${s}, ${o}))`:(0,gW.usePattern)(t,r);t.fail$data((0,ep._)`!${a}.test(${e})`)}};Gv.default=bW});var WO=w(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var _l=ue(),vW={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,_l.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,_l._)`{limit: ${t}}`},TW={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:vW,code(t){let{keyword:e,data:n,schemaCode:r}=t,s=e==="maxProperties"?_l.operators.GT:_l.operators.LT;t.fail$data((0,_l._)`Object.keys(${n}).length ${s} ${r}`)}};Yv.default=TW});var HO=w(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var Sl=tr(),El=ue(),_W=be(),SW={message:({params:{missingProperty:t}})=>(0,El.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,El._)`{missingProperty: ${t}}`},EW={keyword:"required",type:"object",schemaType:"array",$data:!0,error:SW,code(t){let{gen:e,schema:n,schemaCode:r,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&n.length===0)return;let c=n.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let m of n)if(h?.[m]===void 0&&!y.has(m)){let b=o.schemaEnv.baseId+o.errSchemaPath,E=`required property "${m}" is not defined at "${b}" (strictRequired)`;(0,_W.checkStrictMode)(o,E,o.opts.strictRequired)}}function l(){if(c||i)t.block$data(El.nil,d);else for(let h of n)(0,Sl.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(c||i){let y=e.let("valid",!0);t.block$data(y,()=>f(h,y)),t.ok(y)}else e.if((0,Sl.checkMissingProp)(t,n,h)),(0,Sl.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,Sl.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function f(h,y){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(y,(0,Sl.propertyInData)(e,s,h,a.ownProperties)),e.if((0,El.not)(y),()=>{t.error(),e.break()})},El.nil)}}};Kv.default=EW});var GO=w(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var wl=ue(),wW={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,wl.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,wl._)`{limit: ${t}}`},kW={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:wW,code(t){let{keyword:e,data:n,schemaCode:r}=t,s=e==="maxItems"?wl.operators.GT:wl.operators.LT;t.fail$data((0,wl._)`${n}.length ${s} ${r}`)}};Xv.default=kW});var tp=w(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var YO=Sv();YO.code='require("ajv/dist/runtime/equal").default';Jv.default=YO});var KO=w(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var Qv=ll(),Yt=ue(),NW=be(),PW=tp(),RW={message:({params:{i:t,j:e}})=>(0,Yt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Yt._)`{i: ${t}, j: ${e}}`},CW={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:RW,code(t){let{gen:e,data:n,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,Qv.getSchemaTypes)(i.items):[];t.block$data(c,u,(0,Yt._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,Yt._)`${n}.length`),m=e.let("j");t.setParams({i:y,j:m}),e.assign(c,!0),e.if((0,Yt._)`${y} > 1`,()=>(d()?f:h)(y,m))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,m){let b=e.name("item"),E=(0,Qv.checkDataTypes)(l,b,a.opts.strictNumbers,Qv.DataType.Wrong),_=e.const("indices",(0,Yt._)`{}`);e.for((0,Yt._)`;${y}--;`,()=>{e.let(b,(0,Yt._)`${n}[${y}]`),e.if(E,(0,Yt._)`continue`),l.length>1&&e.if((0,Yt._)`typeof ${b} == "string"`,(0,Yt._)`${b} += "_"`),e.if((0,Yt._)`typeof ${_}[${b}] == "number"`,()=>{e.assign(m,(0,Yt._)`${_}[${b}]`),t.error(),e.assign(c,!1).break()}).code((0,Yt._)`${_}[${b}] = ${y}`)})}function h(y,m){let b=(0,NW.useFunc)(e,PW.default),E=e.name("outer");e.label(E).for((0,Yt._)`;${y}--;`,()=>e.for((0,Yt._)`${m} = ${y}; ${m}--;`,()=>e.if((0,Yt._)`${b}(${n}[${y}], ${n}[${m}])`,()=>{t.error(),e.assign(c,!1).break(E)})))}}};Zv.default=CW});var XO=w(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var eT=ue(),DW=be(),AW=tp(),OW={message:"must be equal to constant",params:({schemaCode:t})=>(0,eT._)`{allowedValue: ${t}}`},IW={keyword:"const",$data:!0,error:OW,code(t){let{gen:e,data:n,$data:r,schemaCode:s,schema:i}=t;r||i&&typeof i=="object"?t.fail$data((0,eT._)`!${(0,DW.useFunc)(e,AW.default)}(${n}, ${s})`):t.fail((0,eT._)`${i} !== ${n}`)}};tT.default=IW});var JO=w(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var kl=ue(),xW=be(),MW=tp(),$W={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,kl._)`{allowedValues: ${t}}`},LW={keyword:"enum",schemaType:"array",$data:!0,error:$W,code(t){let{gen:e,data:n,$data:r,schema:s,schemaCode:i,it:o}=t;if(!r&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,xW.useFunc)(e,MW.default)),u;if(a||r)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);u=(0,kl.or)(...s.map((y,m)=>f(h,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,h=>e.if((0,kl._)`${l()}(${n}, ${h})`,()=>e.assign(u,!0).break()))}function f(h,y){let m=s[y];return typeof m=="object"&&m!==null?(0,kl._)`${l()}(${n}, ${h}[${y}])`:(0,kl._)`${n} === ${m}`}}};nT.default=LW});var QO=w(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var qW=jO(),jW=FO(),FW=VO(),BW=zO(),UW=WO(),VW=HO(),zW=GO(),WW=KO(),HW=XO(),GW=JO(),YW=[qW.default,jW.default,FW.default,BW.default,UW.default,VW.default,zW.default,WW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},HW.default,GW.default];rT.default=YW});var iT=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.validateAdditionalItems=void 0;var zi=ue(),sT=be(),KW={message:({params:{len:t}})=>(0,zi.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,zi._)`{limit: ${t}}`},XW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:KW,code(t){let{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,sT.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZO(t,r)}};function ZO(t,e){let{gen:n,schema:r,data:s,keyword:i,it:o}=t;o.items=!0;let a=n.const("len",(0,zi._)`${s}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,zi._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,sT.alwaysValidSchema)(o,r)){let l=n.var("valid",(0,zi._)`${a} <= ${e.length}`);n.if((0,zi.not)(l),()=>c(l)),t.ok(l)}function c(l){n.forRange("i",e.length,a,u=>{t.subschema({keyword:i,dataProp:u,dataPropType:sT.Type.Num},l),o.allErrors||n.if((0,zi.not)(l),()=>n.break())})}}Nl.validateAdditionalItems=ZO;Nl.default=XW});var oT=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.validateTuple=void 0;var eI=ue(),np=be(),JW=tr(),QW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return tI(t,"additionalItems",e);n.items=!0,!(0,np.alwaysValidSchema)(n,e)&&t.ok((0,JW.validateArray)(t))}};function tI(t,e,n=t.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=t;u(s),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=np.mergeEvaluated.items(r,n.length,a.items));let c=r.name("valid"),l=r.const("len",(0,eI._)`${i}.length`);n.forEach((d,f)=>{(0,np.alwaysValidSchema)(a,d)||(r.if((0,eI._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:h}=a,y=n.length,m=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let b=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,np.checkStrictMode)(a,b,f.strictTuples)}}}Pl.validateTuple=tI;Pl.default=QW});var nI=w(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var ZW=oT(),eH={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,ZW.validateTuple)(t,"items")};aT.default=eH});var sI=w(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var rI=ue(),tH=be(),nH=tr(),rH=iT(),sH={message:({params:{len:t}})=>(0,rI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rI._)`{limit: ${t}}`},iH={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:sH,code(t){let{schema:e,parentSchema:n,it:r}=t,{prefixItems:s}=n;r.items=!0,!(0,tH.alwaysValidSchema)(r,e)&&(s?(0,rH.validateAdditionalItems)(t,s):t.ok((0,nH.validateArray)(t)))}};cT.default=iH});var iI=w(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var rr=ue(),rp=be(),oH={message:({params:{min:t,max:e}})=>e===void 0?(0,rr.str)`must contain at least ${t} valid item(s)`:(0,rr.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,rr._)`{minContains: ${t}}`:(0,rr._)`{minContains: ${t}, maxContains: ${e}}`},aH={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:oH,code(t){let{gen:e,schema:n,parentSchema:r,data:s,it:i}=t,o,a,{minContains:c,maxContains:l}=r;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,rr._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,rp.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,rp.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,rp.alwaysValidSchema)(i,n)){let m=(0,rr._)`${u} >= ${o}`;a!==void 0&&(m=(0,rr._)`${m} && ${u} <= ${a}`),t.pass(m);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,rr._)`${s}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),b=e.let("count",0);h(m,()=>e.if(m,()=>y(b)))}function h(m,b){e.forRange("i",0,u,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:rp.Type.Num,compositeRule:!0},m),b()})}function y(m){e.code((0,rr._)`${m}++`),a===void 0?e.if((0,rr._)`${m} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,rr._)`${m} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,rr._)`${m} >= ${o}`,()=>e.assign(d,!0)))}}};lT.default=aH});var sp=w(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.validateSchemaDeps=Jr.validatePropertyDeps=Jr.error=void 0;var uT=ue(),cH=be(),Rl=tr();Jr.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let r=e===1?"property":"properties";return(0,uT.str)`must have ${r} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:r}})=>(0,uT._)`{property: ${t},
|
|
175
|
+
`,n)+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 n=yh(e),r=Jo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=yh(e),r=Jo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.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())}}};bD.Parser=Mb});var ED=k(Bc=>{"use strict";var vD=Sb(),VB=Oc(),Fc=Mc(),zB=Ty(),WB=Ne(),HB=xb(),TD=Lb();function _D(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new HB.LineCounter||null,prettyErrors:e}}function GB(t,e={}){let{lineCounter:n,prettyErrors:r}=_D(e),i=new TD.Parser(n?.addNewLine),s=new vD.Composer(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Fc.prettifyError(t,n)),a.warnings.forEach(Fc.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function SD(t,e={}){let{lineCounter:n,prettyErrors:r}=_D(e),i=new TD.Parser(n?.addNewLine),s=new vD.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 Fc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Fc.prettifyError(t,n)),o.warnings.forEach(Fc.prettifyError(t,n))),o}function YB(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=SD(t,n);if(!i)return null;if(i.warnings.forEach(s=>zB.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:r},n))}function KB(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return WB.isDocument(t)&&!r?t.toString(n):new VB.Document(t,r,n).toString(n)}Bc.parse=YB;Bc.parseAllDocuments=GB;Bc.parseDocument=SD;Bc.stringify=KB});var qb=k(Be=>{"use strict";var XB=Sb(),JB=Oc(),QB=nb(),$b=Mc(),ZB=gc(),Ki=Ne(),eU=Wi(),tU=Ct(),nU=Gi(),rU=Yi(),iU=mh(),sU=Ob(),oU=xb(),aU=Lb(),bh=ED(),wD=fc();Be.Composer=XB.Composer;Be.Document=JB.Document;Be.Schema=QB.Schema;Be.YAMLError=$b.YAMLError;Be.YAMLParseError=$b.YAMLParseError;Be.YAMLWarning=$b.YAMLWarning;Be.Alias=ZB.Alias;Be.isAlias=Ki.isAlias;Be.isCollection=Ki.isCollection;Be.isDocument=Ki.isDocument;Be.isMap=Ki.isMap;Be.isNode=Ki.isNode;Be.isPair=Ki.isPair;Be.isScalar=Ki.isScalar;Be.isSeq=Ki.isSeq;Be.Pair=eU.Pair;Be.Scalar=tU.Scalar;Be.YAMLMap=nU.YAMLMap;Be.YAMLSeq=rU.YAMLSeq;Be.CST=iU;Be.Lexer=sU.Lexer;Be.LineCounter=oU.LineCounter;Be.Parser=aU.Parser;Be.parse=bh.parse;Be.parseAllDocuments=bh.parseAllDocuments;Be.parseDocument=bh.parseDocument;Be.stringify=bh.stringify;Be.visit=wD.visit;Be.visitAsync=wD.visitAsync});var CD=k((hie,RD)=>{"use strict";RD.exports=ND;function ND(t,e,n){t instanceof RegExp&&(t=kD(t,n)),e instanceof RegExp&&(e=kD(e,n));var r=PD(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function kD(t,e){var n=e.match(t);return n?n[0]:null}ND.range=PD;function PD(t,e,n){var r,i,s,o,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],s=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[s,o])}return a}});var $D=k((pie,LD)=>{var DD=CD();LD.exports=uU;var AD="\0SLASH"+Math.random()+"\0",OD="\0OPEN"+Math.random()+"\0",Fb="\0CLOSE"+Math.random()+"\0",ID="\0COMMA"+Math.random()+"\0",xD="\0PERIOD"+Math.random()+"\0";function jb(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function cU(t){return t.split("\\\\").join(AD).split("\\{").join(OD).split("\\}").join(Fb).split("\\,").join(ID).split("\\.").join(xD)}function lU(t){return t.split(AD).join("\\").split(OD).join("{").split(Fb).join("}").split(ID).join(",").split(xD).join(".")}function MD(t){if(!t)return[""];var e=[],n=DD("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=MD(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function uU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Uc(cU(t),!0).map(lU)):[]}function dU(t){return"{"+t+"}"}function fU(t){return/^-?0\d/.test(t)}function hU(t,e){return t<=e}function pU(t,e){return t>=e}function Uc(t,e){var n=[],r=DD("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?Uc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Fb+r.post,Uc(t)):[t];var f;if(u)f=r.body.split(/\.\./);else if(f=MD(r.body),f.length===1&&(f=Uc(f[0],!1).map(dU),f.length===1))return s.map(function(We){return r.pre+f[0]+We});var h;if(u){var y=jb(f[0]),p=jb(f[1]),T=Math.max(f[0].length,f[1].length),S=f.length==3?Math.abs(jb(f[2])):1,b=hU,v=p<y;v&&(S*=-1,b=pU);var w=f.some(fU);h=[];for(var C=y;b(C,p);C+=S){var L;if(l)L=String.fromCharCode(C),L==="\\"&&(L="");else if(L=String(C),w){var B=T-L.length;if(B>0){var q=new Array(B+1).join("0");C<0?L="-"+q+L.slice(1):L=q+L}}h.push(L)}}else{h=[];for(var ae=0;ae<f.length;ae++)h.push.apply(h,Uc(f[ae],!1))}for(var ae=0;ae<h.length;ae++)for(var o=0;o<s.length;o++){var a=i+h[ae]+s[o];(!e||u||a)&&n.push(a)}}return n}});var ol=k(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.regexpCode=Ce.getEsmExportName=Ce.getProperty=Ce.safeStringify=Ce.stringify=Ce.strConcat=Ce.addCodeArg=Ce.str=Ce._=Ce.nil=Ce._Code=Ce.Name=Ce.IDENTIFIER=Ce._CodeOrName=void 0;var il=class{};Ce._CodeOrName=il;Ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ls=class extends il{constructor(e){if(super(),!Ce.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}}};Ce.Name=Ls;var er=class extends il{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((n,r)=>`${n}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,r)=>(r instanceof Ls&&(n[r.str]=(n[r.str]||0)+1),n),{})}};Ce._Code=er;Ce.nil=new er("");function wA(t,...e){let n=[t[0]],r=0;for(;r<e.length;)sv(n,e[r]),n.push(t[++r]);return new er(n)}Ce._=wA;var iv=new er("+");function kA(t,...e){let n=[sl(t[0])],r=0;for(;r<e.length;)n.push(iv),sv(n,e[r]),n.push(iv,sl(t[++r]));return SV(n),new er(n)}Ce.str=kA;function sv(t,e){e instanceof er?t.push(...e._items):e instanceof Ls?t.push(e):t.push(kV(e))}Ce.addCodeArg=sv;function SV(t){let e=1;for(;e<t.length-1;){if(t[e]===iv){let n=EV(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function EV(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ls||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 Ls))return`"${t}${e.slice(1)}`}function wV(t,e){return e.emptyStr()?t:t.emptyStr()?e:kA`${t}${e}`}Ce.strConcat=wV;function kV(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:sl(Array.isArray(t)?t.join(","):t)}function NV(t){return new er(sl(t))}Ce.stringify=NV;function sl(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ce.safeStringify=sl;function PV(t){return typeof t=="string"&&Ce.IDENTIFIER.test(t)?new er(`.${t}`):wA`[${t}]`}Ce.getProperty=PV;function RV(t){if(typeof t=="string"&&Ce.IDENTIFIER.test(t))return new er(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ce.getEsmExportName=RV;function CV(t){return new er(t.toString())}Ce.regexpCode=CV});var cv=k(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ValueScope=Dn.ValueScopeName=Dn.Scope=Dn.varKinds=Dn.UsedValueState=void 0;var Cn=ol(),ov=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},qh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(qh||(Dn.UsedValueState=qh={}));Dn.varKinds={const:new Cn.Name("const"),let:new Cn.Name("let"),var:new Cn.Name("var")};var jh=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Cn.Name?e:this.name(e)}name(e){return new Cn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,r;if(!((r=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||r===void 0)&&r.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}}};Dn.Scope=jh;var Fh=class extends Cn.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,Cn._)`.${new Cn.Name(n)}[${r}]`}};Dn.ValueScopeName=Fh;var DV=(0,Cn._)`\n`,av=class extends jh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?DV:Cn.nil}}get(){return this._scope}name(e){return new Fh(e,this._newName(e))}value(e,n){var r;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(r=n.key)!==null&&r!==void 0?r:n.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]=n.ref,i.setValue(n,{property:s,itemIndex:l}),i}getValue(e,n){let r=this._values[e];if(r)return r.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,Cn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,n,r){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},n,r)}_reduceValues(e,n,r={},i){let s=Cn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,qh.Started);let u=n(l);if(u){let d=this.opts.es5?Dn.varKinds.var:Dn.varKinds.const;s=(0,Cn._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,Cn._)`${s}${u}${this.opts._n}`;else throw new ov(l);c.set(l,qh.Completed)})}return s}};Dn.ValueScope=av});var de=k(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.or=pe.and=pe.not=pe.CodeGen=pe.operators=pe.varKinds=pe.ValueScopeName=pe.ValueScope=pe.Scope=pe.Name=pe.regexpCode=pe.stringify=pe.getProperty=pe.nil=pe.strConcat=pe.str=pe._=void 0;var Ee=ol(),wr=cv(),es=ol();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return es._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return es.str}});Object.defineProperty(pe,"strConcat",{enumerable:!0,get:function(){return es.strConcat}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return es.nil}});Object.defineProperty(pe,"getProperty",{enumerable:!0,get:function(){return es.getProperty}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return es.stringify}});Object.defineProperty(pe,"regexpCode",{enumerable:!0,get:function(){return es.regexpCode}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return es.Name}});var zh=cv();Object.defineProperty(pe,"Scope",{enumerable:!0,get:function(){return zh.Scope}});Object.defineProperty(pe,"ValueScope",{enumerable:!0,get:function(){return zh.ValueScope}});Object.defineProperty(pe,"ValueScopeName",{enumerable:!0,get:function(){return zh.ValueScopeName}});Object.defineProperty(pe,"varKinds",{enumerable:!0,get:function(){return zh.varKinds}});pe.operators={GT:new Ee._Code(">"),GTE:new Ee._Code(">="),LT:new Ee._Code("<"),LTE:new Ee._Code("<="),EQ:new Ee._Code("==="),NEQ:new Ee._Code("!=="),NOT:new Ee._Code("!"),OR:new Ee._Code("||"),AND:new Ee._Code("&&"),ADD:new Ee._Code("+")};var mi=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},lv=class extends mi{constructor(e,n,r){super(),this.varKind=e,this.name=n,this.rhs=r}render({es5:e,_n:n}){let r=e?wr.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=ua(this.rhs,e,n)),this}get names(){return this.rhs instanceof Ee._CodeOrName?this.rhs.names:{}}},Bh=class extends mi{constructor(e,n,r){super(),this.lhs=e,this.rhs=n,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof Ee.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ua(this.rhs,e,n),this}get names(){let e=this.lhs instanceof Ee.Name?{}:{...this.lhs.names};return Vh(e,this.rhs)}},uv=class extends Bh{constructor(e,n,r,i){super(e,r,i),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},dv=class extends mi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fv=class extends mi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},hv=class extends mi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},pv=class extends mi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=ua(this.code,e,n),this}get names(){return this.code instanceof Ee._CodeOrName?this.code.names:{}}},al=class extends mi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,r)=>n+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let r=e[n].optimizeNodes();Array.isArray(r)?e.splice(n,1,...r):r?e[n]=r:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:r}=this,i=r.length;for(;i--;){let s=r[i];s.optimizeNames(e,n)||(AV(e,s.names),r.splice(i,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>js(e,n.names),{})}},gi=class extends al{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},mv=class extends al{},la=class extends gi{};la.kind="else";var $s=class t extends gi{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new la(r):r}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(NA(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=ua(this.condition,e,n),this}get names(){let e=super.names;return Vh(e,this.condition),this.else&&js(e,this.else.names),e}};$s.kind="if";var qs=class extends gi{};qs.kind="for";var gv=class extends qs{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=ua(this.iteration,e,n),this}get names(){return js(super.names,this.iteration.names)}},yv=class extends qs{constructor(e,n,r,i){super(),this.varKind=e,this.name=n,this.from=r,this.to=i}render(e){let n=e.es5?wr.varKinds.var:this.varKind,{name:r,from:i,to:s}=this;return`for(${n} ${r}=${i}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Vh(super.names,this.from);return Vh(e,this.to)}},Uh=class extends qs{constructor(e,n,r,i){super(),this.loop=e,this.varKind=n,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=ua(this.iterable,e,n),this}get names(){return js(super.names,this.iterable.names)}},cl=class extends gi{constructor(e,n,r){super(),this.name=e,this.args=n,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};cl.kind="func";var ll=class extends al{render(e){return"return "+super.render(e)}};ll.kind="return";var bv=class extends gi{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var r,i;return super.optimizeNames(e,n),(r=this.catch)===null||r===void 0||r.optimizeNames(e,n),(i=this.finally)===null||i===void 0||i.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&js(e,this.catch.names),this.finally&&js(e,this.finally.names),e}},ul=class extends gi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ul.kind="catch";var dl=class extends gi{render(e){return"finally"+super.render(e)}};dl.kind="finally";var vv=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new wr.Scope({parent:e}),this._nodes=[new mv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let r=this._extScope.value(e,n);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,r,i){let s=this._scope.toName(n);return r!==void 0&&i&&(this._constants[s.str]=r),this._leafNode(new lv(e,s,r)),s}const(e,n,r){return this._def(wr.varKinds.const,e,n,r)}let(e,n,r){return this._def(wr.varKinds.let,e,n,r)}var(e,n,r){return this._def(wr.varKinds.var,e,n,r)}assign(e,n,r){return this._leafNode(new Bh(e,n,r))}add(e,n){return this._leafNode(new uv(e,pe.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Ee.nil&&this._leafNode(new pv(e)),this}object(...e){let n=["{"];for(let[r,i]of e)n.length>1&&n.push(","),n.push(r),(r!==i||this.opts.es5)&&(n.push(":"),(0,Ee.addCodeArg)(n,i));return n.push("}"),new Ee._Code(n)}if(e,n,r){if(this._blockNode(new $s(e)),n&&r)this.code(n).else().code(r).endIf();else if(n)this.code(n).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new $s(e))}else(){return this._elseNode(new la)}endIf(){return this._endBlockNode($s,la)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new gv(e),n)}forRange(e,n,r,i,s=this.opts.es5?wr.varKinds.var:wr.varKinds.let){let o=this._scope.toName(e);return this._for(new yv(s,o,n,r),()=>i(o))}forOf(e,n,r,i=wr.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=n instanceof Ee.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Ee._)`${o}.length`,a=>{this.var(s,(0,Ee._)`${o}[${a}]`),r(s)})}return this._for(new Uh("of",i,s,n),()=>r(s))}forIn(e,n,r,i=this.opts.es5?wr.varKinds.var:wr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ee._)`Object.keys(${n})`,r);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,n),()=>r(s))}endFor(){return this._endBlockNode(qs)}label(e){return this._leafNode(new dv(e))}break(e){return this._leafNode(new fv(e))}return(e){let n=new ll;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ll)}try(e,n,r){if(!n&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new bv;if(this._blockNode(i),this.code(e),n){let s=this.name("e");this._currNode=i.catch=new ul(s),n(s)}return r&&(this._currNode=i.finally=new dl,this.code(r)),this._endBlockNode(ul,dl)}throw(e){return this._leafNode(new hv(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-n;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Ee.nil,r,i){return this._blockNode(new cl(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(cl)}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,n){let r=this._currNode;if(r instanceof e||n&&r instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof $s))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};pe.CodeGen=vv;function js(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Vh(t,e){return e instanceof Ee._CodeOrName?js(t,e.names):t}function ua(t,e,n){if(t instanceof Ee.Name)return r(t);if(!i(t))return t;return new Ee._Code(t._items.reduce((s,o)=>(o instanceof Ee.Name&&(o=r(o)),o instanceof Ee._Code?s.push(...o._items):s.push(o),s),[]));function r(s){let o=n[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ee._Code&&s._items.some(o=>o instanceof Ee.Name&&e[o.str]===1&&n[o.str]!==void 0)}}function AV(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function NA(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ee._)`!${Tv(t)}`}pe.not=NA;var OV=PA(pe.operators.AND);function IV(...t){return t.reduce(OV)}pe.and=IV;var xV=PA(pe.operators.OR);function MV(...t){return t.reduce(xV)}pe.or=MV;function PA(t){return(e,n)=>e===Ee.nil?n:n===Ee.nil?e:(0,Ee._)`${Tv(e)} ${t} ${Tv(n)}`}function Tv(t){return t instanceof Ee.Name?t:(0,Ee._)`(${t})`}});var ve=k(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.checkStrictMode=me.getErrorPath=me.Type=me.useFunc=me.setEvaluated=me.evaluatedPropsToName=me.mergeEvaluated=me.eachItem=me.unescapeJsonPointer=me.escapeJsonPointer=me.escapeFragment=me.unescapeFragment=me.schemaRefOrVal=me.schemaHasRulesButRef=me.schemaHasRules=me.checkUnknownRules=me.alwaysValidSchema=me.toHash=void 0;var Qe=de(),LV=ol();function $V(t){let e={};for(let n of t)e[n]=!0;return e}me.toHash=$V;function qV(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(DA(t,e),!AA(e,t.self.RULES.all))}me.alwaysValidSchema=qV;function DA(t,e=t.schema){let{opts:n,self:r}=t;if(!n.strictSchema||typeof e=="boolean")return;let i=r.RULES.keywords;for(let s in e)i[s]||xA(t,`unknown keyword: "${s}"`)}me.checkUnknownRules=DA;function AA(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}me.schemaHasRules=AA;function jV(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}me.schemaHasRulesButRef=jV;function FV({topSchemaRef:t,schemaPath:e},n,r,i){if(!i){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Qe._)`${n}`}return(0,Qe._)`${t}${e}${(0,Qe.getProperty)(r)}`}me.schemaRefOrVal=FV;function BV(t){return OA(decodeURIComponent(t))}me.unescapeFragment=BV;function UV(t){return encodeURIComponent(Sv(t))}me.escapeFragment=UV;function Sv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}me.escapeJsonPointer=Sv;function OA(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}me.unescapeJsonPointer=OA;function VV(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}me.eachItem=VV;function RA({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:r}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Qe.Name?(s instanceof Qe.Name?t(i,s,o):e(i,s,o),o):s instanceof Qe.Name?(e(i,o,s),s):n(s,o);return a===Qe.Name&&!(c instanceof Qe.Name)?r(i,c):c}}me.mergeEvaluated={props:RA({mergeNames:(t,e,n)=>t.if((0,Qe._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Qe._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Qe._)`${n} || {}`).code((0,Qe._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Qe._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Qe._)`${n} || {}`),Ev(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:IA}),items:RA({mergeNames:(t,e,n)=>t.if((0,Qe._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Qe._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Qe._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Qe._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function IA(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Qe._)`{}`);return e!==void 0&&Ev(t,n,e),n}me.evaluatedPropsToName=IA;function Ev(t,e,n){Object.keys(n).forEach(r=>t.assign((0,Qe._)`${e}${(0,Qe.getProperty)(r)}`,!0))}me.setEvaluated=Ev;var CA={};function zV(t,e){return t.scopeValue("func",{ref:e,code:CA[e.code]||(CA[e.code]=new LV._Code(e.code))})}me.useFunc=zV;var _v;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(_v||(me.Type=_v={}));function WV(t,e,n){if(t instanceof Qe.Name){let r=e===_v.Num;return n?r?(0,Qe._)`"[" + ${t} + "]"`:(0,Qe._)`"['" + ${t} + "']"`:r?(0,Qe._)`"/" + ${t}`:(0,Qe._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Qe.getProperty)(t).toString():"/"+Sv(t)}me.getErrorPath=WV;function xA(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}me.checkStrictMode=xA});var tr=k(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});var sn=de(),HV={data:new sn.Name("data"),valCxt:new sn.Name("valCxt"),instancePath:new sn.Name("instancePath"),parentData:new sn.Name("parentData"),parentDataProperty:new sn.Name("parentDataProperty"),rootData:new sn.Name("rootData"),dynamicAnchors:new sn.Name("dynamicAnchors"),vErrors:new sn.Name("vErrors"),errors:new sn.Name("errors"),this:new sn.Name("this"),self:new sn.Name("self"),scope:new sn.Name("scope"),json:new sn.Name("json"),jsonPos:new sn.Name("jsonPos"),jsonLen:new sn.Name("jsonLen"),jsonPart:new sn.Name("jsonPart")};wv.default=HV});var fl=k(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.extendErrors=on.resetErrorsCount=on.reportExtraError=on.reportError=on.keyword$DataError=on.keywordError=void 0;var Pe=de(),Wh=ve(),pn=tr();on.keywordError={message:({keyword:t})=>(0,Pe.str)`must pass "${t}" keyword validation`};on.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Pe.str)`"${t}" keyword must be ${e} ($data)`:(0,Pe.str)`"${t}" keyword is invalid ($data)`};function GV(t,e=on.keywordError,n,r){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=$A(t,e,n);r??(o||a)?MA(s,c):LA(i,(0,Pe._)`[${c}]`)}on.reportError=GV;function YV(t,e=on.keywordError,n){let{it:r}=t,{gen:i,compositeRule:s,allErrors:o}=r,a=$A(t,e,n);MA(i,a),s||o||LA(r,pn.default.vErrors)}on.reportExtraError=YV;function KV(t,e){t.assign(pn.default.errors,e),t.if((0,Pe._)`${pn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Pe._)`${pn.default.vErrors}.length`,e),()=>t.assign(pn.default.vErrors,null)))}on.resetErrorsCount=KV;function XV({gen:t,keyword:e,schemaValue:n,data:r,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,pn.default.errors,a=>{t.const(o,(0,Pe._)`${pn.default.vErrors}[${a}]`),t.if((0,Pe._)`${o}.instancePath === undefined`,()=>t.assign((0,Pe._)`${o}.instancePath`,(0,Pe.strConcat)(pn.default.instancePath,s.errorPath))),t.assign((0,Pe._)`${o}.schemaPath`,(0,Pe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Pe._)`${o}.schema`,n),t.assign((0,Pe._)`${o}.data`,r))})}on.extendErrors=XV;function MA(t,e){let n=t.const("err",e);t.if((0,Pe._)`${pn.default.vErrors} === null`,()=>t.assign(pn.default.vErrors,(0,Pe._)`[${n}]`),(0,Pe._)`${pn.default.vErrors}.push(${n})`),t.code((0,Pe._)`${pn.default.errors}++`)}function LA(t,e){let{gen:n,validateName:r,schemaEnv:i}=t;i.$async?n.throw((0,Pe._)`new ${t.ValidationError}(${e})`):(n.assign((0,Pe._)`${r}.errors`,e),n.return(!1))}var Fs={keyword:new Pe.Name("keyword"),schemaPath:new Pe.Name("schemaPath"),params:new Pe.Name("params"),propertyName:new Pe.Name("propertyName"),message:new Pe.Name("message"),schema:new Pe.Name("schema"),parentSchema:new Pe.Name("parentSchema")};function $A(t,e,n){let{createErrors:r}=t.it;return r===!1?(0,Pe._)`{}`:JV(t,e,n)}function JV(t,e,n={}){let{gen:r,it:i}=t,s=[QV(i,n),ZV(t,n)];return e2(t,e,s),r.object(...s)}function QV({errorPath:t},{instancePath:e}){let n=e?(0,Pe.str)`${t}${(0,Wh.getErrorPath)(e,Wh.Type.Str)}`:t;return[pn.default.instancePath,(0,Pe.strConcat)(pn.default.instancePath,n)]}function ZV({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:r}){let i=r?e:(0,Pe.str)`${e}/${t}`;return n&&(i=(0,Pe.str)`${i}${(0,Wh.getErrorPath)(n,Wh.Type.Str)}`),[Fs.schemaPath,i]}function e2(t,{params:e,message:n},r){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([Fs.keyword,i],[Fs.params,typeof e=="function"?e(t):e||(0,Pe._)`{}`]),c.messages&&r.push([Fs.message,typeof n=="function"?n(t):n]),c.verbose&&r.push([Fs.schema,o],[Fs.parentSchema,(0,Pe._)`${u}${d}`],[pn.default.data,s]),l&&r.push([Fs.propertyName,l])}});var jA=k(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.boolOrEmptySchema=da.topBoolOrEmptySchema=void 0;var t2=fl(),n2=de(),r2=tr(),i2={message:"boolean schema is false"};function s2(t){let{gen:e,schema:n,validateName:r}=t;n===!1?qA(t,!1):typeof n=="object"&&n.$async===!0?e.return(r2.default.data):(e.assign((0,n2._)`${r}.errors`,null),e.return(!0))}da.topBoolOrEmptySchema=s2;function o2(t,e){let{gen:n,schema:r}=t;r===!1?(n.var(e,!1),qA(t)):n.var(e,!0)}da.boolOrEmptySchema=o2;function qA(t,e){let{gen:n,data:r}=t,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,t2.reportError)(i,i2,void 0,e)}});var kv=k(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.getRules=fa.isJSONType=void 0;var a2=["string","number","integer","boolean","null","object","array"],c2=new Set(a2);function l2(t){return typeof t=="string"&&c2.has(t)}fa.isJSONType=l2;function u2(){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:{}}}fa.getRules=u2});var Nv=k(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.shouldUseRule=ts.shouldUseGroup=ts.schemaHasRulesForType=void 0;function d2({schema:t,self:e},n){let r=e.RULES.types[n];return r&&r!==!0&&FA(t,r)}ts.schemaHasRulesForType=d2;function FA(t,e){return e.rules.some(n=>BA(t,n))}ts.shouldUseGroup=FA;function BA(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(r=>t[r]!==void 0))}ts.shouldUseRule=BA});var hl=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.reportTypeError=an.checkDataTypes=an.checkDataType=an.coerceAndCheckDataType=an.getJSONTypes=an.getSchemaTypes=an.DataType=void 0;var f2=kv(),h2=Nv(),p2=fl(),fe=de(),UA=ve(),ha;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ha||(an.DataType=ha={}));function m2(t){let e=VA(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}an.getSchemaTypes=m2;function VA(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(f2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}an.getJSONTypes=VA;function g2(t,e){let{gen:n,data:r,opts:i}=t,s=y2(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,h2.schemaHasRulesForType)(t,e[0]));if(o){let a=Rv(e,r,i.strictNumbers,ha.Wrong);n.if(a,()=>{s.length?b2(t,e,s):Cv(t)})}return o}an.coerceAndCheckDataType=g2;var zA=new Set(["string","number","integer","boolean","null"]);function y2(t,e){return e?t.filter(n=>zA.has(n)||e==="array"&&n==="array"):[]}function b2(t,e,n){let{gen:r,data:i,opts:s}=t,o=r.let("dataType",(0,fe._)`typeof ${i}`),a=r.let("coerced",(0,fe._)`undefined`);s.coerceTypes==="array"&&r.if((0,fe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>r.assign(i,(0,fe._)`${i}[0]`).assign(o,(0,fe._)`typeof ${i}`).if(Rv(e,i,s.strictNumbers),()=>r.assign(a,i))),r.if((0,fe._)`${a} !== undefined`);for(let l of n)(zA.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);r.else(),Cv(t),r.endIf(),r.if((0,fe._)`${a} !== undefined`,()=>{r.assign(i,a),v2(t,a)});function c(l){switch(l){case"string":r.elseIf((0,fe._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,fe._)`"" + ${i}`).elseIf((0,fe._)`${i} === null`).assign(a,(0,fe._)`""`);return;case"number":r.elseIf((0,fe._)`${o} == "boolean" || ${i} === null
|
|
177
|
+
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,fe._)`+${i}`);return;case"integer":r.elseIf((0,fe._)`${o} === "boolean" || ${i} === null
|
|
178
|
+
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,fe._)`+${i}`);return;case"boolean":r.elseIf((0,fe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,fe._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":r.elseIf((0,fe._)`${i} === "" || ${i} === 0 || ${i} === false`),r.assign(a,null);return;case"array":r.elseIf((0,fe._)`${o} === "string" || ${o} === "number"
|
|
179
|
+
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,fe._)`[${i}]`)}}}function v2({gen:t,parentData:e,parentDataProperty:n},r){t.if((0,fe._)`${e} !== undefined`,()=>t.assign((0,fe._)`${e}[${n}]`,r))}function Pv(t,e,n,r=ha.Correct){let i=r===ha.Correct?fe.operators.EQ:fe.operators.NEQ,s;switch(t){case"null":return(0,fe._)`${e} ${i} null`;case"array":s=(0,fe._)`Array.isArray(${e})`;break;case"object":s=(0,fe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,fe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,fe._)`typeof ${e} ${i} ${t}`}return r===ha.Correct?s:(0,fe.not)(s);function o(a=fe.nil){return(0,fe.and)((0,fe._)`typeof ${e} == "number"`,a,n?(0,fe._)`isFinite(${e})`:fe.nil)}}an.checkDataType=Pv;function Rv(t,e,n,r){if(t.length===1)return Pv(t[0],e,n,r);let i,s=(0,UA.toHash)(t);if(s.array&&s.object){let o=(0,fe._)`typeof ${e} != "object"`;i=s.null?o:(0,fe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=fe.nil;s.number&&delete s.integer;for(let o in s)i=(0,fe.and)(i,Pv(o,e,n,r));return i}an.checkDataTypes=Rv;var T2={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,fe._)`{type: ${t}}`:(0,fe._)`{type: ${e}}`};function Cv(t){let e=_2(t);(0,p2.reportError)(e,T2)}an.reportTypeError=Cv;function _2(t){let{gen:e,data:n,schema:r}=t,i=(0,UA.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:t}}});var HA=k(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.assignDefaults=void 0;var pa=de(),S2=ve();function E2(t,e){let{properties:n,items:r}=t.schema;if(e==="object"&&n)for(let i in n)WA(t,i,n[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,s)=>WA(t,s,i.default))}Hh.assignDefaults=E2;function WA(t,e,n){let{gen:r,compositeRule:i,data:s,opts:o}=t;if(n===void 0)return;let a=(0,pa._)`${s}${(0,pa.getProperty)(e)}`;if(i){(0,S2.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,pa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,pa._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,pa._)`${a} = ${(0,pa.stringify)(n)}`)}});var nr=k(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateUnion=Ke.validateArray=Ke.usePattern=Ke.callValidateCode=Ke.schemaProperties=Ke.allSchemaProperties=Ke.noPropertyInData=Ke.propertyInData=Ke.isOwnProperty=Ke.hasPropFunc=Ke.reportMissingProp=Ke.checkMissingProp=Ke.checkReportMissingProp=void 0;var dt=de(),Dv=ve(),ns=tr(),w2=ve();function k2(t,e){let{gen:n,data:r,it:i}=t;n.if(Ov(n,r,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,dt._)`${e}`},!0),t.error()})}Ke.checkReportMissingProp=k2;function N2({gen:t,data:e,it:{opts:n}},r,i){return(0,dt.or)(...r.map(s=>(0,dt.and)(Ov(t,e,s,n.ownProperties),(0,dt._)`${i} = ${s}`)))}Ke.checkMissingProp=N2;function P2(t,e){t.setParams({missingProperty:e},!0),t.error()}Ke.reportMissingProp=P2;function GA(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,dt._)`Object.prototype.hasOwnProperty`})}Ke.hasPropFunc=GA;function Av(t,e,n){return(0,dt._)`${GA(t)}.call(${e}, ${n})`}Ke.isOwnProperty=Av;function R2(t,e,n,r){let i=(0,dt._)`${e}${(0,dt.getProperty)(n)} !== undefined`;return r?(0,dt._)`${i} && ${Av(t,e,n)}`:i}Ke.propertyInData=R2;function Ov(t,e,n,r){let i=(0,dt._)`${e}${(0,dt.getProperty)(n)} === undefined`;return r?(0,dt.or)(i,(0,dt.not)(Av(t,e,n))):i}Ke.noPropertyInData=Ov;function YA(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ke.allSchemaProperties=YA;function C2(t,e){return YA(e).filter(n=>!(0,Dv.alwaysValidSchema)(t,e[n]))}Ke.schemaProperties=C2;function D2({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,dt._)`${t}, ${e}, ${r}${i}`:e,d=[[ns.default.instancePath,(0,dt.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,dt._)`${u}, ${n.object(...d)}`;return c!==dt.nil?(0,dt._)`${a}.call(${c}, ${f})`:(0,dt._)`${a}(${f})`}Ke.callValidateCode=D2;var A2=(0,dt._)`new RegExp`;function O2({gen:t,it:{opts:e}},n){let r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(n,r);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,dt._)`${i.code==="new RegExp"?A2:(0,w2.useFunc)(t,i)}(${n}, ${r})`})}Ke.usePattern=O2;function I2(t){let{gen:e,data:n,keyword:r,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,dt._)`${n}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:Dv.Type.Num},s),e.if((0,dt.not)(s),a)})}}Ke.validateArray=I2;function x2(t){let{gen:e,schema:n,keyword:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,Dv.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>n.forEach((c,l)=>{let u=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,dt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,dt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ke.validateUnion=x2});var JA=k(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.validateKeywordUsage=Xr.validSchemaType=Xr.funcKeywordCode=Xr.macroKeywordCode=void 0;var mn=de(),Bs=tr(),M2=nr(),L2=fl();function $2(t,e){let{gen:n,keyword:r,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=XA(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=n.name("valid");t.subschema({schema:a,schemaPath:mn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Xr.macroKeywordCode=$2;function q2(t,e){var n;let{gen:r,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;F2(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=XA(r,i,l),d=r.let("valid");t.block$data(d,f),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function f(){if(e.errors===!1)p(),e.modifying&&KA(t),T(()=>t.error());else{let S=e.async?h():y();e.modifying&&KA(t),T(()=>j2(t,S))}}function h(){let S=r.let("ruleErrs",null);return r.try(()=>p((0,mn._)`await `),b=>r.assign(d,!1).if((0,mn._)`${b} instanceof ${c.ValidationError}`,()=>r.assign(S,(0,mn._)`${b}.errors`),()=>r.throw(b))),S}function y(){let S=(0,mn._)`${u}.errors`;return r.assign(S,null),p(mn.nil),S}function p(S=e.async?(0,mn._)`await `:mn.nil){let b=c.opts.passContext?Bs.default.this:Bs.default.self,v=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,mn._)`${S}${(0,M2.callValidateCode)(t,u,b,v)}`,e.modifying)}function T(S){var b;r.if((0,mn.not)((b=e.valid)!==null&&b!==void 0?b:d),S)}}Xr.funcKeywordCode=q2;function KA(t){let{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,mn._)`${r.parentData}[${r.parentDataProperty}]`))}function j2(t,e){let{gen:n}=t;n.if((0,mn._)`Array.isArray(${e})`,()=>{n.assign(Bs.default.vErrors,(0,mn._)`${Bs.default.vErrors} === null ? ${e} : ${Bs.default.vErrors}.concat(${e})`).assign(Bs.default.errors,(0,mn._)`${Bs.default.vErrors}.length`),(0,L2.extendErrors)(t)},()=>t.error())}function F2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function XA(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,mn.stringify)(n)})}function B2(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Xr.validSchemaType=B2;function U2({schema:t,opts:e,self:n,errSchemaPath:r},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 "${r}": `+n.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Xr.validateKeywordUsage=U2});var ZA=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.extendSubschemaMode=rs.extendSubschemaData=rs.getSubschema=void 0;var Jr=de(),QA=ve();function V2(t,{keyword:e,schemaProp:n,schema:r,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return n===void 0?{schema:a,schemaPath:(0,Jr._)`${t.schemaPath}${(0,Jr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[n],schemaPath:(0,Jr._)`${t.schemaPath}${(0,Jr.getProperty)(e)}${(0,Jr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,QA.escapeFragment)(n)}`}}if(r!==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:r,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}rs.getSubschema=V2;function z2(t,e,{dataProp:n,dataPropType:r,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Jr._)`${e.data}${(0,Jr.getProperty)(n)}`,!0);c(f),t.errorPath=(0,Jr.str)`${l}${(0,QA.getErrorPath)(n,r,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Jr._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Jr.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]}}rs.extendSubschemaData=z2;function W2(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:s}){r!==void 0&&(t.compositeRule=r),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=n}rs.extendSubschemaMode=W2});var Iv=k((Pse,eO)=>{"use strict";eO.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}});var nO=k((Rse,tO)=>{"use strict";var is=tO.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};Gh(e,r,i,t,"",t)};is.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};is.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};is.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};is.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 Gh(t,e,n,r,i,s,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,s,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in is.arrayKeywords)for(var f=0;f<d.length;f++)Gh(t,e,n,d[f],i+"/"+u+"/"+f,s,i,u,r,f)}else if(u in is.propsKeywords){if(d&&typeof d=="object")for(var h in d)Gh(t,e,n,d[h],i+"/"+u+"/"+H2(h),s,i,u,r,h)}else(u in is.keywords||t.allKeys&&!(u in is.skipKeywords))&&Gh(t,e,n,d,i+"/"+u,s,i,u,r)}n(r,i,s,o,a,c,l)}}function H2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var pl=k(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.getSchemaRefs=An.resolveUrl=An.normalizeId=An._getFullPath=An.getFullPath=An.inlineRef=void 0;var G2=ve(),Y2=Iv(),K2=nO(),X2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!xv(t):e?rO(t)<=e:!1}An.inlineRef=J2;var Q2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function xv(t){for(let e in t){if(Q2.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(xv)||typeof n=="object"&&xv(n))return!0}return!1}function rO(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!X2.has(n)&&(typeof t[n]=="object"&&(0,G2.eachItem)(t[n],r=>e+=rO(r)),e===1/0))return 1/0}return e}function iO(t,e="",n){n!==!1&&(e=ma(e));let r=t.parse(e);return sO(t,r)}An.getFullPath=iO;function sO(t,e){return t.serialize(e).split("#")[0]+"#"}An._getFullPath=sO;var Z2=/#\/?$/;function ma(t){return t?t.replace(Z2,""):""}An.normalizeId=ma;function ez(t,e,n){return n=ma(n),t.resolve(e,n)}An.resolveUrl=ez;var tz=/^[a-z_][-a-z0-9._]*$/i;function nz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,i=ma(t[n]||e),s={"":i},o=iO(r,i,!1),a={},c=new Set;return K2(t,{allKeys:!0},(d,f,h,y)=>{if(y===void 0)return;let p=o+f,T=s[y];typeof d[n]=="string"&&(T=S.call(this,d[n])),b.call(this,d.$anchor),b.call(this,d.$dynamicAnchor),s[f]=T;function S(v){let w=this.opts.uriResolver.resolve;if(v=ma(T?w(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!==ma(p)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=p),v}function b(v){if(typeof v=="string"){if(!tz.test(v))throw new Error(`invalid anchor "${v}"`);S.call(this,`#${v}`)}}}),a;function l(d,f,h){if(f!==void 0&&!Y2(d,f))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}An.getSchemaRefs=nz});var yl=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.getData=ss.KeywordCxt=ss.validateFunctionCode=void 0;var uO=jA(),oO=hl(),Lv=Nv(),Yh=hl(),rz=HA(),gl=JA(),Mv=ZA(),Q=de(),ie=tr(),iz=pl(),yi=ve(),ml=fl();function sz(t){if(hO(t)&&(pO(t),fO(t))){cz(t);return}dO(t,()=>(0,uO.topBoolOrEmptySchema)(t))}ss.validateFunctionCode=sz;function dO({gen:t,validateName:e,schema:n,schemaEnv:r,opts:i},s){i.code.es5?t.func(e,(0,Q._)`${ie.default.data}, ${ie.default.valCxt}`,r.$async,()=>{t.code((0,Q._)`"use strict"; ${aO(n,i)}`),az(t,i),t.code(s)}):t.func(e,(0,Q._)`${ie.default.data}, ${oz(i)}`,r.$async,()=>t.code(aO(n,i)).code(s))}function oz(t){return(0,Q._)`{${ie.default.instancePath}="", ${ie.default.parentData}, ${ie.default.parentDataProperty}, ${ie.default.rootData}=${ie.default.data}${t.dynamicRef?(0,Q._)`, ${ie.default.dynamicAnchors}={}`:Q.nil}}={}`}function az(t,e){t.if(ie.default.valCxt,()=>{t.var(ie.default.instancePath,(0,Q._)`${ie.default.valCxt}.${ie.default.instancePath}`),t.var(ie.default.parentData,(0,Q._)`${ie.default.valCxt}.${ie.default.parentData}`),t.var(ie.default.parentDataProperty,(0,Q._)`${ie.default.valCxt}.${ie.default.parentDataProperty}`),t.var(ie.default.rootData,(0,Q._)`${ie.default.valCxt}.${ie.default.rootData}`),e.dynamicRef&&t.var(ie.default.dynamicAnchors,(0,Q._)`${ie.default.valCxt}.${ie.default.dynamicAnchors}`)},()=>{t.var(ie.default.instancePath,(0,Q._)`""`),t.var(ie.default.parentData,(0,Q._)`undefined`),t.var(ie.default.parentDataProperty,(0,Q._)`undefined`),t.var(ie.default.rootData,ie.default.data),e.dynamicRef&&t.var(ie.default.dynamicAnchors,(0,Q._)`{}`)})}function cz(t){let{schema:e,opts:n,gen:r}=t;dO(t,()=>{n.$comment&&e.$comment&&gO(t),hz(t),r.let(ie.default.vErrors,null),r.let(ie.default.errors,0),n.unevaluated&&lz(t),mO(t),gz(t)})}function lz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Q._)`${n}.evaluated`),e.if((0,Q._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Q._)`${t.evaluated}.props`,(0,Q._)`undefined`)),e.if((0,Q._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Q._)`${t.evaluated}.items`,(0,Q._)`undefined`))}function aO(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Q._)`/*# sourceURL=${n} */`:Q.nil}function uz(t,e){if(hO(t)&&(pO(t),fO(t))){dz(t,e);return}(0,uO.boolOrEmptySchema)(t,e)}function fO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function hO(t){return typeof t.schema!="boolean"}function dz(t,e){let{schema:n,gen:r,opts:i}=t;i.$comment&&n.$comment&&gO(t),pz(t),mz(t);let s=r.const("_errs",ie.default.errors);mO(t,s),r.var(e,(0,Q._)`${s} === ${ie.default.errors}`)}function pO(t){(0,yi.checkUnknownRules)(t),fz(t)}function mO(t,e){if(t.opts.jtd)return cO(t,[],!1,e);let n=(0,oO.getSchemaTypes)(t.schema),r=(0,oO.coerceAndCheckDataType)(t,n);cO(t,n,!r,e)}function fz(t){let{schema:e,errSchemaPath:n,opts:r,self:i}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,yi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function hz(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,yi.checkStrictMode)(t,"default is ignored in the schema root")}function pz(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,iz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function mz(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function gO({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:i}){let s=n.$comment;if(i.$comment===!0)t.code((0,Q._)`${ie.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,Q.str)`${r}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Q._)`${ie.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function gz(t){let{gen:e,schemaEnv:n,validateName:r,ValidationError:i,opts:s}=t;n.$async?e.if((0,Q._)`${ie.default.errors} === 0`,()=>e.return(ie.default.data),()=>e.throw((0,Q._)`new ${i}(${ie.default.vErrors})`)):(e.assign((0,Q._)`${r}.errors`,ie.default.vErrors),s.unevaluated&&yz(t),e.return((0,Q._)`${ie.default.errors} === 0`))}function yz({gen:t,evaluated:e,props:n,items:r}){n instanceof Q.Name&&t.assign((0,Q._)`${e}.props`,n),r instanceof Q.Name&&t.assign((0,Q._)`${e}.items`,r)}function cO(t,e,n,r){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,yi.schemaHasRulesButRef)(s,u))){i.block(()=>bO(t,"$ref",u.all.$ref.definition));return}c.jtd||bz(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Lv.shouldUseGroup)(s,f)&&(f.type?(i.if((0,Yh.checkDataType)(f.type,o,c.strictNumbers)),lO(t,f),e.length===1&&e[0]===f.type&&n&&(i.else(),(0,Yh.reportTypeError)(t)),i.endIf()):lO(t,f),a||i.if((0,Q._)`${ie.default.errors} === ${r||0}`))}}function lO(t,e){let{gen:n,schema:r,opts:{useDefaults:i}}=t;i&&(0,rz.assignDefaults)(t,e.type),n.block(()=>{for(let s of e.rules)(0,Lv.shouldUseRule)(r,s)&&bO(t,s.keyword,s.definition,e.type)})}function bz(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(vz(t,e),t.opts.allowUnionTypes||Tz(t,e),_z(t,t.dataTypes))}function vz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{yO(t.dataTypes,n)||$v(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Ez(t,e)}}function Tz(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&$v(t,"use allowUnionTypes to allow union type keyword")}function _z(t,e){let n=t.self.RULES.all;for(let r in n){let i=n[r];if(typeof i=="object"&&(0,Lv.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>Sz(e,o))&&$v(t,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function Sz(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function yO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Ez(t,e){let n=[];for(let r of t.dataTypes)yO(e,r)?n.push(r):e.includes("integer")&&r==="number"&&n.push("integer");t.dataTypes=n}function $v(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,yi.checkStrictMode)(t,e,t.opts.strictTypes)}var Kh=class{constructor(e,n,r){if((0,gl.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yi.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",vO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,gl.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",ie.default.errors))}result(e,n,r){this.failResult((0,Q.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Q.not)(e),void 0,n)}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:n}=this;this.fail((0,Q._)`${n} !== undefined && (${(0,Q.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?ml.reportExtraError:ml.reportError)(this,this.def.error,n)}$dataError(){(0,ml.reportError)(this,this.def.$dataError||ml.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ml.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=Q.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=Q.nil,n=Q.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:s,def:o}=this;r.if((0,Q.or)((0,Q._)`${i} === undefined`,n)),e!==Q.nil&&r.assign(e,!0),(s.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Q.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:r,def:i,it:s}=this;return(0,Q.or)(o(),a());function o(){if(r.length){if(!(n instanceof Q.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,Q._)`${(0,Yh.checkDataTypes)(c,n,s.opts.strictNumbers,Yh.DataType.Wrong)}`}return Q.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Q._)`!${c}(${n})`}return Q.nil}}subschema(e,n){let r=(0,Mv.getSubschema)(this.it,e);(0,Mv.extendSubschemaData)(r,this.it,e),(0,Mv.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return uz(i,n),i}mergeEvaluated(e,n){let{it:r,gen:i}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=yi.mergeEvaluated.props(i,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=yi.mergeEvaluated.items(i,e.items,r.items,n)))}mergeValidEvaluated(e,n){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(n,()=>this.mergeEvaluated(e,Q.Name)),!0}};ss.KeywordCxt=Kh;function bO(t,e,n,r){let i=new Kh(t,n,e);"code"in n?n.code(i,r):i.$data&&n.validate?(0,gl.funcKeywordCode)(i,n):"macro"in n?(0,gl.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,gl.funcKeywordCode)(i,n)}var wz=/^\/(?:[^~]|~0|~1)*$/,kz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vO(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let i,s;if(t==="")return ie.default.rootData;if(t[0]==="/"){if(!wz.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=ie.default.rootData}else{let l=kz.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 r[e-u]}if(u>e)throw new Error(c("data",u));if(s=n[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,Q._)`${s}${(0,Q.getProperty)((0,yi.unescapeJsonPointer)(l))}`,o=(0,Q._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ss.getData=vO});var Xh=k(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var qv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};jv.default=qv});var bl=k(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var Fv=pl(),Bv=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,Fv.resolveUrl)(e,n,r),this.missingSchema=(0,Fv.normalizeId)((0,Fv.getFullPath)(e,this.missingRef))}};Uv.default=Bv});var vl=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.resolveSchema=rr.getCompilingSchema=rr.resolveRef=rr.compileSchema=rr.SchemaEnv=void 0;var kr=de(),Nz=Xh(),Us=tr(),Nr=pl(),TO=ve(),Pz=yl(),ga=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Nr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};rr.SchemaEnv=ga;function zv(t){let e=_O.call(this,t);if(e)return e;let n=(0,Nr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new kr.CodeGen(this.scope,{es5:r,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:Nz.default,code:(0,kr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Us.default.data,parentData:Us.default.parentData,parentDataProperty:Us.default.parentDataProperty,dataNames:[Us.default.data],dataPathArr:[kr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,kr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:kr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,kr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Pz.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Us.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Us.default.self}`,`${Us.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:p}=l;h.evaluated={props:y instanceof kr.Name?void 0:y,items:p instanceof kr.Name?void 0:p,dynamicProps:y instanceof kr.Name,dynamicItems:p instanceof kr.Name},h.source&&(h.source.evaluated=(0,kr.stringify)(h.evaluated))}return t.validate=h,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)}}rr.compileSchema=zv;function Rz(t,e,n){var r;n=(0,Nr.resolveUrl)(this.opts.uriResolver,e,n);let i=t.refs[n];if(i)return i;let s=Az.call(this,t,n);if(s===void 0){let o=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(s=new ga({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[n]=Cz.call(this,s)}rr.resolveRef=Rz;function Cz(t){return(0,Nr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:zv.call(this,t)}function _O(t){for(let e of this._compilations)if(Dz(e,t))return e}rr.getCompilingSchema=_O;function Dz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Az(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||Jh.call(this,t,e)}function Jh(t,e){let n=this.opts.uriResolver.parse(e),r=(0,Nr._getFullPath)(this.opts.uriResolver,n),i=(0,Nr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===i)return Vv.call(this,n,t);let s=(0,Nr.normalizeId)(r),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Jh.call(this,t,o);return typeof a?.schema!="object"?void 0:Vv.call(this,n,a)}if(typeof o?.schema=="object"){if(o.validate||zv.call(this,o),s===(0,Nr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Nr.resolveUrl)(this.opts.uriResolver,i,l)),new ga({schema:a,schemaId:c,root:t,baseId:i})}return Vv.call(this,n,o)}}rr.resolveSchema=Jh;var Oz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Vv(t,{baseId:e,schema:n,root:r}){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 n=="boolean")return;let c=n[(0,TO.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!Oz.has(a)&&l&&(e=(0,Nr.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,TO.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Nr.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=Jh.call(this,r,a)}let{schemaId:o}=this.opts;if(s=s||new ga({schema:n,schemaId:o,root:r,baseId:e}),s.schema!==s.root.schema)return s}});var SO=k((xse,Iz)=>{Iz.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 wO=k((Mse,EO)=>{"use strict";var xz={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};EO.exports={HEX:xz}});var OO=k((Lse,AO)=>{"use strict";var{HEX:Mz}=wO(),Lz=/^(?:(?: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 RO(t){if(DO(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(Lz)||[],[n]=e;return n?{host:qz(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function Wv(t,e=!1){let n="",r=!0;for(let i of t){if(Mz[i]===void 0)return;i!=="0"&&r===!0&&(r=!1),r||(n+=i)}return e&&n.length===0&&(n="0"),n}function $z(t){let e=0,n={error:!1,address:"",zone:""},r=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=Wv(i);if(l!==void 0)r.push(l);else return n.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++,r.push(":"),e>7){n.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?n.zone=i.join(""):a?r.push(i.join("")):r.push(Wv(i))),n.address=r.join(""),n}function CO(t){if(DO(t,":")<2)return{host:t,isIPV6:!1};let e=$z(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,r=e.address;return e.zone&&(n+="%"+e.zone,r+="%25"+e.zone),{host:n,escapedHost:r,isIPV6:!0}}}function qz(t,e){let n="",r=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&r?(s+1<=i&&t[s+1]===e||s+1===i)&&(n+=o,r=!1):(o===e?r=!0:r=!1,n+=o)}return n}function DO(t,e){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}var kO=/^\.\.?\//u,NO=/^\/\.(?:\/|$)/u,PO=/^\/\.\.(?:\/|$)/u,jz=/^\/?(?:.|\n)*?(?=\/|$)/u;function Fz(t){let e=[];for(;t.length;)if(t.match(kO))t=t.replace(kO,"");else if(t.match(NO))t=t.replace(NO,"/");else if(t.match(PO))t=t.replace(PO,"/"),e.pop();else if(t==="."||t==="..")t="";else{let n=t.match(jz);if(n){let r=n[0];t=t.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function Bz(t,e){let n=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=n(t.scheme)),t.userinfo!==void 0&&(t.userinfo=n(t.userinfo)),t.host!==void 0&&(t.host=n(t.host)),t.path!==void 0&&(t.path=n(t.path)),t.query!==void 0&&(t.query=n(t.query)),t.fragment!==void 0&&(t.fragment=n(t.fragment)),t}function Uz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host),r=RO(n);if(r.isIPV4)n=r.host;else{let i=CO(r.host);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=t.host}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}AO.exports={recomposeAuthority:Uz,normalizeComponentEncoding:Bz,removeDotSegments:Fz,normalizeIPv4:RO,normalizeIPv6:CO,stringArrayToHexStripped:Wv}});var qO=k(($se,$O)=>{"use strict";var Vz=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,zz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function IO(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function xO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function MO(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 Wz(t){return t.secure=IO(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Hz(t){if((t.port===(IO(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,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function Gz(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(zz);if(n){let r=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let i=`${r}:${e.nid||t.nid}`,s=Hv[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Yz(t,e){let n=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),i=`${n}:${e.nid||r}`,s=Hv[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function Kz(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!Vz.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function Xz(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var LO={scheme:"http",domainHost:!0,parse:xO,serialize:MO},Jz={scheme:"https",domainHost:LO.domainHost,parse:xO,serialize:MO},Qh={scheme:"ws",domainHost:!0,parse:Wz,serialize:Hz},Qz={scheme:"wss",domainHost:Qh.domainHost,parse:Qh.parse,serialize:Qh.serialize},Zz={scheme:"urn",parse:Gz,serialize:Yz,skipNormalize:!0},eW={scheme:"urn:uuid",parse:Kz,serialize:Xz,skipNormalize:!0},Hv={http:LO,https:Jz,ws:Qh,wss:Qz,urn:Zz,"urn:uuid":eW};$O.exports=Hv});var FO=k((qse,ep)=>{"use strict";var{normalizeIPv6:tW,normalizeIPv4:nW,removeDotSegments:Tl,recomposeAuthority:rW,normalizeComponentEncoding:Zh}=OO(),Gv=qO();function iW(t,e){return typeof t=="string"?t=Qr(bi(t,e),e):typeof t=="object"&&(t=bi(Qr(t,e),e)),t}function sW(t,e,n){let r=Object.assign({scheme:"null"},n),i=jO(bi(t,r),bi(e,r),r,!0);return Qr(i,{...r,skipEscape:!0})}function jO(t,e,n,r){let i={};return r||(t=bi(Qr(t,n),n),e=bi(Qr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Tl(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=Tl(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=Tl(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=Tl(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 oW(t,e,n){return typeof t=="string"?(t=unescape(t),t=Qr(Zh(bi(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=Qr(Zh(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Qr(Zh(bi(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=Qr(Zh(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Qr(t,e){let n={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:""},r=Object.assign({},e),i=[],s=Gv[(r.scheme||n.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&i.push(n.scheme,":");let o=rW(n);if(o!==void 0&&(r.reference!=="suffix"&&i.push("//"),i.push(o),n.path&&n.path.charAt(0)!=="/"&&i.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!s||!s.absolutePath)&&(a=Tl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return n.query!==void 0&&i.push("?",n.query),n.fragment!==void 0&&i.push("#",n.fragment),i.join("")}var aW=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function cW(t){let e=0;for(let n=0,r=t.length;n<r;++n)if(e=t.charCodeAt(n),e>126||aW[e])return!0;return!1}var lW=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function bi(t,e){let n=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let o=t.match(lW);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=nW(r.host);if(c.isIPV4===!1){let l=tW(c.host);r.host=l.host.toLowerCase(),s=l.isIPV6}else r.host=c.host,s=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");let a=Gv[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&s===!1&&cW(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),i&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}var Yv={SCHEMES:Gv,normalize:iW,resolve:sW,resolveComponents:jO,equal:oW,serialize:Qr,parse:bi};ep.exports=Yv;ep.exports.default=Yv;ep.exports.fastUri=Yv});var UO=k(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var BO=FO();BO.code='require("ajv/dist/runtime/uri").default';Kv.default=BO});var XO=k(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CodeGen=Yt.Name=Yt.nil=Yt.stringify=Yt.str=Yt._=Yt.KeywordCxt=void 0;var uW=yl();Object.defineProperty(Yt,"KeywordCxt",{enumerable:!0,get:function(){return uW.KeywordCxt}});var ya=de();Object.defineProperty(Yt,"_",{enumerable:!0,get:function(){return ya._}});Object.defineProperty(Yt,"str",{enumerable:!0,get:function(){return ya.str}});Object.defineProperty(Yt,"stringify",{enumerable:!0,get:function(){return ya.stringify}});Object.defineProperty(Yt,"nil",{enumerable:!0,get:function(){return ya.nil}});Object.defineProperty(Yt,"Name",{enumerable:!0,get:function(){return ya.Name}});Object.defineProperty(Yt,"CodeGen",{enumerable:!0,get:function(){return ya.CodeGen}});var dW=Xh(),GO=bl(),fW=kv(),_l=vl(),hW=de(),Sl=pl(),tp=hl(),Jv=ve(),VO=SO(),pW=UO(),YO=(t,e)=>new RegExp(t,e);YO.code="new RegExp";var mW=["removeAdditional","useDefaults","coerceTypes"],gW=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),yW={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."},bW={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},zO=200;function vW(t){var e,n,r,i,s,o,a,c,l,u,d,f,h,y,p,T,S,b,v,w,C,L,B,q,ae;let We=t.strict,Dt=(e=t.code)===null||e===void 0?void 0:e.optimize,ge=Dt===!0||Dt===void 0?1:Dt||0,Un=(r=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:YO,vi=(i=t.uriResolver)!==null&&i!==void 0?i:pW.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:We)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:We)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:We)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:We)!==null&&f!==void 0?f:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:We)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:ge,regExp:Un}:{optimize:ge,regExp:Un},loopRequired:(p=t.loopRequired)!==null&&p!==void 0?p:zO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:zO,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(v=t.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(w=t.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(L=t.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(B=t.validateFormats)!==null&&B!==void 0?B:!0,unicodeRegExp:(q=t.unicodeRegExp)!==null&&q!==void 0?q:!0,int32range:(ae=t.int32range)!==null&&ae!==void 0?ae:!0,uriResolver:vi}}var El=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...vW(e)};let{es5:n,lines:r}=this.opts.code;this.scope=new hW.ValueScope({scope:{},prefixes:gW,es5:n,lines:r}),this.logger=kW(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,fW.getRules)(),WO.call(this,yW,e,"NOT SUPPORTED"),WO.call(this,bW,e,"DEPRECATED","warn"),this._metaOpts=EW.call(this),e.formats&&_W.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&SW.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),TW.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:r}=this.opts,i=VO;r==="id"&&(i={...VO},i.id=i.$id,delete i.$id),n&&e&&this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(n);return"$async"in r||(this.errors=r.errors),i}compile(e,n){let r=this._addSchema(e,n);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,n);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 GO.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,n)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,n,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,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 n=(0,Sl.normalizeId)(n||s),this._checkUnique(n),this.schemas[n]=this._addSchema(e,r,n,i,!0),this}addMetaSchema(e,n,r=this.opts.validateSchema){return this.addSchema(e,n,!0,r),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&n){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 n;for(;typeof(n=HO.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:r}=this.opts,i=new _l.SchemaEnv({schema:{},schemaId:r});if(n=_l.resolveSchema.call(this,i,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}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 n=HO.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let r=e[this.opts.schemaId];return r&&(r=(0,Sl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let r;if(typeof e=="string")r=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=r);else if(typeof e=="object"&&n===void 0){if(n=e,r=n.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(PW.call(this,r,n),!n)return(0,Jv.eachItem)(r,s=>Xv.call(this,s)),this;CW.call(this,n);let i={...n,type:(0,tp.getJSONTypes)(n.type),schemaType:(0,tp.getJSONTypes)(n.schemaType)};return(0,Jv.eachItem)(r,i.type.length===0?s=>Xv.call(this,s,i):s=>i.type.forEach(o=>Xv.call(this,s,i,o))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let r of n.rules){let i=r.rules.findIndex(s=>s.keyword===e);i>=0&&r.rules.splice(i,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${r}${i.instancePath} ${i.message}`).reduce((i,s)=>i+n+s)}$dataMetaSchema(e,n){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of n){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=KO(u))}}return e}_removeAllSchemas(e,n){for(let r in e){let i=e[r];(!n||n.test(r))&&(typeof i=="string"?delete e[r]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[r]))}}_addSchema(e,n,r,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;r=(0,Sl.normalizeId)(o||r);let l=Sl.getSchemaRefs.call(this,e,r);return c=new _l.SchemaEnv({schema:e,schemaId:a,meta:n,baseId:r,localRefs:l}),this._cache.set(c.schema,c),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=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):_l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{_l.compileSchema.call(this,e)}finally{this.opts=n}}};El.ValidationError=dW.default;El.MissingRefError=GO.default;Yt.default=El;function WO(t,e,n,r="error"){for(let i in t){let s=i;s in e&&this.logger[r](`${n}: option ${i}. ${t[s]}`)}}function HO(t){return t=(0,Sl.normalizeId)(t),this.schemas[t]||this.refs[t]}function TW(){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 _W(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function SW(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 n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function EW(){let t={...this.opts};for(let e of mW)delete t[e];return t}var wW={log(){},warn(){},error(){}};function kW(t){if(t===!1)return wW;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 NW=/^[a-z_$][a-z0-9_$:-]*$/i;function PW(t,e){let{RULES:n}=this;if((0,Jv.eachItem)(t,r=>{if(n.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!NW.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Xv(t,e,n){var r;let i=e?.post;if(n&&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===n);if(o||(o={type:n,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,tp.getJSONTypes)(e.type),schemaType:(0,tp.getJSONTypes)(e.schemaType)}};e.before?RW.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function RW(t,e,n){let r=t.rules.findIndex(i=>i.keyword===n);r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function CW(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=KO(e)),t.validateSchema=this.compile(e,!0))}var DW={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function KO(t){return{anyOf:[t,DW]}}});var JO=k(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var AW={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Qv.default=AW});var ip=k(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.callRef=Vs.getValidate=void 0;var OW=bl(),QO=nr(),On=de(),ba=tr(),ZO=vl(),np=ve(),IW={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:r}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=r,{root:l}=s;if((n==="#"||n==="#/")&&i===l.baseId)return d();let u=ZO.resolveRef.call(c,l,i,n);if(u===void 0)throw new OW.default(r.opts.uriResolver,i,n);if(u instanceof ZO.SchemaEnv)return f(u);return h(u);function d(){if(s===l)return rp(t,o,s,s.$async);let y=e.scopeValue("root",{ref:l});return rp(t,(0,On._)`${y}.validate`,l,l.$async)}function f(y){let p=eI(t,y);rp(t,p,y,y.$async)}function h(y){let p=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,On.stringify)(y)}:{ref:y}),T=e.name("valid"),S=t.subschema({schema:y,dataTypes:[],schemaPath:On.nil,topSchemaRef:p,errSchemaPath:n},T);t.mergeEvaluated(S),t.ok(T)}}};function eI(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,On._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Vs.getValidate=eI;function rp(t,e,n,r){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?ba.default.this:On.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{i.code((0,On._)`await ${(0,QO.callValidateCode)(t,e,l)}`),h(e),o||i.assign(y,!0)},p=>{i.if((0,On._)`!(${p} instanceof ${s.ValidationError})`,()=>i.throw(p)),f(p),o||i.assign(y,!1)}),t.ok(y)}function d(){t.result((0,QO.callValidateCode)(t,e,l),()=>h(e),()=>f(e))}function f(y){let p=(0,On._)`${y}.errors`;i.assign(ba.default.vErrors,(0,On._)`${ba.default.vErrors} === null ? ${p} : ${ba.default.vErrors}.concat(${p})`),i.assign(ba.default.errors,(0,On._)`${ba.default.vErrors}.length`)}function h(y){var p;if(!s.opts.unevaluated)return;let T=(p=n?.validate)===null||p===void 0?void 0:p.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=np.mergeEvaluated.props(i,T.props,s.props));else{let S=i.var("props",(0,On._)`${y}.evaluated.props`);s.props=np.mergeEvaluated.props(i,S,s.props,On.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=np.mergeEvaluated.items(i,T.items,s.items));else{let S=i.var("items",(0,On._)`${y}.evaluated.items`);s.items=np.mergeEvaluated.items(i,S,s.items,On.Name)}}}Vs.callRef=rp;Vs.default=IW});var tI=k(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var xW=JO(),MW=ip(),LW=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xW.default,MW.default];Zv.default=LW});var nI=k(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});var sp=de(),os=sp.operators,op={maximum:{okStr:"<=",ok:os.LTE,fail:os.GT},minimum:{okStr:">=",ok:os.GTE,fail:os.LT},exclusiveMaximum:{okStr:"<",ok:os.LT,fail:os.GTE},exclusiveMinimum:{okStr:">",ok:os.GT,fail:os.LTE}},$W={message:({keyword:t,schemaCode:e})=>(0,sp.str)`must be ${op[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,sp._)`{comparison: ${op[t].okStr}, limit: ${e}}`},qW={keyword:Object.keys(op),type:"number",schemaType:"number",$data:!0,error:$W,code(t){let{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,sp._)`${n} ${op[e].fail} ${r} || isNaN(${n})`)}};eT.default=qW});var rI=k(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var wl=de(),jW={message:({schemaCode:t})=>(0,wl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,wl._)`{multipleOf: ${t}}`},FW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:jW,code(t){let{gen:e,data:n,schemaCode:r,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,wl._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,wl._)`${o} !== parseInt(${o})`;t.fail$data((0,wl._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};tT.default=FW});var sI=k(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});function iI(t){let e=t.length,n=0,r=0,i;for(;r<e;)n++,i=t.charCodeAt(r++),i>=55296&&i<=56319&&r<e&&(i=t.charCodeAt(r),(i&64512)===56320&&r++);return n}nT.default=iI;iI.code='require("ajv/dist/runtime/ucs2length").default'});var oI=k(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var zs=de(),BW=ve(),UW=sI(),VW={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,zs.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,zs._)`{limit: ${t}}`},zW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:VW,code(t){let{keyword:e,data:n,schemaCode:r,it:i}=t,s=e==="maxLength"?zs.operators.GT:zs.operators.LT,o=i.opts.unicode===!1?(0,zs._)`${n}.length`:(0,zs._)`${(0,BW.useFunc)(t.gen,UW.default)}(${n})`;t.fail$data((0,zs._)`${o} ${s} ${r}`)}};rT.default=zW});var aI=k(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var WW=nr(),ap=de(),HW={message:({schemaCode:t})=>(0,ap.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ap._)`{pattern: ${t}}`},GW={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:HW,code(t){let{data:e,$data:n,schema:r,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=n?(0,ap._)`(new RegExp(${i}, ${o}))`:(0,WW.usePattern)(t,r);t.fail$data((0,ap._)`!${a}.test(${e})`)}};iT.default=GW});var cI=k(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var kl=de(),YW={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,kl.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,kl._)`{limit: ${t}}`},KW={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:YW,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxProperties"?kl.operators.GT:kl.operators.LT;t.fail$data((0,kl._)`Object.keys(${n}).length ${i} ${r}`)}};sT.default=KW});var lI=k(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var Nl=nr(),Pl=de(),XW=ve(),JW={message:({params:{missingProperty:t}})=>(0,Pl.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Pl._)`{missingProperty: ${t}}`},QW={keyword:"required",type:"object",schemaType:"array",$data:!0,error:JW,code(t){let{gen:e,schema:n,schemaCode:r,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&n.length===0)return;let c=n.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let p of n)if(h?.[p]===void 0&&!y.has(p)){let T=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${p}" is not defined at "${T}" (strictRequired)`;(0,XW.checkStrictMode)(o,S,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(Pl.nil,d);else for(let h of n)(0,Nl.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(c||s){let y=e.let("valid",!0);t.block$data(y,()=>f(h,y)),t.ok(y)}else e.if((0,Nl.checkMissingProp)(t,n,h)),(0,Nl.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,Nl.noPropertyInData)(e,i,h,a.ownProperties),()=>t.error())})}function f(h,y){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(y,(0,Nl.propertyInData)(e,i,h,a.ownProperties)),e.if((0,Pl.not)(y),()=>{t.error(),e.break()})},Pl.nil)}}};oT.default=QW});var uI=k(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var Rl=de(),ZW={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Rl.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Rl._)`{limit: ${t}}`},eH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ZW,code(t){let{keyword:e,data:n,schemaCode:r}=t,i=e==="maxItems"?Rl.operators.GT:Rl.operators.LT;t.fail$data((0,Rl._)`${n}.length ${i} ${r}`)}};aT.default=eH});var cp=k(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var dI=Iv();dI.code='require("ajv/dist/runtime/equal").default';cT.default=dI});var fI=k(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var lT=hl(),Kt=de(),tH=ve(),nH=cp(),rH={message:({params:{i:t,j:e}})=>(0,Kt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Kt._)`{i: ${t}, j: ${e}}`},iH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:rH,code(t){let{gen:e,data:n,$data:r,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!r&&!i)return;let c=e.let("valid"),l=s.items?(0,lT.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,Kt._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,Kt._)`${n}.length`),p=e.let("j");t.setParams({i:y,j:p}),e.assign(c,!0),e.if((0,Kt._)`${y} > 1`,()=>(d()?f:h)(y,p))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,p){let T=e.name("item"),S=(0,lT.checkDataTypes)(l,T,a.opts.strictNumbers,lT.DataType.Wrong),b=e.const("indices",(0,Kt._)`{}`);e.for((0,Kt._)`;${y}--;`,()=>{e.let(T,(0,Kt._)`${n}[${y}]`),e.if(S,(0,Kt._)`continue`),l.length>1&&e.if((0,Kt._)`typeof ${T} == "string"`,(0,Kt._)`${T} += "_"`),e.if((0,Kt._)`typeof ${b}[${T}] == "number"`,()=>{e.assign(p,(0,Kt._)`${b}[${T}]`),t.error(),e.assign(c,!1).break()}).code((0,Kt._)`${b}[${T}] = ${y}`)})}function h(y,p){let T=(0,tH.useFunc)(e,nH.default),S=e.name("outer");e.label(S).for((0,Kt._)`;${y}--;`,()=>e.for((0,Kt._)`${p} = ${y}; ${p}--;`,()=>e.if((0,Kt._)`${T}(${n}[${y}], ${n}[${p}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};uT.default=iH});var hI=k(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var dT=de(),sH=ve(),oH=cp(),aH={message:"must be equal to constant",params:({schemaCode:t})=>(0,dT._)`{allowedValue: ${t}}`},cH={keyword:"const",$data:!0,error:aH,code(t){let{gen:e,data:n,$data:r,schemaCode:i,schema:s}=t;r||s&&typeof s=="object"?t.fail$data((0,dT._)`!${(0,sH.useFunc)(e,oH.default)}(${n}, ${i})`):t.fail((0,dT._)`${s} !== ${n}`)}};fT.default=cH});var pI=k(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});var Cl=de(),lH=ve(),uH=cp(),dH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Cl._)`{allowedValues: ${t}}`},fH={keyword:"enum",schemaType:"array",$data:!0,error:dH,code(t){let{gen:e,data:n,$data:r,schema:i,schemaCode:s,it:o}=t;if(!r&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,lH.useFunc)(e,uH.default)),u;if(a||r)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=e.const("vSchema",s);u=(0,Cl.or)(...i.map((y,p)=>f(h,p)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,h=>e.if((0,Cl._)`${l()}(${n}, ${h})`,()=>e.assign(u,!0).break()))}function f(h,y){let p=i[y];return typeof p=="object"&&p!==null?(0,Cl._)`${l()}(${n}, ${h}[${y}])`:(0,Cl._)`${n} === ${p}`}}};hT.default=fH});var mI=k(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var hH=nI(),pH=rI(),mH=oI(),gH=aI(),yH=cI(),bH=lI(),vH=uI(),TH=fI(),_H=hI(),SH=pI(),EH=[hH.default,pH.default,mH.default,gH.default,yH.default,bH.default,vH.default,TH.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_H.default,SH.default];pT.default=EH});var gT=k(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.validateAdditionalItems=void 0;var Ws=de(),mT=ve(),wH={message:({params:{len:t}})=>(0,Ws.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ws._)`{limit: ${t}}`},kH={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:wH,code(t){let{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,mT.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}gI(t,r)}};function gI(t,e){let{gen:n,schema:r,data:i,keyword:s,it:o}=t;o.items=!0;let a=n.const("len",(0,Ws._)`${i}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,Ws._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,mT.alwaysValidSchema)(o,r)){let l=n.var("valid",(0,Ws._)`${a} <= ${e.length}`);n.if((0,Ws.not)(l),()=>c(l)),t.ok(l)}function c(l){n.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:mT.Type.Num},l),o.allErrors||n.if((0,Ws.not)(l),()=>n.break())})}}Dl.validateAdditionalItems=gI;Dl.default=kH});var yT=k(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.validateTuple=void 0;var yI=de(),lp=ve(),NH=nr(),PH={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return bI(t,"additionalItems",e);n.items=!0,!(0,lp.alwaysValidSchema)(n,e)&&t.ok((0,NH.validateArray)(t))}};function bI(t,e,n=t.schema){let{gen:r,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=lp.mergeEvaluated.items(r,n.length,a.items));let c=r.name("valid"),l=r.const("len",(0,yI._)`${s}.length`);n.forEach((d,f)=>{(0,lp.alwaysValidSchema)(a,d)||(r.if((0,yI._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:h}=a,y=n.length,p=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!p){let T=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,lp.checkStrictMode)(a,T,f.strictTuples)}}}Al.validateTuple=bI;Al.default=PH});var vI=k(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});var RH=yT(),CH={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,RH.validateTuple)(t,"items")};bT.default=CH});var _I=k(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});var TI=de(),DH=ve(),AH=nr(),OH=gT(),IH={message:({params:{len:t}})=>(0,TI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,TI._)`{limit: ${t}}`},xH={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:IH,code(t){let{schema:e,parentSchema:n,it:r}=t,{prefixItems:i}=n;r.items=!0,!(0,DH.alwaysValidSchema)(r,e)&&(i?(0,OH.validateAdditionalItems)(t,i):t.ok((0,AH.validateArray)(t)))}};vT.default=xH});var SI=k(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});var ir=de(),up=ve(),MH={message:({params:{min:t,max:e}})=>e===void 0?(0,ir.str)`must contain at least ${t} valid item(s)`:(0,ir.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ir._)`{minContains: ${t}}`:(0,ir._)`{minContains: ${t}, maxContains: ${e}}`},LH={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:MH,code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=r;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,ir._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,up.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,up.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,up.alwaysValidSchema)(s,n)){let p=(0,ir._)`${u} >= ${o}`;a!==void 0&&(p=(0,ir._)`${p} && ${u} <= ${a}`),t.pass(p);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,ir._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let p=e.name("_valid"),T=e.let("count",0);h(p,()=>e.if(p,()=>y(T)))}function h(p,T){e.forRange("i",0,u,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:up.Type.Num,compositeRule:!0},p),T()})}function y(p){e.code((0,ir._)`${p}++`),a===void 0?e.if((0,ir._)`${p} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,ir._)`${p} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,ir._)`${p} >= ${o}`,()=>e.assign(d,!0)))}}};TT.default=LH});var dp=k(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateSchemaDeps=Zr.validatePropertyDeps=Zr.error=void 0;var _T=de(),$H=ve(),Ol=nr();Zr.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let r=e===1?"property":"properties";return(0,_T.str)`must have ${r} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:r}})=>(0,_T._)`{property: ${t},
|
|
180
180
|
missingProperty: ${r},
|
|
181
181
|
depsCount: ${e},
|
|
182
|
-
deps: ${n}}`};var lH={keyword:"dependencies",type:"object",schemaType:"object",error:Jr.error,code(t){let[e,n]=uH(t);oI(t,e),aI(t,n)}};function uH({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let s=Array.isArray(t[r])?e:n;s[r]=t[r]}return[e,n]}function oI(t,e=t.schema){let{gen:n,data:r,it:s}=t;if(Object.keys(e).length===0)return;let i=n.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Rl.propertyInData)(n,r,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?n.if(c,()=>{for(let l of a)(0,Rl.checkReportMissingProp)(t,l)}):(n.if((0,uT._)`${c} && (${(0,Rl.checkMissingProp)(t,a,i)})`),(0,Rl.reportMissingProp)(t,i),n.else())}}Jr.validatePropertyDeps=oI;function aI(t,e=t.schema){let{gen:n,data:r,keyword:s,it:i}=t,o=n.name("valid");for(let a in e)(0,cH.alwaysValidSchema)(i,e[a])||(n.if((0,Rl.propertyInData)(n,r,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>n.var(o,!0)),t.ok(o))}Jr.validateSchemaDeps=aI;Jr.default=lH});var lI=w(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});var cI=ue(),dH=be(),fH={message:"property name must be valid",params:({params:t})=>(0,cI._)`{propertyName: ${t.propertyName}}`},hH={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:fH,code(t){let{gen:e,schema:n,data:r,it:s}=t;if((0,dH.alwaysValidSchema)(s,n))return;let i=e.name("valid");e.forIn("key",r,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,cI.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};dT.default=hH});var hT=w(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var ip=tr(),Pr=ue(),pH=er(),op=be(),mH={message:"must NOT have additional properties",params:({params:t})=>(0,Pr._)`{additionalProperty: ${t.additionalProperty}}`},gH={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:mH,code(t){let{gen:e,schema:n,parentSchema:r,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,op.alwaysValidSchema)(o,n))return;let l=(0,ip.allSchemaProperties)(r.properties),u=(0,ip.allSchemaProperties)(r.patternProperties);d(),t.ok((0,Pr._)`${i} === ${pH.default.errors}`);function d(){e.forIn("key",s,b=>{!l.length&&!u.length?y(b):e.if(f(b),()=>y(b))})}function f(b){let E;if(l.length>8){let _=(0,op.schemaRefOrVal)(o,r.properties,"properties");E=(0,ip.isOwnProperty)(e,_,b)}else l.length?E=(0,Pr.or)(...l.map(_=>(0,Pr._)`${b} === ${_}`)):E=Pr.nil;return u.length&&(E=(0,Pr.or)(E,...u.map(_=>(0,Pr._)`${(0,ip.usePattern)(t,_)}.test(${b})`))),(0,Pr.not)(E)}function h(b){e.code((0,Pr._)`delete ${s}[${b}]`)}function y(b){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){h(b);return}if(n===!1){t.setParams({additionalProperty:b}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,op.alwaysValidSchema)(o,n)){let E=e.name("valid");c.removeAdditional==="failing"?(m(b,E,!1),e.if((0,Pr.not)(E),()=>{t.reset(),h(b)})):(m(b,E),a||e.if((0,Pr.not)(E),()=>e.break()))}}function m(b,E,_){let T={keyword:"additionalProperties",dataProp:b,dataPropType:op.Type.Str};_===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,E)}}};fT.default=gH});var fI=w(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});var yH=hl(),uI=tr(),pT=be(),dI=hT(),bH={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:s,it:i}=t;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&dI.default.code(new yH.KeywordCxt(i,dI.default,"additionalProperties"));let o=(0,uI.allSchemaProperties)(n);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=pT.mergeEvaluated.props(e,(0,pT.toHash)(o),i.props));let a=o.filter(d=>!(0,pT.alwaysValidSchema)(i,n[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,uI.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&n[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};mT.default=bH});var gI=w(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var hI=tr(),ap=ue(),pI=be(),mI=be(),vH={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:r,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,hI.allSchemaProperties)(n),c=a.filter(m=>(0,pI.alwaysValidSchema)(i,n[m]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof ap.Name)&&(i.props=(0,mI.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let m of a)l&&h(m),i.allErrors?y(m):(e.var(u,!0),y(m),e.if(u))}function h(m){for(let b in l)new RegExp(m).test(b)&&(0,pI.checkStrictMode)(i,`property ${b} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){e.forIn("key",r,b=>{e.if((0,ap._)`${(0,hI.usePattern)(t,m)}.test(${b})`,()=>{let E=c.includes(m);E||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:b,dataPropType:mI.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,ap._)`${d}[${b}]`,!0):!E&&!i.allErrors&&e.if((0,ap.not)(u),()=>e.break())})})}}};gT.default=vH});var yI=w(yT=>{"use strict";Object.defineProperty(yT,"__esModule",{value:!0});var TH=be(),_H={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:r}=t;if((0,TH.alwaysValidSchema)(r,n)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};yT.default=_H});var bI=w(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});var SH=tr(),EH={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:SH.validateUnion,error:{message:"must match a schema in anyOf"}};bT.default=EH});var vI=w(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});var cp=ue(),wH=be(),kH={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,cp._)`{passingSchemas: ${t.passing}}`},NH={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:kH,code(t){let{gen:e,schema:n,parentSchema:r,it:s}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=n,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(){i.forEach((u,d)=>{let f;(0,wH.alwaysValidSchema)(s,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,cp._)`${c} && ${o}`).assign(o,!1).assign(a,(0,cp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,cp.Name)})})}}};vT.default=NH});var TI=w(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});var PH=be(),RH={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let s=e.name("valid");n.forEach((i,o)=>{if((0,PH.alwaysValidSchema)(r,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};TT.default=RH});var EI=w(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});var lp=ue(),SI=be(),CH={message:({params:t})=>(0,lp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,lp._)`{failingKeyword: ${t.ifClause}}`},DH={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:CH,code(t){let{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,SI.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=_I(r,"then"),i=_I(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),s&&i){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,lp.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,lp._)`${u}`):t.setParams({ifClause:u})}}}};function _I(t,e){let n=t.schema[e];return n!==void 0&&!(0,SI.alwaysValidSchema)(t,n)}_T.default=DH});var wI=w(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});var AH=be(),OH={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,AH.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};ST.default=OH});var kI=w(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});var IH=iT(),xH=nI(),MH=oT(),$H=sI(),LH=iI(),qH=sp(),jH=lI(),FH=hT(),BH=fI(),UH=gI(),VH=yI(),zH=bI(),WH=vI(),HH=TI(),GH=EI(),YH=wI();function KH(t=!1){let e=[VH.default,zH.default,WH.default,HH.default,GH.default,YH.default,jH.default,FH.default,qH.default,BH.default,UH.default];return t?e.push(xH.default,$H.default):e.push(IH.default,MH.default),e.push(LH.default),e}ET.default=KH});var NI=w(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});var wt=ue(),XH={message:({schemaCode:t})=>(0,wt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,wt._)`{format: ${t}}`},JH={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:XH,code(t,e){let{gen:n,data:r,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():h();function f(){let y=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=n.const("fDef",(0,wt._)`${y}[${o}]`),b=n.let("fType"),E=n.let("format");n.if((0,wt._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(b,(0,wt._)`${m}.type || "string"`).assign(E,(0,wt._)`${m}.validate`),()=>n.assign(b,(0,wt._)`"string"`).assign(E,m)),t.fail$data((0,wt.or)(_(),T()));function _(){return c.strictSchema===!1?wt.nil:(0,wt._)`${o} && !${E}`}function T(){let k=u.$async?(0,wt._)`(${m}.async ? await ${E}(${r}) : ${E}(${r}))`:(0,wt._)`${E}(${r})`,C=(0,wt._)`(typeof ${E} == "function" ? ${k} : ${E}.test(${r}))`;return(0,wt._)`${E} && ${E} !== true && ${b} === ${e} && !${C}`}}function h(){let y=d.formats[i];if(!y){_();return}if(y===!0)return;let[m,b,E]=T(y);m===e&&t.pass(k());function _(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function T(C){let $=C instanceof RegExp?(0,wt.regexpCode)(C):c.code.formats?(0,wt._)`${c.code.formats}${(0,wt.getProperty)(i)}`:void 0,B=n.scopeValue("formats",{key:i,ref:C,code:$});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,wt._)`${B}.validate`]:["string",C,B]}function k(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,wt._)`await ${E}(${r})`}return typeof b=="function"?(0,wt._)`${E}(${r})`:(0,wt._)`${E}.test(${r})`}}}};wT.default=JH});var PI=w(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});var QH=NI(),ZH=[QH.default];kT.default=ZH});var RI=w(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.contentVocabulary=ba.metadataVocabulary=void 0;ba.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ba.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var DI=w(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});var eG=qO(),tG=QO(),nG=kI(),rG=PI(),CI=RI(),sG=[eG.default,tG.default,(0,nG.default)(),rG.default,CI.metadataVocabulary,CI.contentVocabulary];NT.default=sG});var RT=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.dynamicAnchor=void 0;var PT=ue(),iG=er(),AI=ml(),oG=Jh(),aG={keyword:"$dynamicAnchor",schemaType:"string",code:t=>OI(t,t.schema)};function OI(t,e){let{gen:n,it:r}=t;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,PT._)`${iG.default.dynamicAnchors}${(0,PT.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:cG(t);n.if((0,PT._)`!${s}`,()=>n.assign(s,i))}Cl.dynamicAnchor=OI;function cG(t){let{schemaEnv:e,schema:n,self:r}=t.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new AI.SchemaEnv({schema:n,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return AI.compileSchema.call(r,l),(0,oG.getValidate)(t,l)}Cl.default=aG});var CT=w(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.dynamicRef=void 0;var II=ue(),lG=er(),xI=Jh(),uG={keyword:"$dynamicRef",schemaType:"string",code:t=>MI(t,t.schema)};function MI(t,e){let{gen:n,keyword:r,it:s}=t;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=n.let("valid",!1);o(c),t.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=n.let("_v",(0,II._)`${lG.default.dynamicAnchors}${(0,II.getProperty)(i)}`);n.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>n.block(()=>{(0,xI.callRef)(t,c),n.let(l,!0)}):()=>(0,xI.callRef)(t,c)}}Dl.dynamicRef=MI;Dl.default=uG});var $I=w(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var dG=RT(),fG=be(),hG={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,dG.dynamicAnchor)(t,""):(0,fG.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};DT.default=hG});var LI=w(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var pG=CT(),mG={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,pG.dynamicRef)(t,t.schema)};AT.default=mG});var qI=w(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var gG=RT(),yG=CT(),bG=$I(),vG=LI(),TG=[gG.default,yG.default,bG.default,vG.default];OT.default=TG});var FI=w(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var jI=sp(),_G={keyword:"dependentRequired",type:"object",schemaType:"object",error:jI.error,code:t=>(0,jI.validatePropertyDeps)(t)};IT.default=_G});var BI=w(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var SG=sp(),EG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,SG.validateSchemaDeps)(t)};xT.default=EG});var UI=w(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});var wG=be(),kG={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:n}){e.contains===void 0&&(0,wG.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};MT.default=kG});var VI=w($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var NG=FI(),PG=BI(),RG=UI(),CG=[NG.default,PG.default,RG.default];$T.default=CG});var WI=w(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var ii=ue(),zI=be(),DG=er(),AG={message:"must NOT have unevaluated properties",params:({params:t})=>(0,ii._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},OG={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:AG,code(t){let{gen:e,schema:n,data:r,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof ii.Name?e.if((0,ii._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,t.ok((0,ii._)`${s} === ${DG.default.errors}`);function c(d){if(n===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,zI.alwaysValidSchema)(i,n)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:zI.Type.Str},f),o||e.if((0,ii.not)(f),()=>e.break())}}function l(d,f){return(0,ii._)`!${d} || !${d}[${f}]`}function u(d,f){let h=[];for(let y in d)d[y]===!0&&h.push((0,ii._)`${f} !== ${y}`);return(0,ii.and)(...h)}}};LT.default=OG});var GI=w(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});var Wi=ue(),HI=be(),IG={message:({params:{len:t}})=>(0,Wi.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Wi._)`{limit: ${t}}`},xG={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:IG,code(t){let{gen:e,schema:n,data:r,it:s}=t,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,Wi._)`${r}.length`);if(n===!1)t.setParams({len:i}),t.fail((0,Wi._)`${o} > ${i}`);else if(typeof n=="object"&&!(0,HI.alwaysValidSchema)(s,n)){let c=e.var("valid",(0,Wi._)`${o} <= ${i}`);e.if((0,Wi.not)(c),()=>a(c,i)),t.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:HI.Type.Num},c),s.allErrors||e.if((0,Wi.not)(c),()=>e.break())})}}};qT.default=xG});var YI=w(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});var MG=WI(),$G=GI(),LG=[MG.default,$G.default];jT.default=LG});var XI=w(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.DiscrError=void 0;var KI;(function(t){t.Tag="tag",t.Mapping="mapping"})(KI||(up.DiscrError=KI={}))});var QI=w(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});var va=ue(),FT=XI(),JI=ml(),qG=pl(),jG=be(),FG={message:({params:{discrError:t,tagName:e}})=>t===FT.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,va._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},BG={keyword:"discriminator",type:"object",schemaType:"object",error:FG,code(t){let{gen:e,data:n,schema:r,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.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,va._)`${n}${(0,va.getProperty)(a)}`);e.if((0,va._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:FT.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let h=f();e.if(!1);for(let y in h)e.elseIf((0,va._)`${l} === ${y}`),e.assign(c,d(h[y]));e.else(),t.error(!1,{discrError:FT.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(h){let y=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(m,va.Name),y}function f(){var h;let y={},m=E(s),b=!0;for(let k=0;k<o.length;k++){let C=o[k];if(C?.$ref&&!(0,jG.schemaHasRulesButRef)(C,i.self.RULES)){let B=C.$ref;if(C=JI.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,B),C instanceof JI.SchemaEnv&&(C=C.schema),C===void 0)throw new qG.default(i.opts.uriResolver,i.baseId,B)}let $=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof $!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(m||E(C)),_($,k)}if(!b)throw new Error(`discriminator: "${a}" must be required`);return y;function E({required:k}){return Array.isArray(k)&&k.includes(a)}function _(k,C){if(k.const)T(k.const,C);else if(k.enum)for(let $ of k.enum)T($,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(k,C){if(typeof k!="string"||k in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[k]=C}}}};BT.default=BG});var ZI=w((Zie,UG)=>{UG.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 ex=w((eoe,VG)=>{VG.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 tx=w((toe,zG)=>{zG.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 nx=w((noe,WG)=>{WG.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 rx=w((roe,HG)=>{HG.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 sx=w((soe,GG)=>{GG.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 ix=w((ioe,YG)=>{YG.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 ox=w(UT=>{"use strict";Object.defineProperty(UT,"__esModule",{value:!0});var KG=ZI(),XG=ex(),JG=tx(),QG=nx(),ZG=rx(),eY=sx(),tY=ix(),nY=["/properties"];function rY(t){return[KG,XG,JG,QG,e(this,ZG),eY,e(this,tY)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function e(n,r){return t?n.$dataMetaSchema(r,nY):r}}UT.default=rY});var ax=w((lt,zT)=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.MissingRefError=lt.ValidationError=lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=lt.Ajv2019=void 0;var sY=IO(),iY=DI(),oY=qI(),aY=VI(),cY=YI(),lY=QI(),uY=ox(),VT="https://json-schema.org/draft/2019-09/schema",Ta=class extends sY.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(oY.default),iY.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(aY.default),this.addVocabulary(cY.default),this.opts.discriminator&&this.addKeyword(lY.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:n}=this.opts;n&&(uY.default.call(this,e),this.refs["http://json-schema.org/schema"]=VT)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(VT)?VT:void 0)}};lt.Ajv2019=Ta;zT.exports=lt=Ta;zT.exports.Ajv2019=Ta;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=Ta;var dY=hl();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return dY.KeywordCxt}});var _a=ue();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return _a._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return _a.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return _a.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return _a.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return _a.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return _a.CodeGen}});var fY=Vh();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return fY.default}});var hY=pl();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return hY.default}})});var tt=K(Lk());var pd=class t{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let s=jk(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=qk(r.text,!1,i);if(c-a===u.length)for(let f=0,h=u.length;f<h;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=r.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=qk(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,s=n.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);n[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-n[i]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],s=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},md;(function(t){function e(s,i,o,a){return new pd(s,i,o,a)}t.create=e;function n(s,i,o){if(s instanceof pd)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(s,i){let o=s.getText(),a=vg(i.map(m1),(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=s.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=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=r})(md||(md={}));function vg(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),s=t.slice(n);vg(r,e),vg(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?t[a++]=r[i++]:t[a++]=s[o++];for(;i<r.length;)t[a++]=r[i++];for(;o<s.length;)t[a++]=s[o++];return t}function qk(t,e,n=0){let r=e?[n]:[];for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,r.push(n+s+1))}return r}function jk(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function m1(t){let e=jk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var gd=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],yd=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var $d=K(J());var Sg=K(require("url")),Bk=require("crypto"),Uk=require("path");var _g=K(J());var en=class{constructor(e,n,r){this.uri=e;this.range=n;this.issues=r}},bd=class extends en{constructor(n,r,s,i){super(r,s,i);this.value=n;this.type="STRING"}},vd=class extends en{constructor(n,r,s,i){super(r,s,i);this.values=n;this.type="BYTESTRING"}},Td=class extends en{constructor(n,r,s,i){super(r,s,i);this.value=n;this.type="ARRAY_VALUE"}},_d=class extends en{constructor(n,r,s,i,o){super(s,i,o);this.label=n;this.nodePath=r;this.type="LABEL_REF"}},Sd=class extends en{constructor(n,r,s,i){super(r,s,i);this.nodePath=n;this.type="NODE_PATH"}},Ed=class extends en{constructor(n,r,s,i,o){super(s,i,o);this.value=n;this.evaluated=r}},wd=class extends Ed{constructor(n,r,s,i,o){super(n,r,s,i,o);this.type="NUMBER_VALUE"}},kd=class extends Ed{constructor(n,r,s,i,o){super(n,r,s,i,o);this.type="EXPRESSION"}},Nd=class extends en{constructor(n,r,s,i){super(r,s,i);this.value=n}},Pd=class extends en{constructor(n,r,s,i,o){super(s,i,o);this.name=n;this.values=r}},Rd=class extends en{constructor(n,r,s,i){super(r,s,i);this.address=n}},Cd=class extends en{constructor(n,r,s,i,o,a){super(i,o,a);this.fullName=n;this.name=r;this.address=s}},Dd=class extends en{constructor(n,r,s,i){super(r,s,i);this.name=n}};var Ha=class extends en{constructor(n,r,s,i,o,a,c){super(o,a,c);this.type=n;this.name=r;this.properties=s;this.nodes=i}},Ad=class extends Ha{constructor(e,n,r,s,i,o){super("REF",e,n,r,s,i,o)}},Od=class extends Ha{constructor(e,n,r,s,i){super("ROOT",null,e,n,r,s,i)}},Id=class extends Ha{constructor(e,n,r,s,i,o){super("CHILD",e,n,r,s,i,o)}};var Tn=K(J()),j=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return le(e,this.uri)?[this]:this.children.flatMap(n=>n.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!le(this.uri,e))return[];let n=te(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:n,selectionRange:n,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Tn.SymbolKind.File,Tn.SymbolKind.Class,Tn.SymbolKind.Namespace].some(r=>r===e))return[];let n=te(this);return[{location:Tn.Location.create(fe(this.uri),n),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===Tn.SymbolKind.File||r.kind===Tn.SymbolKind.Class||r.kind===Tn.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(n=>n.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(bi(this.semanticTokenType),vi(this.semanticTokenModifiers),this.tokenIndexes)}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(n=>n===e||n.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Tn.Range.create(Tn.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Tn.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new en(this.uri,this.range,this.serializeIssues)}};function g1(t){return t.replace(/'(.)'/g,(e,n)=>n.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Tg(t){try{return(0,eval)(g1(t))}catch(e){console.log(e)}return t}var ht=class extends j{toJson(){return-1}resolve(e){return Fk(this.toString(),e)}evaluate(e){return Tg(this.resolve(e))}isTrue(e){return Tg(`!!(${this.resolve(e)})`)}toPrettyString(e){let n=this.evaluate(e);return`${n.toString()} /* ${this.toString()}${typeof n=="number"?` = 0x${n.toString(16)}`:""} */`}serialize(e){return new kd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},Ti=class extends ht{constructor(n,r,s){super();this.expression=n;this.wrapped=r;this.join=s;this.addChild(n),s&&(this.addChild(s.operator),this.addChild(s.expression))}addExpression(n,r){this.addChild(n),this.addChild(r)}toString(){let n=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${n})`:`${n}`}isTrue(n){let r=`(${this.children.map(s=>s instanceof ht?s.resolve(n):s.toString()).join(" ")})`;return Tg(`!!${r}`)}};var Ir=class extends ht{constructor(n,r,s){super(r);this.value=n;this.docSymbolsMeta={name:`param${s+1}`,kind:_g.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Ds=class extends ht{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(n){return le(this.uri,n)?[{name:this.functionName.name,kind:_g.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(n)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(n=>n?.toString()??"<NULL>").join(",")})`}isTrue(n){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&n.has(this.params[0].value)):super.isTrue(n)}};var _i=(t,e,n=!0,r=!0)=>({start:{line:t?.pos.line??0,character:n?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var te=t=>_i(t.tokenIndexes.start,t.tokenIndexes.end),Vk=" ",zk=t=>{Vk=t},wo=()=>Vk,bi=t=>gd.findIndex(e=>e===t),vi=t=>yd.findIndex(e=>e===t),Eg=(t,e,n)=>!le(t.uri,e)||n.line<t.pos.line?!1:n.line>t.pos.line?!0:n.character>t.pos.colEnd,y1=(t,e,n)=>le(t.uri,e)?n.line<t.pos.line?!0:n.line>t.pos.line?!1:n.character<t.pos.col:!1,$n=(t,e,n)=>!!(le(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<n.line||t.tokenIndexes.start.pos.line===n.line&&t.tokenIndexes.start.pos.col<=n.character)&&(t.tokenIndexes.end.pos.line>n.line||t.tokenIndexes.end.pos.line===n.line&&t.tokenIndexes.end.pos.colEnd>=n.character)),Wk=(t,e,n)=>!!(le(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===n.line||t.tokenIndexes.end.pos.line===n.line)&&n.character>=t.tokenIndexes.end.pos.colEnd),Hk=(t,e,n)=>{if(!t)return!1;let s=t.filter(i=>i.pos.line===n.line).at(-1);return s&&s.pos.col>=n.character?!1:e.tokenIndexes?.end===s};var Mr=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].reverse().find(i=>$n(i,e,n));return r},Ga=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].find(i=>y1(i.lastToken,e,n));return r===t?void 0:r},Ya=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].reverse().find(i=>Eg(i.firstToken,e,n));return r===t?void 0:r},H=(t,e,n=$d.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:c.issues?c.issues.map(v1).join(" or "):"",source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},Lt=(t,e,n=$d.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:T1(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(_1).join(" or "),location:{uri:fe(d.uri),range:te(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},L=(t,e,n=$d.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:S1(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(E1).join(" or "),location:{uri:fe(d.uri),range:te(d)}}))],source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},Gk=(t,e)=>[...t].sort((r,s)=>{let i=e.getSortKey(r),o=e.getSortKey(s);if(i===void 0||o===void 0)throw new Error("Sort keys must be set");if(i!==o)return i-o;if(!r.tokenIndexes?.end||!s.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==s.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-s.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-s.tokenIndexes.end.pos.col});async function vt(t,e,n){let r=Ke(t.textDocument.uri);if(!e)return[];console.time("search");let i=(await e.getRuntime()).getDeepestAstNode(r,t.position),o=e.getSortKey(i?.ast);return console.timeEnd("search"),n(i,c=>{let l=t.position;return le(c.uri,r)?!!(c.tokenIndexes?.end&&(c.tokenIndexes.end.pos.line<l.line||c.tokenIndexes.end.pos.line===l.line&&c.tokenIndexes.end.pos.colEnd<=l.character)):o!==void 0&&(e.getSortKey(c)??-1)<=o})}function G(t,e){return{start:t,end:e??t}}var F=(t,e)=>t?.tokens.some(n=>n===e),it=t=>e=>e?.value&&t===e.value?"yes":b1(t)(e),Ie=t=>e=>e?.tokens.some(n=>n===t)?"yes":"no",b1=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",$r=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&le(t.uri,e.uri),cn=(t,e)=>!!t&&!!e&&$r(t,e)&&t.pos.colEnd===e.pos.col,Ld=t=>t.map((e,n)=>({index:n,context:e,files:e.getContextFiles()})),fr=(t,e,n,r)=>{if("id"in e){let i=t?.find(o=>o.id===e.id);return i||void 0}if("name"in e){let i=t?.find(o=>o.ctxNames.includes(e.name));return i||void 0}return n?.getContextFiles().find(i=>le(i,e.uri))?n:Ld(t).sort(i=>i.context.id===r?-1:0).find(i=>i.files.some(o=>le(o,e.uri)))?.context},wg=(t,e)=>Ld(t).filter(r=>r.files.some(s=>le(s,e))).map(r=>r.context),Yk=t=>{let e=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,s;if(s=r.exec(t)){let[,,i,o]=s,a=i.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(s=n.exec(t)){let[,,i,o]=s,a=i.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(s=e.exec(t)){let[,,i]=s;return i.trim()}},Fk=(t,e)=>{let n=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),s=t,i;do i=s,s=n(i),s=r(s),s=s.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(s!==i);return s},fe=t=>Sg.default.pathToFileURL(t).toString(),Ke=t=>et(Sg.default.fileURLToPath(t)),le=(t,e)=>!t||!e?!1:t===e,et=t=>(0,Uk.normalize)(process.platform==="win32"?t.toLowerCase():t),ss=t=>(0,Bk.createHash)("sha256").update([et(t.dtsFile),...t.includePaths.map(et),...t.overlays.map(et),t.bindingType,...t.zephyrBindings.map(et),...t.deviceOrgBindingsMetaSchema.map(et),...t.deviceOrgTreeBindings.map(et)].join(":")).digest("hex"),v1=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 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";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"}},T1=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.`}}).join(" or "),_1=t=>{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";default:return"TODO"}},S1=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 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 29:return`INTRO exceeds address space avalable 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"}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),E1=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";default:return"TODO"}},xr=(t,e)=>{let n=Math.max(t.length,e.length);for(let r=0;r<n;r++){let s=t[t.length-n+r]??0,i=e[e.length-n+r]??0;if(s<i)return-1;if(s>i)return 1}return 0},As=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),s=0;for(let i=0;i<n;i++){let o=t[t.length-1-i]??0,a=e[e.length-1-i]??0,c=o+a+s;r[n-1-i]=c>>>0,s=c>4294967295?1:0}return s&&r.unshift(1),r},w1=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),s=0;for(let i=0;i<n;i++){let o=t[t.length-1-i]??0,a=e[e.length-1-i]??0;o-=s,o<a?(o+=4294967296,s=1):s=0,r[n-1-i]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},k1=(t,e)=>As(t,e),Kk=(t,e)=>{let n=[];for(let r of t){let s=r.childAddress,i=r.length,o=As(s,i);if(xr(e,s)>=0&&xr(e,o)<0){let a=w1(e,s),c=r.parentAddress,l=k1(c,a),u=As(c,i);n.push({start:l,end:u,ast:r.ast})}}return n};function Xk(t){return Array.isArray(t)&&Array.isArray(t[0])}function Ka(t){return!t||t instanceof Ds?t:Ka(t.parentNode)}var hr=K(J());var tN=K(J());var Jk=K(J());var xe=class extends j{constructor(n,r){super(r);this.value=n;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Jk.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new bd(this.value,this.uri,this.range,this.serializeIssues)}};var Zk=K(J());var Qk=K(J());var Vt=class extends ht{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value.toString(),kind:Qk.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(n){return this.value.toString(n)}toJson(){return this.value}toPrettyString(n){let r=this.evaluate(n);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new wd(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var Pt=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Cell Array",kind:Zk.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(n=>n.toString()).join(" ")}>`}toPrettyString(n){return`<${this.values.map(r=>r.toPrettyString(n)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(n=>n.value instanceof Vt)){let n=new ArrayBuffer(8),r=new DataView(n);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(n=>n.value?.toJson()??NaN)}serialize(n){let r=this.values.map(s=>s.value?.serialize(n)??null);return new Td(r,this.uri,this.range,this.serializeIssues)}};var eN=K(J());var is=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Byte String Value",kind:eN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(n=>n.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(n=>n.value?.toJson()??NaN)}serialize(){return new vd(this.values.map(n=>n.value?{value:n.value.toString(16),range:n.value.range,evaluated:n.value.value}:null),this.uri,this.range,this.serializeIssues)}};var We=class extends j{constructor(n,r){super(r);this.name=n;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new Nd(this.name,this.uri,this.range,this.serializeIssues)}},Le=class extends j{constructor(n,r=[]){super();this.propertyName=n;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:tN.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(n)}set values(n){if(this._values)throw new Error("Only one property name is allowed");this._values=n,this.addChild(n)}get values(){return this._values}get quickValues(){return this.values?.values.map(n=>n?n.value instanceof xe?n.value.value:n.value instanceof Pt?n.value.values.map(r=>r.value instanceof Vt?r.value.value:NaN):n.value instanceof is?n.value.values.map(r=>r.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(n=>n?n.value instanceof xe?n.value:n.value instanceof Pt?n.value.values.map(r=>r.value):n.value instanceof is?n.value.values.map(r=>r.value):n.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(n){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(n)??"NULL").join(", ")??"NULL"}`:""};`}serialize(n){return new Pd(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(n)??null)??null,this.uri,this.range,this.serializeIssues)}};var nN=K(J()),ln=class extends j{constructor(n,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:n,kind:nN.SymbolKind.Function}}};var _n=class extends ln{constructor(n){super("Delete Node",n);this._nodeNameOrRef=null}set nodeNameOrRef(n){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=n,this.addChild(n)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Xe=class extends ln{constructor(n){super("Delete Property",n);this._propertyName=null}set propertyName(n){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=n,this.addChild(n)}get propertyName(){return this._propertyName}};var He=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Tt)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 _n)}addNodeChild(e){this.addChild(e)}},Tt=class extends He{constructor(){super(),this.docSymbolsMeta={name:"/",kind:hr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Le)}get name(){return new qe("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof Xe)}get nodes(){return this.children.filter(e=>e instanceof Ae)}get pathName(){return"/"}serialize(e){return new Od(this.properties.map(n=>n.serialize(e)),this.nodes.map(n=>n.serialize(e)),this.uri,this.range,this.serializeIssues)}},qt=class extends He{constructor(n=[]){super();this.labels=n;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:hr.SymbolKind.Class},n.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.labelReference?.issues??[]].map(n=>n())}set labelReference(n){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=n,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:hr.SymbolKind.Class},this.addChild(n)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(n=>n instanceof Ae)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(n=>n instanceof Le)}get deleteProperties(){return this.children.filter(n=>n instanceof Xe)}serialize(n){return new Ad(this.labelReference?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Ae=class t extends He{constructor(n=[],r){super();this.labels=n;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:hr.SymbolKind.Class},r&&this.addChild(r),n.forEach(s=>{this.addChild(s)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(n=>n())}set name(n){if(this._name)throw new Error("Only on label reference is allowed");this._name=n,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:hr.SymbolKind.Class},this.addChild(n)}get name(){return this._name}get nodes(){return this.children.filter(n=>n instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(n=>n instanceof Le)}get deleteProperties(){return this.children.filter(n=>n instanceof Xe)}serialize(n){return new Id(this.name?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},qd=class extends j{constructor(n,r){super(r);this.address=n;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((n,r)=>n.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new Rd(this.address,this.uri,this.range,this.serializeIssues)}},qe=class extends j{constructor(n,r,s){super(r);this.name=n;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(n){if(this._address)throw new Error("Address can only be set once");n&&(this.lastToken=void 0,this._address=n,n.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(n=>n.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(n=>n.toString()).join(",")}`:this.name}buildSemanticTokens(n){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};n(bi("type"),vi("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{n(bi("decorator"),vi("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(n)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(n=>n.issues)??[]].map(n=>n())}serialize(){return new Cd(this.toString(),new Dd(this.name,this.uri,hr.Range.create(hr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),hr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(n=>n.serialize())??null,this.uri,this.range,this.serializeIssues)}};var rN=K(J());var ye=class extends j{constructor(n){super();this.label=n;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:rN.SymbolKind.Key},this.addChild(n)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new _d(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var gr=K(J());var At=t=>t instanceof ln?!0:t instanceof He?!1:t.parentNode?At(t.parentNode):!1;var ko=t=>[...t.map(e=>{if(e instanceof Ae||e instanceof Tt)return e.name;if(e instanceof qt)return e.labelReference})].filter(e=>!!e),kg=(t,e)=>e?e.parentNode===t||kg(t,e.parentNode):!1;var ot=K(J());var sN=K(J());var os=class extends j{constructor(){super();this._pathParts=[]}addPath(n,r){this._pathParts.push(n),r&&this.addChild(r),this.addChild(n)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(n=>n?.toString()??"<NULL>").join("/")}},Ln=class extends j{constructor(n){super();this.path=n;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:sN.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new Sd(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var pt=K(J());var jd=K(J());var iN=require("path"),Os=class extends j{constructor(n,r){super();this.keyword=n;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:jd.SymbolKind.File},this.addChild(n),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(n){this.docSymbolsMeta={name:`Include ${n}`,kind:jd.SymbolKind.File},this._resolvedPath=n}},No=class extends j{constructor(n,r,s){super(s);this._path=n;this.relative=r;this.docSymbolsMeta={name:(0,iN.basename)(this.path),kind:jd.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var Lr=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var N1=async(t,e,n)=>{let r=pt.Position.create(t.pos.line,t.pos.col),s=n.find(i=>$n(i,e,r));if(s)return Mr(s,e,r)},Ng=t=>{if(t)return t instanceof He?t:Ng(t?.parentNode)},Ro=(t,e,n=0)=>!e||!le(e.uri,t)?n:Ro(t,Ng(e.parentNode),n+1),P1=(t,e)=>async n=>{let r=await N1(n.firstToken,e,t);return!r||r===n||n.allDescendants.some(i=>i===r)?0:r instanceof He?Ro(e,Ng(r)):void 0};async function oN(t,e){let n=[],r=Ke(t.textDocument.uri),s=(await e.getRuntime()).fileTopMostAsts(r);return n.push(...(await Promise.all(s.flatMap(async i=>await aN(t,i,r,P1(s,r))))).flat()),n}var Si=(t,e=1)=>{if(t.prevToken){let n=t.pos.line-t.prevToken.pos.line;if(n-e&&(n!==2&&e!==0||e===0))return pt.TextEdit.replace(pt.Range.create(pt.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),pt.Position.create(t.pos.line-e,t.pos.col)),"".padEnd(e-1,`
|
|
183
|
-
`))}},
|
|
184
|
-
|
|
182
|
+
deps: ${n}}`};var qH={keyword:"dependencies",type:"object",schemaType:"object",error:Zr.error,code(t){let[e,n]=jH(t);EI(t,e),wI(t,n)}};function jH({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let i=Array.isArray(t[r])?e:n;i[r]=t[r]}return[e,n]}function EI(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let s=n.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Ol.propertyInData)(n,r,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(c,()=>{for(let l of a)(0,Ol.checkReportMissingProp)(t,l)}):(n.if((0,_T._)`${c} && (${(0,Ol.checkMissingProp)(t,a,s)})`),(0,Ol.reportMissingProp)(t,s),n.else())}}Zr.validatePropertyDeps=EI;function wI(t,e=t.schema){let{gen:n,data:r,keyword:i,it:s}=t,o=n.name("valid");for(let a in e)(0,$H.alwaysValidSchema)(s,e[a])||(n.if((0,Ol.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>n.var(o,!0)),t.ok(o))}Zr.validateSchemaDeps=wI;Zr.default=qH});var NI=k(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});var kI=de(),FH=ve(),BH={message:"property name must be valid",params:({params:t})=>(0,kI._)`{propertyName: ${t.propertyName}}`},UH={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BH,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,FH.alwaysValidSchema)(i,n))return;let s=e.name("valid");e.forIn("key",r,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,kI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};ST.default=UH});var wT=k(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});var fp=nr(),Pr=de(),VH=tr(),hp=ve(),zH={message:"must NOT have additional properties",params:({params:t})=>(0,Pr._)`{additionalProperty: ${t.additionalProperty}}`},WH={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:zH,code(t){let{gen:e,schema:n,parentSchema:r,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,hp.alwaysValidSchema)(o,n))return;let l=(0,fp.allSchemaProperties)(r.properties),u=(0,fp.allSchemaProperties)(r.patternProperties);d(),t.ok((0,Pr._)`${s} === ${VH.default.errors}`);function d(){e.forIn("key",i,T=>{!l.length&&!u.length?y(T):e.if(f(T),()=>y(T))})}function f(T){let S;if(l.length>8){let b=(0,hp.schemaRefOrVal)(o,r.properties,"properties");S=(0,fp.isOwnProperty)(e,b,T)}else l.length?S=(0,Pr.or)(...l.map(b=>(0,Pr._)`${T} === ${b}`)):S=Pr.nil;return u.length&&(S=(0,Pr.or)(S,...u.map(b=>(0,Pr._)`${(0,fp.usePattern)(t,b)}.test(${T})`))),(0,Pr.not)(S)}function h(T){e.code((0,Pr._)`delete ${i}[${T}]`)}function y(T){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){h(T);return}if(n===!1){t.setParams({additionalProperty:T}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,hp.alwaysValidSchema)(o,n)){let S=e.name("valid");c.removeAdditional==="failing"?(p(T,S,!1),e.if((0,Pr.not)(S),()=>{t.reset(),h(T)})):(p(T,S),a||e.if((0,Pr.not)(S),()=>e.break()))}}function p(T,S,b){let v={keyword:"additionalProperties",dataProp:T,dataPropType:hp.Type.Str};b===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(v,S)}}};ET.default=WH});var CI=k(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});var HH=yl(),PI=nr(),kT=ve(),RI=wT(),GH={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:s}=t;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&RI.default.code(new HH.KeywordCxt(s,RI.default,"additionalProperties"));let o=(0,PI.allSchemaProperties)(n);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=kT.mergeEvaluated.props(e,(0,kT.toHash)(o),s.props));let a=o.filter(d=>!(0,kT.alwaysValidSchema)(s,n[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,PI.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&&n[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};NT.default=GH});var II=k(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0});var DI=nr(),pp=de(),AI=ve(),OI=ve(),YH={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:r,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,DI.allSchemaProperties)(n),c=a.filter(p=>(0,AI.alwaysValidSchema)(s,n[p]));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 pp.Name)&&(s.props=(0,OI.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let p of a)l&&h(p),s.allErrors?y(p):(e.var(u,!0),y(p),e.if(u))}function h(p){for(let T in l)new RegExp(p).test(T)&&(0,AI.checkStrictMode)(s,`property ${T} matches pattern ${p} (use allowMatchingProperties)`)}function y(p){e.forIn("key",r,T=>{e.if((0,pp._)`${(0,DI.usePattern)(t,p)}.test(${T})`,()=>{let S=c.includes(p);S||t.subschema({keyword:"patternProperties",schemaProp:p,dataProp:T,dataPropType:OI.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,pp._)`${d}[${T}]`,!0):!S&&!s.allErrors&&e.if((0,pp.not)(u),()=>e.break())})})}}};PT.default=YH});var xI=k(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0});var KH=ve(),XH={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:r}=t;if((0,KH.alwaysValidSchema)(r,n)){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"}};RT.default=XH});var MI=k(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0});var JH=nr(),QH={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:JH.validateUnion,error:{message:"must match a schema in anyOf"}};CT.default=QH});var LI=k(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var mp=de(),ZH=ve(),eG={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,mp._)`{passingSchemas: ${t.passing}}`},tG={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:eG,code(t){let{gen:e,schema:n,parentSchema:r,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;let s=n,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,ZH.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,mp._)`${c} && ${o}`).assign(o,!1).assign(a,(0,mp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,mp.Name)})})}}};DT.default=tG});var $I=k(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var nG=ve(),rG={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let i=e.name("valid");n.forEach((s,o)=>{if((0,nG.alwaysValidSchema)(r,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};AT.default=rG});var FI=k(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var gp=de(),jI=ve(),iG={message:({params:t})=>(0,gp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,gp._)`{failingKeyword: ${t.ifClause}}`},sG={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:iG,code(t){let{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,jI.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let i=qI(r,"then"),s=qI(r,"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,gp.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,gp._)`${u}`):t.setParams({ifClause:u})}}}};function qI(t,e){let n=t.schema[e];return n!==void 0&&!(0,jI.alwaysValidSchema)(t,n)}OT.default=sG});var BI=k(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var oG=ve(),aG={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,oG.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};IT.default=aG});var UI=k(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var cG=gT(),lG=vI(),uG=yT(),dG=_I(),fG=SI(),hG=dp(),pG=NI(),mG=wT(),gG=CI(),yG=II(),bG=xI(),vG=MI(),TG=LI(),_G=$I(),SG=FI(),EG=BI();function wG(t=!1){let e=[bG.default,vG.default,TG.default,_G.default,SG.default,EG.default,pG.default,mG.default,hG.default,gG.default,yG.default];return t?e.push(lG.default,dG.default):e.push(cG.default,uG.default),e.push(fG.default),e}xT.default=wG});var VI=k(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});var kt=de(),kG={message:({schemaCode:t})=>(0,kt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,kt._)`{format: ${t}}`},NG={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:kG,code(t,e){let{gen:n,data:r,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():h();function f(){let y=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),p=n.const("fDef",(0,kt._)`${y}[${o}]`),T=n.let("fType"),S=n.let("format");n.if((0,kt._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>n.assign(T,(0,kt._)`${p}.type || "string"`).assign(S,(0,kt._)`${p}.validate`),()=>n.assign(T,(0,kt._)`"string"`).assign(S,p)),t.fail$data((0,kt.or)(b(),v()));function b(){return c.strictSchema===!1?kt.nil:(0,kt._)`${o} && !${S}`}function v(){let w=u.$async?(0,kt._)`(${p}.async ? await ${S}(${r}) : ${S}(${r}))`:(0,kt._)`${S}(${r})`,C=(0,kt._)`(typeof ${S} == "function" ? ${w} : ${S}.test(${r}))`;return(0,kt._)`${S} && ${S} !== true && ${T} === ${e} && !${C}`}}function h(){let y=d.formats[s];if(!y){b();return}if(y===!0)return;let[p,T,S]=v(y);p===e&&t.pass(w());function b(){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 L=C instanceof RegExp?(0,kt.regexpCode)(C):c.code.formats?(0,kt._)`${c.code.formats}${(0,kt.getProperty)(s)}`:void 0,B=n.scopeValue("formats",{key:s,ref:C,code:L});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,kt._)`${B}.validate`]:["string",C,B]}function w(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,kt._)`await ${S}(${r})`}return typeof T=="function"?(0,kt._)`${S}(${r})`:(0,kt._)`${S}.test(${r})`}}}};MT.default=NG});var zI=k(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var PG=VI(),RG=[PG.default];LT.default=RG});var WI=k(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.contentVocabulary=va.metadataVocabulary=void 0;va.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];va.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var GI=k($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var CG=tI(),DG=mI(),AG=UI(),OG=zI(),HI=WI(),IG=[CG.default,DG.default,(0,AG.default)(),OG.default,HI.metadataVocabulary,HI.contentVocabulary];$T.default=IG});var jT=k(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.dynamicAnchor=void 0;var qT=de(),xG=tr(),YI=vl(),MG=ip(),LG={keyword:"$dynamicAnchor",schemaType:"string",code:t=>KI(t,t.schema)};function KI(t,e){let{gen:n,it:r}=t;r.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,qT._)`${xG.default.dynamicAnchors}${(0,qT.getProperty)(e)}`,s=r.errSchemaPath==="#"?r.validateName:$G(t);n.if((0,qT._)`!${i}`,()=>n.assign(i,s))}Il.dynamicAnchor=KI;function $G(t){let{schemaEnv:e,schema:n,self:r}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new YI.SchemaEnv({schema:n,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return YI.compileSchema.call(r,l),(0,MG.getValidate)(t,l)}Il.default=LG});var FT=k(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.dynamicRef=void 0;var XI=de(),qG=tr(),JI=ip(),jG={keyword:"$dynamicRef",schemaType:"string",code:t=>QI(t,t.schema)};function QI(t,e){let{gen:n,keyword:r,it:i}=t;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=n.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=n.let("_v",(0,XI._)`${qG.default.dynamicAnchors}${(0,XI.getProperty)(s)}`);n.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>n.block(()=>{(0,JI.callRef)(t,c),n.let(l,!0)}):()=>(0,JI.callRef)(t,c)}}xl.dynamicRef=QI;xl.default=jG});var ZI=k(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});var FG=jT(),BG=ve(),UG={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,FG.dynamicAnchor)(t,""):(0,BG.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};BT.default=UG});var ex=k(UT=>{"use strict";Object.defineProperty(UT,"__esModule",{value:!0});var VG=FT(),zG={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,VG.dynamicRef)(t,t.schema)};UT.default=zG});var tx=k(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});var WG=jT(),HG=FT(),GG=ZI(),YG=ex(),KG=[WG.default,HG.default,GG.default,YG.default];VT.default=KG});var rx=k(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});var nx=dp(),XG={keyword:"dependentRequired",type:"object",schemaType:"object",error:nx.error,code:t=>(0,nx.validatePropertyDeps)(t)};zT.default=XG});var ix=k(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});var JG=dp(),QG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,JG.validateSchemaDeps)(t)};WT.default=QG});var sx=k(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});var ZG=ve(),eY={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:n}){e.contains===void 0&&(0,ZG.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};HT.default=eY});var ox=k(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});var tY=rx(),nY=ix(),rY=sx(),iY=[tY.default,nY.default,rY.default];GT.default=iY});var cx=k(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});var as=de(),ax=ve(),sY=tr(),oY={message:"must NOT have unevaluated properties",params:({params:t})=>(0,as._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},aY={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:oY,code(t){let{gen:e,schema:n,data:r,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof as.Name?e.if((0,as._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,as._)`${i} === ${sY.default.errors}`);function c(d){if(n===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,ax.alwaysValidSchema)(s,n)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:ax.Type.Str},f),o||e.if((0,as.not)(f),()=>e.break())}}function l(d,f){return(0,as._)`!${d} || !${d}[${f}]`}function u(d,f){let h=[];for(let y in d)d[y]===!0&&h.push((0,as._)`${f} !== ${y}`);return(0,as.and)(...h)}}};YT.default=aY});var ux=k(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});var Hs=de(),lx=ve(),cY={message:({params:{len:t}})=>(0,Hs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Hs._)`{limit: ${t}}`},lY={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:cY,code(t){let{gen:e,schema:n,data:r,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,Hs._)`${r}.length`);if(n===!1)t.setParams({len:s}),t.fail((0,Hs._)`${o} > ${s}`);else if(typeof n=="object"&&!(0,lx.alwaysValidSchema)(i,n)){let c=e.var("valid",(0,Hs._)`${o} <= ${s}`);e.if((0,Hs.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:lx.Type.Num},c),i.allErrors||e.if((0,Hs.not)(c),()=>e.break())})}}};KT.default=lY});var dx=k(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var uY=cx(),dY=ux(),fY=[uY.default,dY.default];XT.default=fY});var hx=k(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.DiscrError=void 0;var fx;(function(t){t.Tag="tag",t.Mapping="mapping"})(fx||(yp.DiscrError=fx={}))});var mx=k(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});var Ta=de(),JT=hx(),px=vl(),hY=bl(),pY=ve(),mY={message:({params:{discrError:t,tagName:e}})=>t===JT.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Ta._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},gY={keyword:"discriminator",type:"object",schemaType:"object",error:mY,code(t){let{gen:e,data:n,schema:r,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.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,Ta._)`${n}${(0,Ta.getProperty)(a)}`);e.if((0,Ta._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:JT.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let h=f();e.if(!1);for(let y in h)e.elseIf((0,Ta._)`${l} === ${y}`),e.assign(c,d(h[y]));e.else(),t.error(!1,{discrError:JT.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(h){let y=e.name("valid"),p=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(p,Ta.Name),y}function f(){var h;let y={},p=S(i),T=!0;for(let w=0;w<o.length;w++){let C=o[w];if(C?.$ref&&!(0,pY.schemaHasRulesButRef)(C,s.self.RULES)){let B=C.$ref;if(C=px.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,B),C instanceof px.SchemaEnv&&(C=C.schema),C===void 0)throw new hY.default(s.opts.uriResolver,s.baseId,B)}let L=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);T=T&&(p||S(C)),b(L,w)}if(!T)throw new Error(`discriminator: "${a}" must be required`);return y;function S({required:w}){return Array.isArray(w)&&w.includes(a)}function b(w,C){if(w.const)v(w.const,C);else if(w.enum)for(let L of w.enum)v(L,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(w,C){if(typeof w!="string"||w in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[w]=C}}}};QT.default=gY});var gx=k((qoe,yY)=>{yY.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 yx=k((joe,bY)=>{bY.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 bx=k((Foe,vY)=>{vY.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 vx=k((Boe,TY)=>{TY.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 Tx=k((Uoe,_Y)=>{_Y.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 _x=k((Voe,SY)=>{SY.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 Sx=k((zoe,EY)=>{EY.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 Ex=k(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});var wY=gx(),kY=yx(),NY=bx(),PY=vx(),RY=Tx(),CY=_x(),DY=Sx(),AY=["/properties"];function OY(t){return[wY,kY,NY,PY,e(this,RY),CY,e(this,DY)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function e(n,r){return t?n.$dataMetaSchema(r,AY):r}}ZT.default=OY});var wx=k((ft,t_)=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.MissingRefError=ft.ValidationError=ft.CodeGen=ft.Name=ft.nil=ft.stringify=ft.str=ft._=ft.KeywordCxt=ft.Ajv2019=void 0;var IY=XO(),xY=GI(),MY=tx(),LY=ox(),$Y=dx(),qY=mx(),jY=Ex(),e_="https://json-schema.org/draft/2019-09/schema",_a=class extends IY.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(MY.default),xY.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(LY.default),this.addVocabulary($Y.default),this.opts.discriminator&&this.addKeyword(qY.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:n}=this.opts;n&&(jY.default.call(this,e),this.refs["http://json-schema.org/schema"]=e_)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(e_)?e_:void 0)}};ft.Ajv2019=_a;t_.exports=ft=_a;t_.exports.Ajv2019=_a;Object.defineProperty(ft,"__esModule",{value:!0});ft.default=_a;var FY=yl();Object.defineProperty(ft,"KeywordCxt",{enumerable:!0,get:function(){return FY.KeywordCxt}});var Sa=de();Object.defineProperty(ft,"_",{enumerable:!0,get:function(){return Sa._}});Object.defineProperty(ft,"str",{enumerable:!0,get:function(){return Sa.str}});Object.defineProperty(ft,"stringify",{enumerable:!0,get:function(){return Sa.stringify}});Object.defineProperty(ft,"nil",{enumerable:!0,get:function(){return Sa.nil}});Object.defineProperty(ft,"Name",{enumerable:!0,get:function(){return Sa.Name}});Object.defineProperty(ft,"CodeGen",{enumerable:!0,get:function(){return Sa.CodeGen}});var BY=Xh();Object.defineProperty(ft,"ValidationError",{enumerable:!0,get:function(){return BY.default}});var UY=bl();Object.defineProperty(ft,"MissingRefError",{enumerable:!0,get:function(){return UY.default}})});var rt=K(Qk());var vd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=eN(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.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=Zk(r.text,!1,s);if(c-a===u.length)for(let f=0,h=u.length;f<h;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=r.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Zk(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},ko;(function(t){function e(i,s,o,a){return new vd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof vd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Rg(s.map($L),(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=r})(ko||(ko={}));function Rg(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Rg(r,e),Rg(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function Zk(t,e,n=0){let r=e?[n]:[];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++,r.push(n+i+1))}return r}function eN(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function $L(t){let e=eN(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Td=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],_d=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Fd=K(J());var Ag=K(require("url")),rN=require("crypto"),iN=require("path");var Dg=K(J());var tn=class{constructor(e,n,r){this.uri=e;this.range=n;this.issues=r}},Sd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="STRING"}},Ed=class extends tn{constructor(n,r,i,s){super(r,i,s);this.values=n;this.type="BYTESTRING"}},wd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n;this.type="ARRAY_VALUE"}},kd=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.label=n;this.nodePath=r;this.type="LABEL_REF"}},Nd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.nodePath=n;this.type="NODE_PATH"}},Pd=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.value=n;this.evaluated=r}},Rd=class extends Pd{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="NUMBER_VALUE"}},Cd=class extends Pd{constructor(n,r,i,s,o){super(n,r,i,s,o);this.type="EXPRESSION"}},Dd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.value=n}},Ad=class extends tn{constructor(n,r,i,s,o){super(i,s,o);this.name=n;this.values=r}},Od=class extends tn{constructor(n,r,i,s){super(r,i,s);this.address=n}},Id=class extends tn{constructor(n,r,i,s,o,a){super(s,o,a);this.fullName=n;this.name=r;this.address=i}},xd=class extends tn{constructor(n,r,i,s){super(r,i,s);this.name=n}};var Ga=class extends tn{constructor(n,r,i,s,o,a,c){super(o,a,c);this.type=n;this.name=r;this.properties=i;this.nodes=s}},Md=class extends Ga{constructor(e,n,r,i,s,o){super("REF",e,n,r,i,s,o)}},Ld=class extends Ga{constructor(e,n,r,i,s){super("ROOT",null,e,n,r,i,s)}},$d=class extends Ga{constructor(e,n,r,i,s,o){super("CHILD",e,n,r,i,s,o)}};var _n=K(J()),j=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return ue(e,this.uri)?[this]:this.children.flatMap(n=>n.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!ue(this.uri,e))return[];let n=te(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:n,selectionRange:n,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![_n.SymbolKind.File,_n.SymbolKind.Class,_n.SymbolKind.Constant].some(r=>r===e))return[];let n=te(this);return[{location:_n.Location.create(he(this.uri),n),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===_n.SymbolKind.File||r.kind===_n.SymbolKind.Class||r.kind===_n.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(n=>n.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(Ts(this.semanticTokenType),_s(this.semanticTokenModifiers),this.tokenIndexes)}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(n=>n===e||n.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return _n.Range.create(_n.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),_n.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new tn(this.uri,this.range,this.serializeIssues)}};function qL(t){return t.replace(/'(.)'/g,(e,n)=>n.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Cg(t){try{return(0,eval)(qL(t))}catch(e){console.log(e)}return t}var tt=class extends j{toJson(){return-1}resolve(e){return tN(this.toString(),e)}evaluate(e){return Cg(this.resolve(e))}isTrue(e){return Cg(`!!(${this.resolve(e)})`)}toPrettyString(e){let n=this.evaluate(e);return`${n.toString()} /* ${this.toString()}${typeof n=="number"?` = 0x${n.toString(16)}`:""} */`}serialize(e){return new Cd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},oi=class extends tt{constructor(n,r,i){super();this.expression=n;this.wrapped=r;this.join=i;this.addChild(n),i&&(this.addChild(i.operator),this.addChild(i.expression))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(n,r){this.addChild(n),this.addChild(r)}toString(){let n=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${n})`:`${n}`}isTrue(n){let r=`(${this.children.map(i=>i instanceof tt?i.resolve(n):i.toString()).join(" ")})`;return Cg(`!!${r}`)}};var xr=class extends tt{constructor(n,r,i){super(r);this.value=n;this.docSymbolsMeta={name:`param${i+1}`,kind:Dg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Mr=class extends tt{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return ue(this.uri,n)?[{name:this.functionName.name,kind:Dg.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(n)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(n=>n?.toString()??"<NULL>").join(",")})`}isTrue(n){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&n.has(this.params[0].value)):super.isTrue(n)}};var Ss=(t,e,n=!0,r=!0)=>({start:{line:t?.pos.line??0,character:n?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var te=t=>Ss(t.tokenIndexes.start,t.tokenIndexes.end),sN=" ",oN=t=>{sN=t},No=()=>sN,Ts=t=>Td.findIndex(e=>e===t),_s=t=>_d.findIndex(e=>e===t),Og=(t,e,n)=>!ue(t.uri,e)||n.line<t.pos.line?!1:n.line>t.pos.line?!0:n.character>t.pos.colEnd,jL=(t,e,n)=>ue(t.uri,e)?n.line<t.pos.line?!0:n.line>t.pos.line?!1:n.character<t.pos.col:!1,Kn=(t,e,n)=>!!(ue(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<n.line||t.tokenIndexes.start.pos.line===n.line&&t.tokenIndexes.start.pos.col<=n.character)&&(t.tokenIndexes.end.pos.line>n.line||t.tokenIndexes.end.pos.line===n.line&&t.tokenIndexes.end.pos.colEnd>=n.character)),aN=(t,e,n)=>!!(ue(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===n.line||t.tokenIndexes.end.pos.line===n.line)&&n.character>=t.tokenIndexes.end.pos.colEnd),cN=(t,e,n)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===n.line).at(-1);return i&&i.pos.col>=n.character?!1:e.tokenIndexes?.end===i};var $r=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>Kn(s,e,n));return r},Ya=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].find(s=>jL(s.lastToken,e,n));return r===t?void 0:r},Ka=(t,e,n)=>{let r=t,i=t;for(;i;)r=i,i=[...r.children].reverse().find(s=>Og(s.firstToken,e,n));return r===t?void 0:r},H=(t,e,n=Fd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:c.issues?c.issues.map(BL).join(" or "):"",source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},qt=(t,e,n=Fd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:UL(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(VL).join(" or "),location:{uri:he(d.uri),range:te(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},$=(t,e,n=Fd.DiagnosticSeverity.Error,r=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:zL(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(WL).join(" or "),location:{uri:he(d.uri),range:te(d)}}))],source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},lN=(t,e)=>[...t].sort((r,i)=>{let s=e.getSortKey(r),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;if(!r.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function _t(t,e,n){let r=Ve(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(r,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),n(o,l=>{let u=t.position;return ue(l.uri,r)?!!(l.tokenIndexes?.end&&(l.tokenIndexes.end.pos.line<u.line||l.tokenIndexes.end.pos.line===u.line&&l.tokenIndexes.end.pos.colEnd<=u.character)):a!==void 0&&(e.getSortKey(l)??-1)<=a})}function G(t,e){return{start:t,end:e??t}}var F=(t,e)=>t?.tokens.some(n=>n===e),at=t=>e=>e?.value&&t===e.value?"yes":FL(t)(e),xe=t=>e=>e?.tokens.some(n=>n===t)?"yes":"no",FL=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",qr=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&ue(t.uri,e.uri),ln=(t,e)=>!!t&&!!e&&qr(t,e)&&t.pos.colEnd===e.pos.col,Bd=t=>t.map((e,n)=>({index:n,context:e,files:e.getContextFiles()})),hr=(t,e,n,r)=>{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 n?.getContextFiles().find(s=>ue(s,e.uri))?n:Bd(t).sort(s=>s.context.id===r?-1:0).find(s=>s.files.some(o=>ue(o,e.uri)))?.context},Ig=(t,e)=>Bd(t).filter(r=>r.files.some(i=>ue(i,e))).map(r=>r.context),uN=t=>{let e=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;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=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else 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}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},tN=(t,e)=>{let n=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=n(s),i=r(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},he=t=>Ag.default.pathToFileURL(t).toString(),Ve=t=>nt(Ag.default.fileURLToPath(t)),ue=(t,e)=>!t||!e?!1:t===e,nt=t=>(0,iN.normalize)(process.platform==="win32"?t.toLowerCase():t),ai=t=>(0,rN.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)].join(":")).digest("hex"),BL=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 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";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"}},UL=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.`}}).join(" or "),VL=t=>{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";default:return"TODO"}},zL=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 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 29:return`INTRO exceeds address space avalable 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"}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),WL=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";default:return"TODO"}},Lr=(t,e)=>{let n=Math.max(t.length,e.length);for(let r=0;r<n;r++){let i=t[t.length-n+r]??0,s=e[e.length-n+r]??0;if(i<s)return-1;if(i>s)return 1}return 0},Ii=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;r[n-1-s]=c>>>0,i=c>4294967295?1:0}return i&&r.unshift(1),r},HL=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),i=0;for(let s=0;s<n;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,r[n-1-s]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},GL=(t,e)=>Ii(t,e),dN=(t,e)=>{let n=[];for(let r of t){let i=r.childAddress,s=r.length,o=Ii(i,s);if(Lr(e,i)>=0&&Lr(e,o)<0){let a=HL(e,i),c=r.parentAddress,l=GL(c,a),u=Ii(c,s);n.push({start:l,end:u,ast:r.ast})}}return n};function fN(t){return Array.isArray(t)&&Array.isArray(t[0])}function Xa(t){return!t||t instanceof Mr?t:Xa(t.parentNode)}function hN(t,e){let n=t.getText(),r=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=n;for(let s of r){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 nN(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 pN(t,e){return nN(t.end,e.start)>0&&nN(t.start,e.end)<0}var pr=K(J());var vN=K(J());var mN=K(J());var Me=class extends j{constructor(n,r){super(r);this.value=n;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:mN.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new Sd(this.value,this.uri,this.range,this.serializeIssues)}};var yN=K(J());var gN=K(J());var zt=class extends tt{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value.toString(),kind:gN.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(n){return this.value.toString(n)}toJson(){return this.value}toPrettyString(n){let r=this.evaluate(n);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new Rd(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var Rt=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Cell Array",kind:yN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(n=>n.toString()).join(" ")}>`}toPrettyString(n){return`<${this.values.map(r=>r.toPrettyString(n)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(n=>n.value instanceof zt)){let n=new ArrayBuffer(8),r=new DataView(n);return this.values.map(i=>i.value.value).forEach((i,s)=>{r.setUint32(s*4,i)}),r.getBigUint64(0)}return this.values.map(n=>n.value?.toJson()??NaN)}serialize(n){let r=this.values.map(i=>i.value?.serialize(n)??null);return new wd(r,this.uri,this.range,this.serializeIssues)}};var bN=K(J());var ci=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Byte String Value",kind:bN.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(n=>n.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(n=>n.value?.toJson()??NaN)}serialize(){return new Ed(this.values.map(n=>n.value?{value:n.value.toString(16),range:n.value.range,evaluated:n.value.value}:null),this.uri,this.range,this.serializeIssues)}};var Ge=class extends j{constructor(n,r){super(r);this.name=n;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new Dd(this.name,this.uri,this.range,this.serializeIssues)}},je=class extends j{constructor(n,r=[]){super();this.propertyName=n;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:vN.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(n)}set values(n){if(this._values)throw new Error("Only one property name is allowed");this._values=n,this.addChild(n)}get values(){return this._values}get quickValues(){return this.values?.values.map(n=>n?n.value instanceof Me?n.value.value:n.value instanceof Rt?n.value.values.map(r=>r.value instanceof zt?r.value.value:NaN):n.value instanceof ci?n.value.values.map(r=>r.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(n=>n?n.value instanceof Me?n.value:n.value instanceof Rt?n.value.values.map(r=>r.value):n.value instanceof ci?n.value.values.map(r=>r.value):n.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(n){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(n)??"NULL").join(", ")??"NULL"}`:""};`}serialize(n){return new Ad(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(n)??null)??null,this.uri,this.range,this.serializeIssues)}};var TN=K(J()),un=class extends j{constructor(n,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:n,kind:TN.SymbolKind.Function}}};var Sn=class extends un{constructor(n){super("Delete Node",n);this._nodeNameOrRef=null}set nodeNameOrRef(n){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=n,this.addChild(n)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Je=class extends un{constructor(n){super("Delete Property",n);this._propertyName=null}set propertyName(n){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=n,this.addChild(n)}get propertyName(){return this._propertyName}};var Ye=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof mt)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 Sn)}addNodeChild(e){this.addChild(e)}},mt=class extends Ye{constructor(){super(),this.docSymbolsMeta={name:"/",kind:pr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof je)}get name(){return new Fe("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof Je)}get nodes(){return this.children.filter(e=>e instanceof Oe)}get pathName(){return"/"}serialize(e){return new Ld(this.properties.map(n=>n.serialize(e)),this.nodes.map(n=>n.serialize(e)),this.uri,this.range,this.serializeIssues)}},jt=class extends Ye{constructor(n=[]){super();this.labels=n;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:pr.SymbolKind.Class},n.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.labelReference?.issues??[]].map(n=>n())}set labelReference(n){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=n,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:pr.SymbolKind.Class},this.addChild(n)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(n=>n instanceof Oe)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(n=>n instanceof je)}get deleteProperties(){return this.children.filter(n=>n instanceof Je)}serialize(n){return new Md(this.labelReference?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Oe=class t extends Ye{constructor(n=[],r){super();this.labels=n;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:pr.SymbolKind.Class},r&&this.addChild(r),n.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(n=>n())}set name(n){if(this._name)throw new Error("Only on label reference is allowed");this._name=n,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:pr.SymbolKind.Class},this.addChild(n)}get name(){return this._name}get nodes(){return this.children.filter(n=>n instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(n=>n instanceof je)}get deleteProperties(){return this.children.filter(n=>n instanceof Je)}serialize(n){return new $d(this.name?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Ud=class extends j{constructor(n,r){super(r);this.address=n;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((n,r)=>n.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new Od(this.address,this.uri,this.range,this.serializeIssues)}},Fe=class extends j{constructor(n,r,i){super(r);this.name=n;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(n){if(this._address)throw new Error("Address can only be set once");n&&(this.lastToken=void 0,this._address=n,n.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(n=>n.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(n=>n.toString()).join(",")}`:this.name}buildSemanticTokens(n){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};n(Ts("type"),_s("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(i=>{n(Ts("decorator"),_s("declaration"),{start:i.firstToken,end:i.lastToken}),i.buildSemanticTokens(n)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(n=>n.issues)??[]].map(n=>n())}serialize(){return new Id(this.toString(),new xd(this.name,this.uri,pr.Range.create(pr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),pr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(n=>n.serialize())??null,this.uri,this.range,this.serializeIssues)}};var _N=K(J());var be=class extends j{constructor(n){super();this.label=n;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:_N.SymbolKind.Key},this.addChild(n)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new kd(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var yr=K(J());var At=t=>t instanceof un?!0:t instanceof Ye?!1:t.parentNode?At(t.parentNode):!1;var Po=t=>[...t.map(e=>{if(e instanceof Oe||e instanceof mt)return e.name;if(e instanceof jt)return e.labelReference})].filter(e=>!!e),xg=(t,e)=>e?e.parentNode===t||xg(t,e.parentNode):!1;var lt=K(J());var SN=K(J());var li=class extends j{constructor(){super();this._pathParts=[]}addPath(n,r){this._pathParts.push(n),r&&this.addChild(r),this.addChild(n)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(n=>n?.toString()??"<NULL>").join("/")}},Ln=class extends j{constructor(n){super();this.path=n;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:SN.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new Nd(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var se=K(J());var Vd=K(J());var EN=require("path"),xi=class extends j{constructor(n,r){super();this.keyword=n;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:Vd.SymbolKind.File},this.addChild(n),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(n){this.docSymbolsMeta={name:`Include ${n}`,kind:Vd.SymbolKind.File},this._resolvedPath=n}},Ro=class extends j{constructor(n,r,i){super(i);this._path=n;this.relative=r;this.docSymbolsMeta={name:(0,EN.basename)(this.path),kind:Vd.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var Mi=class extends j{constructor(n){super();this.comments=n;n.forEach(this.addChild.bind(this))}},jr=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var YL=async(t,e,n)=>{let r=se.Position.create(t.pos.line,t.pos.col),i=n.find(s=>Kn(s,e,r));if(i)return $r(i,e,r)},Mg=t=>{if(t)return t instanceof Ye?t:Mg(t?.parentNode)},Co=(t,e,n=0)=>{if(e instanceof mt)return n+1;if(!e||!ue(e.uri,t))return n;let r=Mg(e.parentNode);return Co(t,r,n+1)},KL=(t,e)=>async n=>{let r=await YL(n.firstToken,e,t);if(!r||r===n||n.allDescendants.some(o=>o===r))return 0;if(!(r instanceof Ye))return;let i=Mg(r);return Co(e,i)};async function Lg(t,e,n){let r=n.split(`
|
|
183
|
+
`),i=[],s=Ve(t.textDocument.uri),o=(await e.getRuntime()).fileTopMostAsts(s),a=KL(o,s);return i.push(...(await Promise.all(o.flatMap(async c=>await wN(t,c,s,a,r)))).flat()),t.options.trimTrailingWhitespace&&i.push(...XL(r,i)),i}var XL=(t,e)=>{let n=[];return t.forEach((r,i)=>{let s=r.trimEnd();if(s.length!==r.length){let o=se.Range.create(se.Position.create(i,s.length),se.Position.create(i,r.length));e.some(a=>pN(o,a.range))||n.push(se.TextEdit.del(o))}}),n},Wd=(t,e,n=1,r=!1)=>{if(t.prevToken){let i=t.pos.line-t.prevToken.pos.line;if(i-n&&(i!==2&&n!==0||n===0||r))return se.TextEdit.replace(se.Range.create(se.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),se.Position.create(t.pos.line-n,n?e[t.pos.line-n].length:t.pos.col)),"".padEnd(n-1,`
|
|
184
|
+
`))}else if(t.pos.line)return se.TextEdit.del(se.Range.create(se.Position.create(0,0),se.Position.create(t.pos.line,t.pos.col)))},JL=(t,e,n,r="")=>{if(t.pos.line===t.prevToken?.pos.line)return se.TextEdit.replace(se.Range.create(se.Position.create(t.pos.line,t.pos.col),se.Position.create(t.pos.line,t.pos.col)),`
|
|
185
|
+
${r}${"".padStart(e*n.length,n)}`)},$g=(t,e,n,r,i="")=>{let s=`${"".padStart(e*n.length,n)}${i}`,o=se.Range.create(se.Position.create(t.pos.line,0),se.Position.create(t.pos.line,t.pos.col)),a=d$(r,o);return s===a?[]:[se.TextEdit.replace(se.Range.create(se.Position.create(t.pos.line,0),se.Position.create(t.pos.line,t.pos.col)),s)]},ct=(t,e,n=1,r=!1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){if(r)return[];let s=Wd(t.nextToken,e,0);if(!s)throw new Error("remove new LinesEdit must be defined");return n&&(s.newText=`${"".padEnd(n," ")}${s.newText}`),[s]}return t.nextToken.pos.col-t.pos.colEnd===n?[]:n===0?[se.TextEdit.del(se.Range.create(se.Position.create(t.pos.line,t.pos.colEnd),se.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)))]:[se.TextEdit.replace(se.Range.create(se.Position.create(t.pos.line,t.pos.colEnd),se.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)),"".padEnd(n," "))]},Ja=(t,e)=>t.slice(1).flatMap(n=>n.firstToken.prevToken?ct(n.firstToken.prevToken,e):[]),QL=async(t,e,n,r,i,s,o)=>{if(!ue(e.uri,n))return[];let a=[];if(a.push(...Es(e.firstToken,r,i,s)),e instanceof Oe||e instanceof jt)if(a.push(...Ja(e.labels,s)),e instanceof Oe){e.labels.length&&e.name&&e.name.firstToken.prevToken&&a.push(...ct(e.name.firstToken.prevToken,s));let c=e.name&&e.openScope?ct(e.name.lastToken,s):[];a.push(...c)}else{e.labels.length&&e.labelReference?.firstToken.prevToken&&a.push(...ct(e.labelReference.firstToken.prevToken,s));let c=e.labelReference&&e.openScope?ct(e.labelReference.lastToken,s):[];a.push(...c)}else e instanceof mt&&e.firstToken.value==="/"&&e.openScope&&a.push(...ct(e.firstToken,s,1));return a.push(...(await Promise.all(e.children.flatMap(c=>wN(t,c,n,o,s,r+1)))).flat()),e.closeScope&&a.push(...Es(e.closeScope,r,i,s,void 0,1,!0)),e.lastToken.value===";"&&e.closeScope&&a.push(...Qa(e.closeScope,e.lastToken)),a},ZL=(t,e,n,r,i,s)=>{let o=[];if(o.push(...Ja(t.labels,s)),t.labels.length&&t.value?.firstToken.prevToken&&o.push(...ct(t.value.firstToken.prevToken,s)),r&&t.firstToken.prevToken===r)o.push(...ct(r,s,0));else if(t.firstToken.pos.line!==t.firstToken.prevToken?.pos.line){let a=Wd(t.firstToken,s,1,!0);a&&o.push(a),o.push(...$g(t.firstToken,e+2,n,s))}else o.push(...ct(t.firstToken.prevToken,s,1));return t.value instanceof tt&&o.push(...zd(t.value,s)),o},e$=(t,e,n,r)=>{let i=[];return t instanceof Rt||t instanceof ci?(i.push(...t.values.flatMap((s,o)=>ZL(s,e,n,t.openBracket,o?t.values.at(o-1):void 0,r))),t.closeBracket?.prevToken&&(t.closeBracket.prevToken===t.values.at(-1)?.lastToken?i.push(...ct(t.closeBracket.prevToken,r,0)):i.push(...ct(t.closeBracket.prevToken,r,1)))):t instanceof tt&&i.push(...zd(t,r)),i},zd=(t,e)=>t instanceof Mr?t$(t,e):t instanceof oi?n$(t,e):[],t$=(t,e)=>{let n=[];return n.push(...ct(t.functionName.lastToken,e,0)),t.params.forEach((r,i)=>{r?.firstToken.prevToken&&n.push(...ct(r?.firstToken.prevToken,e,i?1:0)),r?.splitToken&&n.push(...Qa(r.lastToken,r.splitToken))}),t.lastToken.value===")"&&t.lastToken.prevToken&&n.push(...ct(t.lastToken.prevToken,e,0)),n},n$=(t,e)=>{let n=[];return t.openBracket&&t.openBracket.nextToken&&n.push(...ct(t.openBracket,e,0)),n.push(...zd(t.expression,e)),t.join&&(t.join.operator.firstToken.prevToken&&n.push(...ct(t.join.operator.firstToken.prevToken,e)),t.join.expression.firstToken.prevToken&&n.push(...ct(t.join.expression.firstToken.prevToken,e)),n.push(...zd(t.join.expression,e))),t.closeBracket&&t.closeBracket.prevToken&&n.push(...ct(t.closeBracket.prevToken,e,0)),n},r$=(t,e,n,r)=>{let i=[];return i.push(...Ja(t.startLabels,r)),i.push(...e$(t.value,e,n,r)),i.push(...Ja(t.endLabels,r)),i},i$=(t,e,n,r)=>{let i=[];return t.values.forEach(s=>{if(!s)return[];if(s.firstToken.prevToken)if(s.firstToken.prevToken.pos.line===s.firstToken.pos.line)i.push(...ct(s.firstToken.prevToken,r,1));else{let o=Wd(s.firstToken,r,1,!0);o&&i.push(o),i.push(...$g(s.firstToken,e+2,n,r))}i.push(...r$(s,e,n,r)),s.nextValueSeparator&&i.push(...Qa(s.lastToken,s.nextValueSeparator))}),i},s$=(t,e,n,r)=>{let i=[];return i.push(...Es(t.firstToken,e,n,r)),i.push(...Ja(t.labels,r)),t.labels.length&&t.propertyName?.firstToken.prevToken&&i.push(...ct(t.propertyName.firstToken.prevToken,r)),t.values&&(t.propertyName&&i.push(...ct(t.propertyName?.lastToken,r)),i.push(...i$(t.values,e,n,r))),t.lastToken.value===";"&&i.push(...Qa(t.children.at(-1).lastToken,t.lastToken)),i},Es=(t,e,n,r,i,s,o)=>{let a=[],c=JL(t,e,n,i);if(c)a.push(c);else{let l=Wd(t,r,s,o);l&&a.push(l),a.push(...$g(t,e,n,r,i))}return a},Qa=(t,e)=>t.pos.line===e.pos.line&&t.pos.colEnd+1===e.pos.colEnd?[]:t.nextToken===e?[se.TextEdit.replace(se.Range.create(se.Position.create(t.pos.line,t.pos.colEnd),se.Position.create(e.pos.line,e.pos.colEnd)),e.value)]:[se.TextEdit.insert(se.Position.create(t.pos.line,t.pos.colEnd),e.value),se.TextEdit.del(se.Range.create(se.Position.create(e.prevToken?.pos.line??e.pos.line,e.prevToken?.pos.colEnd??e.pos.col),se.Position.create(e.pos.line,e.pos.colEnd)))],o$=(t,e,n,r)=>{let i=[];i.push(...Es(t.firstToken,e,n,r));let s=ct(t.keyword.lastToken,r);return i.push(...s),t.lastToken.value===";"&&i.push(...Qa(t.children.at(-1).lastToken,t.lastToken)),i},a$=(t,e,n,r,i)=>{if(n===void 0)return[];if(!ue(t.uri,e))return[];let s=[];s.push(...Es(t.firstToken,n,r,i));let o=ct(t.keyword.lastToken,i);return s.push(...o),s},c$=(t,e,n,r)=>t.comments.flatMap((i,s)=>l$(i,e,n,r,s?s===t.comments.length-1?"last":"comment":"first")),l$=(t,e,n,r,i)=>{let s=[],o=t.firstToken.pos.line;if(t.firstToken.prevToken&&(e===void 0||o===t.firstToken.prevToken?.pos.line))return ct(t.firstToken.prevToken,r);let a;switch(i){case"comment":a=t.firstToken.value==="*"?" ":" * ";break;case"first":break;case"last":a=" ";break}return s.push(...Es(t.firstToken,e??0,n,r,a)),s},u$=(t,e,n,r)=>t.firstToken.pos.line===t.firstToken.prevToken?.pos.line?ct(t.firstToken.prevToken,r):Es(t.firstToken,e??0,n,r),wN=async(t,e,n,r,i,s=0)=>{let o=t.options.tabSize,c=t.options.insertSpaces?"".padStart(o," "):" ";return oN(c),e instanceof Ye?QL(t,e,n,s,c,i,r):e instanceof je?s$(e,s,c,i):e instanceof un?o$(e,s,c,i):e instanceof xi?a$(e,n,await r(e),c,i):e instanceof jr?u$(e,await r(e),c,i):e instanceof Mi?c$(e,await r(e),c,i):[]};function d$(t,e){let n=t[e.start.line],r=t[e.end.line];if(e.start.line===e.end.line)return n.substring(e.start.character,e.end.character);let i=t.slice(e.start.line+1,e.end.line);return[n.substring(e.start.character),...i,r.substring(0,e.end.character)].join(`
|
|
186
|
+
`)}function f$(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,n,r="optional",i=void 0,s,o){this.name=e;this.type=n;this.def=i;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:lt.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(f$).join(" or ")).join(",")}
|
|
185
187
|
|
|
186
188
|
`,...this.bindingType?["**Binding type** ",`${this.bindingType}
|
|
187
189
|
|
|
@@ -190,9 +192,9 @@ ${r}${"".padStart(e*n.length,n)}`)},Is=(t,e,n,r="")=>pt.TextEdit.replace(pt.Rang
|
|
|
190
192
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
191
193
|
|
|
192
194
|
`)]:[]].join(`
|
|
193
|
-
`)});this.signatureArgsCyclic=!1;typeof r!="function"?this.required=()=>r:this.required=r,typeof
|
|
194
|
-
${"".padEnd(
|
|
195
|
-
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[ot.SignatureInformation.create(`${n.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(n){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(n)!=="omitted"&&typeof r.name=="string").map(r=>{let s=n&&r.required(n),i=!!n.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:ot.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var un=class extends j{constructor(n,r,s,i){super();this.startLabels=n;this.value=r;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toPrettyString(n){return`${[this.value?.toPrettyString(n)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Ee=t=>{if(!t?.values.some(e=>!(e?.value instanceof Pt)))return t?.values.flatMap(e=>e.value.values.map(n=>n.value))??[]};var Pe=(t,e,n,r)=>{let s=t.ast.values?.values.at(e)?.value;if(s instanceof Pt){let i=s.values.at(n);if(i?.value instanceof ht){let o=i.value.evaluate(r);if(typeof o=="number")return o}}},qn=(t,e,n=0)=>{if(t instanceof un){if(t?.value instanceof Pt){let r=t.value.values.at(n);if(r?.value instanceof Vt)return e.getPhandle(r.value.value);if(r?.value instanceof ye)return r.value.linksTo;if(r?.value instanceof Ln)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof Vt)return e.getPhandle(t.value);if(t instanceof ye)return t.linksTo;if(t instanceof Ln)return t.path?.pathParts.at(-1)?.linksTo}},V=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var cN=()=>{let t=new Y("compatible",V("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 Co=K(J()),lN=()=>{let t=new Y("device_type",V("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 n=e.ast.values?.values.at(0)?.value;if(n instanceof xe&&n.value!==e.parent.name)return e.parent.name==="cpu"?[L(12,e.ast,Co.DiagnosticSeverity.Error,[],[],[e.name])]:[L(13,e.ast,Co.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[L(14,e.ast,Co.DiagnosticSeverity.Hint,[],[Co.DiagnosticTag.Deprecated],[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 uN=()=>{let t=new Y("#interrupt-cells",V("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 dN=()=>{let t=new Y("interrupt-controller",V("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var fN=()=>{let t=new Y("interrupt-parent",V("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 xs=K(J()),hN=()=>{let t=new Y("interrupts",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s)return r;let i=e.parent,o=i.getProperty("interrupt-parent"),a=i.root,c=o?qn(o?.ast.values?.values.at(0),a):i.parent;if(!c)return o?(r.push(L(17,o.ast.values?.values.at(0)?.value??o.ast)),r):(r.push(L(16,e.ast,xs.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),r);let l=c.getProperty("#interrupt-cells");if(!l)return r;let u=Pe(l,0,0,n);if(!u)return r;let d=[...Array.from({length:u},(m,b)=>`Interrupt${u>1?b:""}`)];t.signatureArgs=d.map(m=>xs.ParameterInformation.create(m));let f=c.getProperty("interrupt-map"),h=i.parent?.getProperty("#address-cells");f&&!h&&r.push(L(16,e.ast.propertyName??e.ast,xs.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.parent.pathString]));let y=0;for(;y<s.length;){if(!l){r.push(L(16,e.ast,xs.DiagnosticSeverity.Error,[...c.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",c.pathString]));break}let m=s.length-y;if(u>m)return r.push(L(19,s.at(-1),xs.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:u},()=>"Interrupt")].join(" ")}> `])),r;let b=s.slice(y,y+u),E=i.mappedReg(n)?.at(0)?.startAddress;if(f&&E){let _=c.getNexusMapEntyMatch("interrupt",n,b,E);_?.match?e.nexusMapsTo.push({mappingValuesAst:b,mapItem:_.match}):r.push(L(31,_.entry,xs.DiagnosticSeverity.Error,[f.ast]))}y+=u}return r});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 qr=K(J()),pN=()=>{let t=new Y("interrupts-extended",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=s.getProperty("interrupts");i&&r.push(L(15,i.ast,qr.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=s.getProperty("interrupt-parent");o&&r.push(L(15,o.ast,qr.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=s.root,c=Ee(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=qn(c[l],a);if(!f)return r.push(L(17,c[l],qr.DiagnosticSeverity.Error)),r;let h=f.getProperty("#interrupt-cells");if(!h){r.push(L(16,e.ast,qr.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",f.pathString]));break}f?.getProperty("#address-cells")||r.push(L(16,e.ast,qr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",f.pathString]));let m=Pe(h,0,0,n);if(m==null)return r;let b=c.length-l-1;if(d.push([`${u}_phandel`,...Array.from({length:m},(k,C)=>`${u}_interrupt${m>1?C:""}`)]),m>b)return r.push(L(19,c.at(-1),qr.DiagnosticSeverity.Error,[],[],[e.name,`<${d.at(-1).join(" ")}>`])),r;let E=c.slice(l+1,l+1+m),_=f.getProperty("interrupt-map"),T=s.mappedReg(n)?.at(0)?.startAddress;if(_&&T){let k=f.getNexusMapEntyMatch("interrupt",n,E,T);k?.match?e.nexusMapsTo.push({mappingValuesAst:E,mapItem:k.match}):r.push(L(31,k.entry,qr.DiagnosticSeverity.Error,[_.ast]))}l+=m+1,u++}return d.push([`${u}_phandel`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(h=>qr.ParameterInformation.create(h))),r});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 mN=()=>{let t=new Y("dma-noncoherent",V("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 gN=()=>{let t=new Y("dma-coherent",V("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 Fd=K(J()),yN=()=>{let t=new Y("dma-ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];return t.signatureArgs=c.map(l=>Fd.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(s.length===0||s.length%(o+a+i)!==0)&&r.push(L(19,s.at(s.length-s.length%(o+a+i))??e.ast,Fd.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:i},()=>"length")].join(" ")}>`])),r});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 Ja=K(J()),Bd=()=>{let t=new Y("ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];return t.signatureArgs=c.map(l=>Ja.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(s.length===0||s.length%(o+a+i)!==0)&&r.push(L(19,s.at(s.length-s.length%(o+a+i))??e.ast,Ja.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`])),r.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(n)?.forEach(d=>{!d?.mappingEnd||!d.mappedAst||d.inMappingRange||(d.regAst,r.push(L(29,d.regAst,Ja.DiagnosticSeverity.Warning,[d.mappedAst],[],[u.name,`0x${d.endAddress.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`])))})}),r});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 {
|
|
195
|
+
`)});this.signatureArgsCyclic=!1;typeof r!="function"?this.required=()=>r:this.required=r,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,n,r,i){let s=this.required(n);if(i){if(s==="omitted")return[$(11,i.ast,lt.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(s==="required"){let l=e.getOrderedNodeAst(n),u=Po(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=" = <>";break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,h)=>{let y=f.openScope??u[h].lastToken;return $(0,u[h],lt.DiagnosticSeverity.Error,[],[],[r],lt.TextEdit.insert(lt.Position.create(y.pos.line,y.pos.col+1),`
|
|
196
|
+
${"".padEnd(Co(u[h].uri,f)*No().length,No())}${r}${d};`))})]}return[]}let o=h$(i),a=[],c=(l,u,d)=>{if(d??=i.ast,!(l.some(h=>h==u)||l.some(h=>h=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(h=>h=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let h=[];l.forEach(y=>{switch(y){case"EMPTY":h.push(1);break;case"STRING":h.push(2);break;case"STRINGLIST":h.push(3);break;case"U32":h.push(5);break;case"U64":h.push(6);break;case"PROP_ENCODED_ARRAY":h.push(7);break}}),h.length&&a.push($(h,d,lt.DiagnosticSeverity.Error,[],[],[i.name]))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push($(4,i.ast.values??i.ast,lt.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push($(3,i.ast.values?.values[d]??i.ast))})}else{this.type[0].types.some(u=>u==="STRINGLIST")?o.some(u=>c(["STRINGLIST"],u,i.ast.values?.values[0]?.value)):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)):o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")?a.push($(8,i.ast.propertyName??i.ast,lt.DiagnosticSeverity.Error,(i.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[i.name])):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;l.some(d=>u.value===d)||a.push($(9,i.ast.values?.values[0]?.value??i.ast,lt.DiagnosticSeverity.Error,[],[],[this.values(i).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,n,r){let i=this.type.at(n);return i?.types.some(s=>s==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(s=>({label:r?`${s}`:`"${s}"`,kind:lt.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`})):i?.types.some(s=>s==="U32"||s==="U64")?this.values(e).map(s=>({label:r?`${s}`:`<${s}>`,kind:lt.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`})):[]}},h$=t=>t.ast.values?t.ast.values.values.map(e=>p$(e)):["EMPTY"],p$=t=>t?t.value instanceof Me?"STRING":t.value instanceof Rt?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof be||t.value instanceof Ln?"U32":"BYTESTRING":"UNKNOWN",Za=class{},En=class extends Za{constructor(n=()=>[]){super();this.additionalValidations=n;this.#e=[];this.noMismatchPropertiesAllowed=!1}#e;#t;getIssue(n,r){let i=[],s=r.getProperty("status"),o=s?.ast.values?.values.at(0)?.value;if(o instanceof Me&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(l=>i.push($(21,l,lt.DiagnosticSeverity.Hint,[...s?.ast?[s?.ast]:[]],[lt.DiagnosticTag.Unnecessary]))),i;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=r.getProperty(l.name);return f&&a.add(f),l.validateProperty(n,r,l.name,f)}let u=r.property.filter(f=>l.getNameMatch(f.name));u.forEach(f=>a.add(f));let d=this.properties.filter(f=>f!==l)??[];return d.length&&u.some(f=>d.some(h=>h.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(n,r,f.name,f))});return a.size!==r.property.length&&this.noMismatchPropertiesAllowed&&r.property.filter(u=>!a.has(u)).forEach(u=>{i.push($(27,u.ast,lt.DiagnosticSeverity.Error,[],[],[u.name],lt.TextEdit.del(Ss(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...i,...c,...this.additionalValidations(n,r)]}get properties(){return this.#e}addProperty(n){Array.isArray(n)?n.forEach(r=>this.#e.push(r)):this.#e.push(n),this.#e.sort((r,i)=>typeof r.name=="string"&&typeof i.name=="string"||typeof r.name!="string"&&typeof i.name!="string"?0:typeof r.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(n){n&&(this.#t=r=>{let i=n(r);return i.bindingsPath=this.bindingsPath,i})}getOnPropertyHover(n){let r=this.properties.find(i=>i.getNameMatch(n));return r?.onHover.bind(r)()}getSignatureHelp(n,r,i,s){let o=this.properties.find(f=>f.getNameMatch(n.name)),a=o?.signatureArgs;if(!o||!a)return;let c=n.getArgumentIndex(i),l=n.getArgumentIndex(s),d=n.getArgumentIndex(r)??l??(c!==void 0?c+1:void 0);if(fN(a)){let f=0;if(d!==void 0){let h=d,y=d?a.findIndex(p=>f<=h&&p.length+f>h?!0:(f+=p.length,!1)):void 0;y!==void 0&&(y>1&&(d=d-a.slice(0,y-1).reduce((p,T)=>p+T.length,0)),a=a.slice(y?y-1:0,y+2))}return{signatures:[lt.SignatureInformation.create(`${n.name} = ${a.map(h=>`<${h.map(y=>y.label).join(" ")}>`).join(`,
|
|
197
|
+
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[lt.SignatureInformation.create(`${n.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(n){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(n)!=="omitted"&&typeof r.name=="string").map(r=>{let i=n&&r.required(n),s=!!n.property.some(a=>r.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${r.name}`,kind:lt.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var dn=class extends j{constructor(n,r,i,s){super();this.startLabels=n;this.value=r;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toPrettyString(n){return`${[this.value?.toPrettyString(n)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var we=t=>{if(!t?.values.some(e=>!(e?.value instanceof Rt)))return t?.values.flatMap(e=>e.value.values.map(n=>n.value))??[]};var Re=(t,e,n,r)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof Rt){let s=i.values.at(n);if(s?.value instanceof tt){let o=s.value.evaluate(r);if(typeof o=="number")return o}}},$n=(t,e,n=0)=>{if(t instanceof dn){if(t?.value instanceof Rt){let r=t.value.values.at(n);if(r?.value instanceof zt)return e.getPhandle(r.value.value);if(r?.value instanceof be)return r.value.linksTo;if(r?.value instanceof Ln)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof zt)return e.getPhandle(t.value);if(t instanceof be)return t.linksTo;if(t instanceof Ln)return t.path?.pathParts.at(-1)?.linksTo}},V=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var kN=()=>{let t=new Y("compatible",V("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 Do=K(J()),NN=()=>{let t=new Y("device_type",V("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 n=e.ast.values?.values.at(0)?.value;if(n instanceof Me&&n.value!==e.parent.name)return e.parent.name==="cpu"?[$(12,e.ast,Do.DiagnosticSeverity.Error,[],[],[e.name])]:[$(13,e.ast,Do.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[$(14,e.ast,Do.DiagnosticSeverity.Hint,[],[Do.DiagnosticTag.Deprecated],[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 PN=()=>{let t=new Y("#interrupt-cells",V("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 RN=()=>{let t=new Y("interrupt-controller",V("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var CN=()=>{let t=new Y("interrupt-parent",V("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 Li=K(J()),DN=()=>{let t=new Y("interrupts",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i)return r;let s=e.parent,o=s.getProperty("interrupt-parent"),a=s.root,c=o?$n(o?.ast.values?.values.at(0),a):s.parent;if(!c)return o?(r.push($(17,o.ast.values?.values.at(0)?.value??o.ast)),r):(r.push($(16,e.ast,Li.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),r);let l=c.getProperty("#interrupt-cells");if(!l)return r;let u=Re(l,0,0,n);if(!u)return r;let d=[...Array.from({length:u},(p,T)=>`Interrupt${u>1?T:""}`)];t.signatureArgs=d.map(p=>Li.ParameterInformation.create(p));let f=c.getProperty("interrupt-map"),h=s.parent?.getProperty("#address-cells");f&&!h&&r.push($(16,e.ast.propertyName??e.ast,Li.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.parent.pathString]));let y=0;for(;y<i.length;){if(!l){r.push($(16,e.ast,Li.DiagnosticSeverity.Error,[...c.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",c.pathString]));break}let p=i.length-y;if(u>p)return r.push($(19,i.at(-1),Li.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:u},()=>"Interrupt")].join(" ")}> `])),r;let T=i.slice(y,y+u),S=s.mappedReg(n)?.at(0)?.startAddress;if(f&&S){let b=c.getNexusMapEntyMatch("interrupt",n,T,S);b?.match?e.nexusMapsTo.push({mappingValuesAst:T,mapItem:b.match}):r.push($(31,b.entry,Li.DiagnosticSeverity.Error,[f.ast]))}y+=u}return r});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 Fr=K(J()),AN=()=>{let t=new Y("interrupts-extended",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=i.getProperty("interrupts");s&&r.push($(15,s.ast,Fr.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.getProperty("interrupt-parent");o&&r.push($(15,o.ast,Fr.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=i.root,c=we(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=$n(c[l],a);if(!f)return r.push($(17,c[l],Fr.DiagnosticSeverity.Error)),r;let h=f.getProperty("#interrupt-cells");if(!h){r.push($(16,e.ast,Fr.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",f.pathString]));break}f?.getProperty("#address-cells")||r.push($(16,e.ast,Fr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",f.pathString]));let p=Re(h,0,0,n);if(p==null)return r;let T=c.length-l-1;if(d.push([`${u}_phandel`,...Array.from({length:p},(w,C)=>`${u}_interrupt${p>1?C:""}`)]),p>T)return r.push($(19,c.at(-1),Fr.DiagnosticSeverity.Error,[],[],[e.name,`<${d.at(-1).join(" ")}>`])),r;let S=c.slice(l+1,l+1+p),b=f.getProperty("interrupt-map"),v=i.mappedReg(n)?.at(0)?.startAddress;if(b&&v){let w=f.getNexusMapEntyMatch("interrupt",n,S,v);w?.match?e.nexusMapsTo.push({mappingValuesAst:S,mapItem:w.match}):r.push($(31,w.entry,Fr.DiagnosticSeverity.Error,[b.ast]))}l+=p+1,u++}return d.push([`${u}_phandel`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(h=>Fr.ParameterInformation.create(h))),r});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 ON=()=>{let t=new Y("dma-noncoherent",V("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 IN=()=>{let t=new Y("dma-coherent",V("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 Hd=K(J()),xN=()=>{let t=new Y("dma-ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>Hd.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,Hd.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:s},()=>"length")].join(" ")}>`])),r});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 ec=K(J()),Gd=()=>{let t=new Y("ranges",V(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i?.length)return[];let s=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n),c=[...Array.from({length:o},(l,u)=>`child-bus-address${o>1?u:""}`),...Array.from({length:a},(l,u)=>`parent-bus-address${a>1?u:""}`),...Array.from({length:s},(l,u)=>`length${s>1?u:""}`)];return t.signatureArgs=c.map(l=>ec.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(o+a+s)!==0)&&r.push($(19,i.at(i.length-i.length%(o+a+s))??e.ast,ec.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`])),r.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(n)?.forEach(d=>{!d?.mappingEnd||!d.mappedAst||d.inMappingRange||(d.regAst,r.push($(29,d.regAst,ec.DiagnosticSeverity.Warning,[d.mappedAst],[],[u.name,`0x${d.endAddress.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,h)=>f.toString(16).padStart(h?8:0,"0")).join("")}`])))})}),r});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 {
|
|
196
198
|
compatible = "simple-bus";
|
|
197
199
|
#address-cells = <1>;
|
|
198
200
|
#size-cells = <1>;
|
|
@@ -207,7 +209,7 @@ ${"".padEnd(Ro(u[h].uri,f)*wo().length,wo())}${r}${d};`))})]}return[]}let o=q1(s
|
|
|
207
209
|
};
|
|
208
210
|
};`,"```"].join(`
|
|
209
211
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
210
|
-
`),"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
|
|
212
|
+
`),"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 MN=()=>{let t=new Y("virtual-reg",V("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 tc=K(J());var LN=()=>{let t=new Y("reg",V("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,n)=>{let r=[],i=we(e.ast.values);if(!i)return[];let s=e.parent.parentSizeCells(n),o=e.parent.parentAddressCells(n),a=[...Array.from({length:o},(l,u)=>`address${o>1?u:""}`),...Array.from({length:s},(l,u)=>`size${s>1?u:""}`)];if(t.signatureArgs=a.map(l=>tc.ParameterInformation.create(l)),t.signatureArgsCyclic=!0,i.length===0||i.length%(s+o)!==0)return r.push($(19,i.at(i.length-i.length%(s+o))??e.ast,tc.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:o},()=>"address"),...Array.from({length:s},()=>"size")].join(" ")}>`])),r;let c=i.slice(0,o).map((l,u)=>Re(e,0,u,n)??0);if(e.parent.address&&Lr(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(o-1),d=l&&u?new j(G(l.firstToken,u.lastToken)):void 0;r.push($(10,d??e.ast.values??e.ast,tc.DiagnosticSeverity.Error,[],[],[e.name]))}return r});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 Yd=()=>new Y("#size-cells",V("U32"),"optional",1);var Kd=()=>{let t=new Y("#address-cells",V("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 {
|
|
211
213
|
#address-cells = <1>;
|
|
212
214
|
#size-cells = <1>;
|
|
213
215
|
serial@4600 {
|
|
@@ -218,8 +220,8 @@ ${"".padEnd(Ro(u[h].uri,f)*wo().length,wo())}${r}${d};`))})]}return[]}let o=q1(s
|
|
|
218
220
|
interrupt-parent = <&ipic>;
|
|
219
221
|
};
|
|
220
222
|
};`,"```"].join(`
|
|
221
|
-
`),"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
|
|
222
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var
|
|
223
|
+
`),"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 $N=()=>{let t=new Y("status",V("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
|
|
224
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var qN=K(J()),jN=()=>{let t=new Y("phandle",V("U32"),"optional",void 0,void 0,(e,n)=>{let r=Re(e,0,0,n);if(r){let i=e.parent.root.getAllPhandle(r);if(i.length>1&&i.at(-1)===e.parent)return[$(18,e.ast.values?.values.at(0)??e.ast,qN.DiagnosticSeverity.Error,i.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[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 {
|
|
223
225
|
phandle = <1>;
|
|
224
226
|
interrupt-controller;
|
|
225
227
|
reg = <0x10000000 0x100>;
|
|
@@ -227,10 +229,10 @@ ${"".padEnd(Ro(u[h].uri,f)*wo().length,wo())}${r}${d};`))})]}return[]}let o=q1(s
|
|
|
227
229
|
`),"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 {
|
|
228
230
|
interrupt-parent = <1>;
|
|
229
231
|
};`,"```"].join(`
|
|
230
|
-
`)],t};var EN=()=>{let t=new Y("model",V("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 zd=K(J()),wN=()=>{let t=new Y("name",V("STRING"),"optional",void 0,void 0,e=>[L(14,e.ast,zd.DiagnosticSeverity.Warning,[],[zd.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var pr=K(J());var kN=()=>{let t=new Y("interrupt-map",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=e.parent.root,o=Ee(e.ast.values);if(!o?.length)return[];s.getProperty("#address-cells")||r.push(L(16,e.ast,pr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.pathString]));let c=s.getProperty("#interrupt-cells");if(!c)return r.push(L(16,e.ast,pr.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`])),r;let l=s.addressCells(n),u=Pe(c,0,0,n),d={};if(u==null)return r;let f=0,h=[],y=0,m=0;for(;f<o.length;){if(h.push([...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),f+l+u>=o.length){let B=f+l+u;r.push(L(20,o[o.length-1],pr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-m)%B===0?B:(o.length-m)%B).join(" ")}`]));break}let b=new j(G(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),E="";for(let B=f;B<l+u+f;B++){let q=o[B];E+=`${q instanceof ht?q.evaluate(n).toString():q.toString()}:`}d[E]??=[],d[E].push(b),f+=l+u;let _=l+u+1;if(o.length<f+1){r.push(L(20,o[o.length-1],pr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-m)%_===0?_:(o.length-m)%_).join(" ")}`]));break}let T=qn(o[f],i);if(!T){r.push(L(17,o[f],pr.DiagnosticSeverity.Error));break}let k=T.addressCells(n),C=T.getProperty("#interrupt-cells");if(!C){r.push(L(16,o[f],pr.DiagnosticSeverity.Error,[...T.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`]));break}f++;let $=Pe(C,0,0,n);if($==null)break;if(h.splice(-1,1,[...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,...Array.from({length:k},(B,q)=>`${y}_ParentAddr${k>1?q:""}`),...Array.from({length:$},(B,q)=>`${y}_ParentIntrpt${$>1?q:""}`)]),f+=k+$,o.length<f){let B=l+u+1+k+$;r.push(L(20,o[o.length-1],pr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-m)%B===0?B:(o.length-m)%B).join(" ")}`]));break}m=f,y++}if(h.push([...Array.from({length:l},(b,E)=>`${y}_ChildAddr${l>1?E:""}`),...Array.from({length:u},(b,E)=>`${y}_ChildIntrpt${u>1?E:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),t.signatureArgs=h.map(b=>b.map(E=>pr.ParameterInformation.create(E))),!e.ast.values)return[];for(let b=0;b<e.ast.values.values.length;b++){let E=e.ast.values.values.at(b);if(E&&(r.length||u==null||!(E.value instanceof Pt)))return r}return Object.values(d).forEach(b=>{b.length>1&&r.push(L(30,b[b.length-1],pr.DiagnosticSeverity.Error,b.slice(0,-1)))}),r});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 NN;(function(t){function e(n){return typeof n=="string"}t.is=e})(NN||(NN={}));var Pg;(function(t){function e(n){return typeof n=="string"}t.is=e})(Pg||(Pg={}));var PN;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(PN||(PN={}));var Wd;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Wd||(Wd={}));var mr;(function(t){function e(r,s){return r===Number.MAX_VALUE&&(r=Wd.MAX_VALUE),s===Number.MAX_VALUE&&(s=Wd.MAX_VALUE),{line:r,character:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.uinteger(s.line)&&O.uinteger(s.character)}t.is=n})(mr||(mr={}));var _t;(function(t){function e(r,s,i,o){if(O.uinteger(r)&&O.uinteger(s)&&O.uinteger(i)&&O.uinteger(o))return{start:mr.create(r,s),end:mr.create(i,o)};if(mr.is(r)&&mr.is(s))return{start:r,end:s};throw new Error(`Range#create called with invalid arguments[${r}, ${s}, ${i}, ${o}]`)}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&mr.is(s.start)&&mr.is(s.end)}t.is=n})(_t||(_t={}));var Hd;(function(t){function e(r,s){return{uri:r,range:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&_t.is(s.range)&&(O.string(s.uri)||O.undefined(s.uri))}t.is=n})(Hd||(Hd={}));var RN;(function(t){function e(r,s,i,o){return{targetUri:r,targetRange:s,targetSelectionRange:i,originSelectionRange:o}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&_t.is(s.targetRange)&&O.string(s.targetUri)&&_t.is(s.targetSelectionRange)&&(_t.is(s.originSelectionRange)||O.undefined(s.originSelectionRange))}t.is=n})(RN||(RN={}));var Rg;(function(t){function e(r,s,i,o){return{red:r,green:s,blue:i,alpha:o}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.numberRange(s.red,0,1)&&O.numberRange(s.green,0,1)&&O.numberRange(s.blue,0,1)&&O.numberRange(s.alpha,0,1)}t.is=n})(Rg||(Rg={}));var CN;(function(t){function e(r,s){return{range:r,color:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&_t.is(s.range)&&Rg.is(s.color)}t.is=n})(CN||(CN={}));var DN;(function(t){function e(r,s,i){return{label:r,textEdit:s,additionalTextEdits:i}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.string(s.label)&&(O.undefined(s.textEdit)||Ao.is(s))&&(O.undefined(s.additionalTextEdits)||O.typedArray(s.additionalTextEdits,Ao.is))}t.is=n})(DN||(DN={}));var AN;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(AN||(AN={}));var ON;(function(t){function e(r,s,i,o,a,c){let l={startLine:r,endLine:s};return O.defined(i)&&(l.startCharacter=i),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.uinteger(s.startLine)&&O.uinteger(s.startLine)&&(O.undefined(s.startCharacter)||O.uinteger(s.startCharacter))&&(O.undefined(s.endCharacter)||O.uinteger(s.endCharacter))&&(O.undefined(s.kind)||O.string(s.kind))}t.is=n})(ON||(ON={}));var Cg;(function(t){function e(r,s){return{location:r,message:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&Hd.is(s.location)&&O.string(s.message)}t.is=n})(Cg||(Cg={}));var En;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(En||(En={}));var IN;(function(t){t.Unnecessary=1,t.Deprecated=2})(IN||(IN={}));var xN;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(xN||(xN={}));var Gd;(function(t){function e(r,s,i,o,a,c){let l={range:r,message:s};return O.defined(i)&&(l.severity=i),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var s;let i=r;return O.defined(i)&&_t.is(i.range)&&O.string(i.message)&&(O.number(i.severity)||O.undefined(i.severity))&&(O.integer(i.code)||O.string(i.code)||O.undefined(i.code))&&(O.undefined(i.codeDescription)||O.string((s=i.codeDescription)===null||s===void 0?void 0:s.href))&&(O.string(i.source)||O.undefined(i.source))&&(O.undefined(i.relatedInformation)||O.typedArray(i.relatedInformation,Cg.is))}t.is=n})(Gd||(Gd={}));var Do;(function(t){function e(r,s,...i){let o={title:r,command:s};return O.defined(i)&&i.length>0&&(o.arguments=i),o}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.title)&&O.string(s.command)}t.is=n})(Do||(Do={}));var Ao;(function(t){function e(i,o){return{range:i,newText:o}}t.replace=e;function n(i,o){return{range:{start:i,end:i},newText:o}}t.insert=n;function r(i){return{range:i,newText:""}}t.del=r;function s(i){let o=i;return O.objectLiteral(o)&&O.string(o.newText)&&_t.is(o.range)}t.is=s})(Ao||(Ao={}));var Dg;(function(t){function e(r,s,i){let o={label:r};return s!==void 0&&(o.needsConfirmation=s),i!==void 0&&(o.description=i),o}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.string(s.label)&&(O.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(O.string(s.description)||s.description===void 0)}t.is=n})(Dg||(Dg={}));var Oo;(function(t){function e(n){let r=n;return O.string(r)}t.is=e})(Oo||(Oo={}));var MN;(function(t){function e(i,o,a){return{range:i,newText:o,annotationId:a}}t.replace=e;function n(i,o,a){return{range:{start:i,end:i},newText:o,annotationId:a}}t.insert=n;function r(i,o){return{range:i,newText:"",annotationId:o}}t.del=r;function s(i){let o=i;return Ao.is(o)&&(Dg.is(o.annotationId)||Oo.is(o.annotationId))}t.is=s})(MN||(MN={}));var Ag;(function(t){function e(r,s){return{textDocument:r,edits:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&$g.is(s.textDocument)&&Array.isArray(s.edits)}t.is=n})(Ag||(Ag={}));var Og;(function(t){function e(r,s,i){let o={kind:"create",uri:r};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),i!==void 0&&(o.annotationId=i),o}t.create=e;function n(r){let s=r;return s&&s.kind==="create"&&O.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||O.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||O.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Oo.is(s.annotationId))}t.is=n})(Og||(Og={}));var Ig;(function(t){function e(r,s,i,o){let a={kind:"rename",oldUri:r,newUri:s};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let s=r;return s&&s.kind==="rename"&&O.string(s.oldUri)&&O.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||O.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||O.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Oo.is(s.annotationId))}t.is=n})(Ig||(Ig={}));var xg;(function(t){function e(r,s,i){let o={kind:"delete",uri:r};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),i!==void 0&&(o.annotationId=i),o}t.create=e;function n(r){let s=r;return s&&s.kind==="delete"&&O.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||O.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||O.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Oo.is(s.annotationId))}t.is=n})(xg||(xg={}));var Mg;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(s=>O.string(s.kind)?Og.is(s)||Ig.is(s)||xg.is(s):Ag.is(s)))}t.is=e})(Mg||(Mg={}));var $N;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)}t.is=n})($N||($N={}));var LN;(function(t){function e(r,s){return{uri:r,version:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&O.integer(s.version)}t.is=n})(LN||(LN={}));var $g;(function(t){function e(r,s){return{uri:r,version:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&(s.version===null||O.integer(s.version))}t.is=n})($g||($g={}));var qN;(function(t){function e(r,s,i,o){return{uri:r,languageId:s,version:i,text:o}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&O.string(s.languageId)&&O.integer(s.version)&&O.string(s.text)}t.is=n})(qN||(qN={}));var Lg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){let r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Lg||(Lg={}));var Za;(function(t){function e(n){let r=n;return O.objectLiteral(n)&&Lg.is(r.kind)&&O.string(r.value)}t.is=e})(Za||(Za={}));var jN;(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})(jN||(jN={}));var FN;(function(t){t.PlainText=1,t.Snippet=2})(FN||(FN={}));var BN;(function(t){t.Deprecated=1})(BN||(BN={}));var UN;(function(t){function e(r,s,i){return{newText:r,insert:s,replace:i}}t.create=e;function n(r){let s=r;return s&&O.string(s.newText)&&_t.is(s.insert)&&_t.is(s.replace)}t.is=n})(UN||(UN={}));var VN;(function(t){t.asIs=1,t.adjustIndentation=2})(VN||(VN={}));var zN;(function(t){function e(n){let r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(zN||(zN={}));var WN;(function(t){function e(n){return{label:n}}t.create=e})(WN||(WN={}));var HN;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(HN||(HN={}));var Yd;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){let s=r;return O.string(s)||O.objectLiteral(s)&&O.string(s.language)&&O.string(s.value)}t.is=n})(Yd||(Yd={}));var GN;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(Za.is(r.contents)||Yd.is(r.contents)||O.typedArray(r.contents,Yd.is))&&(n.range===void 0||_t.is(n.range))}t.is=e})(GN||(GN={}));var wn;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(wn||(wn={}));var YN;(function(t){function e(n,r,...s){let i={label:n};return O.defined(r)&&(i.documentation=r),O.defined(s)?i.parameters=s:i.parameters=[],i}t.create=e})(YN||(YN={}));var KN;(function(t){t.Text=1,t.Read=2,t.Write=3})(KN||(KN={}));var XN;(function(t){function e(n,r){let s={range:n};return O.number(r)&&(s.kind=r),s}t.create=e})(XN||(XN={}));var JN;(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})(JN||(JN={}));var QN;(function(t){t.Deprecated=1})(QN||(QN={}));var ZN;(function(t){function e(n,r,s,i,o){let a={name:n,kind:r,location:{uri:i,range:s}};return o&&(a.containerName=o),a}t.create=e})(ZN||(ZN={}));var eP;(function(t){function e(n,r,s,i){return i!==void 0?{name:n,kind:r,location:{uri:s,range:i}}:{name:n,kind:r,location:{uri:s}}}t.create=e})(eP||(eP={}));var tP;(function(t){function e(r,s,i,o,a,c){let l={name:r,detail:s,kind:i,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let s=r;return s&&O.string(s.name)&&O.number(s.kind)&&_t.is(s.range)&&_t.is(s.selectionRange)&&(s.detail===void 0||O.string(s.detail))&&(s.deprecated===void 0||O.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=n})(tP||(tP={}));var nP;(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"})(nP||(nP={}));var Kd;(function(t){t.Invoked=1,t.Automatic=2})(Kd||(Kd={}));var rP;(function(t){function e(r,s,i){let o={diagnostics:r};return s!=null&&(o.only=s),i!=null&&(o.triggerKind=i),o}t.create=e;function n(r){let s=r;return O.defined(s)&&O.typedArray(s.diagnostics,Gd.is)&&(s.only===void 0||O.typedArray(s.only,O.string))&&(s.triggerKind===void 0||s.triggerKind===Kd.Invoked||s.triggerKind===Kd.Automatic)}t.is=n})(rP||(rP={}));var sP;(function(t){function e(r,s,i){let o={title:r},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Do.is(s)?o.command=s:o.edit=s,a&&i!==void 0&&(o.kind=i),o}t.create=e;function n(r){let s=r;return s&&O.string(s.title)&&(s.diagnostics===void 0||O.typedArray(s.diagnostics,Gd.is))&&(s.kind===void 0||O.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Do.is(s.command))&&(s.isPreferred===void 0||O.boolean(s.isPreferred))&&(s.edit===void 0||Mg.is(s.edit))}t.is=n})(sP||(sP={}));var iP;(function(t){function e(r,s){let i={range:r};return O.defined(s)&&(i.data=s),i}t.create=e;function n(r){let s=r;return O.defined(s)&&_t.is(s.range)&&(O.undefined(s.command)||Do.is(s.command))}t.is=n})(iP||(iP={}));var oP;(function(t){function e(r,s){return{tabSize:r,insertSpaces:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.uinteger(s.tabSize)&&O.boolean(s.insertSpaces)}t.is=n})(oP||(oP={}));var aP;(function(t){function e(r,s,i){return{range:r,target:s,data:i}}t.create=e;function n(r){let s=r;return O.defined(s)&&_t.is(s.range)&&(O.undefined(s.target)||O.string(s.target))}t.is=n})(aP||(aP={}));var cP;(function(t){function e(r,s){return{range:r,parent:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&_t.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=n})(cP||(cP={}));var lP;(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"})(lP||(lP={}));var uP;(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"})(uP||(uP={}));var dP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(dP||(dP={}));var fP;(function(t){function e(r,s){return{range:r,text:s}}t.create=e;function n(r){let s=r;return s!=null&&_t.is(s.range)&&O.string(s.text)}t.is=n})(fP||(fP={}));var hP;(function(t){function e(r,s,i){return{range:r,variableName:s,caseSensitiveLookup:i}}t.create=e;function n(r){let s=r;return s!=null&&_t.is(s.range)&&O.boolean(s.caseSensitiveLookup)&&(O.string(s.variableName)||s.variableName===void 0)}t.is=n})(hP||(hP={}));var pP;(function(t){function e(r,s){return{range:r,expression:s}}t.create=e;function n(r){let s=r;return s!=null&&_t.is(s.range)&&(O.string(s.expression)||s.expression===void 0)}t.is=n})(pP||(pP={}));var mP;(function(t){function e(r,s){return{frameId:r,stoppedLocation:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&_t.is(r.stoppedLocation)}t.is=n})(mP||(mP={}));var qg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(qg||(qg={}));var jg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&(s.tooltip===void 0||O.string(s.tooltip)||Za.is(s.tooltip))&&(s.location===void 0||Hd.is(s.location))&&(s.command===void 0||Do.is(s.command))}t.is=n})(jg||(jg={}));var gP;(function(t){function e(r,s,i){let o={position:r,label:s};return i!==void 0&&(o.kind=i),o}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&mr.is(s.position)&&(O.string(s.label)||O.typedArray(s.label,jg.is))&&(s.kind===void 0||qg.is(s.kind))&&s.textEdits===void 0||O.typedArray(s.textEdits,Ao.is)&&(s.tooltip===void 0||O.string(s.tooltip)||Za.is(s.tooltip))&&(s.paddingLeft===void 0||O.boolean(s.paddingLeft))&&(s.paddingRight===void 0||O.boolean(s.paddingRight))}t.is=n})(gP||(gP={}));var yP;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(yP||(yP={}));var bP;(function(t){function e(n,r,s,i){return{insertText:n,filterText:r,range:s,command:i}}t.create=e})(bP||(bP={}));var vP;(function(t){function e(n){return{items:n}}t.create=e})(vP||(vP={}));var TP;(function(t){t.Invoked=0,t.Automatic=1})(TP||(TP={}));var _P;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(_P||(_P={}));var SP;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(SP||(SP={}));var EP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&Pg.is(r.uri)&&O.string(r.name)}t.is=e})(EP||(EP={}));var wP;(function(t){function e(i,o,a,c){return new Fg(i,o,a,c)}t.create=e;function n(i){let o=i;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=n;function r(i,o){let a=i.getText(),c=s(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=i.offsetAt(d.range.start),h=i.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=r;function s(i,o){if(i.length<=1)return i;let a=i.length/2|0,c=i.slice(0,a),l=i.slice(a);s(c,o),s(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?i[f++]=c[u++]:i[f++]=l[d++];for(;u<c.length;)i[f++]=c[u++];for(;d<l.length;)i[f++]=l[d++];return i}})(wP||(wP={}));var Fg=class{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let s=0;s<n.length;s++){r&&(e.push(s),r=!1);let i=n.charAt(s);r=i==="\r"||i===`
|
|
231
|
-
`,
|
|
232
|
-
`&&
|
|
233
|
-
rialnumber.`],t};function
|
|
232
|
+
`)],t};var FN=()=>{let t=new Y("model",V("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 Xd=K(J()),BN=()=>{let t=new Y("name",V("STRING"),"optional",void 0,void 0,e=>[$(14,e.ast,Xd.DiagnosticSeverity.Warning,[],[Xd.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var mr=K(J());var UN=()=>{let t=new Y("interrupt-map",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=e.parent.root,o=we(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||r.push($(16,e.ast,mr.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.pathString]));let c=i.getProperty("#interrupt-cells");if(!c)return r.push($(16,e.ast,mr.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),r;let l=i.addressCells(n),u=Re(c,0,0,n),d={};if(u==null)return r;let f=0,h=[],y=0,p=0;for(;f<o.length;){if(h.push([...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),f+l+u>=o.length){let B=f+l+u;r.push($(20,o[o.length-1],mr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}let T=new j(G(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),S="";for(let B=f;B<l+u+f;B++){let q=o[B];S+=`${q instanceof tt?q.evaluate(n).toString():q.toString()}:`}d[S]??=[],d[S].push(T),f+=l+u;let b=l+u+1;if(o.length<f+1){r.push($(20,o[o.length-1],mr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%b===0?b:(o.length-p)%b).join(" ")}`]));break}let v=$n(o[f],s);if(!v){r.push($(17,o[f],mr.DiagnosticSeverity.Error));break}let w=v.addressCells(n),C=v.getProperty("#interrupt-cells");if(!C){r.push($(16,o[f],mr.DiagnosticSeverity.Error,[...v.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]));break}f++;let L=Re(C,0,0,n);if(L==null)break;if(h.splice(-1,1,[...Array.from({length:l},(B,q)=>`${y}_ChildAddr${l>1?q:""}`),...Array.from({length:u},(B,q)=>`${y}_ChildIntrpt${u>1?q:""}`),`${y}_IntrptParent`,...Array.from({length:w},(B,q)=>`${y}_ParentAddr${w>1?q:""}`),...Array.from({length:L},(B,q)=>`${y}_ParentIntrpt${L>1?q:""}`)]),f+=w+L,o.length<f){let B=l+u+1+w+L;r.push($(20,o[o.length-1],mr.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-p)%B===0?B:(o.length-p)%B).join(" ")}`]));break}p=f,y++}if(h.push([...Array.from({length:l},(T,S)=>`${y}_ChildAddr${l>1?S:""}`),...Array.from({length:u},(T,S)=>`${y}_ChildIntrpt${u>1?S:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),t.signatureArgs=h.map(T=>T.map(S=>mr.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&&(r.length||u==null||!(S.value instanceof Rt)))return r}return Object.values(d).forEach(T=>{T.length>1&&r.push($(30,T[T.length-1],mr.DiagnosticSeverity.Error,T.slice(0,-1)))}),r});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 VN;(function(t){function e(n){return typeof n=="string"}t.is=e})(VN||(VN={}));var qg;(function(t){function e(n){return typeof n=="string"}t.is=e})(qg||(qg={}));var zN;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(zN||(zN={}));var Jd;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Jd||(Jd={}));var gr;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Jd.MAX_VALUE),i===Number.MAX_VALUE&&(i=Jd.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.uinteger(i.line)&&O.uinteger(i.character)}t.is=n})(gr||(gr={}));var St;(function(t){function e(r,i,s,o){if(O.uinteger(r)&&O.uinteger(i)&&O.uinteger(s)&&O.uinteger(o))return{start:gr.create(r,i),end:gr.create(s,o)};if(gr.is(r)&&gr.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&gr.is(i.start)&&gr.is(i.end)}t.is=n})(St||(St={}));var Qd;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&St.is(i.range)&&(O.string(i.uri)||O.undefined(i.uri))}t.is=n})(Qd||(Qd={}));var WN;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&St.is(i.targetRange)&&O.string(i.targetUri)&&St.is(i.targetSelectionRange)&&(St.is(i.originSelectionRange)||O.undefined(i.originSelectionRange))}t.is=n})(WN||(WN={}));var jg;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){let i=r;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=n})(jg||(jg={}));var HN;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&St.is(i.range)&&jg.is(i.color)}t.is=n})(HN||(HN={}));var GN;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&O.string(i.label)&&(O.undefined(i.textEdit)||Oo.is(i))&&(O.undefined(i.additionalTextEdits)||O.typedArray(i.additionalTextEdits,Oo.is))}t.is=n})(GN||(GN={}));var YN;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(YN||(YN={}));var KN;(function(t){function e(r,i,s,o,a,c){let l={startLine:r,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 n(r){let i=r;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=n})(KN||(KN={}));var Fg;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Qd.is(i.location)&&O.string(i.message)}t.is=n})(Fg||(Fg={}));var wn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(wn||(wn={}));var XN;(function(t){t.Unnecessary=1,t.Deprecated=2})(XN||(XN={}));var JN;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(JN||(JN={}));var Zd;(function(t){function e(r,i,s,o,a,c){let l={range:r,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 n(r){var i;let s=r;return O.defined(s)&&St.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,Fg.is))}t.is=n})(Zd||(Zd={}));var Ao;(function(t){function e(r,i,...s){let o={title:r,command:i};return O.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.title)&&O.string(i.command)}t.is=n})(Ao||(Ao={}));var Oo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){let o=s;return O.objectLiteral(o)&&O.string(o.newText)&&St.is(o.range)}t.is=i})(Oo||(Oo={}));var Bg;(function(t){function e(r,i,s){let o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){let i=r;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=n})(Bg||(Bg={}));var Io;(function(t){function e(n){let r=n;return O.string(r)}t.is=e})(Io||(Io={}));var QN;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){let o=s;return Oo.is(o)&&(Bg.is(o.annotationId)||Io.is(o.annotationId))}t.is=i})(QN||(QN={}));var Ug;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&Gg.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Ug||(Ug={}));var Vg;(function(t){function e(r,i,s){let o={kind:"create",uri:r};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 n(r){let i=r;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||Io.is(i.annotationId))}t.is=n})(Vg||(Vg={}));var zg;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,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 n(r){let i=r;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||Io.is(i.annotationId))}t.is=n})(zg||(zg={}));var Wg;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};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 n(r){let i=r;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||Io.is(i.annotationId))}t.is=n})(Wg||(Wg={}));var Hg;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>O.string(i.kind)?Vg.is(i)||zg.is(i)||Wg.is(i):Ug.is(i)))}t.is=e})(Hg||(Hg={}));var ZN;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)}t.is=n})(ZN||(ZN={}));var eP;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.integer(i.version)}t.is=n})(eP||(eP={}));var Gg;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&(i.version===null||O.integer(i.version))}t.is=n})(Gg||(Gg={}));var tP;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.string(i.uri)&&O.string(i.languageId)&&O.integer(i.version)&&O.string(i.text)}t.is=n})(tP||(tP={}));var Yg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){let r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Yg||(Yg={}));var nc;(function(t){function e(n){let r=n;return O.objectLiteral(n)&&Yg.is(r.kind)&&O.string(r.value)}t.is=e})(nc||(nc={}));var nP;(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})(nP||(nP={}));var rP;(function(t){t.PlainText=1,t.Snippet=2})(rP||(rP={}));var iP;(function(t){t.Deprecated=1})(iP||(iP={}));var sP;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){let i=r;return i&&O.string(i.newText)&&St.is(i.insert)&&St.is(i.replace)}t.is=n})(sP||(sP={}));var oP;(function(t){t.asIs=1,t.adjustIndentation=2})(oP||(oP={}));var aP;(function(t){function e(n){let r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(aP||(aP={}));var cP;(function(t){function e(n){return{label:n}}t.create=e})(cP||(cP={}));var lP;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(lP||(lP={}));var ef;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){let i=r;return O.string(i)||O.objectLiteral(i)&&O.string(i.language)&&O.string(i.value)}t.is=n})(ef||(ef={}));var uP;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(nc.is(r.contents)||ef.is(r.contents)||O.typedArray(r.contents,ef.is))&&(n.range===void 0||St.is(n.range))}t.is=e})(uP||(uP={}));var kn;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(kn||(kn={}));var dP;(function(t){function e(n,r,...i){let s={label:n};return O.defined(r)&&(s.documentation=r),O.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(dP||(dP={}));var fP;(function(t){t.Text=1,t.Read=2,t.Write=3})(fP||(fP={}));var hP;(function(t){function e(n,r){let i={range:n};return O.number(r)&&(i.kind=r),i}t.create=e})(hP||(hP={}));var pP;(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})(pP||(pP={}));var mP;(function(t){t.Deprecated=1})(mP||(mP={}));var gP;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(gP||(gP={}));var yP;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(yP||(yP={}));var bP;(function(t){function e(r,i,s,o,a,c){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&O.string(i.name)&&O.number(i.kind)&&St.is(i.range)&&St.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=n})(bP||(bP={}));var vP;(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"})(vP||(vP={}));var tf;(function(t){t.Invoked=1,t.Automatic=2})(tf||(tf={}));var TP;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return O.defined(i)&&O.typedArray(i.diagnostics,Zd.is)&&(i.only===void 0||O.typedArray(i.only,O.string))&&(i.triggerKind===void 0||i.triggerKind===tf.Invoked||i.triggerKind===tf.Automatic)}t.is=n})(TP||(TP={}));var _P;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ao.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&O.string(i.title)&&(i.diagnostics===void 0||O.typedArray(i.diagnostics,Zd.is))&&(i.kind===void 0||O.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ao.is(i.command))&&(i.isPreferred===void 0||O.boolean(i.isPreferred))&&(i.edit===void 0||Hg.is(i.edit))}t.is=n})(_P||(_P={}));var SP;(function(t){function e(r,i){let s={range:r};return O.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return O.defined(i)&&St.is(i.range)&&(O.undefined(i.command)||Ao.is(i.command))}t.is=n})(SP||(SP={}));var EP;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&O.uinteger(i.tabSize)&&O.boolean(i.insertSpaces)}t.is=n})(EP||(EP={}));var wP;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return O.defined(i)&&St.is(i.range)&&(O.undefined(i.target)||O.string(i.target))}t.is=n})(wP||(wP={}));var kP;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&St.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(kP||(kP={}));var NP;(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"})(NP||(NP={}));var PP;(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"})(PP||(PP={}));var RP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(RP||(RP={}));var CP;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){let i=r;return i!=null&&St.is(i.range)&&O.string(i.text)}t.is=n})(CP||(CP={}));var DP;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){let i=r;return i!=null&&St.is(i.range)&&O.boolean(i.caseSensitiveLookup)&&(O.string(i.variableName)||i.variableName===void 0)}t.is=n})(DP||(DP={}));var AP;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){let i=r;return i!=null&&St.is(i.range)&&(O.string(i.expression)||i.expression===void 0)}t.is=n})(AP||(AP={}));var OP;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){let i=r;return O.defined(i)&&St.is(r.stoppedLocation)}t.is=n})(OP||(OP={}));var Kg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Kg||(Kg={}));var Xg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&(i.tooltip===void 0||O.string(i.tooltip)||nc.is(i.tooltip))&&(i.location===void 0||Qd.is(i.location))&&(i.command===void 0||Ao.is(i.command))}t.is=n})(Xg||(Xg={}));var IP;(function(t){function e(r,i,s){let o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return O.objectLiteral(i)&&gr.is(i.position)&&(O.string(i.label)||O.typedArray(i.label,Xg.is))&&(i.kind===void 0||Kg.is(i.kind))&&i.textEdits===void 0||O.typedArray(i.textEdits,Oo.is)&&(i.tooltip===void 0||O.string(i.tooltip)||nc.is(i.tooltip))&&(i.paddingLeft===void 0||O.boolean(i.paddingLeft))&&(i.paddingRight===void 0||O.boolean(i.paddingRight))}t.is=n})(IP||(IP={}));var xP;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(xP||(xP={}));var MP;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(MP||(MP={}));var LP;(function(t){function e(n){return{items:n}}t.create=e})(LP||(LP={}));var $P;(function(t){t.Invoked=0,t.Automatic=1})($P||($P={}));var qP;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(qP||(qP={}));var jP;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(jP||(jP={}));var FP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&qg.is(r.uri)&&O.string(r.name)}t.is=e})(FP||(FP={}));var BP;(function(t){function e(s,o,a,c){return new Jg(s,o,a,c)}t.create=e;function n(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=n;function r(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),h=s.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=r;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}})(BP||(BP={}));var Jg=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
233
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
234
|
+
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return gr.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return gr.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}},O;(function(t){let e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function o(h){return e.call(h)==="[object Number]"}t.number=o;function a(h,y,p){return e.call(h)==="[object Number]"&&y<=h&&h<=p}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function u(h){return e.call(h)==="[object Function]"}t.func=u;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,y){return Array.isArray(h)&&h.every(y)}t.typedArray=f})(O||(O={}));var UP=()=>{let t=new Y("interrupt-map-mask",V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=we(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#interrupt-cells");if(!o)return r;let a=i.addressCells(n),c=Re(o,0,0,n);if(c==null)return r;let l=[...Array.from({length:a},(u,d)=>`AddressMask${a>1?d:""}`),...Array.from({length:c},(u,d)=>`InterruptMask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>kn.create(u)),s.length!==a+c&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}>`])),r});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 Br=K(J());var VP=()=>{let t=new Y(/^(?!interrupt-|no-).*?-map$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=e.name.split("-map",1)[0],i=[],s=e.parent,o=e.parent.root,a=s.getProperty(`#${r}-cells`);if(!a)return i.push($(16,e.ast,Br.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${s.path.slice(1).join("/")}`])),i;let c=Re(a,0,0,n);if(c==null)return i;let l=we(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,h=[],y=0;for(;d<l.length;){if(h.push([...Array.from({length:c},(w,C)=>`${y}_Interrupt${c>1?C:""}`),`${y}_SpecifierParent`,`${y}_ParentSpecifier...`]),d+c>=l.length){let w=d+c;i.push($(20,l[l.length-1],Br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%w===0?w:(l.length-f)%w).join(" ")}`]));break}let p=new j(G(l.at(d).firstToken,l.at(c+d-1)?.lastToken)),T="";for(let w=d;w<c+d;w++){let C=l[w];T+=`${C instanceof tt?C.evaluate(n).toString():C.toString()}:`}if(u[T]??=[],u[T].push(p),d+=c,l.length<d+1){let w=c+1;i.push($(20,l[l.length-1],Br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%w===0?w:(l.length-f)%w).join(" ")}`]));break}let S=$n(l[d],o);if(!S){i.push($(17,l[d],Br.DiagnosticSeverity.Error));break}let b=S.getProperty(`#${r}-cells`);if(!b)return i.push($(16,l[d],Br.DiagnosticSeverity.Error,[...S.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${s.path.slice(1).join("/")}`])),i;d++;let v=Re(b,0,0,n);if(v==null)break;if(h.splice(-1,1,[...Array.from({length:c},(w,C)=>`${y}_ChildSpecifier${c>1?C:""}`),`${y}_SpecifierParent`,...Array.from({length:v},(w,C)=>`${y}_ParentSpecifier${v>1?C:""}`)]),d+=v,l.length<d){let w=c+1+v;i.push($(20,l[l.length-1],Br.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%w===0?w:(l.length-f)%w).join(" ")}`]));break}f=d,y++}return h.push([...Array.from({length:c},(p,T)=>`${y}_Interrupt${c>1?T:""}`),`${y}_SpecifierParent`,`${y}_ParentSpecifier...`]),t.signatureArgs=h.map(p=>p.map(T=>Br.ParameterInformation.create(T))),Object.values(u).forEach(p=>{p.length>1&&i.push($(30,p[p.length-1],Br.DiagnosticSeverity.Error,p.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 zP=()=>{let t=new Y(/^(?!interrupt-).*?-map-mask$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=we(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return r;let c=Re(a,0,0,n);if(c==null)return r;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>kn.create(u)),s.length!==c&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`])),r});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 WP=()=>{let t=new Y(/^(?!interrupt-).*?-map-pass-thru$/,V("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],i=e.parent,s=we(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return r;let c=Re(a,0,0,n);if(c==null)return r;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];return t.signatureArgs=l.map(u=>kn.create(u)),s.length!==c&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`])),r});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 HP=()=>{let t=new Y(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,V("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function Nn(){let t=new En;return t.addProperty([kN(),FN(),jN(),$N(),Kd(),Yd(),LN(),MN(),Gd(),xN(),IN(),ON(),BN(),NN(),DN(),CN(),AN(),PN(),RN(),UN(),UP(),VP(),zP(),WP(),HP()]),t}var GP=()=>{let t=new Y("chassis-type",V("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 YP=()=>{let t=new Y("serial-number",V("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
|
|
235
|
+
rialnumber.`],t};function KP(){let t=Nn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(s=>s.name==="#size-cells");n.required=()=>"required";let r=t.properties.find(s=>s.name==="model");r.required=()=>"required";let i=t.properties.find(s=>s.name==="compatible");return i.required=()=>"required",t.addProperty([GP(),YP()]),t}var $i=K(J());function XP(){let t=new En((n,r)=>{let i=[];return r.parent?.name!=="/"&&i.push($(26,r.definitions[0],$i.DiagnosticSeverity.Error,r.definitions.slice(1),[],["Aliases node can only be added to a root node"])),r.nodes.forEach(s=>{s.definitions.forEach(o=>{i.push($(26,o,$i.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],$i.TextEdit.del(Ss(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),i});t.noMismatchPropertiesAllowed=!0;let e=new Y(/^[-A-Za-z0-9]+$/,V(["STRING","U32"]),void 0,void 0,void 0,n=>{let r=[],i=n.ast.quickValues;if(i?.length===1&&typeof i[0]=="string"){if(!i[0].startsWith("/"))return r.push($(23,n.ast.values??n.ast,$i.DiagnosticSeverity.Error,[],[],[i[0],n.name])),r;if(i[0].trim().endsWith("/"))return r.push($(23,n.ast.values??n.ast,$i.DiagnosticSeverity.Error,[],[],["",i[0]])),r;let s=n.parent.root,o=i[0].split("/").slice(1);for(;o[0];){let a=s,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(s=l?a.getNode(l,d,!1):void 0,!s){r.push($(23,n.ast.values??n.ast,$i.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return r});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function JP(){let t=Nn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="reg");return e.required=()=>"required",t}var ZP=K(J());var QP=(t,e,n)=>{let r=t?.(e,n)??[],i=e.parent.root.getProperty(e.name),s=i?Re(i,0,0,n):void 0,o=e.parent.getProperty(e.name);return(o?Re(o,0,0,n):void 0)!==s&&r.push($(28,e.ast,ZP.DiagnosticSeverity.Error,[...i?.ast?[i.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),r};function eR(){let t=new En;t.noMismatchPropertiesAllowed=!0;let e=Kd(),n=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>QP(n,o,a),e.required=()=>"required";let r=Yd(),i=r?.additionalTypeCheck;r.additionalTypeCheck=(o,a)=>QP(i,o,a),r.required=()=>"required";let s=Gd();return s.required=()=>"required",s.type=V("EMPTY"),s.additionalTypeCheck=void 0,t.addProperty([e,r,s]),t}var tR=K(J());function nR(){let t=Nn();t.additionalValidations=(i,s)=>{let o=[];return s.parent?.name!=="/"&&o.push($(26,s.definitions[0],tR.DiagnosticSeverity.Error,s.definitions.slice(1),[],["Chosen node can only be added to a root node"])),o};let e=new Y("bootargs",V("STRING"));e.description=[`A string that specifies the boot arguments for
|
|
234
236
|
theclientprogram. Thevaluecouldpotentially
|
|
235
237
|
be a null string if no boot arguments are re-
|
|
236
238
|
quired.`];let n=new Y("stdout-path ",V("STRING"));n.description=[`A string that specifies the full path to the node
|
|
@@ -242,54 +244,66 @@ ified, stdout-path should be assumed to define
|
|
|
242
244
|
theinput device.`];let r=new Y("stdin-path ",V("STRING"));return r.description=[`A string that specifies the boot arguments for
|
|
243
245
|
theclientprogram. Thevaluecouldpotentially
|
|
244
246
|
be a null string if no boot arguments are re-
|
|
245
|
-
quired.`],t.addProperty([e,n,r]),t}var
|
|
247
|
+
quired.`],t.addProperty([e,n,r]),t}var Qg=K(J());function rR(){let t=Nn();t.additionalValidations=(i,s)=>s.parent?.name!=="/"?[$(26,s.definitions[0],Qg.DiagnosticSeverity.Error,s.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(i=>i.name==="#size-cells");n.required=()=>"required";let r=n?.additionalTypeCheck;return n.additionalTypeCheck=(i,s)=>{let o=r?.(i,s)??[],a=i.parent.getProperty(i.name);return(a?Re(a,0,0,s):void 0)!==0&&o.push($(28,i.ast,Qg.DiagnosticSeverity.Error,void 0,void 0,[`${i.name} value in cpus node must be '0'`])),o},t}var iR=K(J());function sR(){let t=Nn();t.additionalValidations=(r,i)=>i.parent?.name!=="cpus"?[$(26,i.definitions[0],iR.DiagnosticSeverity.Error,i.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=t.properties.find(r=>r.name==="device_type");e.required=()=>"required";let n=t.properties.find(r=>r.name==="reg");return n.required=()=>"required",n.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
|
|
246
248
|
CP U/threads represented by the CPU node.
|
|
247
249
|
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.
|
|
248
250
|
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.
|
|
249
251
|
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.
|
|
250
252
|
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
|
|
251
253
|
If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
|
|
252
|
-
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
|
|
253
|
-
any circumstances other than under the control of the device driver using the region.`],t};var HP=()=>{let t=new Y("reusable",V("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 GP=()=>{let t=new Y("size",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],s=Ee(e.ast.values),i=e.parent.sizeCells(n),o=[...Array.from({length:i},(a,c)=>`size${i>1?c:""}`)];return t.signatureArgs=o.map(a=>wn.create(a)),s?.length!==e.parent.sizeCells(n)&&r.push(L(19,e.ast.values??e.ast,En.Error,[],[],[e.name,`<${Array.from({length:i},()=>"size")}>`])),r});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function YP(){let t=kn(),e=t.properties.find(n=>n.name==="reg");return e.required=()=>"optional",t.addProperty([GP(),VP(),zP(),WP(),HP()]),t}function Ei(t){switch(t?.name){case"/":return OP();case"aliases":return IP();case"memory":return xP();case"reserved-memory":return LP();case"chosen":return jP();case"cpus":return FP();case"cpu":return UP()}return t?.parent?.name==="reserved-memory"?YP():kn()}var we=class t{constructor(e,n,r,s=null){this.bindingLoader=e;this.name=n;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];s?.addNode(this)}static toJson(e){let n={};return e.property.forEach(r=>n[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>n[r.fullName]=t.toJson(r)),n}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[Ei(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(n=>n===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(n=>n===e)?this:[...this._nodes,...this._deletedNodes.map(n=>n.node)].map(n=>n.getReferenceBy(e)).find(n=>n)}get nodeNameOrLabelRef(){return ko([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,n){let r=[...this.definitions,...this.referencedBy].find(s=>$n(s,e,n));if(r){let s=this.deletes.map(c=>({item:this,ast:Mr(c,e,n),beforeAst:Ya(c,e,n),afterAst:Ga(c,e,n)})).find(c=>$n(c.ast,e,n));if(s)return s;let i=[...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=>$n(c.ast,e,n)||c.ast.lastToken.value!==";"&&Wk(c.ast,e,n));if(i)return i.item.getDeepestAstNode(e,n);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,n)).find(c=>c);if(o)return o;let a=Mr(r,e,n);return{item:this,ast:a,beforeAst:Ya(a,e,n),afterAst:Ga(a,e,n)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ae).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.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.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.issues),...this._deletedNodes.flatMap(n=>n.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||e.push(Lt(9,this.definitions.at(-1).name??new j(G(this.definitions.at(-1).firstToken)),gr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[Lt(6,e.property.ast,gr.DiagnosticSeverity.Hint,[e.by],[gr.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(n=>Lt(6,n.ast,gr.DiagnosticSeverity.Hint,[e.by],[gr.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(n=>n instanceof Ae),...e.node.referencedBy].flatMap(n=>Lt(7,n,gr.DiagnosticSeverity.Hint,[e.by],[gr.DiagnosticTag.Deprecated],[n instanceof Ae?n.name.toString():n.labelReference.label.value]))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}get property(){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,n){return this._nodes.some(r=>r.name===e&&(r.address===n||r.address?.every((s,i)=>n?.at(i)===s)))}hasProperty(e){return this._properties.some(n=>n.name===e)}getProperty(e){return this._properties.find(n=>n.name===e)}deleteNode(e,n,r){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===r||r?.every((o,a)=>i.address?.at(a)===o)));s!==-1&&(this._deletedNodes.push({node:this._nodes[s],by:n}),this._nodes.splice(s,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Pt){let r=n.values[0].value;if(r instanceof Vt&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Pt){let r=n.values[0].value;if(r instanceof Vt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,n,r=!0){let s=r||!!n||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===n||o.address?.every((a,c)=>n?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,n){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:n}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let n=this._properties.findIndex(r=>r.name===e.name);if(n===-1)this._properties.push(e);else{let r=this._properties.splice(n,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[Ei(this)])}getChild(e,n=!0){let r=[...e];r.splice(0,1);let s=r[0].split("@"),i=s[0],o=s[1]!==void 0?s[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(i,o,n);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,n){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!n(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,n)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;regArray(e){if(this.#e!==void 0)return this.#e;let n=this.getProperty("reg");if(!n){this.#e=null;return}let r=this.parentAddressCells(e),s=this.parentSizeCells(e),i=[],o=Ee(n.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:r}).map(()=>o.pop()),c=Array.from({length:s}).map(()=>o.pop());if(![...a,...c].every(d=>d instanceof ht))continue;let l=a.map(d=>d.evaluate(e)),u=c.map(d=>d.evaluate(e));[...l,...u].every(d=>typeof d=="number")&&i.push({startAddress:l,endAddress:As(l,u),size:u,ast:new j(G(a[0].firstToken,c.at(-1)?.lastToken??a.at(-1)?.lastToken))})}return this.#e=i,this.#e}#t;rangeMap(e){if(this.#t!==void 0)return this.#t;let n=this.getProperty("ranges");if(!n){this.#t=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Ee(n.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof ht);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}#s;dmaRangeMap(e){if(this.#s!==void 0)return this.#s;let n=this.getProperty("dma-ranges");if(!n){this.#s=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Ee(n.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof ht);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#s=o,this.#s}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#n;addressCells(e){if(this.#n!==void 0)return this.#n;let n=this?.getProperty("#address-cells");return this.#n=n?Pe(n,0,0,e)??2:2,this.#n}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let n=this.getProperty("#size-cells");return this.#o=n?Pe(n,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let n=this.parent?.rangeMap(e),r=this.regArray(e);return this.#f=r?.flatMap(s=>{let i=s.startAddress,o=s.size,a=As(i,o),c=this.parent?.mappedReg(e),l={startAddress:i,startAddressRaw:i,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:s.ast};if(!n)return[l];let u=Kk(n,i);return u.length?u.map(d=>(l.mappedAst=d.ast,l.startAddress=d.start,l.endAddress=As(d.start,o),l.inMappingRange=xr(l.endAddress,d.end)<=0,l.mappingEnd=d.end,{...l,mappedAst:d.ast,startAddress:d.start,endAddress:As(d.start,o),inMappingRange:xr(l.endAddress,d.end)<=0,mappingEnd:d.end})):[l]}).sort((s,i)=>xr(s.endAddress,i.endAddress))??[],this.#f}getNexusMapEntyMatch(e,n,r,s=[]){let i=new j(G(r[0].firstToken,r.at(-1).lastToken)),o=this.getNexusMap(e,n);if(o){let a=[...s.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...r.map((l,u)=>{let d=l instanceof ht?l.evaluate(n):l;return(typeof d=="number"?d&(o.mapMask.at(u+s.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof ht?u.evaluate(n):u).toString()).join(":")===a);return{entry:i,match:c}}return{entry:i}}getNexusMap(e,n){let r=this.getProperty(`${e}-map`),s=Ee(r?.ast.values);if(!s?.length)return;let i=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=Pe(o,0,0,n);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(n));let c=[],l=0;for(;l<s.length;){let f=s.slice(l,a+l);if(l+=a,s.length<l+1)break;let h=qn(s[l],i);if(!h)break;let y=h.getProperty(`#${e}-cells`);if(!y)return;l++;let m=Pe(y,0,0,n);if(m==null||(e==="interrupt"&&(m+=h.addressCells(n)),l+=m,s.length<l))break;let b=s.slice(l-m,l);c.push({mappingValues:f,node:h,parentValues:b})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,h)=>(u?Pe(u,0,h,n):void 0)??4294967295),map:c}}toTooltipString(e){return`${this.labels.map(n=>n.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
254
|
+
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 oR=()=>{let t=new Y("alignment",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=we(e.ast.values),s=e.parent.sizeCells(n),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>kn.create(a)),i?.length!==s&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${Array.from({length:e.parent.sizeCells(n)},()=>"size")}>`])),r});return t.description=["Address boundary for alignment of allocation."],t};var aR=()=>{let t=new Y("alloc-ranges",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=we(e.ast.values);if(!i)return[];let s=e.parent.addressCells(n),o=e.parent.sizeCells(n),a=[...Array.from({length:s},(c,l)=>`address${s>1?l:""}`),...Array.from({length:o},(c,l)=>`size${o>1?l:""}`)];return t.signatureArgs=a.map(c=>kn.create(c)),t.signatureArgsCyclic=!0,(i.length===0||i.length%(s+o)!==0)&&r.push($(19,i.at(i.length-i.length%(o+s))??e.ast,wn.Error,[],[],[e.name,`<${[...Array.from({length:s},()=>"address"),...Array.from({length:o},()=>"size")].join(" ")}>`])),r});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var cR=()=>{let t=new Y("no-map",V("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
|
|
255
|
+
any circumstances other than under the control of the device driver using the region.`],t};var lR=()=>{let t=new Y("reusable",V("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 uR=()=>{let t=new Y("size",V("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],i=we(e.ast.values),s=e.parent.sizeCells(n),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>kn.create(a)),i?.length!==e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,wn.Error,[],[],[e.name,`<${Array.from({length:s},()=>"size")}>`])),r});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function dR(){let t=Nn(),e=t.properties.find(n=>n.name==="reg");return e.required=()=>"optional",t.addProperty([uR(),oR(),aR(),cR(),lR()]),t}function ws(t){switch(t?.name){case"/":return KP();case"aliases":return XP();case"memory":return JP();case"reserved-memory":return eR();case"chosen":return nR();case"cpus":return rR();case"cpu":return sR()}return t?.parent?.name==="reserved-memory"?dR():Nn()}var ke=class t{constructor(e,n,r,i=null){this.bindingLoader=e;this.name=n;this.address=r;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];i?.addNode(this)}static toJson(e){let n={};return e.property.forEach(r=>n[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>n[r.fullName]=t.toJson(r)),n}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[ws(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(n=>n===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(n=>n===e)?this:[...this._nodes,...this._deletedNodes.map(n=>n.node)].map(n=>n.getReferenceBy(e)).find(n=>n)}get nodeNameOrLabelRef(){return Po([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,n){let r=[...this.definitions,...this.referencedBy].find(i=>Kn(i,e,n));if(r){let i=this.deletes.map(c=>({item:this,ast:$r(c,e,n),beforeAst:Ka(c,e,n),afterAst:Ya(c,e,n)})).find(c=>Kn(c.ast,e,n));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=>Kn(c.ast,e,n)||c.ast.lastToken.value!==";"&&aN(c.ast,e,n));if(s)return s.item.getDeepestAstNode(e,n);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,n)).find(c=>c);if(o)return o;let a=$r(r,e,n);return{item:this,ast:a,beforeAst:Ka(a,e,n),afterAst:Ya(a,e,n)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Oe).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.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.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.issues),...this._deletedNodes.flatMap(n=>n.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||e.push(qt(9,this.definitions.at(-1).name??new j(G(this.definitions.at(-1).firstToken)),yr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[qt(6,e.property.ast,yr.DiagnosticSeverity.Hint,[e.by],[yr.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(n=>qt(6,n.ast,yr.DiagnosticSeverity.Hint,[e.by],[yr.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(n=>n instanceof Oe),...e.node.referencedBy].flatMap(n=>qt(7,n,yr.DiagnosticSeverity.Hint,[e.by],[yr.DiagnosticTag.Deprecated],[n instanceof Oe?n.name.toString():n.labelReference.label.value]))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}get property(){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,n){return this._nodes.some(r=>r.name===e&&(r.address===n||r.address?.every((i,s)=>n?.at(s)===i)))}hasProperty(e){return this._properties.some(n=>n.name===e)}getProperty(e){return this._properties.find(n=>n.name===e)}deleteNode(e,n,r){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===r||r?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:n}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof zt&&r.value===e)return[this,...this._nodes.flatMap(i=>i.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Rt){let r=n.values[0].value;if(r instanceof zt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,n,r=!0){let i=r||!!n||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===n||o.address?.every((a,c)=>n?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,n){let r=this._properties.findIndex(i=>i.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:n}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let n=this._properties.findIndex(r=>r.name===e.name);if(n===-1)this._properties.push(e);else{let r=this._properties.splice(n,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[ws(this)])}getChild(e,n=!0){let r=[...e];r.splice(0,1);let i=r[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,n);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,n){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!n(s.by)).map(s=>s.node)].find(s=>s.fullName===r[0])?.getChildFromScope(r,n)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;regArray(e){if(this.#e!==void 0)return this.#e;let n=this.getProperty("reg");if(!n){this.#e=null;return}let r=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=we(n.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:r}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(d=>d instanceof tt))continue;let l=a.map(d=>d.evaluate(e)),u=c.map(d=>d.evaluate(e));[...l,...u].every(d=>typeof d=="number")&&s.push({startAddress:l,endAddress:Ii(l,u),size:u,ast:new j(G(a[0].firstToken,c.at(-1)?.lastToken??a.at(-1)?.lastToken))})}return this.#e=s,this.#e}#t;rangeMap(e){if(this.#t!==void 0)return this.#t;let n=this.getProperty("ranges");if(!n){this.#t=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=we(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof tt))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}#i;dmaRangeMap(e){if(this.#i!==void 0)return this.#i;let n=this.getProperty("dma-ranges");if(!n){this.#i=null;return}let r=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=we(n.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:r}).map(()=>a.pop());if(![...c,...l,...u].every(y=>y instanceof tt))continue;let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#i=o,this.#i}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#n;addressCells(e){if(this.#n!==void 0)return this.#n;let n=this?.getProperty("#address-cells");return this.#n=n?Re(n,0,0,e)??2:2,this.#n}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let n=this.getProperty("#size-cells");return this.#o=n?Re(n,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let n=this.parent?.rangeMap(e),r=this.regArray(e);return this.#f=r?.flatMap(i=>{let s=i.startAddress,o=i.size,a=Ii(s,o),c=this.parent?.mappedReg(e),l={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:i.ast};if(!n)return[l];let u=dN(n,s);return u.length?u.map(d=>(l.mappedAst=d.ast,l.startAddress=d.start,l.endAddress=Ii(d.start,o),l.inMappingRange=Lr(l.endAddress,d.end)<=0,l.mappingEnd=d.end,{...l,mappedAst:d.ast,startAddress:d.start,endAddress:Ii(d.start,o),inMappingRange:Lr(l.endAddress,d.end)<=0,mappingEnd:d.end})):[l]}).sort((i,s)=>Lr(i.endAddress,s.endAddress))??[],this.#f}getNexusMapEntyMatch(e,n,r,i=[]){let s=new j(G(r[0].firstToken,r.at(-1).lastToken)),o=this.getNexusMap(e,n);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...r.map((l,u)=>{let d=l instanceof tt?l.evaluate(n):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 tt?u.evaluate(n):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,n){let r=this.getProperty(`${e}-map`),i=we(r?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=Re(o,0,0,n);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(n));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let h=$n(i[l],s);if(!h)break;let y=h.getProperty(`#${e}-cells`);if(!y)return;l++;let p=Re(y,0,0,n);if(p==null||(e==="interrupt"&&(p+=h.addressCells(n)),l+=p,i.length<l))break;let T=i.slice(l-p,l);c.push({mappingValues:f,node:h,parentValues:T})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,h)=>(u?Re(u,0,h,n):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.property.length?`
|
|
254
256
|
`:""}${this.property.map(n=>n.toPrettyString(e)).join(`
|
|
255
257
|
`)}${this.nodes.length?`
|
|
256
258
|
${this.nodes.map(n=>`${n.fullName}{ /* ... */ };`).join(`
|
|
257
259
|
`)}`:""}
|
|
258
|
-
};`}toMarkupContent(e){return{kind:
|
|
259
|
-
`)}}toFullString(e,n=1){let r=this.definitions.some(
|
|
260
|
-
${" ".repeat(n)}`:""}${this.property.map(
|
|
260
|
+
};`}toMarkupContent(e){return{kind:yr.MarkupKind.Markdown,value:["### Path",this.pathString,"### Current State","```devicetree",this.toTooltipString(e),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
|
|
261
|
+
`)}}toFullString(e,n=1){let r=this.definitions.some(s=>s instanceof Oe&&s.omitIfNoRef),i=r&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return i?`/* /omit-if-no-ref/ ${this.labels.map(s=>s.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
262
|
+
${" ".repeat(n)}`:""}${this.property.map(s=>s.toString()).join(`
|
|
261
263
|
${" ".repeat(n)}`)}${this.nodes.length?`
|
|
262
|
-
${" ".repeat(n)}${this.nodes.map(
|
|
264
|
+
${" ".repeat(n)}${this.nodes.map(s=>`${s.fullName}{ ... };`).join(`
|
|
263
265
|
${" ".repeat(n)}`)}`:""}
|
|
264
|
-
${" ".repeat(n-1)}}; */`:`${
|
|
265
|
-
${" ".repeat(n-1)}`:""}${this.
|
|
266
|
-
${" ".repeat(n)}`:""}${this.property.map(
|
|
266
|
+
${" ".repeat(n-1)}}; */`:`${i?"/* /omit-if-no-ref/ ":r?`/* /omit-if-no-ref/ */
|
|
267
|
+
${" ".repeat(n-1)}`:""}${this.uniqueLabels()}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
268
|
+
${" ".repeat(n)}`:""}${this.property.map(s=>s.toPrettyString(e)).join(`
|
|
267
269
|
${" ".repeat(n)}`)}${this.nodes.length?`
|
|
268
|
-
${" ".repeat(n)}${this.nodes.map(
|
|
270
|
+
${" ".repeat(n)}${this.nodes.map(s=>s.toFullString(e,n+1)).join(`
|
|
269
271
|
${" ".repeat(n)}`)}`:""}
|
|
270
|
-
${" ".repeat(n-1)}}; ${
|
|
271
|
-
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var
|
|
272
|
+
${" ".repeat(n-1)}}; ${i?" */":""}`}serialize(e){let n=this.mappedReg(e),r=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof En?{...this.nodeType,properties:i.properties.map(s=>({name:typeof s.name=="string"?s.name:s.name.toString(),allowedValues:s.allowedValues,type:s.type}))}:void 0,issues:r.flatMap(s=>s.serializeIssues),path:this.pathString,name:this.fullName,nodes:r.map(s=>s.serialize(e)),properties:this.property.map(s=>s.ast.serialize(e)),childNodes:this.nodes.map(s=>s.serialize(e)),reg:n?.map(s=>({mappedStartAddress:s?.startAddress,mappedEndAddress:s?.endAddress,startAddress:s?.startAddressRaw,endAddress:s?.endAddressRaw,size:s?.size,inMappingRange:s?.inMappingRange}))}}};var xo=K(J());var Zg=K(J());var qi=class extends j{constructor(n,r){super(r);this.label=n;this.docSymbolsMeta={name:this.label.value,kind:Zg.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`${this.label.toString()}:`}},Wt=class extends j{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value,kind:Zg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(n){let r=this.parentNode;if(!(r instanceof be&&r.linksTo)){super.buildSemanticTokens(n);return}n(Ts("type"),_s("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var ze=class{constructor(e,n){this.ast=e;this.parent=n;this.nexusMapsTo=[]}getDeepestAstNode(e,n){let r=$r(this.ast,e,n);return this.ast.assignOperatorToken&&Og(this.ast.assignOperatorToken,e,n)?{item:this,ast:r,beforeAst:Ka(this.ast,e,n),afterAst:Ya(this.ast,e,n)}:{item:this,ast:r}}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(n=>n===e)?this:null}))}getArgumentIndex(e){if(!e)return;let n=this.ast.getFlatAstValues()?.findIndex(r=>r===e||r?.isAncestorOf(e));return n===-1?void 0:n}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[qt(0,this.replaces.ast,xo.DiagnosticSeverity.Hint,[this.ast],[xo.DiagnosticTag.Unnecessary],[this.name])]:[]]}onHover(){if(this.nexusMapsTo.length)return{kind:xo.MarkupKind.Markdown,value:["### Nexus mappings",...this.nexusMapsTo.flatMap(e=>["```",`${this.name} = <... ${e.mappingValuesAst.map(n=>n.toString()).join(" ")} ...> maps to <... ${e.mapItem.mappingValues.map(n=>n.toString()).join(" ")} ...>;`,"```",`[Mapping (${e.mappingValuesAst.map(n=>n.toString()).join(" ")})](${`${e.mapItem.mappingValues[0].uri}#L${e.mapItem.mappingValues[0].firstToken.pos.line}`})`])].join(`
|
|
273
|
+
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var yR=K(J());var uc=require("fs");var nf=class t{constructor(e,n){this.text=e;this.uri=n;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
272
274
|
`,`
|
|
273
275
|
`).split(/\n/).map(r=>`${r}
|
|
274
276
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
275
|
-
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!t.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&t.isSyntaxChar(this.currentChar)){this.move();break}let n=this.lineNumber;if(!this.move()||this.lineNumber!==n)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let n=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(n+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(n+=this.currentChar??"");else return n}if(!this.move())return n}return this.move(),n+=e,n}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let n=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!n)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return n&&!r?.tokens.some(s=>s===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let n={...e,uri:this.uri},r=this._tokens.at(-1);n.prevToken=r,r&&(r.nextToken=n),this._tokens.push(n)}isLetters(e){let n=e.match(/^[A-Za-z]+/);return n?.[0]?(this.pushToken({tokens:[47],value:n?.[0],pos:this.generatePos(e,n?.[0])}),!0):!1}isDigit(e){let n=e.match(/^[0-9]/);return n?.[0]?(this.pushToken({tokens:[20,19],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isHexDigit(e){let n=e.match(/^[A-Fa-f]/);return n?.[0]?(this.pushToken({tokens:[20,47],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isCurlyOpen(e){let n="{";return e===n?(this.pushToken({tokens:[2],pos:this.generatePos(e,n),value:"{"}),!0):!1}isCurlyClose(e){let n="}";return e===n?(this.pushToken({tokens:[3],pos:this.generatePos(e,n),value:"}"}),!0):!1}isSemicolon(e){let n=";";return e===n?(this.pushToken({tokens:[1],pos:this.generatePos(e,n),value:n}),!0):!1}isColon(e){let n=":";return e===n?(this.pushToken({tokens:[50],pos:this.generatePos(e,n),value:n}),!0):!1}isHash(e){let n="#";return e.startsWith(n)?(this.pushToken({tokens:[46],pos:this.generatePos(e,n),value:n}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let n="=";return e===n?(this.pushToken({tokens:[0],pos:this.generatePos(e,n),value:n}),!0):!1}isGtSym(e){let n=">";return e===n?(this.pushToken({tokens:[4],pos:this.generatePos(e,n),value:n}),!0):!1}isLtSym(e){let n="<";return e===n?(this.pushToken({tokens:[5],pos:this.generatePos(e,n),value:n}),!0):!1}isLogicalNot(e){let n="!";return e===n?(this.pushToken({tokens:[6],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseOr(e){let n="|";return e===n?(this.pushToken({tokens:[8],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseXOr(e){let n="^";return e===n?(this.pushToken({tokens:[9],pos:this.generatePos(e,n),value:n}),!0):!1}isAmpersand(e){let n="&";return e===n?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseNot(e){let n="~";return e===n?(this.pushToken({tokens:[10],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundOpen(e){let n="(";return e===n?(this.pushToken({tokens:[42],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundClose(e){let n=")";return e===n?(this.pushToken({tokens:[43],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareOpen(e){let n="[";return e===n?(this.pushToken({tokens:[11],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareClose(e){let n="]";return e===n?(this.pushToken({tokens:[12],pos:this.generatePos(e,n),value:n}),!0):!1}isComma(e){let n=",";return e===n?(this.pushToken({tokens:[24],pos:this.generatePos(e,n),value:n}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let n=e.match(/^["']/);if(n?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,s=this.columnNumber-1,i=this.getString(n[0]),o=i.length+this.numberOfEscapedCharsLastString;return this.pushToken({tokens:[21],value:i,pos:{col:s,line:r,len:o,colEnd:s+o}}),!0}return!1}isForwardSlash(e){let n="/";return e===n?(this.pushToken({tokens:[13],pos:this.generatePos(e,n),value:"/"}),!0):!1}isBackSlash(e){let n="\\";return e===n?(this.pushToken({tokens:[14],pos:this.generatePos(e,n),value:"\\"}),!0):!1}isAddOperator(e){let n="+";return e===n?(this.pushToken({tokens:[15],pos:this.generatePos(e,n),value:n}),!0):!1}isQuestionMark(e){let n="?";return e===n?(this.pushToken({tokens:[44],pos:this.generatePos(e,n),value:n}),!0):!1}isPeriod(e){let n=".";return e===n?(this.pushToken({tokens:[45],pos:this.generatePos(e,n),value:n}),!0):!1}isNegateOperator(e){let n="-";return e===n?(this.pushToken({tokens:[16],pos:this.generatePos(e,n),value:n}),!0):!1}isUnderScore(e){let n="_";return e===n?(this.pushToken({tokens:[48],pos:this.generatePos(e,n),value:n}),!0):!1}isAt(e){let n="@";return e===n?(this.pushToken({tokens:[49],pos:this.generatePos(e,n),value:n}),!0):!1}isMultiplicationOperator(e){let n="*";return e===n?(this.pushToken({tokens:[17],pos:this.generatePos(e,n),value:n}),!0):!1}isModulusOperator(e){let n="%";return e===n?(this.pushToken({tokens:[18],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefine(e){let n="#define";return e.toLowerCase()===n?(this.pushToken({tokens:[25],pos:this.generatePos(e,n),value:n}),!0):!1}isCInclude(e){let n="#include";return e.toLowerCase()===n?(this.pushToken({tokens:[26],pos:this.generatePos(e,n),value:n}),!0):!1}isCLine(e){let n="#line";return e.toLowerCase()===n?(this.pushToken({tokens:[27],pos:this.generatePos(e,n),value:n}),!0):!1}isCUndef(e){let n="#undef";return e.toLowerCase()===n?(this.pushToken({tokens:[28],pos:this.generatePos(e,n),value:n}),!0):!1}isCError(e){let n="#error";return e.toLowerCase()===n?(this.pushToken({tokens:[29],pos:this.generatePos(e,n),value:n}),!0):!1}isCPragma(e){let n="#pragma";return e.toLowerCase()===n?(this.pushToken({tokens:[30],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefined(e){let n="#defined";return e.toLowerCase()===n?(this.pushToken({tokens:[31],pos:this.generatePos(e,n),value:n}),!0):!1}isCIf(e){let n="#if";return e.toLowerCase()===n?(this.pushToken({tokens:[32],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfDef(e){let n="#ifdef";return e.toLowerCase()===n?(this.pushToken({tokens:[33],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfNDef(e){let n="#ifndef";return e.toLowerCase()===n?(this.pushToken({tokens:[34],pos:this.generatePos(e,n),value:n}),!0):!1}isCElIf(e){let n="#elif";return e.toLowerCase()===n?(this.pushToken({tokens:[35],pos:this.generatePos(e,n),value:n}),!0):!1}isCElse(e){let n="#else";return e.toLowerCase()===n?(this.pushToken({tokens:[36],pos:this.generatePos(e,n),value:n}),!0):!1}isCEndIf(e){let n="#endif";return e.toLowerCase()===n?(this.pushToken({tokens:[37],pos:this.generatePos(e,n),value:n}),!0):!1}isCTrue(e){let n="true";return e==n?(this.pushToken({tokens:[38],value:n,pos:this.generatePos(e,n)}),!0):!1}isCFalse(e){let n="false";return e==n?(this.pushToken({tokens:[39],value:n,pos:this.generatePos(e,n)}),!0):!1}generatePos(e,n){let r=this.columnNumber-e.length+this.lineNumberOfEscapedChars;return{line:this.lineNumber,col:r,len:n.length,colEnd:r+n.length}}};var at=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var Vg=require("fs"),Mo=require("path");var KP=K(J());var Ot=class extends ht{constructor(n,r){super(r);this.name=n;this.docSymbolsMeta={name:this.name.toString(),kind:KP.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Jd=class extends j{constructor(n,r){super(r);this.operator=n;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var XP=K(J());var Qd=class extends at{toString(){return"..."}},Fr=class extends j{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(n){return le(this.uri,n)?[{name:this.functionName.name,kind:XP.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r.getDocumentSymbols(n))}]:[]}toString(){return`${this.functionName}(${this.params.map(n=>n.toString()).join(",")})`}};var Ls=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,n=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!le(this.currentToken?.uri,e.uri))return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(n){let o=new j(G(s,i));this._issues.push(H(22,o))}return i};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(),n=this.positionStack.pop();if(n===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=n}peekIndex(e=1){let n=this.positionStack.at(-1*e);if(n===void 0)throw new Error("Index out of bounds");return n}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 n=[];return e.every(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(n.push(s),this.moveToNextToken,o=cn(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),n}consumeAnyConcurrentTokens(e){this.enqueueToStack();let n=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)n.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=cn(r,this.currentToken);return this.mergeStack(),n}getDocumentSymbols(e){return this.allAstItems.flatMap(n=>n.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,n){let r=[],s=(i,o,a)=>{if(!a?.start||!a?.end||!le(a.start.uri,n)||!le(a.end.uri,n))return;let c=a.end.pos.colEnd-a.start.pos.col;r.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),r.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let s=r.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Ot(s,G(r[0],r.at(-1)));return!n&&i.name!=="defined"&&(e.get(i.name)||this._issues.push(H(42,i))),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let n=e,r;if(F(e,40)?(r="&",F(this.currentToken,40)&&(r="&&",n=this.moveToNextToken)):F(e,10)?(r="!",F(this.currentToken,0)&&(r="!=",n=this.moveToNextToken)):F(e,8)?(r="|",F(this.currentToken,8)&&(r="||",n=this.moveToNextToken)):F(e,9)?r="^":F(e,4)?(r=">",F(this.currentToken,4)?(r="<<",n=this.moveToNextToken):F(this.currentToken,0)&&(r=">=",n=this.moveToNextToken)):F(e,5)?(r="<",F(this.currentToken,5)?(r=">>",n=this.moveToNextToken):F(this.currentToken,0)&&(r="<=",n=this.moveToNextToken)):F(e,15)?r="+":F(e,16)?r="-":F(e,17)?r="*":F(e,13)?r="/":F(e,18)?r="%":F(e,46)?F(this.currentToken,46)&&(r="##",n=this.moveToNextToken):F(e,0)&&F(this.currentToken,0)&&(r="==",n=this.moveToNextToken),r){let s=new Jd(r,G(e,n));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,n,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=i},a=h=>h.flatMap(y=>"items"in y?a(y.items):y),c=[s],l=[];l[0]={rewind:o,tokens:[]};let u=this.currentToken;for(;u&&!n(u);){if(r?.(u)){let h=this.peekIndex()+1,y=()=>{this.positionStack[this.positionStack.length-1]=h};c.push(u),l[l.length]={rewind:y,tokens:[]}}else if(e(u)){let h=this.parseScopedBlock(e,n,r);h&&(c.push(h),l[l.length-1].tokens.push(...a(h.items))),u=this.currentToken;continue}else c.push(u),l[l.length-1].tokens.push(u);this.moveToNextToken,u=this.currentToken}let d=u;d&&n(d)&&(this.moveToNextToken,c.push(d));let f={startToken:s,items:c,splitTokens:l,endToken:d};return this.mergeStack(),f}isFunctionCall(e){this.enqueueToStack();let n=this.processCIdentifier(e,!1);if(!n){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(n.name==="defined")r.length>1?this._issues.push(H(44,n)):r.length<1&&this._issues.push(H(45,n));else{let i=e.get(n.name)?.macro;i&&(i?.identifier instanceof Fr?r.length>i.identifier.params.length?this._issues.push(H(44,n,void 0,[i])):r.length<i.identifier.params.length&&this._issues.push(H(45,n,void 0,[i])):this._issues.push(H(43,n)))}let s=new Ds(n,r);return s.lastToken=this.prevToken,this.mergeStack(),s}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([it("0"),it("x")]);if(e.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(Ie));if(!n.length){this.popStack();return}let r=Number.parseInt(n.map(i=>i.value).join(""),16),s=new Vt(r,G(e[0],n.at(-1)));return this.mergeStack(),s}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(Ie));if(!e.length){this.popStack();return}let n=Number.parseInt(e.map(s=>s.value).join(""),10),r=new Vt(n,G(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let n,r,s;if(F(this.currentToken,42))return n=this.moveToNextToken,r=n,s=this.processExpression(e,!0),s&&(s=new Ti(new Ti(s,!0),!1)),F(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(H(26,new j(G(n)))),this.mergeStack(),s;this.popStack()}processExpression(e,n=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!r){this.popStack();return}if(n){let s=this.isOperator();for(;s;){let i=this.processExpression(e);i?r instanceof Ti?r.addExpression(s,i):r=new Ti(r,!1,{operator:s,expression:i}):this._issues.push(H(27,s)),s=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!F(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!F(r,42),r=>!!F(r,43),r=>!!F(r,24));return e?.items.length===2&&F(e.endToken,43)?[]:e?.splitTokens.map((r,s)=>r.tokens.length===0?null:new Ir(r.tokens.map((i,o)=>{let a=i.value;return i.pos.line===r.tokens.at(o+1)?.pos.line&&(a=a.padEnd(r.tokens[o+1].pos.col-i.pos.col," ")),a}).join(""),G(r.tokens[0],r.tokens.at(-1)),s))}};var Zd=class t extends Ls{constructor(n){super();this.uri=n;this.comments=[];this.tokens=[]}cleanUpComments(){let n=[];for(let r=0;r<this.tokens.length;r++){let s=t.processBlockComments(this.tokens,r)||t.processLineComments(this.tokens,r);s&&(r=s.index,n.push(...s.tokenUsed),this.comments.push(...s.comments))}n.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=yr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(n,r){let s=[],i=()=>(s.push(r++),n[r]),o=()=>n[r],a=()=>n[r-1],c=o(),l=c;if(!c||!F(c,13)||(l=i(),!F(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!F(a(),17)||!F(o(),13)||!cn(a(),o())),d=l.pos.line,f=c,h=[];l=i();do{if(o()?.pos.line!==d){let m=new Lr(G(f,a()));h.push(m),d=o().pos.line??0,f=o()}l=i()}while(r<n.length&&!u());let y=new Lr(G(f,o()));return h.push(y),i(),{comments:h,tokenUsed:s,index:r-1}}static processLineComments(n,r){let s=[];if(!F(n[r],13)||n.length===r+1||!F(n[r+1],13)||!cn(n[r],n[r+1]))return;let i=[];for(;n[r].pos.line===n.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=n[s.at(-1)],a=new Lr(G(n[s[0]],n[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var JP=K(J()),ef=class extends j{constructor(n,r){super(n);this.content=r}toString(){let n=this.content.filter(r=>!F(r,14));return n.map((r,s)=>{let i=r.value;return r.pos.line===n.at(s+1)?.pos.line?i=i.padEnd(n[s+1].pos.col-r.pos.col," "):n.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},tc=class extends j{constructor(n,r,s){super();this.keyword=n;this.identifier=r;this.content=s;this.addChild(n),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ot?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:JP.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
276
|
-
`)}}};var wi=class extends j{constructor(e){super(e)}},nc=class extends j{constructor(n,r){super();this.keyword=n;this.content=r;this.active=!1;this.addChild(n)}},rc=class extends nc{constructor(n,r,s){super(n,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(n){return this.identifier&&n.has(this.identifier.name)}},tf=class extends nc{constructor(n,r,s){super(n,s);this.expression=r;this.addChild(r),this.addChild(s)}useBlock(n){return this.expression instanceof Ds?this.expression.functionName.name==="defined"?this.expression&&n.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(n):this.expression?.isTrue(n)}},nf=class extends rc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},sc=class extends nc{};var xo=class extends j{constructor(n,r,s){super();this.ifDef=n;this.endIf=r;this.elseOption=s;this.addChild(n),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(n,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(n);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}},qs=class extends j{constructor(n,r,s){super();this.ifBlocks=n;this.endIf=r;this.elseOption=s;n.forEach(i=>this.addChild(i)),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(n,r){let s=[],i=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{s.push({start:i(a.tokenIndexes.start),end:i(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(n)?(a.active=!0,o=!0):a.content&&s.push({start:i(a.content.tokenIndexes.start),end:i(a.content.tokenIndexes.end)})}),this.elseOption&&(s.push({start:i(this.elseOption.keyword.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var ic=K(J());var $o=class extends Ls{constructor(n,r,s){super();this.uri=n;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}get currentToken(){let n=this.prevToken,r=$r(n,this.tokens.at(this.peekIndex()))||!n||F(n,14)&&n.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&F(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(n){super.reset(),this.macros.clear(),n?(this.macroSnapShot.clear(),Array.from(n).forEach(([r,s])=>this.macroSnapShot.set(r,s)),Array.from(n).forEach(([r,s])=>this.macros.set(r,s))):Array.from(this.macroSnapShot).forEach(([r,s])=>this.macros.set(r,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(n){let r=this.stable;return this.parsing=new Promise(s=>{r.then(()=>{if(n&&n.size===this.macroSnapShot.size){let i=Array.from(n);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),s();return}}this.reset(n),this.parse().then(s)})}),this.parsing}async parse(){let n=new Zd(this.uri);if(await n.stable,this.tokens=n.tokens,this.nodes.push(...n.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 r=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,25))return this.popStack(),!1;this.macroStart=!0;let s=new at(G(r)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(H(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new ef(G(o[0],o.at(-1)),o));let c=new tc(s,i,a);this.macros.set(c.name,{macro:c,resolver:Yk(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(n,l-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,28))return this.popStack(),!1;this.macroStart=!0;let s=new at(G(r)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(H(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=new tc(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(n,a-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let n=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&n.push(r)}return n}isFunctionDefinition(){this.enqueueToStack();let n=this.processCIdentifier(this.macros,!0);if(!n){this.popStack();return}let r=this.moveToNextToken;if(!F(r,42)||!cn(n.lastToken,r)){this.popStack();return}let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!F(this.currentToken,24)&&!F(this.currentToken,43)?this._issues.push(H(28,i)):F(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Fr(n,s);return F(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(H(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(45),Ie(45),Ie(45)]);if(n.length!==3){this.popStack();return}let r=new Qd(G(n[0],n.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let n=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>F(o,a))&&!$r(o.prevToken,o),o=>!!o&&[37].some(a=>F(o,a))&&!$r(o.prevToken,o),o=>!!o&&[36,35].some(a=>F(o,a))&&!$r(o.prevToken,o));if(!r)return;let s;F(r.startToken,32)?s=this.processIfBlock(r,(o,a,c)=>new tf(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>F(r.startToken,33)?new rc(o,a??null,c):new nf(o,a??null,c)),this.nodes.push(s),s.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...s instanceof qs?s.ifBlocks:[s.ifDef],...s.elseOption?[s.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(H(47,o.content,ic.DiagnosticSeverity.Hint,[],[ic.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=n}processIfDefBlock(n,r){this.enqueueToStack(),this.macroStart=!0;let s=new at(G(n.startToken));n.splitTokens[0].rewind();let i=this.processCIdentifier(this.macros,!0);i||this._issues.push(H(31,s)),this.macroStart=!1;let o,a=i?.lastToken.nextToken??s.lastToken.nextToken;a&&n.splitTokens[0].tokens.find(f=>f===a)&&(o=new wi(G(a,n.splitTokens[0].tokens.at(-1))));let c=r(s,i??null,o??null),l;if(n.splitTokens.length>1){let f=n.splitTokens[1].tokens[0].prevToken,h=new at(G(f)),y;n.splitTokens[1].tokens.length&&(y=new wi(G(n.splitTokens[1].tokens[0],n.splitTokens[1].tokens.at(-1)))),l=new sc(h,y??null)}let u;n.endToken?u=new at(G(n.endToken)):this._issues.push(H(46,s));let d=new xo(c,u??null,l);return this.mergeStack(),d}processIfBlock(n,r){this.enqueueToStack();let s=new at(G(n.startToken)),i=[],o;n.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new at(G(d));this.macroStart=!0;let h=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===n.splitTokens.length-1&&F(d,36)){let m=d,b=new at(G(m)),E;l.tokens.length&&(E=new wi(G(l.tokens[0],l.tokens.at(-1)))),o=new sc(b,E??null)}else{h||this._issues.push(H(31,s));let m,b=h?.lastToken.nextToken??s.lastToken.nextToken;b&&l.tokens.find(_=>_===b)&&(m=new wi(G(b,n.splitTokens[u].tokens.at(-1))));let E=r(f,h??null,m??null);i.push(E)}});let a;n.endToken?a=new at(G(n.endToken)):this._issues.push(H(46,s));let c=new qs(i,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(n){if(n.path.path)return n.path.relative?[(0,Mo.resolve)((0,Mo.dirname)(n.uri),n.path.path),...this.incudes.map(r=>(0,Mo.resolve)(r,n.path.path))].find(r=>(0,Vg.existsSync)(r)):this.incudes.map(r=>(0,Mo.resolve)(r,n.path.path)).find(r=>(0,Vg.existsSync)(r))}async processInclude(){this.enqueueToStack();let n=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if(F(r,26))this.moveToNextToken;else{let m=this.checkConcurrentTokens([Ie(13),it("include"),Ie(13)]);if(m.length!==3)return this.popStack(),!1;s=m[0],i=m.at(-1)}let o=s,a=new at(G(s,i));r=this.moveToNextToken;let c=r,l=!!F(r,21);if(!c||!l&&!F(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!F(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new No(u,l,G(c,r)),f=new Os(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!F(this.currentToken,4)?this._issues.push(H(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let h=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(H(36,f.path,ic.DiagnosticSeverity.Warning)),y){yr().requestTokens(y,!0);let m=await oc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await m.stable,this._issues.push(...m.issues),this.macros.clear(),Array.from(m.macros).forEach(([b,E])=>this.macros.set(b,E)),y.endsWith(".h")?this.tokens.splice(n,h-n):this.tokens.splice(n,h-n,...m.tokens),this.nodes.push(...m.nodes),this.dtsIncludes.push(...m.dtsIncludes)}else this.tokens.splice(n,h-n);return this.positionStack[this.positionStack.length-1]=n,!0}};var QP,zg=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,n,r,s){e=et(e);let i=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(i);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new $o(e,n,r),c=this.includeOwners.get(a)??new Set;return c.add(s),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(i,a),a}reset(e){e=et(e);let n=this.headerFiles.get(e);n&&Array.from(n).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function oc(){return QP??=new zg,QP}var ZP,Wg=class t{constructor(){this.fileMap=new Map}static clone(e){let n=e.map(r=>({...r}));return n.forEach((r,s)=>{r.prevToken=n[s-1],r.nextToken=n[s+1]}),n}needsRenew(e,n){return e=et(e),this.fileMap.get(e)?.text!==n}renewLexer(e,n){if(e=et(e),oc().reset(e),!e||!(0,rf.existsSync)(e))return[];try{n??=(0,rf.readFileSync)(e).toString();let r=new Xd(n,e);return this.fileMap.set(e,r),t.clone(r.tokens)}catch{}return[]}requestTokens(e,n){e=et(e);let r=this.fileMap.get(e)?.tokens;return!r&&n?[...this.renewLexer(e)]:t.clone(r??[])}reset(e){e=et(e),oc().reset(e),this.fileMap.delete(e)}};function yr(){return ZP??=new Wg,ZP}var Lo=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new we(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let n=this.fileTopMostAstCache.get(e);if(n)return n;let r=[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(s=>s.cPreprocessorParser.allAstItems)].flatMap(s=>s.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,r),r}getDeepestAstNode(e,n){let s=this.fileTopMostAsts(e).find(i=>$n(i,e,n)||Hk(yr().requestTokens(e,!1),i,n));if(s instanceof qt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,n);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Mr(s,e,n)}}else if(s instanceof Tt&&s.path){let i=this.rootNode.getDeepestAstNode(e,n);return i?{...i,runtime:this}:void 0}else if(s instanceof Ae&&s.path){let i=t.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,n);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:Mr(s,e,n)}}static getNodeFromPath(e,n,r=!0){if(e.length===0)return n;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=n.getNode(i,a,r);return l?t.getNodeFromPath(c,l,r):void 0}resolvePath(e,n){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(n??=this.rootNode.allDescendantsLabels,n.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof He)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],n=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{n.has(r.label.label.value)?n.get(r.label.label.value)?.push(r):n.set(r.label.label.value,[r])}),Array.from(n).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof we);(!s.every(a=>a&&a.owner===i?.owner)||!i)&&e.push(Lt(4,s.at(0).label,eR.DiagnosticSeverity.Error,s.slice(1).map(a=>a.label),[],[s.at(0).label.label.value]))}}),e}get typesIssues(){let e=n=>[...n.nodeType?.getIssue(this,n)??[],...n.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return Gk([...e.definitions,...e.referencedBy],this.context)}};var tR=K(J()),sf=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Values",kind:tR.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(n=>n?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(n=>n?.toJson())}};var nR=K(J()),of=class extends j{constructor(n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:"DTS Document version",kind:nR.SymbolKind.Function}}};var Br=class extends j{constructor(n,r){super();this.value=n;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(n)??"NULL"}`}toPrettyString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(n)??"NULL"}`}};var rR=K(J()),af=class extends j{constructor(n,r,s){super();this.keyword=n;this.startAddress=r;this.endAddress=s;this.addChild(n),this.docSymbolsMeta={name:"Memreserve",kind:rR.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var sR=K(J()),cf=class extends j{constructor(n,r){super();this.keyword=n;this.bitsSize=r;this.addChild(n),this.docSymbolsMeta={name:"bits",kind:sR.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var iR=K(J()),ac=class extends Ls{constructor(n,r,s){super();this.uri=n;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new He;this.unhandledStatements=new Tt;this.cPreprocessorParser=new $o(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(n=>n.resolvedPath).filter(n=>!!n)]}reset(){super.reset(),this.others=[],this.rootDocument=new He,this._issues=[],this.unhandledStatements=new Tt}async reparse(){let n=performance.now(),r=this.stable;return this.parsing=new Promise(s=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-n),s()})}),this.parsing}async parse(){let n=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,et(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new j(G(s));this._issues.push(H(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(H(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(H(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(n){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!F(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!F(s,i))return this.popStack(),!1;let o=new Tt;o.openScope=s,n.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(n){let r=this.currentToken;if(F(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new j(G(s));this._issues.push(H(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(n.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return F(this.currentToken,3)||F(this.currentToken,1)}endStatement(n=!0){let r=this.currentToken;if(!F(r,1)){let s=this.prevToken;if(s&&n){let i=new j(G(this.prevToken));return this._issues.push(H(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;F(this.currentToken,1);){let n=this.moveToNextToken;if(n){let r=new j(G(n));this._issues.push(H(23,r))}}}processNode(n,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(n,r)||this.isProperty(n)||this.isDeleteNode(n,r)||this.isDeleteProperty(n),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(G(o));this._issues.push(H(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(n=!1){let r=[],s=this.isLabelAssign(n);for(;s;)r.push(s),s=this.isLabelAssign(n);return r}isChildNode(n,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new qt(i):new Ae(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!F(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(H(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof qt?(c.labelReference=a,l=!0):o&&c instanceof Ae&&(l=o.address!==void 0,c.name=o),F(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(H(2,u))}else return this.popStack(),!1;return n.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let n=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(Ie)),s=a=>{a=a.replace(/^0x/,"").replace(/\s+/g,""),a.length%8!==0&&(a=a.padStart(Math.ceil(a.length/8)*8,"0"));let c=[];for(let l=0;l<a.length;l+=8){let u=a.slice(l,l+8);c.push(parseInt(u,16)>>>0)}return c},i=r.length?s(r.map(a=>a.value).join("")):[NaN];if(n){if(i.some(a=>Number.isNaN(a))){let a=new j(G(n));this._issues.push(H(8,a))}else if(!Number.isNaN(i)&&!cn(n,r[0])){let a=new j(G(n,r.at(0)));this._issues.push(H(29,a))}}return new qd(i,G(r[0]??this.prevToken,r.at(-1)))}processNodeAddresses(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(49)]);if(r.length){if(!cn(n.lastToken,r[0])){let o=new j(G(n.lastToken,r[0]));this._issues.push(H(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),F(this.currentToken,24)){if(this.prevToken&&!cn(this.prevToken,this.currentToken)){let o=new j(G(this.prevToken,this.currentToken));this._issues.push(H(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Ie));if(!n.length){this.popStack();return}let r=n.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new qe(r,G(n[0],n.at(-1))),i=this.processNodeAddresses(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Ie));if(!n.length){this.popStack();return}let r=new We(n.map(s=>s.value).join(""),G(n[0],n.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!n.length){this.popStack();return}let r=n.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new zt(r,G(n[0],n.at(-1)));return this.mergeStack(),s}isLabelAssign(n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let s=r.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&F(i,50),a=new $s(new zt(s,G(r[0],r.at(-1))),G(r[0],o?i:r.at(-1)));if(o){let c=r.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.colEnd)&&this._issues.push(H(29,new j(G(c,i)))),this.moveToNextToken}else if(n)this._issues.push(H(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(F(this.currentToken,2)||F(this.currentToken,49))return this.popStack(),!1;let i=new Le(s,r),o;F(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(H(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,n.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("d"),it("ts"),Ie(16),it("v"),it("1")]);if(n.length!==6)return this.popStack(),!1;let r=n[0],s=r,i=new at;i.firstToken=r;let o=new of(i);if(this.others.push(o),F(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=n.at(-1),this._issues.push(H(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("memreserve")]);if(n.length!==2)return this.popStack(),!1;let r=new at;r.firstToken=n[0];let i=n[0];F(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=n.at(-1),this._issues.push(H(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new af(r,o,a);return this.others.push(c),o||this._issues.push(H(37,r)),a||this._issues.push(H(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("b"),it("its")]);if(n.length!==3){this.popStack();return}let r=new at;r.firstToken=n[0];let i=n[0];F(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=n.at(-1),this._issues.push(H(21,r)));let o=this.processDec(),a=new cf(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(H(40,o)):this._issues.push(H(39,r)),this._issues.push(H(41,a,iR.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("omit"),Ie(16),it("if"),Ie(16),it("no"),Ie(16),it("ref"),Ie(13)]);if(n.length!==9){this.popStack();return}let r=new at(G(n[0],n.at(-1)));return this.mergeStack(),r}isDeleteNode(n,r){this.enqueueToStack();let s=this.checkConcurrentTokens([Ie(13),it("d"),it("e"),it("lete"),Ie(16),it("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new at;if(a.firstToken=i,s.length===1&&!F(this.currentToken,2)){this._issues.push(H(25,a)),a.lastToken=s.at(-1);let d=new _n(a);return n.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(H(c.startsWith("/delete-n")?34:25,a)):F(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(H(21,a));let l=new _n(a);if($r(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(H(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(H(7,f));let h=d||f?void 0:this.isNodeName();h&&r==="Ref"&&this._issues.push(H(10,h)),!d&&!h&&!f&&this._issues.push(H([7,10],l)),l.nodeNameOrRef=d??f??h??null}else r==="Name"?this._issues.push(H(7,a)):r==="Ref"&&this._issues.push(H(10,a));let u=this.endStatement();return l.lastToken=u,n.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),it("d"),it("e"),it("lete"),Ie(16),it("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new at;if(o.firstToken=s,r.length===1&&!F(this.currentToken,2)){this._issues.push(H(25,o)),o.lastToken=r.at(-1);let u=new Xe(o);return n.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(H(a.startsWith("/delete-p")?35:25,o)):F(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(H(21,o));let c=new Xe(o);if($r(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(H(6,c)),c.propertyName=u??null}else this._issues.push(H(6,o));let l=this.endStatement();return c.lastToken=l,n.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new un(n,r,s);return this.mergeStack(),i}processValue(n){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(n)||this.arrayValues(n)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!F(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=F(this.currentToken,24);if(d)this.moveToNextToken;else if(!$r(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let h=new j(G(u,this.currentToken));this._issues.push(H(0,h))}if(!d&&f===null)break;if(l&&!d&&f){let h=new j(G(l));this._issues.push(H(28,h))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new sf(s)}processStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!F(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let s=r.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new xe(s,G(r));r.value.match(/["']$/)||this._issues.push(H(r.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new un(n,i,o);return this.mergeStack(),a}arrayValues(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(F(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(n)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new un(r,o,a,s);F(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(H(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!F(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(H(15,u))});let a=new is(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(H(14,a)));let c=new un(n,a,o);F(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(H(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(n){this.enqueueToStack();let r=n(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=n();if(s){let i=n();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(n){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,n)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new Pt(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),s=this.processHex();if(!s){this.popStack();return}let i=new Br(s,r);return this.mergeStack(),i}processHexString(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Ie));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new Vt(s,G(r[0],r.at(-1))),o=new Br(i,n);return this.mergeStack(),o}processLabeledDec(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),s=this.processDec();if(!s){this.popStack();return}let i=new Br(s,r);return this.mergeStack(),i}processLabeledExpression(n=!0,r=n){this.enqueueToStack();let s=[];n&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression(this.cPreprocessorParser.macros);if(!i){this.popStack();return}let o=new Br(i,s);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new un(n,r,s);return this.mergeStack(),i}isLabelRef(n){this.enqueueToStack();let r=this.currentToken;if(!r||!F(r,40)){this.popStack();return}else this.moveToNextToken;let s=this.isLabelName();if(!s){let o=new ye(null);return this._issues.push(H(18,new j(G(r)))),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.colEnd)&&this._issues.push(H(29,new j(G(r,s.firstToken))));let i=new ye(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(n);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new un(r,s,i);return this.mergeStack(),o}processRefValue(n,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(n),i=this.currentToken;if(!i||!F(i,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new Br(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(H([18,9],new j(G(i))));let l=new Br(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new Br(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(n=!0,r=new os){this.enqueueToStack();let s;if(F(this.currentToken,13))s=this.moveToNextToken;else{if(!n){this.popStack();return}this.prevToken&&this._issues.push(H(19,new j(G(this.prevToken))))}let i=this.isNodeName();if(i||this._issues.push(H(7,new j(G(s??this.prevToken)))),r.addPath(i??null,s?new j(G(s)):void 0),n&&!s&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let n=this.moveToNextToken,r=n;if(!F(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!F(r,2)){this.popStack();return}let i=this.processNodePath(),o=new Ln(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!cn(l.lastToken,c)){this._issues.push(H(29,new j(G(l.lastToken,c))));return}if(u===0&&s&&!cn(s,l?.firstToken)){this._issues.push(H(29,new j(G(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!cn(l.lastToken,d.firstToken)&&this._issues.push(H(29,new j(G(l.lastToken,d?.firstToken))))}),F(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(H(3,new j(G(this.prevToken)))),o.firstToken=n,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(n=>n instanceof Os)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var qo=K(J());var oR=require("fs");var aR=require("path"),lf=class{constructor(e,n){this.settings=e;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,aR.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(oR.existsSync),this.parser=new ac(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=ss(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new ac(s,r.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,n=s=>({file:s,includes:(e.get(s)??[]).map(i=>n(i.resolvedPath??i.path))});return(await this.getRuntime()).includes.forEach(s=>{let i=e.get(s.uri);i||(i=[],e.set(s.uri,i)),i.push({path:s.path.path,resolvedPath:s.resolvedPath})}),{mainDtsPath:n(this.parser.uri),overlays:this.overlays.map(n)}}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(n=>le(n,e))}getUriParser(e){let n=this.overlayParsers.find(r=>r.getFiles().some(s=>le(s,e)));return n??=this.parser.getFiles().some(r=>le(r,e))?this.parser:void 0,n}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,n){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>le(i.ast.uri,e)&&(!n||$n(i.ast,e,n))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof xe&&l.compatible===o.value.value);return c?{range:te(o.value),target:fe(c.bindingsPath)}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>le(i.uri,e)&&(!n||$n(i,e,n))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:te(i.path),target:fe(o)}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let n=i=>[...i.property,...i.nodes.flatMap(n)],r=n(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof ye){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(Lt(3,o,qo.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof os){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(Lt(8,d,qo.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(h=>h?.linksTo).map(h=>h?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){let n=this.getUriParser(e);return n?(this.sortKeys=new WeakMap,await n.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 n=new Lo(this);this._issues=[],this.processRoot(this.parser.rootDocument,n);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,n);return n.includes=this.parser.includes,n.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof Lr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>this.sortKeys.set(r,s)),this.linkPropertiesLabelsAndNodePaths(n),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),n}processRoot(e,n){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,n.rootNode,n)}}processChild(e,n,r){e instanceof He?this.processDtcBaseNode(e,n,r):e instanceof Le?this.processDtcProperty(e,n,r):e instanceof _n?this.processDeleteNode(e,n,r):e instanceof Xe&&this.processDeleteProperty(e,n,r)}checkNodeUniqueNames(e,n){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||xr(c.address,a.fullAddress)===0)),s=n.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof Ae&&o.name)r(i.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(Lt(2,o.name)),i.push(o.name);else if(o instanceof _n&&o.nodeNameOrRef instanceof qe){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,n,r){e instanceof Tt?this.processDtcRootNode(e,r):e instanceof Ae?this.processDtcChildNode(e,n,r):e instanceof qt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,n){n.roots.push(e),n.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,n.rootNode),[...e.children].sort((r,s)=>r instanceof Le&&s instanceof Xe||s instanceof Le&&r instanceof Xe?0:s instanceof Le?1:0).forEach(r=>this.processChild(r,n.rootNode,n))}processDtcChildNode(e,n,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new we(this.bindingLoader,e.name.name,e.name.fullAddress,n);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),n=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof He&&i instanceof He?0:s instanceof He?-1:0).forEach(s=>this.processChild(s,n,r))}processDtcRefNode(e,n){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=n.rootNode.getChild(s),e.labelReference.linksTo=r,e.labels.forEach(i=>i.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(i=>{n.labelsUsedCache.set(i.label.value,s)}),r?(n.references.push(e),this.checkNodeUniqueNames(e,r)):n.unlinkedRefNodes.push(e)):(this._issues.push(Lt(3,e.labelReference,qo.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),n.unlinkedRefNodes.push(e))}else n.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof He&&i instanceof He?0:s instanceof He?-1:0).forEach(s=>this.processChild(s,r??new we(this.bindingLoader,""),n))}processDtcProperty(e,n,r){e.propertyName?.name&&n.addProperty(new Be(e,n)),e.children.forEach(s=>this.processChild(s,n,r))}processDeleteNode(e,n,r){if(e.nodeNameOrRef instanceof qe&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!n.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(Lt(5,e.nodeNameOrRef));else{n.deletes.push(e);let s=n.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=s,n.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof ye&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),n.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof He&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(Lt(3,e.nodeNameOrRef,qo.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Ln&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(r.unlinkedDeletes.push(e),c&&this._issues.push(Lt(8,c,qo.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),n.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof He&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,n,r))}processDeleteProperty(e,n,r){e.propertyName?.name&&!n.hasProperty(e.propertyName.name)?this._issues.push(Lt(1,e.propertyName)):e.propertyName?.name&&(n.deletes.push(e),n.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,n,r))}async getDiagnostics(){let e=new Map,n=(r,s)=>{let i=e.get(s);i||(i=[],e.set(s,i)),i.push(r)};try{return(await this.getAllParsers()).forEach(i=>{i.issues.forEach(o=>n(o.diagnostic(),o.raw.astElement.uri))}),(await this.getContextIssues()??[]).forEach(i=>n(i.diagnostic(),i.raw.astElement.uri)),(await this.getRuntime())?.typesIssues.forEach(i=>n(i.diagnostic(),i.raw.astElement.uri)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
|
|
277
|
-
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var
|
|
277
|
+
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!t.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&t.isSyntaxChar(this.currentChar)){this.move();break}let n=this.lineNumber;if(!this.move()||this.lineNumber!==n)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let n=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(n+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(n+=this.currentChar??"");else return n}if(!this.move())return n}return this.move(),n+=e,n}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let n=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!n)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return n&&!r?.tokens.some(i=>i===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let n={...e,uri:this.uri},r=this._tokens.at(-1);n.prevToken=r,r&&(r.nextToken=n),this._tokens.push(n)}isLetters(e){let n=e.match(/^[A-Za-z]+/);return n?.[0]?(this.pushToken({tokens:[47],value:n?.[0],pos:this.generatePos(e,n?.[0])}),!0):!1}isDigit(e){let n=e.match(/^[0-9]/);return n?.[0]?(this.pushToken({tokens:[20,19],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isHexDigit(e){let n=e.match(/^[A-Fa-f]/);return n?.[0]?(this.pushToken({tokens:[20,47],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isCurlyOpen(e){let n="{";return e===n?(this.pushToken({tokens:[2],pos:this.generatePos(e,n),value:"{"}),!0):!1}isCurlyClose(e){let n="}";return e===n?(this.pushToken({tokens:[3],pos:this.generatePos(e,n),value:"}"}),!0):!1}isSemicolon(e){let n=";";return e===n?(this.pushToken({tokens:[1],pos:this.generatePos(e,n),value:n}),!0):!1}isColon(e){let n=":";return e===n?(this.pushToken({tokens:[50],pos:this.generatePos(e,n),value:n}),!0):!1}isHash(e){let n="#";return e.startsWith(n)?(this.pushToken({tokens:[46],pos:this.generatePos(e,n),value:n}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let n="=";return e===n?(this.pushToken({tokens:[0],pos:this.generatePos(e,n),value:n}),!0):!1}isGtSym(e){let n=">";return e===n?(this.pushToken({tokens:[4],pos:this.generatePos(e,n),value:n}),!0):!1}isLtSym(e){let n="<";return e===n?(this.pushToken({tokens:[5],pos:this.generatePos(e,n),value:n}),!0):!1}isLogicalNot(e){let n="!";return e===n?(this.pushToken({tokens:[6],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseOr(e){let n="|";return e===n?(this.pushToken({tokens:[8],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseXOr(e){let n="^";return e===n?(this.pushToken({tokens:[9],pos:this.generatePos(e,n),value:n}),!0):!1}isAmpersand(e){let n="&";return e===n?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseNot(e){let n="~";return e===n?(this.pushToken({tokens:[10],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundOpen(e){let n="(";return e===n?(this.pushToken({tokens:[42],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundClose(e){let n=")";return e===n?(this.pushToken({tokens:[43],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareOpen(e){let n="[";return e===n?(this.pushToken({tokens:[11],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareClose(e){let n="]";return e===n?(this.pushToken({tokens:[12],pos:this.generatePos(e,n),value:n}),!0):!1}isComma(e){let n=",";return e===n?(this.pushToken({tokens:[24],pos:this.generatePos(e,n),value:n}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let n=e.match(/^["']/);if(n?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,i=this.columnNumber-1,s=this.getString(n[0]),o=s.length+this.numberOfEscapedCharsLastString;return this.pushToken({tokens:[21],value:s,pos:{col:i,line:r,len:o,colEnd:i+o}}),!0}return!1}isForwardSlash(e){let n="/";return e===n?(this.pushToken({tokens:[13],pos:this.generatePos(e,n),value:"/"}),!0):!1}isBackSlash(e){let n="\\";return e===n?(this.pushToken({tokens:[14],pos:this.generatePos(e,n),value:"\\"}),!0):!1}isAddOperator(e){let n="+";return e===n?(this.pushToken({tokens:[15],pos:this.generatePos(e,n),value:n}),!0):!1}isQuestionMark(e){let n="?";return e===n?(this.pushToken({tokens:[44],pos:this.generatePos(e,n),value:n}),!0):!1}isPeriod(e){let n=".";return e===n?(this.pushToken({tokens:[45],pos:this.generatePos(e,n),value:n}),!0):!1}isNegateOperator(e){let n="-";return e===n?(this.pushToken({tokens:[16],pos:this.generatePos(e,n),value:n}),!0):!1}isUnderScore(e){let n="_";return e===n?(this.pushToken({tokens:[48],pos:this.generatePos(e,n),value:n}),!0):!1}isAt(e){let n="@";return e===n?(this.pushToken({tokens:[49],pos:this.generatePos(e,n),value:n}),!0):!1}isMultiplicationOperator(e){let n="*";return e===n?(this.pushToken({tokens:[17],pos:this.generatePos(e,n),value:n}),!0):!1}isModulusOperator(e){let n="%";return e===n?(this.pushToken({tokens:[18],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefine(e){let n="#define";return e.toLowerCase()===n?(this.pushToken({tokens:[25],pos:this.generatePos(e,n),value:n}),!0):!1}isCInclude(e){let n="#include";return e.toLowerCase()===n?(this.pushToken({tokens:[26],pos:this.generatePos(e,n),value:n}),!0):!1}isCLine(e){let n="#line";return e.toLowerCase()===n?(this.pushToken({tokens:[27],pos:this.generatePos(e,n),value:n}),!0):!1}isCUndef(e){let n="#undef";return e.toLowerCase()===n?(this.pushToken({tokens:[28],pos:this.generatePos(e,n),value:n}),!0):!1}isCError(e){let n="#error";return e.toLowerCase()===n?(this.pushToken({tokens:[29],pos:this.generatePos(e,n),value:n}),!0):!1}isCPragma(e){let n="#pragma";return e.toLowerCase()===n?(this.pushToken({tokens:[30],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefined(e){let n="#defined";return e.toLowerCase()===n?(this.pushToken({tokens:[31],pos:this.generatePos(e,n),value:n}),!0):!1}isCIf(e){let n="#if";return e.toLowerCase()===n?(this.pushToken({tokens:[32],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfDef(e){let n="#ifdef";return e.toLowerCase()===n?(this.pushToken({tokens:[33],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfNDef(e){let n="#ifndef";return e.toLowerCase()===n?(this.pushToken({tokens:[34],pos:this.generatePos(e,n),value:n}),!0):!1}isCElIf(e){let n="#elif";return e.toLowerCase()===n?(this.pushToken({tokens:[35],pos:this.generatePos(e,n),value:n}),!0):!1}isCElse(e){let n="#else";return e.toLowerCase()===n?(this.pushToken({tokens:[36],pos:this.generatePos(e,n),value:n}),!0):!1}isCEndIf(e){let n="#endif";return e.toLowerCase()===n?(this.pushToken({tokens:[37],pos:this.generatePos(e,n),value:n}),!0):!1}isCTrue(e){let n="true";return e==n?(this.pushToken({tokens:[38],value:n,pos:this.generatePos(e,n)}),!0):!1}isCFalse(e){let n="false";return e==n?(this.pushToken({tokens:[39],value:n,pos:this.generatePos(e,n)}),!0):!1}generatePos(e,n){let r=this.columnNumber-e.length+this.lineNumberOfEscapedChars;return{line:this.lineNumber,col:r,len:n.length,colEnd:r+n.length}}};var ut=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var ey=require("fs"),Lo=require("path");var fR=K(J());var Ot=class extends tt{constructor(n,r){super(r);this.name=n;this.docSymbolsMeta={name:this.name.toString(),kind:fR.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var rf=class extends j{constructor(n,r){super(r);this.operator=n;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var hR=K(J());var sf=class extends ut{toString(){return"..."}},Ur=class extends j{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(n){return ue(this.uri,n)?[{name:this.functionName.name,kind:hR.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r.getDocumentSymbols(n))}]:[]}toString(){return`${this.functionName}(${this.params.map(n=>n.toString()).join(",")})`}};var ji=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,n=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!ue(this.currentToken?.uri,e.uri))return;let i=this.currentToken,s=i;for(;this.currentToken?.pos.line===r;)s=this.moveToNextToken;if(n){let o=new j(G(i,s));this._issues.push(H(22,o))}return s};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(),n=this.positionStack.pop();if(n===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=n}peekIndex(e=1){let n=this.positionStack.at(-1*e);if(n===void 0)throw new Error("Index out of bounds");return n}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 n=[];return e.every(r=>{let i=this.currentToken,s=r(i),o=!1;return s!=="no"&&i&&(n.push(i),this.moveToNextToken,o=ln(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),n}consumeAnyConcurrentTokens(e){this.enqueueToStack();let n=[],r,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)n.push(this.currentToken),r=this.currentToken,this.moveToNextToken,i=ln(r,this.currentToken);return this.mergeStack(),n}getDocumentSymbols(e){return this.allAstItems.flatMap(n=>n.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,n){let r=[],i=(s,o,a)=>{if(!a?.start||!a?.end||!ue(a.start.uri,n)||!ue(a.end.uri,n))return;let c=a.end.pos.colEnd-a.start.pos.col;r.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(i)}),r.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,n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(xe));if(!r.length){this.popStack();return}let i=r.map(o=>o.value).join("");if(!i.match(/^[_A-Za-z]/)){this.popStack();return}let s=new Ot(i,G(r[0],r.at(-1)));return!n&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(H(42,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let n=e,r;if(F(e,40)?(r="&",F(this.currentToken,40)&&(r="&&",n=this.moveToNextToken)):F(e,10)?(r="!",F(this.currentToken,0)&&(r="!=",n=this.moveToNextToken)):F(e,8)?(r="|",F(this.currentToken,8)&&(r="||",n=this.moveToNextToken)):F(e,9)?r="^":F(e,4)?(r=">",F(this.currentToken,4)?(r="<<",n=this.moveToNextToken):F(this.currentToken,0)&&(r=">=",n=this.moveToNextToken)):F(e,5)?(r="<",F(this.currentToken,5)?(r=">>",n=this.moveToNextToken):F(this.currentToken,0)&&(r="<=",n=this.moveToNextToken)):F(e,15)?r="+":F(e,16)?r="-":F(e,17)?r="*":F(e,13)?r="/":F(e,18)?r="%":F(e,46)?F(this.currentToken,46)&&(r="##",n=this.moveToNextToken):F(e,0)&&F(this.currentToken,0)&&(r="==",n=this.moveToNextToken),r){let i=new rf(r,G(e,n));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,n,r){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=y=>y.flatMap(p=>"items"in p?a(p.items):p),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!n(d);){if(r?.(d)){let y=this.peekIndex()+1,p=()=>{this.positionStack[this.positionStack.length-1]=y};c.push(d),l.push(d),u[u.length]={rewind:p,tokens:[]}}else if(e(d)){let y=this.parseScopedBlock(e,n,r);y&&(c.push(y),u[u.length-1].tokens.push(...a(y.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&&n(f)&&(this.moveToNextToken,c.push(f));let h={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),h}isFunctionCall(e){this.enqueueToStack();let n=this.processCIdentifier(e,!1);if(!n){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(n.name==="defined")r.length>1?this._issues.push(H(44,n)):r.length<1&&this._issues.push(H(45,n));else{let s=e.get(n.name)?.macro;s&&(s?.identifier instanceof Ur?r.length>s.identifier.params.length?this._issues.push(H(44,n,void 0,[s])):r.length<s.identifier.params.length&&this._issues.push(H(45,n,void 0,[s])):this._issues.push(H(43,n)))}let i=new Mr(n,r);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([at("0"),at("x")]);if(e.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(xe));if(!n.length){this.popStack();return}let r=Number.parseInt(n.map(s=>s.value).join(""),16),i=new zt(r,G(e[0],n.at(-1)));return this.mergeStack(),i}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(xe));if(!e.length){this.popStack();return}let n=Number.parseInt(e.map(i=>i.value).join(""),10),r=new zt(n,G(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let n,r;if(F(this.currentToken,42)){let i;n=this.moveToNextToken,r=n;let s=this.processExpression(e,!0);return s&&(i=new oi(s,!0),s=new oi(i,!1),i.openBracket=n),F(this.currentToken,43)?(r=this.moveToNextToken,i&&(i.closeBracket=r)):this._issues.push(H(26,new j(G(n)))),this.mergeStack(),s}this.popStack()}processExpression(e,n=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!r){this.popStack();return}if(n){let i=this.isOperator();for(;i;){let s=this.processExpression(e);s?r instanceof oi?r.addExpression(i,s):r=new oi(r,!1,{operator:i,expression:s}):this._issues.push(H(27,i)),i=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!F(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!F(r,42),r=>!!F(r,43),r=>!!F(r,24));return e?.items.length===2&&F(e.endToken,43)?[]:e?.splitTokens.map((r,i)=>{if(r.tokens.length===0)return null;let s=new xr(r.tokens.map((o,a)=>{let c=o.value;return o.pos.line===r.tokens.at(a+1)?.pos.line&&(c=c.padEnd(r.tokens[a+1].pos.col-o.pos.col," ")),c}).join(""),G(r.tokens[0],r.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var of=class t extends ji{constructor(n){super();this.uri=n;this.comments=[];this.tokens=[]}cleanUpComments(){let n=[];for(let r=0;r<this.tokens.length;r++){let i=t.processBlockComment(this.tokens,r)||t.processLineComment(this.tokens,r);i&&(r=i.index,n.push(...i.tokenUsed),this.comments.push(i.comment))}n.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=qn().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComment(n,r){let i=[],s=()=>(i.push(r++),n[r]),o=()=>n[r],a=()=>n[r-1],c=o(),l=c;if(!c||!F(c,13)||(l=s(),!F(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!F(a(),17)||!F(o(),13)||!ln(a(),o())),d=l.pos.line,f=c,h=[];l=s();do{if(o()?.pos.line!==d){let T=new jr(G(f,a()));h.push(T),d=o().pos.line??0,f=o()}l=s()}while(r<n.length&&!u());let y=new jr(G(f,o()));h.push(y);let p=new Mi(h);return s(),{comment:p,tokenUsed:i,index:r-1}}static processLineComment(n,r){let i=[];if(!F(n[r],13)||n.length===r+1||!F(n[r+1],13)||!ln(n[r],n[r+1]))return;for(;n[r].pos.line===n.at(r+1)?.pos.line;)i.push(r++);return i.push(r++),{comment:new jr(G(n[i[0]],n[i.at(-1)])),tokenUsed:i,index:r-1}}};var pR=K(J()),af=class extends j{constructor(n,r){super(n);this.content=r}toString(){let n=this.content.filter(r=>!F(r,14));return n.map((r,i)=>{let s=r.value;return r.pos.line===n.at(i+1)?.pos.line?s=s.padEnd(n[i+1].pos.col-r.pos.col," "):n.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},ic=class extends j{constructor(n,r,i){super();this.keyword=n;this.identifier=r;this.content=i;this.addChild(n),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ot?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:pR.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
278
|
+
`)}}};var ks=class extends j{constructor(e){super(e)}},sc=class extends j{constructor(n,r){super();this.keyword=n;this.content=r;this.active=!1;this.addChild(n)}},oc=class extends sc{constructor(n,r,i){super(n,i);this.identifier=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.identifier&&n.has(this.identifier.name)}},cf=class extends sc{constructor(n,r,i){super(n,i);this.expression=r;this.addChild(r),this.addChild(i)}useBlock(n){return this.expression instanceof Mr?this.expression.functionName.name==="defined"?this.expression&&n.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(n):this.expression?.isTrue(n)}},lf=class extends oc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},ac=class extends sc{};var Mo=class extends j{constructor(n,r,i){super();this.ifDef=n;this.endIf=r;this.elseOption=i;this.addChild(n),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];i.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(n);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&i.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(i.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}},Fi=class extends j{constructor(n,r,i){super();this.ifBlocks=n;this.endIf=r;this.elseOption=i;n.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(r)}getInValidTokenRange(n,r){let i=[],s=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{i.push({start:s(a.tokenIndexes.start),end:s(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(n)?(a.active=!0,o=!0):a.content&&i.push({start:s(a.content.tokenIndexes.start),end:s(a.content.tokenIndexes.end)})}),this.elseOption&&(i.push({start:s(this.elseOption.keyword.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}};var cc=K(J());var $o=class extends ji{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([s,o])=>this.macroSnapShot.set(s,o)),Array.from(i).forEach(([s,o])=>this.macros.set(s,o)))}get currentToken(){let n=this.prevToken,r=qr(n,this.tokens.at(this.peekIndex()))||!n||F(n,14)&&n.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&F(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(n){super.reset(),this.macros.clear(),n?(this.macroSnapShot.clear(),Array.from(n).forEach(([r,i])=>this.macroSnapShot.set(r,i)),Array.from(n).forEach(([r,i])=>this.macros.set(r,i))):Array.from(this.macroSnapShot).forEach(([r,i])=>this.macros.set(r,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(n){let r=this.stable;return this.parsing=new Promise(i=>{r.then(()=>{if(n&&n.size===this.macroSnapShot.size){let s=Array.from(n);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(n),this.parse().then(i)})}),this.parsing}async parse(){let n=new of(this.uri);if(await n.stable,this.tokens=n.tokens,this.nodes.push(...n.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||!ue(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,25))return this.popStack(),!1;this.macroStart=!0;let i=new ut(G(r)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(H(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new af(G(o[0],o.at(-1)),o));let c=new ic(i,s,a);this.macros.set(c.name,{macro:c,resolver:uN(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(n,l-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!F(r,28))return this.popStack(),!1;this.macroStart=!0;let i=new ut(G(r)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(H(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new ic(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(n,a-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let n=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&n.push(r)}return n}isFunctionDefinition(){this.enqueueToStack();let n=this.processCIdentifier(this.macros,!0);if(!n){this.popStack();return}let r=this.moveToNextToken;if(!F(r,42)||!ln(n.lastToken,r)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!F(this.currentToken,24)&&!F(this.currentToken,43)?this._issues.push(H(28,s)):F(this.currentToken,43)||(r=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Ur(n,i);return F(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(H(26,i.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let n=this.checkConcurrentTokens([xe(45),xe(45),xe(45)]);if(n.length!==3){this.popStack();return}let r=new sf(G(n[0],n.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let n=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>F(o,a))&&!qr(o.prevToken,o),o=>!!o&&[37].some(a=>F(o,a))&&!qr(o.prevToken,o),o=>!!o&&[36,35].some(a=>F(o,a))&&!qr(o.prevToken,o));if(!r)return;let i;F(r.startToken,32)?i=this.processIfBlock(r,(o,a,c)=>new cf(o,a??null,c)):i=this.processIfDefBlock(r,(o,a,c)=>F(r.startToken,33)?new oc(o,a??null,c):new lf(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 Fi?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(H(47,o.content,cc.DiagnosticSeverity.Hint,[],[cc.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=n}processIfDefBlock(n,r){this.enqueueToStack(),this.macroStart=!0;let i=new ut(G(n.startToken));n.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(H(31,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&n.splitTokens[0].tokens.find(f=>f===a)&&(o=new ks(G(a,n.splitTokens[0].tokens.at(-1))));let c=r(i,s??null,o??null),l;if(n.splitTokens.length>1){let f=n.splitTokens[1].tokens[0].prevToken,h=new ut(G(f)),y;n.splitTokens[1].tokens.length&&(y=new ks(G(n.splitTokens[1].tokens[0],n.splitTokens[1].tokens.at(-1)))),l=new ac(h,y??null)}let u;n.endToken?u=new ut(G(n.endToken)):this._issues.push(H(46,i));let d=new Mo(c,u??null,l);return this.mergeStack(),d}processIfBlock(n,r){this.enqueueToStack();let i=new ut(G(n.startToken)),s=[],o;n.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ut(G(d));this.macroStart=!0;let h=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===n.splitTokens.length-1&&F(d,36)){let p=d,T=new ut(G(p)),S;l.tokens.length&&(S=new ks(G(l.tokens[0],l.tokens.at(-1)))),o=new ac(T,S??null)}else{h||this._issues.push(H(31,i));let p,T=h?.lastToken.nextToken??i.lastToken.nextToken;T&&l.tokens.find(b=>b===T)&&(p=new ks(G(T,n.splitTokens[u].tokens.at(-1))));let S=r(f,h??null,p??null);s.push(S)}});let a;n.endToken?a=new ut(G(n.endToken)):this._issues.push(H(46,i));let c=new Fi(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(n){if(n.path.path)return n.path.relative?[(0,Lo.resolve)((0,Lo.dirname)(n.uri),n.path.path),...this.incudes.map(r=>(0,Lo.resolve)(r,n.path.path))].find(r=>(0,ey.existsSync)(r)):this.incudes.map(r=>(0,Lo.resolve)(r,n.path.path)).find(r=>(0,ey.existsSync)(r))}async processInclude(){this.enqueueToStack();let n=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let i=r,s=r;if(F(r,26))this.moveToNextToken;else{let p=this.checkConcurrentTokens([xe(13),at("include"),xe(13)]);if(p.length!==3)return this.popStack(),!1;i=p[0],s=p.at(-1)}let o=i,a=new ut(G(i,s));r=this.moveToNextToken;let c=r,l=!!F(r,21);if(!c||!l&&!F(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!F(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Ro(u,l,G(c,r)),f=new xi(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!F(this.currentToken,4)?this._issues.push(H(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let h=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(H(36,f.path,cc.DiagnosticSeverity.Warning)),y){qn().requestTokens(y,!0);let p=await lc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await p.stable,this._issues.push(...p.issues),this.macros.clear(),Array.from(p.macros).forEach(([T,S])=>this.macros.set(T,S)),y.endsWith(".h")?this.tokens.splice(n,h-n):this.tokens.splice(n,h-n,...p.tokens),this.nodes.push(...p.nodes),this.dtsIncludes.push(...p.dtsIncludes)}else this.tokens.splice(n,h-n);return this.positionStack[this.positionStack.length-1]=n,!0}};var ty,uf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,n,r,i){e=nt(e);let s=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new $o(e,n,r),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 n=this.headerFiles.get(e);n&&Array.from(n).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function lc(){return ty??=new uf,ty}function mR(){ty=new uf}var ny,df=class t{constructor(){this.fileMap=new Map}static clone(e){let n=e.map(r=>({...r}));return n.forEach((r,i)=>{r.prevToken=n[i-1],r.nextToken=n[i+1]}),n}needsRenew(e,n){return e=nt(e),this.fileMap.get(e)?.text!==n}getDocument(e){return ko.create(e,"devicetree",0,this.fileMap.get(e)?.text??(0,uc.readFileSync)(e).toString())}renewLexer(e,n){if(e=nt(e),lc().reset(e),!e||!(0,uc.existsSync)(e))return[];try{n??=(0,uc.readFileSync)(e).toString();let r=new nf(n,e);return this.fileMap.set(e,r),t.clone(r.tokens)}catch{}return[]}requestTokens(e,n){e=nt(e);let r=this.fileMap.get(e)?.tokens;return!r&&n?[...this.renewLexer(e)]:t.clone(r??[])}reset(e){e=nt(e),lc().reset(e),this.fileMap.delete(e)}};function qn(){return ny??=new df,ny}function gR(){ny=new df}var qo=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new ke(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let n=this.fileTopMostAstCache.get(e);if(n)return n;let r=[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(i=>i.cPreprocessorParser.allAstItems)].flatMap(i=>i.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,r),r}getDeepestAstNode(e,n){let i=this.fileTopMostAsts(e).find(s=>Kn(s,e,n)||cN(qn().requestTokens(e,!1),s,n));if(i instanceof jt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,n);return o?{...o,runtime:this}:{item:null,runtime:this,ast:$r(i,e,n)}}else if(i instanceof mt&&i.path){let s=this.rootNode.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i instanceof Oe&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,n);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:$r(i,e,n)}}static getNodeFromPath(e,n,r=!0){if(e.length===0)return n;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=n.getNode(s,a,r);return l?t.getNodeFromPath(c,l,r):void 0}resolvePath(e,n){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(n??=this.rootNode.allDescendantsLabels,n.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof Ye)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],n=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{n.has(r.label.label.value)?n.get(r.label.label.value)?.push(r):n.set(r.label.label.value,[r])}),Array.from(n).forEach(r=>{let i=r[1];if(i.length>1){let s=i.find(a=>a.owner instanceof ke);(!i.every(a=>a&&a.owner===s?.owner)||!s)&&e.push(qt(4,i.at(0).label,yR.DiagnosticSeverity.Error,i.slice(1).map(a=>a.label),[],[i.at(0).label.label.value]))}}),e}get typesIssues(){let e=n=>[...n.nodeType?.getIssue(this,n)??[],...n.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return lN([...e.definitions,...e.referencedBy],this.context)}};var bR=K(J()),ff=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Values",kind:bR.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(n=>n?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(n=>n?.toJson())}};var vR=K(J()),hf=class extends j{constructor(n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:"DTS Document version",kind:vR.SymbolKind.Function}}};var Vr=class extends j{constructor(n,r){super();this.value=n;this.labels=r;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(n)??"NULL"}`}toPrettyString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(n)??"NULL"}`}};var TR=K(J()),pf=class extends j{constructor(n,r,i){super();this.keyword=n;this.startAddress=r;this.endAddress=i;this.addChild(n),this.docSymbolsMeta={name:"Memreserve",kind:TR.SymbolKind.Function},this.addChild(r),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var _R=K(J()),mf=class extends j{constructor(n,r){super();this.keyword=n;this.bitsSize=r;this.addChild(n),this.docSymbolsMeta={name:"bits",kind:_R.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var SR=K(J()),dc=class extends ji{constructor(n,r,i){super();this.uri=n;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new Ye;this.unhandledStatements=new mt;this.cPreprocessorParser=new $o(this.uri,this.incudes,i)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(n=>n.resolvedPath).filter(n=>!!n)]}reset(){super.reset(),this.others=[],this.rootDocument=new Ye,this._issues=[],this.unhandledStatements=new mt}async reparse(){let n=performance.now(),r=this.stable;return this.parsing=new Promise(i=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-n),i()})}),this.parsing}async parse(){let n=performance.now();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.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let i=this.moveToNextToken;if(i){let s=new j(G(i));this._issues.push(H(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(i=>{this._issues.push(H(32,i))}),this.unhandledStatements.deleteProperties.forEach(i=>{this._issues.push(H(33,i))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(n){this.enqueueToStack();let r=this.moveToNextToken,i=r,s=13;if(!r||!F(r,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!F(i,s))return this.popStack(),!1;let o=new mt;o.openScope=i,n.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(n){let r=this.currentToken;if(F(r,3))this.moveToNextToken;else{let i=this.prevToken;if(i){let s=new j(G(i));this._issues.push(H(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(n.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return F(this.currentToken,3)||F(this.currentToken,1)}endStatement(n=!0){let r=this.currentToken;if(!F(r,1)){let i=this.prevToken;if(i&&n){let s=new j(G(this.prevToken));return this._issues.push(H(1,s)),i}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;F(this.currentToken,1);){let n=this.moveToNextToken;if(n){let r=new j(G(n));this._issues.push(H(23,r))}}}processNode(n,r){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(n,r)||this.isProperty(n)||this.isDeleteNode(n,r)||this.isDeleteProperty(n),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(G(o));this._issues.push(H(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(n=!1){let r=[],i=this.isLabelAssign(n);for(;i;)r.push(i),i=this.isLabelAssign(n);return r}isChildNode(n,r){this.enqueueToStack();let i;r==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new jt(s):new Oe(s,i);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!F(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(H(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof jt?(c.labelReference=a,l=!0):o&&c instanceof Oe&&(l=o.address!==void 0,c.name=o),F(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(H(2,u))}else return this.popStack(),!1;return n.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let n=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(xe)),i=a=>{a=a.replace(/^0x/,"").replace(/\s+/g,""),a.length%8!==0&&(a=a.padStart(Math.ceil(a.length/8)*8,"0"));let c=[];for(let l=0;l<a.length;l+=8){let u=a.slice(l,l+8);c.push(parseInt(u,16)>>>0)}return c},s=r.length?i(r.map(a=>a.value).join("")):[NaN];if(n){if(s.some(a=>Number.isNaN(a))){let a=new j(G(n));this._issues.push(H(8,a))}else if(!Number.isNaN(s)&&!ln(n,r[0])){let a=new j(G(n,r.at(0)));this._issues.push(H(29,a))}}return new Ud(s,G(r[0]??this.prevToken,r.at(-1)))}processNodeAddresses(n){this.enqueueToStack();let r=this.checkConcurrentTokens([xe(49)]);if(r.length){if(!ln(n.lastToken,r[0])){let o=new j(G(n.lastToken,r[0]));this._issues.push(H(29,o))}let i=[],s=()=>{if(i.push(this.processNodeAddress()),F(this.currentToken,24)){if(this.prevToken&&!ln(this.prevToken,this.currentToken)){let o=new j(G(this.prevToken,this.currentToken));this._issues.push(H(29,o))}this.moveToNextToken,s()}};return s(),this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(xe));if(!n.length){this.popStack();return}let r=n.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let i=new Fe(r,G(n[0],n.at(-1))),s=this.processNodeAddresses(i);return i.address=s,this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(xe));if(!n.length){this.popStack();return}let r=new Ge(n.map(i=>i.value).join(""),G(n[0],n.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(xe));if(!n.length){this.popStack();return}let r=n.map(s=>s.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let i=new Wt(r,G(n[0],n.at(-1)));return this.mergeStack(),i}isLabelAssign(n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(xe));if(!r.length){this.popStack();return}let i=r.map(c=>c.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&F(s,50),a=new qi(new Wt(i,G(r[0],r.at(-1))),G(r[0],o?s:r.at(-1)));if(o){let c=r.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(H(29,new j(G(c,s)))),this.moveToNextToken}else if(n)this._issues.push(H(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(F(this.currentToken,2)||F(this.currentToken,49))return this.popStack(),!1;let s=new je(i,r),o;F(this.currentToken,0)?(s.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this._issues.push(H(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,n.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let n=this.checkConcurrentTokens([xe(13),at("d"),at("ts"),xe(16),at("v"),at("1")]);if(n.length!==6)return this.popStack(),!1;let r=n[0],i=r,s=new ut;s.firstToken=r;let o=new hf(s);if(this.others.push(o),F(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=n.at(-1),this._issues.push(H(21,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let n=this.checkConcurrentTokens([xe(13),at("memreserve")]);if(n.length!==2)return this.popStack(),!1;let r=new ut;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(H(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new pf(r,o,a);return this.others.push(c),o||this._issues.push(H(37,r)),a||this._issues.push(H(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let n=this.checkConcurrentTokens([xe(13),at("b"),at("its")]);if(n.length!==3){this.popStack();return}let r=new ut;r.firstToken=n[0];let s=n[0];F(this.currentToken,13)?(s=this.moveToNextToken,r.lastToken=s):(r.lastToken=n.at(-1),this._issues.push(H(21,r)));let o=this.processDec(),a=new mf(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(H(40,o)):this._issues.push(H(39,r)),this._issues.push(H(41,a,SR.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let n=this.checkConcurrentTokens([xe(13),at("omit"),xe(16),at("if"),xe(16),at("no"),xe(16),at("ref"),xe(13)]);if(n.length!==9){this.popStack();return}let r=new ut(G(n[0],n.at(-1)));return this.mergeStack(),r}isDeleteNode(n,r){this.enqueueToStack();let i=this.checkConcurrentTokens([xe(13),at("d"),at("e"),at("lete"),xe(16),at("node")]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new ut;if(a.firstToken=s,i.length===1&&!F(this.currentToken,2)){this._issues.push(H(25,a)),a.lastToken=i.at(-1);let d=new Sn(a);return n.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(H(c.startsWith("/delete-n")?34:25,a)):F(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(H(21,a));let l=new Sn(a);if(qr(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(H(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(H(7,f));let h=d||f?void 0:this.isNodeName();h&&r==="Ref"&&this._issues.push(H(10,h)),!d&&!h&&!f&&this._issues.push(H([7,10],l)),l.nodeNameOrRef=d??f??h??null}else r==="Name"?this._issues.push(H(7,a)):r==="Ref"&&this._issues.push(H(10,a));let u=this.endStatement();return l.lastToken=u,n.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(n){this.enqueueToStack();let r=this.checkConcurrentTokens([xe(13),at("d"),at("e"),at("lete"),xe(16),at("property")]);if(!r.length)return this.popStack(),!1;let i=r[0],s=i,o=new ut;if(o.firstToken=i,r.length===1&&!F(this.currentToken,2)){this._issues.push(H(25,o)),o.lastToken=r.at(-1);let u=new Je(o);return n.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(H(a.startsWith("/delete-p")?35:25,o)):F(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(H(21,o));let c=new Je(o);if(qr(o.tokenIndexes?.end,i)){let u=this.isPropertyName();u||this._issues.push(H(6,c)),c.propertyName=u??null}else this._issues.push(H(6,o));let l=this.endStatement();return c.lastToken=l,n.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&i.push(...this.processOptionalLabelAssign(!0));let s=new dn(n,r,i);return this.mergeStack(),s}processValue(n){this.enqueueToStack();let i=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(n)||this.arrayValues(n)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!F(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d,f=F(this.currentToken,24);if(f)d=this.currentToken,this.moveToNextToken;else if(!qr(this.prevToken,this.currentToken))break;let h=o();if(u&&h===null&&f){let p=new j(G(u,this.currentToken));this._issues.push(H(0,p))}if(!f&&h===null)break;if(l&&!f&&h){let p=new j(G(l));this._issues.push(H(28,p))}let y=c.at(-1);y&&(y.nextValueSeparator??=d),c.push(h)}return c})();if(i.length===0){this.popStack();return}return this.mergeStack(),new ff(i)}processStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!F(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let i=r.value;i.match(/["']$/)&&(i=i.slice(1,-1));let s=new Me(i,G(r));r.value.match(/["']$/)||this._issues.push(H(r.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new dn(n,s,o);return this.mergeStack(),a}arrayValues(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),i=this.processBits(),s=this.currentToken;if(F(s,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(n)??null;o.openBracket=s;let a=this.processOptionalLabelAssign(!0)??[],c=new dn(r,o,a,i);F(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(H(12,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=s,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,i=r;if(!F(i,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(H(15,u))});let a=new ci(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=r,this._issues.push(H(14,a)));let c=new dn(n,a,o);F(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(H(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(n){this.enqueueToStack();let r=n(),i=[];if(!r)return this.popStack(),[];for(;r;)i=[...i,r],r=n();if(i){let s=n();s&&(i=[...i,s])}return this.mergeStack(),i}processArrayValues(n){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,n)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),i=new Rt(r);return r.length===0&&(i.firstToken=this.currentToken),this.mergeStack(),i}processLabeledHex(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processHex();if(!i){this.popStack();return}let s=new Vr(i,r);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(xe));if(!r.length){this.popStack();return}let i=Number.parseInt(r.map(a=>a.value).join(""),16),s=new zt(i,G(r[0],r.at(-1))),o=new Vr(s,n);return this.mergeStack(),o}processLabeledDec(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),i=this.processDec();if(!i){this.popStack();return}let s=new Vr(i,r);return this.mergeStack(),s}processLabeledExpression(n=!0,r=n){this.enqueueToStack();let i=[];n&&(i=this.processOptionalLabelAssign(r));let s=this.processExpression(this.cPreprocessorParser.macros);if(!s){this.popStack();return}let o=new Vr(s,i);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let i=this.processOptionalLabelAssign(!0),s=new dn(n,r,i);return this.mergeStack(),s}isLabelRef(n){this.enqueueToStack();let r=this.currentToken;if(!r||!F(r,40)){this.popStack();return}else this.moveToNextToken;let i=this.isLabelName();if(!i){let o=new be(null);return this._issues.push(H(18,new j(G(r)))),o.firstToken=r,this.mergeStack(),o}r&&(i.firstToken.pos.line!==r.pos.line||i.firstToken.pos.col!==r.pos.colEnd)&&this._issues.push(H(29,new j(G(r,i.firstToken))));let s=new be(i);return s.firstToken=r,this.mergeStack(),s}isLabelRefValue(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),i=this.isLabelRef(n);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 dn(r,i,s);return this.mergeStack(),o}processRefValue(n,r){this.enqueueToStack();let i=this.processOptionalLabelAssign(n),s=this.currentToken;if(!s||!F(s,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new Vr(o,i);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(H([18,9],new j(G(s))));let l=new Vr(null,i);return l.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),l}let c=new Vr(a,i);return c.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(n=!0,r=new li){this.enqueueToStack();let i;if(F(this.currentToken,13))i=this.moveToNextToken;else{if(!n){this.popStack();return}this.prevToken&&this._issues.push(H(19,new j(G(this.prevToken))))}let s=this.isNodeName();if(s||this._issues.push(H(7,new j(G(i??this.prevToken)))),r.addPath(s??null,i?new j(G(i)):void 0),n&&!i&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let n=this.moveToNextToken,r=n;if(!F(r,40)){this.popStack();return}let i=this.moveToNextToken;if(r=i,!F(r,2)){this.popStack();return}let s=this.processNodePath(),o=new Ln(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&!ln(l.lastToken,c)){this._issues.push(H(29,new j(G(l.lastToken,c))));return}if(u===0&&i&&!ln(i,l?.firstToken)){this._issues.push(H(29,new j(G(i,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&!ln(l.lastToken,d.firstToken)&&this._issues.push(H(29,new j(G(l.lastToken,d?.firstToken))))}),F(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(H(3,new j(G(this.prevToken)))),o.firstToken=n,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(n=>n instanceof xi)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var jo=K(J());var ER=require("fs");var wR=require("path"),gf=class t{constructor(e,n){this.settings=e;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,wR.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(ER.existsSync),this.parser=new dc(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=ai(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(i=>new dc(i,r.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,n=i=>({file:i,includes:(e.get(i)??[]).map(s=>n(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:n(this.parser.uri),overlays:this.overlays.map(n)}}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(n=>ue(n,e))}getUriParser(e){let n=this.overlayParsers.find(r=>r.getFiles().some(i=>ue(i,e)));return n??=this.parser.getFiles().some(r=>ue(r,e))?this.parser:void 0,n}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,n){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>ue(s.ast.uri,e)&&(!n||Kn(s.ast,e,n))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof Me&&l.compatible===o.value.value);return c?{range:te(o.value),target:he(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>ue(s.uri,e)&&(!n||Kn(s,e,n))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:te(s.path),target:he(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let n=s=>[...s.property,...s.nodes.flatMap(n)],r=n(e.rootNode),i=e.rootNode.allDescendantsLabels;r.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof be){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(qt(3,o,jo.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof li){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(qt(8,d,jo.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(h=>h?.linksTo).map(h=>h?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){let n=this.getUriParser(e);return n?(this.sortKeys=new WeakMap,await n.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 n=new qo(this);this._issues=[],this.processRoot(this.parser.rootDocument,n);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,n);return n.includes=this.parser.includes,n.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof jr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,i)=>this.sortKeys.set(r,i)),this.linkPropertiesLabelsAndNodePaths(n),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),n}processRoot(e,n){for(let r=0;r<e.children.length;r++){let i=e.children[r];this.processChild(i,n.rootNode,n)}}processChild(e,n,r){e instanceof Ye?this.processDtcBaseNode(e,n,r):e instanceof je?this.processDtcProperty(e,n,r):e instanceof Sn?this.processDeleteNode(e,n,r):e instanceof Je&&this.processDeleteProperty(e,n,r)}checkNodeUniqueNames(e,n){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||Lr(c.address,a.fullAddress)===0)),i=n.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof Oe&&o.name)r(s.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(qt(2,o.name)),s.push(o.name);else if(o instanceof Sn&&o.nodeNameOrRef instanceof Fe){let a=o.nodeNameOrRef;r(i,a)&&(s=s.filter(c=>r(s.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,n,r){e instanceof mt?this.processDtcRootNode(e,r):e instanceof Oe?this.processDtcChildNode(e,n,r):e instanceof jt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,n){n.roots.push(e),n.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,n.rootNode),[...e.children].sort((r,i)=>r instanceof je&&i instanceof Je||i instanceof je&&r instanceof Je?0:i instanceof je?1:0).forEach(r=>this.processChild(r,n.rootNode,n))}processDtcChildNode(e,n,r){if(e.name?.name){let i=e.path?r.resolvePath(e.path):void 0,o=(i?r.rootNode.getChild(i):void 0)??new ke(this.bindingLoader,e.name.name,e.name.fullAddress,n);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),n=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((i,s)=>i instanceof Ye&&s instanceof Ye?0:i instanceof Ye?-1:0).forEach(i=>this.processChild(i,n,r))}processDtcRefNode(e,n){let r;if(e.labelReference){let i=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);i?(e.resolveNodePath??=[...i],r=n.rootNode.getChild(i),e.labelReference.linksTo=r,e.labels.forEach(s=>s.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(s=>{n.labelsUsedCache.set(s.label.value,i)}),r?(n.references.push(e),this.checkNodeUniqueNames(e,r)):n.unlinkedRefNodes.push(e)):(this._issues.push(qt(3,e.labelReference,jo.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),n.unlinkedRefNodes.push(e))}else n.unlinkedRefNodes.push(e);[...e.children].sort((i,s)=>i instanceof Ye&&s instanceof Ye?0:i instanceof Ye?-1:0).forEach(i=>this.processChild(i,r??new ke(this.bindingLoader,""),n))}processDtcProperty(e,n,r){e.propertyName?.name&&n.addProperty(new ze(e,n)),e.children.forEach(i=>this.processChild(i,n,r))}processDeleteNode(e,n,r){if(e.nodeNameOrRef instanceof Fe&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!n.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(qt(5,e.nodeNameOrRef));else{n.deletes.push(e);let i=n.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,n.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{r.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof be&&e.nodeNameOrRef.value){let i=r.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=r.rootNode.getChild(i),n.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof Ye&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(qt(3,e.nodeNameOrRef,jo.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Ln&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=s?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),s=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(r.unlinkedDeletes.push(e),c&&this._issues.push(qt(8,c,jo.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),n.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Ye&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,n,r))}processDeleteProperty(e,n,r){e.propertyName?.name&&!n.hasProperty(e.propertyName.name)?this._issues.push(qt(1,e.propertyName)):e.propertyName?.name&&(n.deletes.push(e),n.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,n,r))}static#e(e,n,r){let i=r.get(n);i||(i=[],r.set(n,i)),i.push(e)}async getDiagnostics(){let e=new Map;try{return(await this.getAllParsers()).forEach(i=>{i.issues.forEach(s=>t.#e(s.diagnostic(),s.raw.astElement.uri,e))}),(await this.getContextIssues()??[]).forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)),(await this.getRuntime())?.typesIssues.forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)),e}catch(n){throw console.error(n),n}}async toFullString(){return`/dts-v1/;
|
|
279
|
+
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var Et=K(J());var kR=require("fs"),Fo=require("path");function m$(t){if(!t||!(t.ast instanceof Ro))return[];let e=r=>r.flatMap(i=>(0,kR.readdirSync)(i,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,Fo.join)((0,Fo.relative)(i,s.parentPath),s.name)}`,kind:Et.CompletionItemKind.File})));if(t.ast.relative)return e([(0,Fo.dirname)(t.ast.uri)]);let n=t.runtime.context.settings.includePaths??[];return e(n)}var bf=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>bf(n.node,e)),...t.nodes.flatMap(n=>bf(n,e))],ry=(t,e)=>[...t.labels,...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>ry(n.node,e)),...t.nodes.flatMap(n=>ry(n,e))];function g$(t,e){if(!t||!(t.item instanceof ze)||!(t.ast instanceof be))return[];let n=r=>ry(r,e);return Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Method}))}function y$(t,e){if(!t||t.item!==null||!(t.ast instanceof be)||!(t.ast.parentNode instanceof jt))return[];let n=r=>bf(r,e).filter(i=>e(i));return[...Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
|
|
278
280
|
$1
|
|
279
|
-
};`,kind:St.CompletionItemKind.Value,insertTextFormat:St.InsertTextFormat.Snippet}))]}function V1(t,e){let n=s=>s?s.parentNode instanceof qt||s.parentNode instanceof Tt||s.parentNode instanceof Ae?!1:n(s.parentNode):!0;if(!t||t.item!==null||!At(t.ast)||!n(t.ast))return[];let r=s=>df(s,e).filter(i=>e(i));return t.ast instanceof at?r(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:St.CompletionItemKind.Keyword,insertTextFormat:St.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:St.CompletionItemKind.Keyword,insertTextFormat:St.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(t.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:t.ast instanceof ye?`${s}`:`&${s}`,kind:St.CompletionItemKind.Variable}))}function z1(t,e){if(!t||!(t.item instanceof we)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof ln)||t.beforeAst?.parentNode instanceof Xe))return[];let n=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Ae)).filter(s=>e(s));return t.ast instanceof qe||t.ast instanceof _n||t.beforeAst?.parentNode instanceof _n?Array.from(new Set(n(t.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:St.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-node/",kind:St.CompletionItemKind.Keyword,insertTextFormat:St.InsertTextFormat.Snippet,sortText:"~"}]:[]}function W1(t,e){if(!t||!(t.item instanceof we)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof ln)||t.beforeAst?.parentNode instanceof _n))return[];let n=r=>[...r.property,...r.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return t.ast instanceof We||t.ast instanceof Xe||t.beforeAst?.parentNode instanceof Xe?Array.from(new Set(n(t.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:St.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:St.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:St.InsertTextFormat.Snippet}]:[]}function H1(t,e){let n=t?.ast instanceof os?t.ast:t?.ast.parentNode;if(!t||!n||!(n instanceof os))return[];let r=n.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!At(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:St.CompletionItemKind.Variable}))}var uf=t=>!t||t instanceof Le?!1:t instanceof un||uf(t.parentNode);function G1(t){return!t||!(t.item instanceof Be&&t.item.ast.assignOperatorToken)?[]:!uf(t?.ast)&&!(t.ast instanceof Le&&t.item.ast.values===null)&&!uf(t.beforeAst)&&!uf(t.afterAst)?[]:t.item.parent.nodeType instanceof Sn?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,s])=>s.macro.identifier instanceof Fr?{label:`${s.macro.identifier.toString()}`,insertText:`${s.macro.name}(${s.macro.identifier.params.map((i,o)=>i instanceof Ot?`$${o+1}`:"").join(", ")})`,kind:St.CompletionItemKind.Function,sortText:`~${s.macro.name}`,insertTextFormat:St.InsertTextFormat.Snippet}:{label:s.macro.identifier.name,kind:St.CompletionItemKind.Variable,sortText:`~${s.macro.name}`}):[]}async function lR(t,e){return vt(t,e,(n,r)=>[...W1(n,r),...z1(n,r),...V1(n,r),...H1(n,r),...U1(n,r),...B1(n,r),...F1(n),...G1(n)])}var Ur=K(J());function Y1(t){if(!t||t.item===null||!(t.ast instanceof We))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof Le)return Ur.Location.create(fe(s.uri),te(s.propertyName??s));if(s instanceof Xe)return Ur.Location.create(fe(s.uri),te(s.propertyName??s))}).filter(s=>s);if(t.item instanceof Be&&t.ast instanceof We)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof We&&t.ast.parentNode instanceof Xe){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function K1(t){if(!t)return[];let e=n=>{let s=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===n)return!0}).map(o=>o.ast)??[],i=n.parent?.deletedNodes.filter(o=>o.node===n&&(o.by.nodeNameOrRef instanceof qe?o.by.nodeNameOrRef!==t.ast:!n.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...n.linkedRefLabels,...n.linkedNodeNamePaths,...n.definitions,...i].map(o=>{if(o instanceof Tt)return Ur.Location.create(fe(o.uri),te(o.name??o));if(o instanceof Ae)return Ur.Location.create(fe(o.uri),te(o.name??o));if(o instanceof qe)return Ur.Location.create(fe(o.uri),te(o));if(o instanceof qe)return Ur.Location.create(fe(o.uri),te(o));if(o instanceof ye)return Ur.Location.create(fe(o.uri),te(o.label??o));if(o instanceof Le)return Ur.Location.create(fe((o.values??o)?.uri),te(o.values??o))}).filter(o=>o)};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof zt&&t.ast.parentNode instanceof ye&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return At(t.ast)?[...e(t.ast.linksTo),Ur.Location.create(fe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof xe&&t.item instanceof Be&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}async function uR(t,e){return vt(t,e,n=>[...K1(n),...Y1(n)])}var as=K(J());function dR(t){if(!t||t.item===null||!(t.ast instanceof We))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof Le||s instanceof Xe)&&s.propertyName)return as.Location.create(fe(s.uri),te(s.propertyName))}).filter(s=>s);if(t.item instanceof Be&&t.ast instanceof We)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof We&&t.ast.parentNode instanceof Xe){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function fR(t,e){if(!e||!(e.ast instanceof zt))return[];"newName"in t&&(e.ast.parentNode instanceof ye&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof $s&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let n=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof Ae).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===n).map(i=>{if(i)return as.Location.create(fe(i.uri),te(i))}).filter(i=>i);return e.item instanceof we&&!At(e.ast)?r(e.item):e.ast instanceof zt&&e.ast.parentNode instanceof ye&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function hR(t){if(!t||!(t.ast instanceof qe))return[];let e=n=>{let s=t.runtime.rootNode.getNode("aliases")?.property.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(n)||c===n)return!0}}).map(o=>o.ast)??[],i=n.parent?.deletedNodes.filter(o=>o.node===n&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...n.linkedNodeNamePaths,...n.definitions,...i].map(o=>{if(o instanceof Ae&&o.name)return as.Location.create(fe(o.uri),te(o.name));if(o instanceof qe)return as.Location.create(fe(o.uri),te(o));if(o instanceof Le&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof xe){let a=o.values.values[0].value,c=te(a),l=a.value.split("/"),u=n.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,as.Location.create(fe(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof qe&&t.ast.linksTo?At(t.ast)?[...e(t.ast.linksTo),as.Location.create(fe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo):[]}async function pR(t,e){let n={};return(await vt(t,e,s=>[...hR(s),...fR(t,s),...dR(s)])).forEach(s=>{n[s.uri]??=[],n[s.uri].push(as.TextEdit.replace(s.range,t.newName))}),{changes:n}}async function mR(t,e){let n=await vt(t,e,r=>[...hR(r),...fR(t,r),...dR(r)]);if(n.some(r=>e?.settings.lockRenameEdits?.some(s=>Ke(r.uri).startsWith(s))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!n.length}}var Fo=K(J());function X1(t){if(!t||t.item===null||!(t.ast instanceof We))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof Le)return Fo.Location.create(fe(s.uri),te(s.propertyName??s))}).filter(s=>s);if(t.item instanceof Be&&t.ast instanceof We)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof We&&t.ast.parentNode instanceof Xe){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function J1(t){if(!t)return[];let e=n=>[...n.definitions,...n.referencedBy].map(r=>{if(r instanceof Tt)return Fo.Location.create(fe(r.uri),te(r));if(r instanceof Ae)return Fo.Location.create(fe(r.uri),te(r));if(r instanceof qt)return Fo.Location.create(fe(r.uri),te(r))}).filter(r=>r);if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof zt&&t.ast.parentNode instanceof ye&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof xe&&t.item instanceof Be&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}function Q1(t){if(t?.ast instanceof Ot||t?.ast instanceof Ir){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return[Fo.Location.create(fe(e.macro.uri),te(e.macro.identifier))]}return[]}async function gR(t,e){return vt(t,e,n=>[...J1(n),...X1(n),...Q1(n)])}var ff=K(J());function Z1(t){if(!t||t.item===null||!(t.ast instanceof We))return;let e=r=>r.replaces?e(r.replaces):r,n=r=>ff.Location.create(fe(r.ast.uri),te(r.ast.propertyName??r.ast));if(t.item instanceof Be&&t.ast instanceof We)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof We&&t.ast.parentNode instanceof Xe){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(e(r))}}function eL(t){if(!t)return;let e=n=>{let r=n.definitions.at(0);return r?ff.Location.create(fe(r.uri),te(r)):void 0};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof zt&&t.ast.parentNode instanceof ye&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof xe&&t.item instanceof Be&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}}function tL(t){if(t?.ast instanceof Ot||t?.ast instanceof Ir){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return ff.Location.create(fe(e.macro.uri),te(e.macro.identifier))}}async function yR(t,e){return(await vt(t,e,n=>[eL(n)||Z1(n)||tL(n)])).at(0)}var re=K(J());var nL=(t,e,n,r,s)=>{switch(n){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(re.Range.create(re.Position.create(r.range.start.line,t.pos.colEnd),re.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},rL=(t,e,n,r,s)=>{if(!r)return[];switch(t){case 0:return[{title:s??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 27:return[{title:s??"Remove Property",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 26:return[{title:s??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 25:return r?[{title:s??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}]:[];default:return}};function bR(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>nL(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>rL(l,a,t.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),n=e.filter(a=>a.kind===re.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==re.CodeActionKind.SourceFixAll),i=n.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return r.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)}),[...s,...n.map(a=>({...a,kind:re.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var hf=t=>!t||t instanceof Le?!1:t instanceof un||hf(t.parentNode);function sL(t){if(!t||!(t.item instanceof Be&&t.item.ast.assignOperatorToken))return[];let e=hf(t?.ast);if(!e&&!(t.ast instanceof Le&&t.item.ast.values===null)&&!hf(t.beforeAst)&&!hf(t.afterAst))return[];let n=-1;t.item.ast.values===null?n=0:n=(t.item.ast.values?.values.findIndex(s=>s&&kg(s,t.beforeAst))??-1)+1,n===-1&&(n=0);let r=t.item.parent.nodeType;return r instanceof Sn?r.properties.find(s=>s.name===t.item?.name)?.getPropertyCompletionItems(t.item,n,e)??[]:[]}function iL(t){if(!t||!(t.item instanceof Be&&t.ast instanceof We&&t.item.ast.values==null||t.item instanceof we)||At(t.ast)||t.beforeAst?.parentNode instanceof ln)return[];let e=n=>n.nodeType?.getPropertyListCompletionItems(n)??[];return t.item instanceof Be?e(t.item.parent):e(t.item)}async function vR(t,e){return vt(t,e,n=>[...sL(n),...iL(n)])}var pf=K(J());async function oL(t){if(t?.ast instanceof Ot||t?.ast instanceof Ir){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ot?t.ast.name:t.ast.value);if(e){let n=Ka(t.ast),r=(await t.runtime.context.getAllParsers()).at(-1);if(n){let s=n?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:pf.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${s}${typeof s=="number"?` (0x${s.toString(16)})`:""}`,"```"].join(`
|
|
280
|
-
`)},range:te(t.ast)}}return{contents:{kind:
|
|
281
|
-
`)},range:te(t.ast)}}}}async function
|
|
282
|
-
${n?.value??""}`},range:te(t.ast)}}}function TR(t,e){return vt(t,e,async n=>[await aL(n)||cL(n)||await oL(n)])}var HT=K(Pb());var RD=K(TD(),1);var jc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var FB={"[: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]},Fc=t=>t.replace(/[[\]\\-]/g,"\\$&"),BB=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_D=t=>t.join(""),SD=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=n+1,o=!1,a=!1,c=!1,l=!1,u=n,d="";e:for(;i<t.length;){let m=t.charAt(i);if((m==="!"||m==="^")&&i===n+1){l=!0,i++;continue}if(m==="]"&&o&&!c){u=i+1;break}if(o=!0,m==="\\"&&!c){c=!0,i++;continue}if(m==="["&&!c){for(let[b,[E,_,T]]of Object.entries(FB))if(t.startsWith(b,i)){if(d)return["$.",!1,t.length-n,!0];i+=b.length,T?s.push(E):r.push(E),a=a||_;continue e}}if(c=!1,d){m>d?r.push(Fc(d)+"-"+Fc(m)):m===d&&r.push(Fc(m)),d="",i++;continue}if(t.startsWith("-]",i+1)){r.push(Fc(m+"-")),i+=2;continue}if(t.startsWith("-",i+1)){d=m,i+=2;continue}r.push(Fc(m)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,t.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let m=r[0].length===2?r[0].slice(-1):r[0];return[BB(m),!1,u-n,!1]}let f="["+(l?"^":"")+_D(r)+"]",h="["+(l?"":"^")+_D(s)+"]";return[r.length&&s.length?"("+f+"|"+h+")":r.length?f:h,a,u-n,!0]};var Tr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var UB=new Set(["!","?","+","*","@"]),ED=t=>UB.has(t),VB="(?!(?:^|/)\\.\\.?(?:$|/))",fh="(?!\\.)",zB=new Set(["[","."]),WB=new Set(["..","."]),HB=new Set("().*{}+?[]^$\\!"),GB=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Db="[^/]",wD=Db+"*?",kD=Db+"+?",Jo=class t{type;#e;#t;#s=!1;#n=[];#o;#f;#l;#d=!1;#a;#c;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.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.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let s=n.#f+1;!r.type&&s<r.#n.length;s++)for(let i of e.#n){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#n[s])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#n.push(n)}}toJSON(){let e=this.type===null?this.#n.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#n.map(n=>n.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 n=0;n<this.#f;n++){let r=e.#n[n];if(!(r instanceof t&&r.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.#n.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#n)n.copyIn(r);return n}static#b(e,n,r,s){let i=!1,o=!1,a=-1,c=!1;if(n.type===null){let h=r,y="";for(;h<e.length;){let m=e.charAt(h++);if(i||m==="\\"){i=!i,y+=m;continue}if(o){h===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(h===a+2&&c)&&(o=!1),y+=m;continue}else if(m==="["){o=!0,a=h,c=!1,y+=m;continue}if(!s.noext&&ED(m)&&e.charAt(h)==="("){n.push(y),y="";let b=new t(m,n);h=t.#b(e,b,h,s),n.push(b);continue}y+=m}return n.push(y),h}let l=r+1,u=new t(null,n),d=[],f="";for(;l<e.length;){let h=e.charAt(l++);if(i||h==="\\"){i=!i,f+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),f+=h;continue}else if(h==="["){o=!0,a=l,c=!1,f+=h;continue}if(ED(h)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(h,u);u.push(y),l=t.#b(e,y,l,s);continue}if(h==="|"){u.push(f),f="",d.push(u),u=new t(null,n);continue}if(h===")")return f===""&&n.#n.length===0&&(n.#i=!0),u.push(f),f="",n.push(...d,u),l;f+=h}return n.type=null,n.#t=void 0,n.#n=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#b(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[y,m,b,E]=typeof h=="string"?t.#h(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||b,this.#s=this.#s||E,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&WB.has(this.#n[0]))){let y=zB,m=n&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),b=!n&&!e&&y.has(l.charAt(0));u=m?VB:b?fh:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Tr(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#p(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,Tr(this.toString()),!1,!1]}let o=!r||e||n||!fh?"":this.#p(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?fh:"")+kD;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?fh:"")+wD+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,Tr(i),this.#t=!!this.#t,this.#s]}#p(e){return this.#n.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#h(e,n,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(HB.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=SD(e,a);if(d){i+=l,o=o||u,a+=d-1,n=n||f;continue}}if(c==="*"){r&&e==="*"?i+=kD:i+=wD,n=!0;continue}if(c==="?"){i+=Db,n=!0;continue}i+=GB(c)}return[i,Tr(e),!!n,o]}};var Qo=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var dn=(t,e,n={})=>(jc(e),!n.nocomment&&e.charAt(0)==="#"?!1:new jn(e,n).match(t)),YB=/^\*+([^+@!?\*\[\(]*)$/,KB=t=>e=>!e.startsWith(".")&&e.endsWith(t),XB=t=>e=>e.endsWith(t),JB=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),QB=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),ZB=/^\*+\.\*+$/,eU=t=>!t.startsWith(".")&&t.includes("."),tU=t=>t!=="."&&t!==".."&&t.includes("."),nU=/^\.\*+$/,rU=t=>t!=="."&&t!==".."&&t.startsWith("."),sU=/^\*+$/,iU=t=>t.length!==0&&!t.startsWith("."),oU=t=>t.length!==0&&t!=="."&&t!=="..",aU=/^\?+([^+@!?\*\[\(]*)?$/,cU=([t,e=""])=>{let n=CD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},lU=([t,e=""])=>{let n=DD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},uU=([t,e=""])=>{let n=DD([t]);return e?r=>n(r)&&r.endsWith(e):n},dU=([t,e=""])=>{let n=CD([t]);return e?r=>n(r)&&r.endsWith(e):n},CD=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},DD=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},AD=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ND={win32:{sep:"\\"},posix:{sep:"/"}},fU=AD==="win32"?ND.win32.sep:ND.posix.sep;dn.sep=fU;var Ht=Symbol("globstar **");dn.GLOBSTAR=Ht;var hU="[^/]",pU=hU+"*?",mU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",gU="(?:(?!(?:\\/|^)\\.).)*?",yU=(t,e={})=>n=>dn(n,t,e);dn.filter=yU;var Xn=(t,e={})=>Object.assign({},t,e),bU=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return dn;let e=dn;return Object.assign((r,s,i={})=>e(r,s,Xn(t,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Xn(t,i))}static defaults(s){return e.defaults(Xn(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Xn(t,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Xn(t,i))}},unescape:(r,s={})=>e.unescape(r,Xn(t,s)),escape:(r,s={})=>e.escape(r,Xn(t,s)),filter:(r,s={})=>e.filter(r,Xn(t,s)),defaults:r=>e.defaults(Xn(t,r)),makeRe:(r,s={})=>e.makeRe(r,Xn(t,s)),braceExpand:(r,s={})=>e.braceExpand(r,Xn(t,s)),match:(r,s,i={})=>e.match(r,s,Xn(t,i)),sep:e.sep,GLOBSTAR:Ht})};dn.defaults=bU;var OD=(t,e={})=>(jc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,RD.default)(t));dn.braceExpand=OD;var vU=(t,e={})=>new jn(t,e).makeRe();dn.makeRe=vU;var TU=(t,e,n={})=>{let r=new jn(e,n);return t=t.filter(s=>r.match(s)),r.options.nonull&&!t.length&&t.push(e),t};dn.match=TU;var PD=/[?*]|[+@!]\(.*?\)|\[|\]/,_U=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){jc(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||AD,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.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 n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!PD.test(i[2]))&&!PD.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(n=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],l=r[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(s,1);let u=r.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let s=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(s){e[n]=[],e[r]=s;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<n.length;)if(e[s]===n[i])o.push(a==="b"?n[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&n[i]===e[s+1])o.push(e[s]),s++;else if(r&&n[i]==="**"&&e[s]===n[i+1])o.push(n[i]),i++;else if(e[s]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(n[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(n[i]),s++,i++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),_=!E&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),T=b?3:m?0:void 0,k=_?3:E?0:void 0;if(typeof T=="number"&&typeof k=="number"){let[C,$]=[e[T],n[k]];C.toLowerCase()===$.toLowerCase()&&(n[k]=C,k>T?n=n.slice(k):T>k&&(e=e.slice(T)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,c=e.length,l=n.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=n[a],d=e[o];if(this.debug(n,u,d),u===!1)return!1;if(u===Ht){this.debug("GLOBSTAR",[n,u,d]);var f=o,h=a+1;if(h===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var y=e[f];if(this.debug(`
|
|
283
|
-
globstar while`,e,f,n,h,y),this.matchOne(e.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,c,y),!0;if(y==="."||y===".."||!
|
|
284
|
-
>>> no match, partial?`,e,f,n,h),f===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return OD(this.pattern,this.options)}parse(e){jc(e);let n=this.options;if(e==="**")return Ht;if(e==="")return"";let r,s=null;(r=e.match(sU))?s=n.dot?oU:iU:(r=e.match(YB))?s=(n.nocase?n.dot?QB:JB:n.dot?XB:KB)(r[1]):(r=e.match(aU))?s=(n.nocase?n.dot?lU:cU:n.dot?uU:dU)(r):(r=e.match(ZB))?s=n.dot?tU:eU:(r=e.match(nU))&&(s=rU);let i=Jo.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?pU:n.dot?mU:gU,s=new Set(n.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?_U(u):u===Ht?Ht:u._src});return l.forEach((u,d)=>{let f=l[d+1],h=l[d-1];u!==Ht||h===Ht||(h===void 0?f!==void 0&&f!==Ht?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=h+"(?:\\/|"+r+")?":f!==Ht&&(l[d-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Ht))}),l.filter(u=>u!==Ht).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].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,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return dn.defaults(e).Minimatch}};dn.AST=Jo;dn.Minimatch=jn;dn.escape=Qo;dn.unescape=Tr;var nA=require("node:url");var Zo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xD=new Set,Ab=typeof process=="object"&&process?process:{},MD=(t,e,n,r)=>{typeof Ab.emitWarning=="function"?Ab.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},hh=globalThis.AbortController,ID=globalThis.AbortSignal;if(typeof hh>"u"){ID=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},hh=class{constructor(){e()}signal=new ID;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let t=Ab.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,MD("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 SU=t=>!xD.has(t),Kre=Symbol("type"),Ys=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),$D=t=>Ys(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ea:null:null,ea=class extends Array{constructor(e){super(e),this.fill(0)}},Ob=class t{heap;length;static#e=!1;static create(e){let n=$D(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Bc=class t{#e;#t;#s;#n;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#i;#y;#b;#p;#h;#E;#g;#w;#k;#T;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#i,next:e.#y,prev:e.#b,get head(){return e.#p},get tail(){return e.#h},free:e.#E,isBackgroundFetch:n=>e.#u(n),backgroundFetch:(n,r,s,i)=>e.#q(n,r,s,i),moveToTail:n=>e.#F(n),indexes:n=>e.#P(n),rindexes:n=>e.#R(n),isStale:n=>e.#v(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#s}get disposeAfter(){return this.#n}constructor(e){let{max:n=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:y=0,sizeCalculation:m,fetchMethod:b,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:C,ignoreFetchAbort:$}=e;if(n!==0&&!Ys(n))throw new TypeError("max option must be a nonnegative integer");let B=n?$D(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=y||this.#t,this.sizeCalculation=m,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(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=E,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=b,this.#S=!!b,this.#a=new Map,this.#c=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#y=new B(n),this.#b=new B(n),this.#p=0,this.#h=0,this.#E=Ob.create(n),this.#l=0,this.#d=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#n=u,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#_=!!this.#s,this.#m=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(this.#t!==0&&!Ys(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ys(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ys(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!Ys(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 q="LRU_CACHE_UNBOUNDED";SU(q)&&(xD.add(q),MD("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new ea(this.#e),n=new ea(this.#e);this.#T=e,this.#k=n,this.#O=(i,o,a=Zo.now())=>{if(n[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(i)&&this.#A(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{n[i]=e[i]!==0?Zo.now():0},this.#r=(i,o)=>{if(e[o]){let a=e[o],c=n[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=r||s();let l=i.now-c;i.remainingTTL=a-l}};let r=0,s=()=>{let i=Zo.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=n[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#v=i=>{let o=n[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#r=()=>{};#O=()=>{};#v=()=>!1;#D(){let e=new ea(this.#e);this.#d=0,this.#w=e,this.#I=n=>{this.#d-=e[n],e[n]=0},this.#M=(n,r,s,i)=>{if(this.#u(r))return 0;if(!Ys(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,n),!Ys(s))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 s},this.#x=(n,r,s)=>{if(e[n]=r,this.#t){let i=this.#t-e[n];for(;this.#d>i;)this.#L(!0)}this.#d+=e[n],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,n,r)=>{};#M=(e,n,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#h;!(!this.#$(n)||((e||!this.#v(n))&&(yield n),n===this.#p));)n=this.#b[n]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#p;!(!this.#$(n)||((e||!this.#v(n))&&(yield n),n===this.#h));)n=this.#y[n]}#$(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#R())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#P()){let n=this.#c[e];n!==void 0&&!this.#u(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#R()){let n=this.#c[e];n!==void 0&&!this.#u(this.#i[e])&&(yield n)}}*values(){for(let e of this.#P())this.#i[e]!==void 0&&!this.#u(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#R())this.#i[e]!==void 0&&!this.#u(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#P()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#P()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#R()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#R({allowStale:!0}))this.#v(n)&&(this.#A(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#T&&this.#k){let o=this.#T[n],a=this.#k[n];if(o&&a){let c=o-(Zo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#w&&(i.size=this.#w[n]),i}dump(){let e=[];for(let n of this.#P({allowStale:!0})){let r=this.#c[n],s=this.#i[n],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#T&&this.#k){o.ttl=this.#T[n];let a=Zo.now()-this.#k[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let s=Date.now()-r.start;r.start=Zo.now()-s}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,n,r.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.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#h:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#L(!1):this.#l,this.#c[d]=e,this.#i[d]=n,this.#a.set(e,d),this.#y[this.#h]=d,this.#b[d]=this.#h,this.#h=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#i[d];if(n!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#_&&this.#s?.(h,e,"set"),this.#m&&this.#g?.push([h,e,"set"]))}else o||(this.#_&&this.#s?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#i[d]=n,c){c.set="replace";let h=f&&this.#u(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(s!==0&&!this.#T&&this.#C(),this.#T&&(l||this.#O(d,s,i),c&&this.#r(c,d)),!o&&this.#m&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#l;){let e=this.#i[this.#p];if(this.#L(!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,n;for(;n=e?.shift();)this.#n?.(...n)}}}#L(e){let n=this.#p,r=this.#c[n],s=this.#i[n];return this.#S&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#s?.(s,r,"evict"),this.#m&&this.#g?.push([s,r,"evict"])),this.#I(n),e&&(this.#c[n]=void 0,this.#i[n]=void 0,this.#E.push(n)),this.#l===1?(this.#p=this.#h=0,this.#E.length=0):this.#p=this.#y[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=n,i=this.#a.get(e);if(i!==void 0){let o=this.#i[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(i))s&&(s.has="stale",this.#r(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#r(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,s=this.#a.get(e);if(s===void 0||!r&&this.#v(s))return;let i=this.#i[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,n,r,s){let i=n===void 0?void 0:this.#i[n];if(this.#u(i))return i;let o=new hh,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(m,b=!1)=>{let{aborted:E}=o.signal,_=r.ignoreFetchAbort&&m!==void 0;if(r.status&&(E&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!b)return d(o.signal.reason);let T=h;return this.#i[n]===h&&(m===void 0?T.__staleWhileFetching?this.#i[n]=T.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=m),d(m)),d=m=>{let{aborted:b}=o.signal,E=b&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,T=_||r.noDeleteOnFetchRejection,k=h;if(this.#i[n]===h&&(!T||k.__staleWhileFetching===void 0?this.#A(e,"fetch"):E||(this.#i[n]=k.__staleWhileFetching)),_)return r.status&&k.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw m},f=(m,b)=>{let E=this.#o?.(e,i,c);E&&E instanceof Promise&&E.then(_=>m(_===void 0?void 0:_),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(m(void 0),r.allowStaleOnFetchAbort&&(m=_=>l(_,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),y=Object.assign(h,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return n===void 0?(this.set(e,y,{...c.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=y,y}#u(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof hh}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=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:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:E,signal:_}=n;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:E});let T={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:h,status:E,signal:_},k=this.#a.get(e);if(k===void 0){E&&(E.fetch="miss");let C=this.#q(e,k,T,m);return C.__returned=C}else{let C=this.#i[k];if(this.#u(C)){let Ve=r&&C.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",Ve&&(E.returnedStale=!0)),Ve?C.__staleWhileFetching:C.__returned=C}let $=this.#v(k);if(!b&&!$)return E&&(E.fetch="hit"),this.#F(k),s&&this.#N(k),E&&this.#r(E,k),C;let B=this.#q(e,k,T,m),oe=B.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=$?"stale":"refresh",oe&&$&&(E.returnedStale=!0)),oe?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#f;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=n,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=r(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let c=this.#i[a],l=this.#u(c);return o&&this.#r(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,n){this.#b[n]=e,this.#y[e]=n}#F(e){e!==this.#h&&(e===this.#p?this.#p=this.#y[e]:this.#j(this.#b[e],this.#y[e]),this.#j(this.#h,e),this.#h=e)}delete(e){return this.#A(e,"delete")}#A(e,n){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(s);let i=this.#i[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#s?.(i,e,n),this.#m&&this.#g?.push([i,e,n])),this.#a.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#h)this.#h=this.#b[s];else if(s===this.#p)this.#p=this.#y[s];else{let o=this.#b[s];this.#y[o]=this.#y[s];let a=this.#y[s];this.#b[a]=this.#b[s]}this.#l--,this.#E.push(s)}}if(this.#m&&this.#g?.length){let s=this.#g,i;for(;i=s?.shift();)this.#n?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#R({allowStale:!0})){let r=this.#i[n];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[n];this.#_&&this.#s?.(r,s,e),this.#m&&this.#g?.push([r,s,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#T&&this.#k&&(this.#T.fill(0),this.#k.fill(0)),this.#w&&this.#w.fill(0),this.#p=0,this.#h=0,this.#E.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#n?.(...r)}}};var ra=require("node:path"),HD=require("node:url"),Gr=require("fs"),OU=K(require("node:fs"),1),Js=require("node:fs/promises");var Th=require("node:events"),jb=K(require("node:stream"),1),BD=require("node:string_decoder"),LD=typeof process=="object"&&process?process:{stdout:null,stderr:null},EU=t=>!!t&&typeof t=="object"&&(t instanceof Xs||t instanceof jb.default||wU(t)||kU(t)),wU=t=>!!t&&typeof t=="object"&&t instanceof Th.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==jb.default.Writable.prototype.pipe,kU=t=>!!t&&typeof t=="object"&&t instanceof Th.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",us=Symbol("EOF"),ds=Symbol("maybeEmitEnd"),Ks=Symbol("emittedEnd"),ph=Symbol("emittingEnd"),Uc=Symbol("emittedError"),mh=Symbol("closed"),qD=Symbol("read"),gh=Symbol("flush"),jD=Symbol("flushChunk"),_r=Symbol("encoding"),ta=Symbol("decoder"),jt=Symbol("flowing"),Vc=Symbol("paused"),na=Symbol("resume"),Ft=Symbol("buffer"),fn=Symbol("pipes"),Bt=Symbol("bufferLength"),Ib=Symbol("bufferPush"),yh=Symbol("bufferShift"),tn=Symbol("objectMode"),Et=Symbol("destroyed"),xb=Symbol("error"),Mb=Symbol("emitData"),FD=Symbol("emitEnd"),$b=Symbol("emitEnd2"),Wr=Symbol("async"),Lb=Symbol("abort"),bh=Symbol("aborted"),zc=Symbol("signal"),Oi=Symbol("dataListeners"),Fn=Symbol("discarded"),Wc=t=>Promise.resolve().then(t),NU=t=>t(),PU=t=>t==="end"||t==="finish"||t==="prefinish",RU=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,CU=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),vh=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[na](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},qb=class extends vh{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=s=>n.emit("error",s),e.on("error",this.proxyErrors)}},DU=t=>!!t.objectMode,AU=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Xs=class extends Th.EventEmitter{[jt]=!1;[Vc]=!1;[fn]=[];[Ft]=[];[tn];[_r];[Wr];[ta];[us]=!1;[Ks]=!1;[ph]=!1;[mh]=!1;[Uc]=null;[Bt]=0;[Et]=!1;[zc];[bh]=!1;[Oi]=0;[Fn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");DU(n)?(this[tn]=!0,this[_r]=null):AU(n)?(this[_r]=n.encoding,this[tn]=!1):(this[tn]=!1,this[_r]=null),this[Wr]=!!n.async,this[ta]=this[_r]?new BD.StringDecoder(this[_r]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Ft]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[fn]});let{signal:r}=n;r&&(this[zc]=r,r.aborted?this[Lb]():r.addEventListener("abort",()=>this[Lb]()))}get bufferLength(){return this[Bt]}get encoding(){return this[_r]}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[tn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Wr]}set async(e){this[Wr]=this[Wr]||!!e}[Lb](){this[bh]=!0,this.emit("abort",this[zc]?.reason),this.destroy(this[zc]?.reason)}get aborted(){return this[bh]}set aborted(e){}write(e,n,r){if(this[bh])return!1;if(this[us])throw new Error("write after end");if(this[Et])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let s=this[Wr]?Wc:NU;if(!this[tn]&&!Buffer.isBuffer(e)){if(CU(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(RU(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[tn]?(this[jt]&&this[Bt]!==0&&this[gh](!0),this[jt]?this.emit("data",e):this[Ib](e),this[Bt]!==0&&this.emit("readable"),r&&s(r),this[jt]):e.length?(typeof e=="string"&&!(n===this[_r]&&!this[ta]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[_r]&&(e=this[ta].write(e)),this[jt]&&this[Bt]!==0&&this[gh](!0),this[jt]?this.emit("data",e):this[Ib](e),this[Bt]!==0&&this.emit("readable"),r&&s(r),this[jt]):(this[Bt]!==0&&this.emit("readable"),r&&s(r),this[jt])}read(e){if(this[Et])return null;if(this[Fn]=!1,this[Bt]===0||e===0||e&&e>this[Bt])return this[ds](),null;this[tn]&&(e=null),this[Ft].length>1&&!this[tn]&&(this[Ft]=[this[_r]?this[Ft].join(""):Buffer.concat(this[Ft],this[Bt])]);let n=this[qD](e||null,this[Ft][0]);return this[ds](),n}[qD](e,n){if(this[tn])this[yh]();else{let r=n;e===r.length||e===null?this[yh]():typeof r=="string"?(this[Ft][0]=r.slice(e),n=r.slice(0,e),this[Bt]-=e):(this[Ft][0]=r.subarray(e),n=r.subarray(0,e),this[Bt]-=e)}return this.emit("data",n),!this[Ft].length&&!this[us]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[us]=!0,this.writable=!1,(this[jt]||!this[Vc])&&this[ds](),this}[na](){this[Et]||(!this[Oi]&&!this[fn].length&&(this[Fn]=!0),this[Vc]=!1,this[jt]=!0,this.emit("resume"),this[Ft].length?this[gh]():this[us]?this[ds]():this.emit("drain"))}resume(){return this[na]()}pause(){this[jt]=!1,this[Vc]=!0,this[Fn]=!1}get destroyed(){return this[Et]}get flowing(){return this[jt]}get paused(){return this[Vc]}[Ib](e){this[tn]?this[Bt]+=1:this[Bt]+=e.length,this[Ft].push(e)}[yh](){return this[tn]?this[Bt]-=1:this[Bt]-=this[Ft][0].length,this[Ft].shift()}[gh](e=!1){do;while(this[jD](this[yh]())&&this[Ft].length);!e&&!this[Ft].length&&!this[us]&&this.emit("drain")}[jD](e){return this.emit("data",e),this[jt]}pipe(e,n){if(this[Et])return e;this[Fn]=!1;let r=this[Ks];return n=n||{},e===LD.stdout||e===LD.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[fn].push(n.proxyErrors?new qb(this,e,n):new vh(this,e,n)),this[Wr]?Wc(()=>this[na]()):this[na]()),e}unpipe(e){let n=this[fn].find(r=>r.dest===e);n&&(this[fn].length===1?(this[jt]&&this[Oi]===0&&(this[jt]=!1),this[fn]=[]):this[fn].splice(this[fn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Fn]=!1,this[Oi]++,!this[fn].length&&!this[jt]&&this[na]();else if(e==="readable"&&this[Bt]!==0)super.emit("readable");else if(PU(e)&&this[Ks])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Uc]){let s=n;this[Wr]?Wc(()=>s.call(this,this[Uc])):s.call(this,this[Uc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Oi]=this.listeners("data").length,this[Oi]===0&&!this[Fn]&&!this[fn].length&&(this[jt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Oi]=0,!this[Fn]&&!this[fn].length&&(this[jt]=!1)),n}get emittedEnd(){return this[Ks]}[ds](){!this[ph]&&!this[Ks]&&!this[Et]&&this[Ft].length===0&&this[us]&&(this[ph]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[mh]&&this.emit("close"),this[ph]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Et&&this[Et])return!1;if(e==="data")return!this[tn]&&!r?!1:this[Wr]?(Wc(()=>this[Mb](r)),!0):this[Mb](r);if(e==="end")return this[FD]();if(e==="close"){if(this[mh]=!0,!this[Ks]&&!this[Et])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[Uc]=r,super.emit(xb,r);let i=!this[zc]||this.listeners("error").length?super.emit("error",r):!1;return this[ds](),i}else if(e==="resume"){let i=super.emit("resume");return this[ds](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...n);return this[ds](),s}[Mb](e){for(let r of this[fn])r.dest.write(e)===!1&&this.pause();let n=this[Fn]?!1:super.emit("data",e);return this[ds](),n}[FD](){return this[Ks]?!1:(this[Ks]=!0,this.readable=!1,this[Wr]?(Wc(()=>this[$b]()),!0):this[$b]())}[$b](){if(this[ta]){let n=this[ta].end();if(n){for(let r of this[fn])r.dest.write(n);this[Fn]||super.emit("data",n)}}for(let n of this[fn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[tn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[tn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[tn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[_r]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(Et,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Fn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[us])return n();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Et,u),n(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Et,u),this.pause(),i({value:d,done:!!this[us]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Et,u),n(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(Et,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Fn]=!1;let e=!1,n=()=>(this.pause(),this.off(xb,n),this.off(Et,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let s=this.read();return s===null?n():{done:!1,value:s}};return this.once("end",n),this.once(xb,n),this.once(Et,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Et])return e?this.emit("error",e):this.emit(Et),this;this[Et]=!0,this[Fn]=!0,this[Ft].length=0,this[Bt]=0;let n=this;return typeof n.close=="function"&&!this[mh]&&n.close(),e?this.emit("error",e):this.emit(Et),this}static get isStream(){return EU}};var IU=Gr.realpathSync.native,Gc={lstatSync:Gr.lstatSync,readdir:Gr.readdir,readdirSync:Gr.readdirSync,readlinkSync:Gr.readlinkSync,realpathSync:IU,promises:{lstat:Js.lstat,readdir:Js.readdir,readlink:Js.readlink,realpath:Js.realpath}},GD=t=>!t||t===Gc||t===OU?Gc:{...Gc,...t,promises:{...Gc.promises,...t.promises||{}}},YD=/^\\\\\?\\([a-z]:)\\?$/i,xU=t=>t.replace(/\//g,"\\").replace(YD,"$1\\"),MU=/[\\\/]/,Qn=0,KD=1,XD=2,Hr=4,JD=6,QD=8,Ii=10,ZD=12,Jn=15,Hc=~Jn,Fb=16,UD=32,Yc=64,Sr=128,_h=256,Eh=512,VD=Yc|Sr|Eh,$U=1023,Bb=t=>t.isFile()?QD:t.isDirectory()?Hr:t.isSymbolicLink()?Ii:t.isCharacterDevice()?XD:t.isBlockDevice()?JD:t.isSocket()?ZD:t.isFIFO()?KD:Qn,zD=new Map,Kc=t=>{let e=zD.get(t);if(e)return e;let n=t.normalize("NFKD");return zD.set(t,n),n},WD=new Map,Sh=t=>{let e=WD.get(t);if(e)return e;let n=Kc(t.toLowerCase());return WD.set(t,n),n},wh=class extends Bc{constructor(){super({max:256})}},Ub=class extends Bc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},eA=Symbol("PathScurry setAsCwd"),nn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#y;get atimeMs(){return this.#y}#b;get mtimeMs(){return this.#b}#p;get ctimeMs(){return this.#p}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#T;#_;#S;#m;#C;#N;#r;#O;#v;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Qn,r,s,i,o,a){this.name=e,this.#T=i?Sh(e):Kc(e),this.#r=n&$U,this.nocase=i,this.roots=s,this.root=r||this,this.#O=o,this.#S=a.fullpath,this.#C=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=GD(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 n=this.getRootString(e),s=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(s):this.#I(s)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#O.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#O.set(this,n),this.#r&=~Fb,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?Sh(e):Kc(e);for(let c of r)if(c.#T===s)return c;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,Qn,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Sr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,n=this.parent;if(!n)return this.#N=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let s=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#m=`//?/${s}`:this.#m=s}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#m=r}isUnknown(){return(this.#r&Jn)===Qn}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.#r&Jn)===QD}isDirectory(){return(this.#r&Jn)===Hr}isCharacterDevice(){return(this.#r&Jn)===XD}isBlockDevice(){return(this.#r&Jn)===JD}isFIFO(){return(this.#r&Jn)===KD}isSocket(){return(this.#r&Jn)===ZD}isSymbolicLink(){return(this.#r&Ii)===Ii}lstatCached(){return this.#r&UD?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.#r&Jn;return!(e!==Qn&&e!==Ii||this.#r&_h||this.#r&Sr)}calledReaddir(){return!!(this.#r&Fb)}isENOENT(){return!!(this.#r&Sr)}isNamed(e){return this.nocase?this.#T===Sh(e):this.#T===Kc(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}#x(e){this.#r|=Fb;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&Sr||(this.#r=(this.#r|Sr)&Hc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#R(){this.#r|=Eh,this.#$()}#$(){if(this.#r&Yc)return;let e=this.#r;(e&Jn)===Hr&&(e&=Hc),this.#r=e|Yc,this.#P()}#L(e=""){e==="ENOTDIR"||e==="EPERM"?this.#$():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#$():e==="ENOENT"&&this.#M()}#u(e=""){let n=this.#r;n|=_h,e==="ENOENT"&&(n|=Sr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=Hc),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#$()}#j(e,n){return this.#A(e,n)||this.#F(e,n)}#F(e,n){let r=Bb(e),s=this.newChild(e.name,r,{parent:this}),i=s.#r&Jn;return i!==Hr&&i!==Ii&&i!==Qn&&(s.#r|=Yc),n.unshift(s),n.provisional++,s}#A(e,n){for(let r=n.provisional;r<n.length;r++){let s=n[r];if((this.nocase?Sh(e.name):Kc(e.name))===s.#T)return this.#B(e,s,r,n)}}#B(e,n,r,s){let i=n.name;return n.#r=n.#r&Hc|Bb(e),i!==e.name&&(n.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(n)),s.provisional++,n}async lstat(){if((this.#r&Sr)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&Sr)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#W(e){let{atime:n,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:h,mtime:y,mtimeMs:m,nlink:b,rdev:E,size:_,uid:T}=e;this.#E=n,this.#y=r,this.#k=s,this.#h=i,this.#d=o,this.#i=a,this.#w=c,this.#p=l,this.#t=u,this.#f=d,this.#a=f,this.#s=h,this.#g=y,this.#b=m,this.#n=b,this.#l=E,this.#c=_,this.#o=T;let k=Bb(e);this.#r=this.#r&Hc|k|UD,k!==Qn&&k!==Hr&&k!==Ii&&(this.#r|=Yc)}#V=[];#z=!1;#H(e){this.#z=!1;let n=this.#V.slice();this.#V.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);n?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#L(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(s,e);this.#x(e)}catch(s){this.#L(s.code),e.provisional=0}this.#U=void 0,r()}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 n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#L(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&VD)return!1;let e=Jn&this.#r;return e===Qn||e===Hr||e===Ii}shouldWalk(e,n){return(this.#r&Hr)===Hr&&!(this.#r&VD)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#D)return this.#D;if(!((Eh|_h|Sr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#D)return this.#D;if(!((Eh|_h|Sr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[eA](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],s=this;for(;s&&s.parent;)n.add(s),s.#C=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!n.has(s);)s.#C=void 0,s.#N=void 0,s=s.parent}},kh=class t extends nn{sep="\\";splitSep=MU;constructor(e,n=Qn,r,s,i,o,a){super(e,n,r,s,i,o,a)}newChild(e,n=Qn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return ra.win32.parse(e).root}getRoot(e){if(e=xU(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new sa(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YD,"$1\\"),e===n}},Nh=class t extends nn{splitSep="/";sep="/";constructor(e,n=Qn,r,s,i,o,a){super(e,n,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Qn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Ph=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#n;constructor(e=process.cwd(),n,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=Gc}={}){this.#n=GD(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,HD.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new wh,this.#t=new wh,this.#s=new Ub(i);let c=a.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=n.sep,f=this.rootPath,h=!1;for(let y of c){let m=u--;l=l.child(y,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:f+=(h?"":d)+y}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpath();return this.#e.set(n,s),s}resolvePosix(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,s),s}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,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.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:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((h,y)=>{if(h)return f(h);let m=y.length;if(!m)return f();let b=()=>{--m===0&&f()};for(let E of y)(!i||i(E))&&a.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,o)?l(_,b):b()):E.shouldWalk(c,o)?l(E,b):b()},!0)},u=e;return new Promise((d,f)=>{l(u,h=>{if(h)return f(h);d(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(r?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(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,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield r?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new Xs({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=(b,E,_=!1)=>{if(b)return a.emit("error",b);if(s&&!_){let T=[];for(let k of E)k.isSymbolicLink()&&T.push(k.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(T.length){Promise.all(T).then(()=>y(null,E,!0));return}}for(let T of E)T&&(!i||i(T))&&(a.write(r?T:T.fullpath())||(f=!0));u--;for(let T of E){let k=T.realpathCached()||T;k.shouldWalk(c,o)&&l.push(k)}f&&!a.flowing?a.once("drain",d):m||d()},m=!0;h.readdirCB(y,!0),m=!1}};return d(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof nn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new Xs({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=h.readdirSync();for(let m of y)(!i||i(m))&&(a.write(r?m:m.fullpath())||(f=!0));u--;for(let m of y){let b=m;if(m.isSymbolicLink()){if(!(s&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(c,o)&&l.push(b)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[eA](n)}},sa=class extends Ph{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,ra.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return ra.win32.parse(e).root.toUpperCase()}newRoot(e){return new kh(this.rootPath,Hr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ia=class extends Ph{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,ra.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Nh(this.rootPath,Hr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Xc=class extends ia{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}},ese=process.platform==="win32"?kh:Nh,tA=process.platform==="win32"?sa:process.platform==="darwin"?Xc:ia;var LU=t=>t.length>=1,qU=t=>t.length>=1,oa=class t{#e;#t;#s;length;#n;#o;#f;#l;#d;#a;#c=!0;constructor(e,n,r,s){if(!LU(e))throw new TypeError("empty pattern list");if(!qU(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#n=s,this.#s===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,h,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let m=[i,o,a,c,""].join("/"),b=[u,d,f,h,""].join("/");this.#e=[m,...l],this.#t=[b,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===Ht}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#f=this.#f||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#n),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#n==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var jU=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",aa=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:s,noglobstar:i,platform:o=jU}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new jn(e,this.mmopts);for(let r=0;r<n.set.length;r++){let s=n.set[r],i=n.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new oa(s,i,0,this.platform),a=new jn(o.globString(),this.mmopts),c=i[i.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 n=e.fullpath(),r=`${n}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(n))return!0;return!1}};var Vb=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),s=this.store.get(r);s?s.add(n.globString()):this.store.set(r,new Set([n.globString()]))}},zb=class{store=new Map;add(e,n,r){let s=(n?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},Wb=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Jc=class t{hasWalkedCache;matches=new zb;subwalks=new Wb;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new Vb}processPatterns(e,n){this.patterns=n;let r=n.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===Ht){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let h=s.parent||s;f?this.hasWalkedCache.hasWalked(h,f)||this.subwalks.add(h,f):this.matches.add(h,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),s=this.child();for(let i of n)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Ht?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,n,r,s){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,n,r,s){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,n,r,s){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var FU=(t,e)=>typeof t=="string"?new aa([t],e):Array.isArray(t)?new aa(t,e):t,Rh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=FU(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,n)}matchFinish(e,n){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,n,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,n)}matchSync(e,n,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new Jc(this.opts),r)}walkCB2(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())i++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new Jc(this.opts),r)}walkCB2Sync(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},Qc=class extends Rh{matches=new Set;constructor(e,n,r){super(e,n,r)}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,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(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}},Zc=class extends Rh{results;constructor(e,n,r){super(e,n,r),this.results=new Xs({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 BU=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Er=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,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,nA.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=n.platform||BU,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=n.platform==="win32"?sa:n.platform==="darwin"?Xc:n.platform?ia:tA;this.scurry=new c(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new jn(c,s)),[o,a]=i.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 oa(c,u,0,this.platform)})}async walk(){return[...await new Qc(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 Qc(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 Zc(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 Zc(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 Hb=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new jn(n,e).hasMagic())return!0;return!1};function Ch(t,e={}){return new Er(t,e).streamSync()}function sA(t,e={}){return new Er(t,e).stream()}function iA(t,e={}){return new Er(t,e).walkSync()}async function rA(t,e={}){return new Er(t,e).walk()}function Dh(t,e={}){return new Er(t,e).iterateSync()}function oA(t,e={}){return new Er(t,e).iterate()}var UU=Ch,VU=Object.assign(sA,{sync:Ch}),zU=Dh,WU=Object.assign(oA,{sync:Dh}),HU=Object.assign(iA,{stream:Ch,iterate:Dh}),xi=Object.assign(rA,{glob:rA,globSync:iA,sync:HU,globStream:sA,stream:VU,globStreamSync:Ch,streamSync:UU,globIterate:oA,iterate:WU,globIterateSync:Dh,iterateSync:zU,Glob:Er,hasMagic:Hb,escape:Qo,unescape:Tr});xi.glob=xi;var GT=require("path"),YT=require("fs");var ux=K(ax());var WT={};Qx(WT,{$id:()=>mY,$schema:()=>pY,default:()=>TY,definitions:()=>yY,properties:()=>vY,title:()=>gY,type:()=>bY});var pY="http://json-schema.org/draft-07/schema#",mY="http://json-schema.org/draft-07/schema#",gY="Core schema meta-schema",yY={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:[]}},bY=["object","boolean"],vY={$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:"#"}},TY={$schema:pY,$id:mY,title:gY,definitions:yY,type:bY,properties:vY,default:!0};var xt=K(J());var dp=class extends Xa{constructor(n,r){super();this.ajv=n;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(n,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof xe&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(L(21,c,xt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[xt.DiagnosticTag.Unnecessary]))),s;let a=we.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(..._Y(n,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return s}getOnPropertyHover(n){let r=(this.validate?.schema).properties?.[n];if(r&&typeof r=="object"&&"description"in r)return{kind:xt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
281
|
+
};`,kind:Et.CompletionItemKind.Value,insertTextFormat:Et.InsertTextFormat.Snippet}))]}function b$(t,e){let n=i=>i?i.parentNode instanceof jt||i.parentNode instanceof mt||i.parentNode instanceof Oe?!1:n(i.parentNode):!0;if(!t||t.item!==null||!At(t.ast)||!n(t.ast))return[];let r=i=>bf(i,e).filter(s=>e(s));return t.ast instanceof ut?r(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(t.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:t.ast instanceof be?`${i}`:`&${i}`,kind:Et.CompletionItemKind.Variable}))}function v$(t,e){if(!t||!(t.item instanceof ke)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof Je))return[];let n=r=>[...r.nodes,...r.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>i.definitions.filter(s=>s instanceof Oe)).filter(i=>e(i));return t.ast instanceof Fe||t.ast instanceof Sn||t.beforeAst?.parentNode instanceof Sn?Array.from(new Set(n(t.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-node/",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]}function T$(t,e){if(!t||!(t.item instanceof ke)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof un)||t.beforeAst?.parentNode instanceof Sn))return[];let n=r=>[...r.property,...r.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));return t.ast instanceof Ge||t.ast instanceof Je||t.beforeAst?.parentNode instanceof Je?Array.from(new Set(n(t.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Et.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Et.InsertTextFormat.Snippet}]:[]}function _$(t,e){let n=t?.ast instanceof li?t.ast:t?.ast.parentNode;if(!t||!n||!(n instanceof li))return[];let r=n.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let i=r.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!At(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...i,o].join("/")}`,kind:Et.CompletionItemKind.Variable}))}var yf=t=>!t||t instanceof je?!1:t instanceof dn||yf(t.parentNode);function S$(t){return!t||!(t.item instanceof ze&&t.item.ast.assignOperatorToken)?[]:!yf(t?.ast)&&!(t.ast instanceof je&&t.item.ast.values===null)&&!yf(t.beforeAst)&&!yf(t.afterAst)?[]:t.item.parent.nodeType instanceof En?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,i])=>i.macro.identifier instanceof Ur?{label:`${i.macro.identifier.toString()}`,insertText:`${i.macro.name}(${i.macro.identifier.params.map((s,o)=>s instanceof Ot?`$${o+1}`:"").join(", ")})`,kind:Et.CompletionItemKind.Function,sortText:`~${i.macro.name}`,insertTextFormat:Et.InsertTextFormat.Snippet}:{label:i.macro.identifier.name,kind:Et.CompletionItemKind.Variable,sortText:`~${i.macro.name}`}):[]}async function NR(t,e){return _t(t,e,(n,r)=>[...T$(n,r),...v$(n,r),...b$(n,r),..._$(n,r),...y$(n,r),...g$(n,r),...m$(n),...S$(n)])}var zr=K(J());function E$(t){if(!t||t.item===null||!(t.ast instanceof Ge))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if(i instanceof je)return zr.Location.create(he(i.uri),te(i.propertyName??i));if(i instanceof Je)return zr.Location.create(he(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof ze&&t.ast instanceof Ge)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof Ge&&t.ast.parentNode instanceof Je){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function w$(t){if(!t)return[];let e=n=>{let i=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===n)return!0}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&(o.by.nodeNameOrRef instanceof Fe?o.by.nodeNameOrRef!==t.ast:!n.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedRefLabels,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof mt)return zr.Location.create(he(o.uri),te(o.name??o));if(o instanceof Oe)return zr.Location.create(he(o.uri),te(o.name??o));if(o instanceof Fe)return zr.Location.create(he(o.uri),te(o));if(o instanceof Fe)return zr.Location.create(he(o.uri),te(o));if(o instanceof be)return zr.Location.create(he(o.uri),te(o.label??o));if(o instanceof je)return zr.Location.create(he((o.values??o)?.uri),te(o.values??o))}).filter(o=>o)};if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Fe&&t.ast.linksTo)return At(t.ast)?[...e(t.ast.linksTo),zr.Location.create(he(t.ast.uri),te(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof Me&&t.item instanceof ze&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}async function PR(t,e){return _t(t,e,n=>[...w$(n),...E$(n)])}var ui=K(J());function RR(t){if(!t||t.item===null||!(t.ast instanceof Ge))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast),r.parent.deletedProperties.find(i=>i.property===r)?.by??[]].map(i=>{if((i instanceof je||i instanceof Je)&&i.propertyName)return ui.Location.create(he(i.uri),te(i.propertyName))}).filter(i=>i);if(t.item instanceof ze&&t.ast instanceof Ge)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof Ge&&t.ast.parentNode instanceof Je){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function CR(t,e){if(!e||!(e.ast instanceof Wt))return[];"newName"in t&&(e.ast.parentNode instanceof be&&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 n=e.ast.value,r=i=>[...i.definitions.filter(s=>s instanceof Oe).flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===n).map(s=>{if(s)return ui.Location.create(he(s.uri),te(s))}).filter(s=>s);return e.item instanceof ke&&!At(e.ast)?r(e.item):e.ast instanceof Wt&&e.ast.parentNode instanceof be&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function DR(t){if(!t||!(t.ast instanceof Fe))return[];let e=n=>{let i=t.runtime.rootNode.getNode("aliases")?.property.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(n)||c===n)return!0}}).map(o=>o.ast)??[],s=n.parent?.deletedNodes.filter(o=>o.node===n&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...n.linkedNodeNamePaths,...n.definitions,...s].map(o=>{if(o instanceof Oe&&o.name)return ui.Location.create(he(o.uri),te(o.name));if(o instanceof Fe)return ui.Location.create(he(o.uri),te(o));if(o instanceof je&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Me){let a=o.values.values[0].value,c=te(a),l=a.value.split("/"),u=n.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,ui.Location.create(he(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof ke&&!At(t.ast)?e(t.item):t.ast instanceof Fe&&t.ast.linksTo?At(t.ast)?[...e(t.ast.linksTo),ui.Location.create(he(t.ast.uri),te(t.ast))]:e(t.ast.linksTo):[]}async function AR(t,e){let n={};return(await _t(t,e,i=>[...DR(i),...CR(t,i),...RR(i)])).forEach(i=>{n[i.uri]??=[],n[i.uri].push(ui.TextEdit.replace(i.range,t.newName))}),{changes:n}}async function OR(t,e){let n=await _t(t,e,r=>[...DR(r),...CR(t,r),...RR(r)]);if(n.some(r=>e?.settings.lockRenameEdits?.some(i=>Ve(r.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!n.length}}var Bo=K(J());function k$(t){if(!t||t.item===null||!(t.ast instanceof Ge))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(i=>i.ast)].map(i=>{if(i instanceof je)return Bo.Location.create(he(i.uri),te(i.propertyName??i))}).filter(i=>i);if(t.item instanceof ze&&t.ast instanceof Ge)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof Ge&&t.ast.parentNode instanceof Je){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function N$(t){if(!t)return[];let e=n=>[...n.definitions,...n.referencedBy].map(r=>{if(r instanceof mt)return Bo.Location.create(he(r.uri),te(r));if(r instanceof Oe)return Bo.Location.create(he(r.uri),te(r));if(r instanceof jt)return Bo.Location.create(he(r.uri),te(r))}).filter(r=>r);if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Fe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Me&&t.item instanceof ze&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}function P$(t){if(t?.ast instanceof Ot||t?.ast instanceof xr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return[Bo.Location.create(he(e.macro.uri),te(e.macro.identifier))]}return[]}async function IR(t,e){return _t(t,e,n=>[...N$(n),...k$(n),...P$(n)])}var vf=K(J());function R$(t){if(!t||t.item===null||!(t.ast instanceof Ge))return;let e=r=>r.replaces?e(r.replaces):r,n=r=>vf.Location.create(he(r.ast.uri),te(r.ast.propertyName??r.ast));if(t.item instanceof ze&&t.ast instanceof Ge)return n(e(t.item));if(t.item instanceof ke&&t.ast instanceof Ge&&t.ast.parentNode instanceof Je){let r=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(r)return n(e(r))}}function C$(t){if(!t)return;let e=n=>{let r=n.definitions.at(0);return r?vf.Location.create(he(r.uri),te(r)):void 0};if(t.item instanceof ke&&!At(t.ast))return e(t.item);if(t.ast instanceof Wt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof Fe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Me&&t.item instanceof ze&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}}function D$(t){if(t?.ast instanceof Ot||t?.ast instanceof xr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ot?t.ast.name:t.ast.value);if(e)return vf.Location.create(he(e.macro.uri),te(e.macro.identifier))}}async function xR(t,e){return(await _t(t,e,n=>[C$(n)||R$(n)||D$(n)])).at(0)}var re=K(J());var A$=(t,e,n,r,i)=>{switch(n){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(re.Range.create(re.Position.create(r.range.start.line,t.pos.colEnd),re.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},O$=(t,e,n,r,i)=>{if(!r)return[];switch(t){case 0:return[{title:i??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 25:return r?[{title:i??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}]:[];default:return}};function MR(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>A$(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>O$(l,a,t.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),n=e.filter(a=>a.kind===re.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==re.CodeActionKind.SourceFixAll),s=n.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return r.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,...n.map(a=>({...a,kind:re.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:re.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:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var Tf=t=>!t||t instanceof je?!1:t instanceof dn||Tf(t.parentNode);function I$(t){if(!t||!(t.item instanceof ze&&t.item.ast.assignOperatorToken))return[];let e=Tf(t?.ast);if(!e&&!(t.ast instanceof je&&t.item.ast.values===null)&&!Tf(t.beforeAst)&&!Tf(t.afterAst))return[];let n=-1;t.item.ast.values===null?n=0:n=(t.item.ast.values?.values.findIndex(i=>i&&xg(i,t.beforeAst))??-1)+1,n===-1&&(n=0);let r=t.item.parent.nodeType;return r instanceof En?r.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,n,e)??[]:[]}function x$(t){if(!t||!(t.item instanceof ze&&t.ast instanceof Ge&&t.item.ast.values==null||t.item instanceof ke)||At(t.ast)||t.beforeAst?.parentNode instanceof un)return[];let e=n=>n.nodeType?.getPropertyListCompletionItems(n)??[];return t.item instanceof ze?e(t.item.parent):e(t.item)}async function LR(t,e){return _t(t,e,n=>[...I$(n),...x$(n)])}var _f=K(J());async function M$(t){if(t?.ast instanceof Ot||t?.ast instanceof xr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ot?t.ast.name:t.ast.value);if(e){let n=Xa(t.ast),r=(await t.runtime.context.getAllParsers()).at(-1);if(n){let i=n?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:_f.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
|
|
282
|
+
`)},range:te(t.ast)}}return{contents:{kind:_f.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t.ast?.evaluate(r.cPreprocessorParser.macros)}`,"```"].join(`
|
|
283
|
+
`)},range:te(t.ast)}}}}async function L$(t){if(!t)return;let e=(await t.runtime.context.getAllParsers()).at(-1);if(t?.item instanceof ke)return{contents:t.item.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)};if(t?.ast instanceof Fe){let n=t.ast.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast.parentNode instanceof be){let n=t.ast.parentNode.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast instanceof Me&&t.item instanceof ze&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}}function $$(t){if(t?.item instanceof ze&&t.ast instanceof Ge){let e=t.item.onHover(),n=t.item.parent.nodeType?.getOnPropertyHover(t.item.name);if(e||n)return{contents:{kind:_f.MarkupKind.Markdown,value:`${e?.value??""}
|
|
284
|
+
${n?.value??""}`},range:te(t.ast)}}}function $R(t,e){return _t(t,e,async n=>[await L$(n)||$$(n)||await M$(n)])}var r_=K(qb());var WD=K($D(),1);var Vc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var mU={"[: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]},zc=t=>t.replace(/[[\]\\-]/g,"\\$&"),gU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qD=t=>t.join(""),jD=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,c=!1,l=!1,u=n,d="";e:for(;s<t.length;){let p=t.charAt(s);if((p==="!"||p==="^")&&s===n+1){l=!0,s++;continue}if(p==="]"&&o&&!c){u=s+1;break}if(o=!0,p==="\\"&&!c){c=!0,s++;continue}if(p==="["&&!c){for(let[T,[S,b,v]]of Object.entries(mU))if(t.startsWith(T,s)){if(d)return["$.",!1,t.length-n,!0];s+=T.length,v?i.push(S):r.push(S),a=a||b;continue e}}if(c=!1,d){p>d?r.push(zc(d)+"-"+zc(p)):p===d&&r.push(zc(p)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(zc(p+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=p,s+=2;continue}r.push(zc(p)),s++}if(u<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let p=r[0].length===2?r[0].slice(-1):r[0];return[gU(p),!1,u-n,!1]}let f="["+(l?"^":"")+qD(r)+"]",h="["+(l?"":"^")+qD(i)+"]";return[r.length&&i.length?"("+f+"|"+h+")":r.length?f:h,a,u-n,!0]};var Tr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var yU=new Set(["!","?","+","*","@"]),FD=t=>yU.has(t),bU="(?!(?:^|/)\\.\\.?(?:$|/))",vh="(?!\\.)",vU=new Set(["[","."]),TU=new Set(["..","."]),_U=new Set("().*{}+?[]^$\\!"),SU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bb="[^/]",BD=Bb+"*?",UD=Bb+"+?",Qo=class t{type;#e;#t;#i=!1;#n=[];#o;#f;#l;#d=!1;#a;#c;#s=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.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.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#f+1;!r.type&&i<r.#n.length;i++)for(let s of e.#n){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#n[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#n.push(n)}}toJSON(){let e=this.type===null?this.#n.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#n.map(n=>n.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 n=0;n<this.#f;n++){let r=e.#n[n];if(!(r instanceof t&&r.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.#n.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#n)n.copyIn(r);return n}static#b(e,n,r,i){let s=!1,o=!1,a=-1,c=!1;if(n.type===null){let h=r,y="";for(;h<e.length;){let p=e.charAt(h++);if(s||p==="\\"){s=!s,y+=p;continue}if(o){h===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(h===a+2&&c)&&(o=!1),y+=p;continue}else if(p==="["){o=!0,a=h,c=!1,y+=p;continue}if(!i.noext&&FD(p)&&e.charAt(h)==="("){n.push(y),y="";let T=new t(p,n);h=t.#b(e,T,h,i),n.push(T);continue}y+=p}return n.push(y),h}let l=r+1,u=new t(null,n),d=[],f="";for(;l<e.length;){let h=e.charAt(l++);if(s||h==="\\"){s=!s,f+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),f+=h;continue}else if(h==="["){o=!0,a=l,c=!1,f+=h;continue}if(FD(h)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(h,u);u.push(y),l=t.#b(e,y,l,i);continue}if(h==="|"){u.push(f),f="",d.push(u),u=new t(null,n);continue}if(h===")")return f===""&&n.#n.length===0&&(n.#s=!0),u.push(f),f="",n.push(...d,u),l;f+=h}return n.type=null,n.#t=void 0,n.#n=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#b(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[y,p,T,S]=typeof h=="string"?t.#h(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||T,this.#i=this.#i||S,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&TU.has(this.#n[0]))){let y=vU,p=n&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),T=!n&&!e&&y.has(l.charAt(0));u=p?bU:T?vh:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Tr(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#p(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,Tr(this.toString()),!1,!1]}let o=!r||e||n||!vh?"":this.#p(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!n?vh:"")+UD;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?vh:"")+BD+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Tr(s),this.#t=!!this.#t,this.#i]}#p(e){return this.#n.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#h(e,n,r=!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+=(_U.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=jD(e,a);if(d){s+=l,o=o||u,a+=d-1,n=n||f;continue}}if(c==="*"){r&&e==="*"?s+=UD:s+=BD,n=!0;continue}if(c==="?"){s+=Bb,n=!0;continue}s+=SU(c)}return[s,Tr(e),!!n,o]}};var Zo=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var fn=(t,e,n={})=>(Vc(e),!n.nocomment&&e.charAt(0)==="#"?!1:new jn(e,n).match(t)),EU=/^\*+([^+@!?\*\[\(]*)$/,wU=t=>e=>!e.startsWith(".")&&e.endsWith(t),kU=t=>e=>e.endsWith(t),NU=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),PU=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),RU=/^\*+\.\*+$/,CU=t=>!t.startsWith(".")&&t.includes("."),DU=t=>t!=="."&&t!==".."&&t.includes("."),AU=/^\.\*+$/,OU=t=>t!=="."&&t!==".."&&t.startsWith("."),IU=/^\*+$/,xU=t=>t.length!==0&&!t.startsWith("."),MU=t=>t.length!==0&&t!=="."&&t!=="..",LU=/^\?+([^+@!?\*\[\(]*)?$/,$U=([t,e=""])=>{let n=HD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},qU=([t,e=""])=>{let n=GD([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},jU=([t,e=""])=>{let n=GD([t]);return e?r=>n(r)&&r.endsWith(e):n},FU=([t,e=""])=>{let n=HD([t]);return e?r=>n(r)&&r.endsWith(e):n},HD=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},GD=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},YD=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",VD={win32:{sep:"\\"},posix:{sep:"/"}},BU=YD==="win32"?VD.win32.sep:VD.posix.sep;fn.sep=BU;var Gt=Symbol("globstar **");fn.GLOBSTAR=Gt;var UU="[^/]",VU=UU+"*?",zU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",WU="(?:(?!(?:\\/|^)\\.).)*?",HU=(t,e={})=>n=>fn(n,t,e);fn.filter=HU;var Jn=(t,e={})=>Object.assign({},t,e),GU=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return fn;let e=fn;return Object.assign((r,i,s={})=>e(r,i,Jn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,Jn(t,s))}static defaults(i){return e.defaults(Jn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,Jn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Jn(t,s))}},unescape:(r,i={})=>e.unescape(r,Jn(t,i)),escape:(r,i={})=>e.escape(r,Jn(t,i)),filter:(r,i={})=>e.filter(r,Jn(t,i)),defaults:r=>e.defaults(Jn(t,r)),makeRe:(r,i={})=>e.makeRe(r,Jn(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,Jn(t,i)),match:(r,i,s={})=>e.match(r,i,Jn(t,s)),sep:e.sep,GLOBSTAR:Gt})};fn.defaults=GU;var KD=(t,e={})=>(Vc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,WD.default)(t));fn.braceExpand=KD;var YU=(t,e={})=>new jn(t,e).makeRe();fn.makeRe=YU;var KU=(t,e,n={})=>{let r=new jn(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};fn.match=KU;var zD=/[?*]|[+@!]\(.*?\)|\[|\]/,XU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){Vc(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||YD,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.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 n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),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]==="?"||!zD.test(s[2]))&&!zD.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 r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],c=r[i+2],l=r[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let u=r.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let p=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!p&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),b=!S&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),v=T?3:p?0:void 0,w=b?3:S?0:void 0;if(typeof v=="number"&&typeof w=="number"){let[C,L]=[e[v],n[w]];C.toLowerCase()===L.toLowerCase()&&(n[w]=C,w>v?n=n.slice(w):v>w&&(e=e.slice(v)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,c=e.length,l=n.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=n[a],d=e[o];if(this.debug(n,u,d),u===!1)return!1;if(u===Gt){this.debug("GLOBSTAR",[n,u,d]);var f=o,h=a+1;if(h===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 y=e[f];if(this.debug(`
|
|
285
|
+
globstar while`,e,f,n,h,y),this.matchOne(e.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,c,y),!0;if(y==="."||y===".."||!i.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
|
|
286
|
+
>>> no match, partial?`,e,f,n,h),f===c))}let p;if(typeof u=="string"?(p=d===u,this.debug("string match",u,d,p)):(p=u.test(d),this.debug("pattern match",u,d,p)),!p)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return KD(this.pattern,this.options)}parse(e){Vc(e);let n=this.options;if(e==="**")return Gt;if(e==="")return"";let r,i=null;(r=e.match(IU))?i=n.dot?MU:xU:(r=e.match(EU))?i=(n.nocase?n.dot?PU:NU:n.dot?kU:wU)(r[1]):(r=e.match(LU))?i=(n.nocase?n.dot?qU:$U:n.dot?jU:FU)(r):(r=e.match(RU))?i=n.dot?DU:CU:(r=e.match(AU))&&(i=OU);let s=Qo.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 n=this.options,r=n.noglobstar?VU:n.dot?zU:WU,i=new Set(n.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"?XU(u):u===Gt?Gt:u._src});return l.forEach((u,d)=>{let f=l[d+1],h=l[d-1];u!==Gt||h===Gt||(h===void 0?f!==void 0&&f!==Gt?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=h+"(?:\\/|"+r+")?":f!==Gt&&(l[d-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Gt))}),l.filter(u=>u!==Gt).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,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=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(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return fn.defaults(e).Minimatch}};fn.AST=Qo;fn.Minimatch=jn;fn.escape=Zo;fn.unescape=Tr;var vA=require("node:url");var ea=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,JD=new Set,Ub=typeof process=="object"&&process?process:{},QD=(t,e,n,r)=>{typeof Ub.emitWarning=="function"?Ub.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Th=globalThis.AbortController,XD=globalThis.AbortSignal;if(typeof Th>"u"){XD=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Th=class{constructor(){e()}signal=new XD;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=Ub.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,QD("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 JU=t=>!JD.has(t),xie=Symbol("type"),Xi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ZD=t=>Xi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ta:null:null,ta=class extends Array{constructor(e){super(e),this.fill(0)}},Vb=class t{heap;length;static#e=!1;static create(e){let n=ZD(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Wc=class t{#e;#t;#i;#n;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#y;#b;#p;#h;#E;#g;#w;#k;#T;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#y,prev:e.#b,get head(){return e.#p},get tail(){return e.#h},free:e.#E,isBackgroundFetch:n=>e.#u(n),backgroundFetch:(n,r,i,s)=>e.#q(n,r,i,s),moveToTail:n=>e.#F(n),indexes:n=>e.#P(n),rindexes:n=>e.#R(n),isStale:n=>e.#v(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#i}get disposeAfter(){return this.#n}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:y=0,sizeCalculation:p,fetchMethod:T,memoMethod:S,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:C,ignoreFetchAbort:L}=e;if(n!==0&&!Xi(n))throw new TypeError("max option must be a nonnegative integer");let B=n?ZD(n):Array;if(!B)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=y||this.#t,this.sizeCalculation=p,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.#a=new Map,this.#c=new Array(n).fill(void 0),this.#s=new Array(n).fill(void 0),this.#y=new B(n),this.#b=new B(n),this.#p=0,this.#h=0,this.#E=Vb.create(n),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#_=!!this.#i,this.#m=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!Xi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Xi(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=Xi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Xi(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 q="LRU_CACHE_UNBOUNDED";JU(q)&&(JD.add(q),QD("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new ta(this.#e),n=new ta(this.#e);this.#T=e,this.#k=n,this.#O=(s,o,a=ea.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(s)&&this.#A(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#N=s=>{n[s]=e[s]!==0?ea.now():0},this.#r=(s,o)=>{if(e[o]){let a=e[o],c=n[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=r||i();let l=s.now-c;s.remainingTTL=a-l}};let r=0,i=()=>{let s=ea.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=n[o];if(!a||!c)return 1/0;let l=(r||i())-c;return a-l},this.#v=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#N=()=>{};#r=()=>{};#O=()=>{};#v=()=>!1;#D(){let e=new ta(this.#e);this.#d=0,this.#w=e,this.#I=n=>{this.#d-=e[n],e[n]=0},this.#M=(n,r,i,s)=>{if(this.#u(r))return 0;if(!Xi(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Xi(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.#x=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#d>s;)this.#$(!0)}this.#d+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,n,r)=>{};#M=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#h;!(!this.#L(n)||((e||!this.#v(n))&&(yield n),n===this.#p));)n=this.#b[n]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#p;!(!this.#L(n)||((e||!this.#v(n))&&(yield n),n===this.#h));)n=this.#y[n]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*rkeys(){for(let e of this.#R()){let n=this.#c[e];n!==void 0&&!this.#u(this.#s[e])&&(yield n)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#P()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#R()){let i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#R({allowStale:!0}))this.#v(n)&&(this.#A(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#s[n],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#T&&this.#k){let o=this.#T[n],a=this.#k[n];if(o&&a){let c=o-(ea.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[n]),s}dump(){let e=[];for(let n of this.#P({allowStale:!0})){let r=this.#c[n],i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#T&&this.#k){o.ttl=this.#T[n];let a=ea.now()-this.#k[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=ea.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,n,r.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.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#h:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#$(!1):this.#l,this.#c[d]=e,this.#s[d]=n,this.#a.set(e,d),this.#y[this.#h]=d,this.#b[d]=this.#h,this.#h=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(n!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#_&&this.#i?.(h,e,"set"),this.#m&&this.#g?.push([h,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#s[d]=n,c){c.set="replace";let h=f&&this.#u(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(i!==0&&!this.#T&&this.#C(),this.#T&&(l||this.#O(d,i,s),c&&this.#r(c,d)),!o&&this.#m&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#p];if(this.#$(!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,n;for(;n=e?.shift();)this.#n?.(...n)}}}#$(e){let n=this.#p,r=this.#c[n],i=this.#s[n];return this.#S&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(i,r,"evict"),this.#m&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#c[n]=void 0,this.#s[n]=void 0,this.#E.push(n)),this.#l===1?(this.#p=this.#h=0,this.#E.length=0):this.#p=this.#y[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.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.#r(i,s));else return r&&this.#N(s),i&&(i.has="hit",this.#r(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#v(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#q(e,n,r,i){let s=n===void 0?void 0:this.#s[n];if(this.#u(s))return s;let o=new Th,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},l=(p,T=!1)=>{let{aborted:S}=o.signal,b=r.ignoreFetchAbort&&p!==void 0;if(r.status&&(S&&!T?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,b&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!b&&!T)return d(o.signal.reason);let v=h;return this.#s[n]===h&&(p===void 0?v.__staleWhileFetching?this.#s[n]=v.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,p,c.options))),p},u=p=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=p),d(p)),d=p=>{let{aborted:T}=o.signal,S=T&&r.allowStaleOnFetchAbort,b=S||r.allowStaleOnFetchRejection,v=b||r.noDeleteOnFetchRejection,w=h;if(this.#s[n]===h&&(!v||w.__staleWhileFetching===void 0?this.#A(e,"fetch"):S||(this.#s[n]=w.__staleWhileFetching)),b)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw p},f=(p,T)=>{let S=this.#o?.(e,s,c);S&&S instanceof Promise&&S.then(b=>p(b===void 0?void 0:b),T),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(p(void 0),r.allowStaleOnFetchAbort&&(p=b=>l(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),y=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...c.options,status:void 0}),n=this.#a.get(e)):this.#s[n]=y,y}#u(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Th}async fetch(e,n={}){let{allowStale:r=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:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:p,forceRefresh:T=!1,status:S,signal:b}=n;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let v={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:h,status:S,signal:b},w=this.#a.get(e);if(w===void 0){S&&(S.fetch="miss");let C=this.#q(e,w,v,p);return C.__returned=C}else{let C=this.#s[w];if(this.#u(C)){let We=r&&C.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",We&&(S.returnedStale=!0)),We?C.__staleWhileFetching:C.__returned=C}let L=this.#v(w);if(!T&&!L)return S&&(S.fetch="hit"),this.#F(w),i&&this.#N(w),S&&this.#r(S,w),C;let B=this.#q(e,w,v,p),ae=B.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=L?"stale":"refresh",ae&&L&&(S.returnedStale=!0)),ae?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#f;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=r(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#r(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,n){this.#b[n]=e,this.#y[e]=n}#F(e){e!==this.#h&&(e===this.#p?this.#p=this.#y[e]:this.#j(this.#b[e],this.#y[e]),this.#j(this.#h,e),this.#h=e)}delete(e){return this.#A(e,"delete")}#A(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(s,e,n),this.#m&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#h)this.#h=this.#b[i];else if(i===this.#p)this.#p=this.#y[i];else{let o=this.#b[i];this.#y[o]=this.#y[i];let a=this.#y[i];this.#b[a]=this.#b[i]}this.#l--,this.#E.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#n?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#R({allowStale:!0})){let r=this.#s[n];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[n];this.#_&&this.#i?.(r,i,e),this.#m&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#T&&this.#k&&(this.#T.fill(0),this.#k.fill(0)),this.#w&&this.#w.fill(0),this.#p=0,this.#h=0,this.#E.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#n?.(...r)}}};var ia=require("node:path"),lA=require("node:url"),Kr=require("fs"),aV=K(require("node:fs"),1),Zi=require("node:fs/promises");var Ph=require("node:events"),Xb=K(require("node:stream"),1),iA=require("node:string_decoder"),eA=typeof process=="object"&&process?process:{stdout:null,stderr:null},QU=t=>!!t&&typeof t=="object"&&(t instanceof Qi||t instanceof Xb.default||ZU(t)||eV(t)),ZU=t=>!!t&&typeof t=="object"&&t instanceof Ph.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Xb.default.Writable.prototype.pipe,eV=t=>!!t&&typeof t=="object"&&t instanceof Ph.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",hi=Symbol("EOF"),pi=Symbol("maybeEmitEnd"),Ji=Symbol("emittedEnd"),_h=Symbol("emittingEnd"),Hc=Symbol("emittedError"),Sh=Symbol("closed"),tA=Symbol("read"),Eh=Symbol("flush"),nA=Symbol("flushChunk"),_r=Symbol("encoding"),na=Symbol("decoder"),Ft=Symbol("flowing"),Gc=Symbol("paused"),ra=Symbol("resume"),Bt=Symbol("buffer"),hn=Symbol("pipes"),Ut=Symbol("bufferLength"),zb=Symbol("bufferPush"),wh=Symbol("bufferShift"),nn=Symbol("objectMode"),wt=Symbol("destroyed"),Wb=Symbol("error"),Hb=Symbol("emitData"),rA=Symbol("emitEnd"),Gb=Symbol("emitEnd2"),Gr=Symbol("async"),Yb=Symbol("abort"),kh=Symbol("aborted"),Yc=Symbol("signal"),Is=Symbol("dataListeners"),Fn=Symbol("discarded"),Kc=t=>Promise.resolve().then(t),tV=t=>t(),nV=t=>t==="end"||t==="finish"||t==="prefinish",rV=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,iV=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Nh=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ra](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Kb=class extends Nh{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},sV=t=>!!t.objectMode,oV=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Qi=class extends Ph.EventEmitter{[Ft]=!1;[Gc]=!1;[hn]=[];[Bt]=[];[nn];[_r];[Gr];[na];[hi]=!1;[Ji]=!1;[_h]=!1;[Sh]=!1;[Hc]=null;[Ut]=0;[wt]=!1;[Yc];[kh]=!1;[Is]=0;[Fn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");sV(n)?(this[nn]=!0,this[_r]=null):oV(n)?(this[_r]=n.encoding,this[nn]=!1):(this[nn]=!1,this[_r]=null),this[Gr]=!!n.async,this[na]=this[_r]?new iA.StringDecoder(this[_r]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Bt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[hn]});let{signal:r}=n;r&&(this[Yc]=r,r.aborted?this[Yb]():r.addEventListener("abort",()=>this[Yb]()))}get bufferLength(){return this[Ut]}get encoding(){return this[_r]}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[nn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Gr]}set async(e){this[Gr]=this[Gr]||!!e}[Yb](){this[kh]=!0,this.emit("abort",this[Yc]?.reason),this.destroy(this[Yc]?.reason)}get aborted(){return this[kh]}set aborted(e){}write(e,n,r){if(this[kh])return!1;if(this[hi])throw new Error("write after end");if(this[wt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[Gr]?Kc:tV;if(!this[nn]&&!Buffer.isBuffer(e)){if(iV(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(rV(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[nn]?(this[Ft]&&this[Ut]!==0&&this[Eh](!0),this[Ft]?this.emit("data",e):this[zb](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):e.length?(typeof e=="string"&&!(n===this[_r]&&!this[na]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[_r]&&(e=this[na].write(e)),this[Ft]&&this[Ut]!==0&&this[Eh](!0),this[Ft]?this.emit("data",e):this[zb](e),this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft]):(this[Ut]!==0&&this.emit("readable"),r&&i(r),this[Ft])}read(e){if(this[wt])return null;if(this[Fn]=!1,this[Ut]===0||e===0||e&&e>this[Ut])return this[pi](),null;this[nn]&&(e=null),this[Bt].length>1&&!this[nn]&&(this[Bt]=[this[_r]?this[Bt].join(""):Buffer.concat(this[Bt],this[Ut])]);let n=this[tA](e||null,this[Bt][0]);return this[pi](),n}[tA](e,n){if(this[nn])this[wh]();else{let r=n;e===r.length||e===null?this[wh]():typeof r=="string"?(this[Bt][0]=r.slice(e),n=r.slice(0,e),this[Ut]-=e):(this[Bt][0]=r.subarray(e),n=r.subarray(0,e),this[Ut]-=e)}return this.emit("data",n),!this[Bt].length&&!this[hi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[hi]=!0,this.writable=!1,(this[Ft]||!this[Gc])&&this[pi](),this}[ra](){this[wt]||(!this[Is]&&!this[hn].length&&(this[Fn]=!0),this[Gc]=!1,this[Ft]=!0,this.emit("resume"),this[Bt].length?this[Eh]():this[hi]?this[pi]():this.emit("drain"))}resume(){return this[ra]()}pause(){this[Ft]=!1,this[Gc]=!0,this[Fn]=!1}get destroyed(){return this[wt]}get flowing(){return this[Ft]}get paused(){return this[Gc]}[zb](e){this[nn]?this[Ut]+=1:this[Ut]+=e.length,this[Bt].push(e)}[wh](){return this[nn]?this[Ut]-=1:this[Ut]-=this[Bt][0].length,this[Bt].shift()}[Eh](e=!1){do;while(this[nA](this[wh]())&&this[Bt].length);!e&&!this[Bt].length&&!this[hi]&&this.emit("drain")}[nA](e){return this.emit("data",e),this[Ft]}pipe(e,n){if(this[wt])return e;this[Fn]=!1;let r=this[Ji];return n=n||{},e===eA.stdout||e===eA.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[hn].push(n.proxyErrors?new Kb(this,e,n):new Nh(this,e,n)),this[Gr]?Kc(()=>this[ra]()):this[ra]()),e}unpipe(e){let n=this[hn].find(r=>r.dest===e);n&&(this[hn].length===1?(this[Ft]&&this[Is]===0&&(this[Ft]=!1),this[hn]=[]):this[hn].splice(this[hn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[Fn]=!1,this[Is]++,!this[hn].length&&!this[Ft]&&this[ra]();else if(e==="readable"&&this[Ut]!==0)super.emit("readable");else if(nV(e)&&this[Ji])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Hc]){let i=n;this[Gr]?Kc(()=>i.call(this,this[Hc])):i.call(this,this[Hc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Is]=this.listeners("data").length,this[Is]===0&&!this[Fn]&&!this[hn].length&&(this[Ft]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Is]=0,!this[Fn]&&!this[hn].length&&(this[Ft]=!1)),n}get emittedEnd(){return this[Ji]}[pi](){!this[_h]&&!this[Ji]&&!this[wt]&&this[Bt].length===0&&this[hi]&&(this[_h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Sh]&&this.emit("close"),this[_h]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==wt&&this[wt])return!1;if(e==="data")return!this[nn]&&!r?!1:this[Gr]?(Kc(()=>this[Hb](r)),!0):this[Hb](r);if(e==="end")return this[rA]();if(e==="close"){if(this[Sh]=!0,!this[Ji]&&!this[wt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Hc]=r,super.emit(Wb,r);let s=!this[Yc]||this.listeners("error").length?super.emit("error",r):!1;return this[pi](),s}else if(e==="resume"){let s=super.emit("resume");return this[pi](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[pi](),i}[Hb](e){for(let r of this[hn])r.dest.write(e)===!1&&this.pause();let n=this[Fn]?!1:super.emit("data",e);return this[pi](),n}[rA](){return this[Ji]?!1:(this[Ji]=!0,this.readable=!1,this[Gr]?(Kc(()=>this[Gb]()),!0):this[Gb]())}[Gb](){if(this[na]){let n=this[na].end();if(n){for(let r of this[hn])r.dest.write(n);this[Fn]||super.emit("data",n)}}for(let n of this[hn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[nn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[nn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[nn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[_r]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(wt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Fn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[hi])return n();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(wt,u),n(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(wt,u),this.pause(),s({value:d,done:!!this[hi]})},l=()=>{this.off("error",a),this.off("data",c),this.off(wt,u),n(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(wt,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Fn]=!1;let e=!1,n=()=>(this.pause(),this.off(Wb,n),this.off(wt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(Wb,n),this.once(wt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[wt])return e?this.emit("error",e):this.emit(wt),this;this[wt]=!0,this[Fn]=!0,this[Bt].length=0,this[Ut]=0;let n=this;return typeof n.close=="function"&&!this[Sh]&&n.close(),e?this.emit("error",e):this.emit(wt),this}static get isStream(){return QU}};var cV=Kr.realpathSync.native,Jc={lstatSync:Kr.lstatSync,readdir:Kr.readdir,readdirSync:Kr.readdirSync,readlinkSync:Kr.readlinkSync,realpathSync:cV,promises:{lstat:Zi.lstat,readdir:Zi.readdir,readlink:Zi.readlink,realpath:Zi.realpath}},uA=t=>!t||t===Jc||t===aV?Jc:{...Jc,...t,promises:{...Jc.promises,...t.promises||{}}},dA=/^\\\\\?\\([a-z]:)\\?$/i,lV=t=>t.replace(/\//g,"\\").replace(dA,"$1\\"),uV=/[\\\/]/,Zn=0,fA=1,hA=2,Yr=4,pA=6,mA=8,xs=10,gA=12,Qn=15,Xc=~Qn,Jb=16,sA=32,Qc=64,Sr=128,Rh=256,Dh=512,oA=Qc|Sr|Dh,dV=1023,Qb=t=>t.isFile()?mA:t.isDirectory()?Yr:t.isSymbolicLink()?xs:t.isCharacterDevice()?hA:t.isBlockDevice()?pA:t.isSocket()?gA:t.isFIFO()?fA:Zn,aA=new Map,Zc=t=>{let e=aA.get(t);if(e)return e;let n=t.normalize("NFKD");return aA.set(t,n),n},cA=new Map,Ch=t=>{let e=cA.get(t);if(e)return e;let n=Zc(t.toLowerCase());return cA.set(t,n),n},Ah=class extends Wc{constructor(){super({max:256})}},Zb=class extends Wc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},yA=Symbol("PathScurry setAsCwd"),rn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#s;get blocks(){return this.#s}#y;get atimeMs(){return this.#y}#b;get mtimeMs(){return this.#b}#p;get ctimeMs(){return this.#p}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#T;#_;#S;#m;#C;#N;#r;#O;#v;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Zn,r,i,s,o,a){this.name=e,this.#T=s?Ch(e):Zc(e),this.#r=n&dV,this.nocase=s,this.roots=i,this.root=r||this,this.#O=o,this.#S=a.fullpath,this.#C=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=uA(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 n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#O.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#O.set(this,n),this.#r&=~Jb,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Ch(e):Zc(e);for(let c of r)if(c.#T===i)return c;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,Zn,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Sr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,n=this.parent;if(!n)return this.#N=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let i=n.fullpath()+(n.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,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#m=r}isUnknown(){return(this.#r&Qn)===Zn}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.#r&Qn)===mA}isDirectory(){return(this.#r&Qn)===Yr}isCharacterDevice(){return(this.#r&Qn)===hA}isBlockDevice(){return(this.#r&Qn)===pA}isFIFO(){return(this.#r&Qn)===fA}isSocket(){return(this.#r&Qn)===gA}isSymbolicLink(){return(this.#r&xs)===xs}lstatCached(){return this.#r&sA?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.#r&Qn;return!(e!==Zn&&e!==xs||this.#r&Rh||this.#r&Sr)}calledReaddir(){return!!(this.#r&Jb)}isENOENT(){return!!(this.#r&Sr)}isNamed(e){return this.nocase?this.#T===Ch(e):this.#T===Zc(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}#x(e){this.#r|=Jb;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&Sr||(this.#r=(this.#r|Sr)&Xc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#R(){this.#r|=Dh,this.#L()}#L(){if(this.#r&Qc)return;let e=this.#r;(e&Qn)===Yr&&(e&=Xc),this.#r=e|Qc,this.#P()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#M()}#u(e=""){let n=this.#r;n|=Rh,e==="ENOENT"&&(n|=Sr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=Xc),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,n){return this.#A(e,n)||this.#F(e,n)}#F(e,n){let r=Qb(e),i=this.newChild(e.name,r,{parent:this}),s=i.#r&Qn;return s!==Yr&&s!==xs&&s!==Zn&&(i.#r|=Qc),n.unshift(i),n.provisional++,i}#A(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?Ch(e.name):Zc(e.name))===i.#T)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#r=n.#r&Xc|Qb(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if((this.#r&Sr)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&Sr)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#W(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:h,mtime:y,mtimeMs:p,nlink:T,rdev:S,size:b,uid:v}=e;this.#E=n,this.#y=r,this.#k=i,this.#h=s,this.#d=o,this.#s=a,this.#w=c,this.#p=l,this.#t=u,this.#f=d,this.#a=f,this.#i=h,this.#g=y,this.#b=p,this.#n=T,this.#l=S,this.#c=b,this.#o=v;let w=Qb(e);this.#r=this.#r&Xc|w|sA,w!==Zn&&w!==Yr&&w!==xs&&(this.#r|=Qc)}#V=[];#z=!1;#H(e){this.#z=!1;let n=this.#V.slice();this.#V.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#V.push(e),this.#z)return;this.#z=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#$(s.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(i,e);this.#x(e)}catch(i){this.#$(i.code),e.provisional=0}this.#U=void 0,r()}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 n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#$(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&oA)return!1;let e=Qn&this.#r;return e===Zn||e===Yr||e===xs}shouldWalk(e,n){return(this.#r&Yr)===Yr&&!(this.#r&oA)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#D)return this.#D;if(!((Dh|Rh|Sr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#D)return this.#D;if(!((Dh|Rh|Sr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#R()}}[yA](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#N=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#N=void 0,i=i.parent}},Oh=class t extends rn{sep="\\";splitSep=uV;constructor(e,n=Zn,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=Zn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return ia.win32.parse(e).root}getRoot(e){if(e=lV(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new sa(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(dA,"$1\\"),e===n}},Ih=class t extends rn{splitSep="/";sep="/";constructor(e,n=Zn,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Zn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},xh=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Jc}={}){this.#n=uA(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,lA.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Ah,this.#t=new Ah,this.#i=new Zb(s);let c=a.substring(this.rootPath.length).split(r);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.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=n.sep,f=this.rootPath,h=!1;for(let y of c){let p=u--;l=l.child(y,{relative:new Array(p).fill("..").join(d),relativePosix:new Array(p).fill("..").join("/"),fullpath:f+=(h?"":d)+y}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,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,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?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:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((h,y)=>{if(h)return f(h);let p=y.length;if(!p)return f();let T=()=>{--p===0&&f()};for(let S of y)(!s||s(S))&&a.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(c,o)?l(b,T):T()):S.shouldWalk(c,o)?l(S,T):T()},!0)},u=e;return new Promise((d,f)=>{l(u,h=>{if(h)return f(h);d(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?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(r?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,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?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 r?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,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new Qi({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=(T,S,b=!1)=>{if(T)return a.emit("error",T);if(i&&!b){let v=[];for(let w of S)w.isSymbolicLink()&&v.push(w.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(v.length){Promise.all(v).then(()=>y(null,S,!0));return}}for(let v of S)v&&(!s||s(v))&&(a.write(r?v:v.fullpath())||(f=!0));u--;for(let v of S){let w=v.realpathCached()||v;w.shouldWalk(c,o)&&l.push(w)}f&&!a.flowing?a.once("drain",d):p||d()},p=!0;h.readdirCB(y,!0),p=!1}};return d(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof rn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new Qi({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=h.readdirSync();for(let p of y)(!s||s(p))&&(a.write(r?p:p.fullpath())||(f=!0));u--;for(let p of y){let T=p;if(p.isSymbolicLink()){if(!(i&&(T=p.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 n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[yA](n)}},sa=class extends xh{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,ia.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ia.win32.parse(e).root.toUpperCase()}newRoot(e){return new Oh(this.rootPath,Yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},oa=class extends xh{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,ia.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ih(this.rootPath,Yr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},el=class extends oa{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}},jie=process.platform==="win32"?Oh:Ih,bA=process.platform==="win32"?sa:process.platform==="darwin"?el:oa;var fV=t=>t.length>=1,hV=t=>t.length>=1,aa=class t{#e;#t;#i;length;#n;#o;#f;#l;#d;#a;#c=!0;constructor(e,n,r,i){if(!fV(e))throw new TypeError("empty pattern list");if(!hV(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#i=r,this.#n=i,this.#i===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,h,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let p=[s,o,a,c,""].join("/"),T=[u,d,f,h,""].join("/");this.#e=[p,...l],this.#t=[T,...y],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.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===Gt}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#f=this.#f||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#i+1,this.#n),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#n==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var pV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ca=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=pV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new jn(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new aa(i,s,0,this.platform),a=new jn(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 n=e.fullpath(),r=`${n}/`,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(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};var ev=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}},tv=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},nv=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},tl=class t{hasWalkedCache;matches=new tv;subwalks=new nv;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new ev}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){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===Gt){(!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 h=i.parent||i;f?this.hasWalkedCache.hasWalked(h,f)||this.subwalks.add(h,f):this.matches.add(h,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,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Gt?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,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var mV=(t,e)=>typeof t=="string"?new ca([t],e):Array.isArray(t)?new ca(t,e):t,Mh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=mV(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(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,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}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,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}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,n)}matchFinish(e,n){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){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.#i)?"."+this.#i:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new tl(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())s++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new tl(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())s++,this.walkCB2Sync(a,c,r.child(),o);o()}},nl=class extends Mh{matches=new Set;constructor(e,n,r){super(e,n,r)}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,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(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}},rl=class extends Mh{results;constructor(e,n,r){super(e,n,r),this.results=new Qi({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 gV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Er=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,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,vA.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=n.platform||gV,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=n.platform==="win32"?sa:n.platform==="darwin"?el:n.platform?oa:bA;this.scurry=new c(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,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 jn(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 aa(c,u,0,this.platform)})}async walk(){return[...await new nl(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 nl(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 rl(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 rl(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 rv=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new jn(n,e).hasMagic())return!0;return!1};function Lh(t,e={}){return new Er(t,e).streamSync()}function _A(t,e={}){return new Er(t,e).stream()}function SA(t,e={}){return new Er(t,e).walkSync()}async function TA(t,e={}){return new Er(t,e).walk()}function $h(t,e={}){return new Er(t,e).iterateSync()}function EA(t,e={}){return new Er(t,e).iterate()}var yV=Lh,bV=Object.assign(_A,{sync:Lh}),vV=$h,TV=Object.assign(EA,{sync:$h}),_V=Object.assign(SA,{stream:Lh,iterate:$h}),Ms=Object.assign(TA,{glob:TA,globSync:SA,sync:_V,globStream:_A,stream:bV,globStreamSync:Lh,streamSync:yV,globIterate:EA,iterate:TV,globIterateSync:$h,iterateSync:vV,Glob:Er,hasMagic:rv,escape:Zo,unescape:Tr});Ms.glob=Ms;var i_=require("path"),s_=require("fs");var Px=K(wx());var n_={};TM(n_,{$id:()=>zY,$schema:()=>VY,default:()=>KY,definitions:()=>HY,properties:()=>YY,title:()=>WY,type:()=>GY});var VY="http://json-schema.org/draft-07/schema#",zY="http://json-schema.org/draft-07/schema#",WY="Core schema meta-schema",HY={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:[]}},GY=["object","boolean"],YY={$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:"#"}},KY={$schema:VY,$id:zY,title:WY,definitions:HY,type:GY,properties:YY,default:!0};var xt=K(J());var bp=class extends Za{constructor(n,r){super();this.ajv=n;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(n,r){let i=[],s=r.getProperty("status"),o=s?.ast.values?.values.at(0)?.value;if(o instanceof Me&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>i.push($(21,c,xt.DiagnosticSeverity.Hint,[...s?.ast?[s?.ast]:[]],[xt.DiagnosticTag.Unnecessary]))),i;let a=ke.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>i.push(...XY(n,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return i}getOnPropertyHover(n){let r=(this.validate?.schema).properties?.[n];if(r&&typeof r=="object"&&"description"in r)return{kind:xt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
285
287
|
|
|
286
288
|
`):r.description]:[]].join(`
|
|
287
|
-
`)}}getSignatureHelp(){}getPropertyListCompletionItems(n){let r=Object.keys((this.validate?.schema).properties),
|
|
288
|
-
${"".padEnd(
|
|
289
|
+
`)}}getSignatureHelp(){}getPropertyListCompletionItems(n){let r=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return r.map(s=>{let o=n&&i.some(l=>l===s),a=!!n.property.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:xt.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},XY=(t,e,n,r)=>{let i=JY(n,e.instancePath),s=i.node;if(e.keyword==="additionalProperties"){let o=s.getProperty(e.params.additionalProperty);return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Node "${s.name}" ${e.message}: ${o.name}`],xt.TextEdit.del(Ss(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=s.getProperty(e.instancePath.split("/")[1]);return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=t.getOrderedNodeAst(s),c=Po(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return $(0,c[u],xt.DiagnosticSeverity.Error,[],[],[o],xt.TextEdit.insert(xt.Position.create(d.pos.line,d.pos.col+1),`
|
|
290
|
+
${"".padEnd(Co(c[u].uri,l)*No().length,No())}${o};`))})}else if(e.keyword==="const"){let o=i.property;return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=i.property;return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
|
|
289
291
|
${e.params.allowedValues.join(`
|
|
290
292
|
`)}
|
|
291
|
-
${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=
|
|
293
|
+
${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=s.getProperty(e.instancePath.split("/").at(-1)??"");return o?[$(25,o.ast,xt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return i.property?[$(25,i.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
292
294
|
${JSON.stringify(e)}
|
|
293
|
-
${r}`])]:[
|
|
295
|
+
${r}`])]:[$(25,i.node.definitions[0]instanceof mt?i.node.definitions[0]:i.node.definitions[0].name??i.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
294
296
|
${JSON.stringify(e)}
|
|
295
|
-
${r}`])]},SY=(t,e)=>cx(t,e.split("/").filter(n=>n)),cx=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let n=e[0].split("@"),r=n[0],s=n.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=t.getNode(r,s);return i?cx(i,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var KT=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof xe)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,n){xi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,GT.resolve)(e,s);try{let i=HT.default.parse((0,YT.readFileSync)(s,"utf-8"));n.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,n){xi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,GT.resolve)(e,s);try{let i=HT.default.parse((0,YT.readFileSync)(s,"utf-8"));n.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,n,r){let s=`${e.join(";")}::${n.join(";")}`,i=this.ajvMap.get(s);return i||(i=new ux.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(WT),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),n.forEach(c=>this.parseBindings(c,i))),t.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new dp(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.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)??[]}},lx,dx=()=>(lx??=new KT,lx);var gx=K(Pb());var Sa=require("path"),yx=require("fs");var Bn=K(J());var fx=t=>{switch(t){case"string":return V("STRING");case"int":return V("U32");case"boolean":return V("EMPTY");case"array":return V("PROP_ENCODED_ARRAY");case"uint8-array":return V("BYTESTRING");case"string-array":return V("STRINGLIST");case"phandle":return V("U32");case"phandles":return V("PROP_ENCODED_ARRAY");case"phandle-array":return V("PROP_ENCODED_ARRAY");case"path":return V(["STRING","U32"]);case"compound":return V("ANY")}},hx=(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(n=>typeof n=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},fp=(t,e)=>{if(e=e.include.reduce((n,r)=>{let s=t.find(i=>(0,Sa.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return n.include=n.include.filter(o=>o!==r),EY(t,s,n,i)??n}return console.warn(`Unable to find ${r}`),n},e),e["child-binding"]&&(e["child-binding"].include=bx(e["child-binding"].include),e["child-binding"]=fp(t,e["child-binding"])),!e.include.length)return e},EY=(t,e,n,r=[])=>{let s=fp(t,e),i=fp(t,n);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:s.properties?.[d]??{},h=i.properties?.[d]??{};a={...a,[d]:{...f,...h}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],h=i[d]??[];i[d]=Array.from([...f,...h])}),i},bx=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],XT=class t{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof xe)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,n){let r=t.getNodeCompatible(n);if(!r)return[Ei(n)];let s=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);return i.length?i:[Ei(n)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(n=>{if(this.readFolders.indexOf(n)!==-1)return;this.readFolders.push(n);let s=xi.sync("**/*.yaml",{cwd:n,ignore:"test/*"}).map(o=>{o=(0,Sa.resolve)(n,o);try{let a=gx.default.parse((0,yx.readFileSync)(o,"utf-8"));return{...a,include:bx(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>fp(s,o)).filter(o=>!!o&&!o.include.length);wY(i,this.typeCache)})}},px,vx=()=>(px??=new XT,px),wY=(t,e)=>t.forEach(n=>{let r=n.compatible??(n.filePath?(0,Sa.basename)(n.filePath,"yaml"):void 0);r&&e.set(r,s=>Tx(n,s))}),Tx=(t,e)=>{let n=Ei(e);n.compatible=t.compatible??(t.filePath?(0,Sa.basename)(t.filePath,"yaml"):void 0),n.description=t.description,n.bindingsPath=t.filePath,n.bus=typeof t.bus=="string"?[t.bus]:t.bus,n.onBus=t["on-bus"];let s=Object.keys(t).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:t[i]}));if(t.properties&&Object.keys(t.properties).forEach(i=>{let o=t.properties[i];kY(n,i,o),n.cellsValues=s}),t["child-binding"]){let i=t["child-binding"];n.childNodeType=o=>Tx(i,o)}return n},kY=(t,e,n)=>{let r=t.properties.find(s=>s.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>n.required?"required":"optional",r.values=()=>n.enum??[],r.constValue=hx(n.type,n.const),r.bindingType=n.type;let s=r.additionalTypeCheck;r.additionalTypeCheck=(i,o)=>[...mx(n,e,r)(i,o),...s?.(i,o)??[]]}else{let s=n.type==="compound"?r?.type:fx(n.type);s??=fx(n.type);let i=new Y(e,s,n.required?"required":"optional",void 0,n.enum);i.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...mx(n,e,i)(o,a)];return i.signatureArgs??=r?.signatureArgs,i.signatureArgsCyclic??=!!r?.signatureArgsCyclic,c},i.description=n.description?[n.description]:r?.description,i.bindingType=n.type,i.constValue=hx(n.type,n.const),t.addProperty(i)}},mx=(t,e,n)=>{let r=t;return(s,i)=>{let o=s.parent.root,a=[];if(r.const){let c=s.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push(L(24,s.ast.values??s.ast,Bn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push(L(14,s.ast,Bn.DiagnosticSeverity.Warning,[],[Bn.DiagnosticTag.Deprecated],[s.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&Ee(s.ast.values)?.forEach(l=>{qn(l,o)||a.push(L(22,l,Bn.DiagnosticSeverity.Error))}),r.type==="path"&&s.ast.values?.values.at(0)?.value instanceof xe){let c=s.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push(L(23,c,Bn.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=Ee(s.ast.values),l=0,u=[],d=0;for(;c&&l<c.length;){let f=c.at(l),h=qn(f,o);if(!h){a.push(L(22,f??s.ast,Bn.DiagnosticSeverity.Error));break}let y="";e.endsWith("-gpios")?y="gpio":y=r["specifier-space"]??e.slice(0,-1);let m=h.getProperty(`#${y}-cells`);if(!m){a.push(L(16,s.ast,Bn.DiagnosticSeverity.Error,[...h.nodeNameOrLabelRef],[],[s.name,`#${y}-cells`,`/${h.path.slice(1).join("/")}`]));break}let b=m?Pe(m,0,0,i)??0:0,E=h.nodeType?.cellsValues?.find(k=>k.specifier===y)?.values;if(u.push([`${d}_phandel`,...E?.map(k=>`${d}_${k}`)??[],...Array.from({length:b-(E?.length??0)},(k,C)=>`${d}_cell${b-(E?.length??0)?C:""}`)]),1+b>c.length-l){a.push(L(19,f??s.ast,Bn.DiagnosticSeverity.Error,[],[],[s.name,`<${u.at(-1).join(" ")}>`]));break}l+=1+b;let _=c.slice(l-b,l),T=h.getProperty(`${y}-map`);if(T){let k=h.getNexusMapEntyMatch(y,i,_);k?.match?s.nexusMapsTo.push({mappingValuesAst:_,mapItem:k.match}):a.push(L(31,k.entry,Bn.DiagnosticSeverity.Error,[T.ast]))}d++}u.push([`${d}_phandel`,`${d}_cell...`]),n.signatureArgs=u.map(f=>f.map(h=>Bn.ParameterInformation.create(h)))}return a}};var _x=(t,e)=>({files:t,type:e,getNodeTypes:async n=>{switch(e){case"Zephyr":return vx().getNodeTypes(t.zephyrBindings,n);case"DevicetreeOrg":return dx().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n)}}});var QT=K(J());var JT=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(JT):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:QT.FoldingRangeKind.Region},...t.nodes.flatMap(JT)],Sx=t=>{let e=[];return[...t instanceof qs?t.ifBlocks.map(n=>({start:(n.expression??n.keyword).lastToken,end:n.content?.lastToken??(n.expression??n.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(n=>{!n||!n.end||e.push({startLine:n.start.pos.line,startCharacter:n.start.pos.col,endLine:n.end.pos.line,endCharacter:n.end.pos.colEnd,kind:QT.FoldingRangeKind.Region})}),e},NY=t=>t instanceof He?JT(t):t instanceof xo||t instanceof qs?Sx(t):[];function Ex(t,e){return e.allAstItems.flatMap(n=>[n,...n.allDescendants]).filter(n=>le(n.uri,t)).flatMap(NY)}var Gi=K(J());function PY(t){if(!t||!(t.ast instanceof qe)&&!(t.ast instanceof zt))return[];let e=n=>n.nodeType?.bindingsPath?[Gi.Location.create(fe(n.nodeType.bindingsPath),Gi.Range.create(Gi.Position.create(0,0),Gi.Position.create(0,0)))]:[];return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof zt&&t.ast.parentNode instanceof ye&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof qe&&t.ast.linksTo?e(t.ast.linksTo):[]}async function wx(t,e){return vt(t,e,n=>[...PY(n)])}var pp=require("fs");var RY=(t,e)=>{yr().reset(t),yr().requestTokens(t,!0),e(t)},hp=class{constructor(e,n,r){this.file=e;this.cb=n;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,n=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),RY(e,n)},(0,pp.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,pp.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var an=K(require("path")),ZT=require("fs");var sr=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),Yi={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},e_=async(t,e,n)=>{let r=(t.cwd?await sr(t.cwd,n):void 0)??e.cwd,s=await Promise.all((t.includePaths??e.defaultIncludePaths).map(f=>sr(f,n))),i=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(f=>sr(f,n))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>sr(f,n))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>sr(f,n))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(f=>sr(f,n)));r&&o==="Zephyr"&&(!i||i.length===0)&&(i=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[];return r&&(i=i.map(f=>(0,an.resolve)(r,f)).filter(f=>(0,ZT.existsSync)(f)),a=a?.map(f=>(0,an.resolve)(r,f)),c=c.map(f=>(0,an.resolve)(r,f)),s=s.map(f=>(0,an.resolve)(r,f)),u=(0,an.resolve)(r,u),d=d.map(f=>(0,an.resolve)(r,f)),l=l.map(f=>(0,an.resolve)(r,f))),{ctxName:t.ctxName??(0,an.basename)(u),cwd:r?et(r):void 0,includePaths:s.map(et),zephyrBindings:i.map(et),bindingType:o,deviceOrgTreeBindings:a.map(et),deviceOrgBindingsMetaSchema:c.map(et),dtsFile:et(u),overlays:d.map(et),lockRenameEdits:l.map(et)}},Al=async(t,e)=>{let n=t.cwd?await sr(t.cwd,e):void 0,r=t.defaultBindingType,s=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>sr(d,e))),i=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>sr(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>sr(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>sr(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>sr(d,e)));n&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,an.resolve)(n,d)),r==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,an.resolve)(n,d)),s=s.map(d=>(0,an.resolve)(n,d))),t.defaultDeviceOrgTreeBindings=(t.defaultDeviceOrgTreeBindings??[]).map(d=>t.cwd?(0,an.resolve)(t.cwd,d):d);let l={cwd:n,defaultDeviceOrgBindingsMetaSchema:s,defaultDeviceOrgTreeBindings:i,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:t.autoChangeContext??Yi.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Yi.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>e_(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,ZT.existsSync)(f)&&an.default.isAbsolute(f)));return{...l,contexts:u}};var Ix=require("path");var kx=t=>`DT_PROP(${t_(t.parent)}, ${t.name.replaceAll("-","_")}))`,Nx=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var t_=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Px=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Rx=t=>{let e=[];return Lo.getNodeFromPath(["aliases"],t.root)?.property.filter(s=>{if(s.ast.quickValues?.at(0)===t.pathString)return!0;let i=s.ast.values?.values.at(0)?.value;if(i instanceof ye&&i.linksTo===t||i instanceof Ln&&i.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(s=>e.push(`DT_ALIAS(${s.name.replaceAll("-","_")})`)),e};function CY(t,e){if(!t||!(t.item instanceof Be)||!(t.ast instanceof We))return[];let n=[];if(e.settings.bindingType==="Zephyr"){n.push({type:"dt_zephyr_macro_prop_node_path",data:kx(t.item)});let r=t.item;Nx(t.item).forEach(s=>{n.push({type:"dt_zephyr_macro_prop_node_label",data:s})})}return n}function DY(t,e){if(!t||t.item===null)return[];let n;if(t.item instanceof we?n=t.item:t.ast.parentNode instanceof ye&&t.ast.parentNode.linksTo?n=t.ast.parentNode.linksTo:t.ast instanceof qe&&t.ast.linksTo&&(n=t.ast.linksTo),!n)return[];let r=[{type:"path",data:n.pathString}];return e.settings.bindingType==="Zephyr"&&(Px(n).forEach(s=>{r.push({type:"dt_zephyr_macro_node_label",data:s})}),r.push({type:"dt_zephyr_macro_node_path",data:t_(n)}),Rx(n).forEach(s=>{r.push({type:"dt_zephyr_macro_prop_node_alias",data:s})})),r}async function Cx(t,e){return e?vt(t,e,n=>[...DY(n,e),...CY(n,e)]):[]}var Dx=K(J());function AY(t){return!t||!(t.item instanceof Be)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function OY(t){let e=Ka(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let r=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!r||!(r instanceof Fr))return;let s=r.params.map(o=>({label:o instanceof Ot?o.name:"..."})),i=e.params.find(o=>o&&(t.ast===o||o.isAncestorOf(t.ast)));return i??=t.afterAst?e.params.find(o=>o&&(t.afterAst===o||o.isAncestorOf(t.afterAst))):void 0,i??=t.beforeAst?e.params.find(o=>o&&(t.beforeAst===o||o.isAncestorOf(t.beforeAst))):void 0,{signatures:[Dx.SignatureInformation.create(`${e.functionName.name}(${s.map(o=>o.label).join(", ")})`,void 0,...s.flat())],activeSignature:0,activeParameter:i?e.params.indexOf(i):void 0}}async function Ax(t,e){if(e)return(await vt(t,e,async n=>[await OY(n)||AY(n)])).at(0)}var Me=[],Fe,wa,gp=new WeakMap,mp=new Map,xx=async t=>{await t.stable(),t.getContextFiles().forEach(e=>{mp.has(e)||mp.set(e,new hp(e,a_,n=>!!yp(n))),mp.get(e)?.watch()})},i_=async t=>{let e=Me.indexOf(t);if(e===-1)return;bp(t,void 0,!0),gp.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let n=await Ki(t);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Fe===t,type:n.type}),Me.splice(e,1),await l_(),t===Fe&&(Fe=void 0,Me.length)){let r=wa?fr(Me,{uri:wa}):void 0;r??=Me[0],console.log("Active context was deleted. Forcing active to",r.id),await Kt({id:r.id},!0)}Mx(t)},Mx=async t=>{await t.stable(),t.getContextFiles().forEach(e=>mp.get(e)?.unwatch())},IY=t=>{let e=gp.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},Ue=async()=>{await Promise.all(Me.map(IY))},o_=async t=>(await $x()).indexOf(t)!==-1,$x=async()=>{let t=await Lx();return Me.filter(e=>!t.some(n=>n===e))},Lx=async()=>{let t=await s_();return Me.filter(e=>t.contexts.find(n=>ss(n)===e.id))},xY=async()=>{let t=await jY();return Me.filter(e=>t.contexts.find(n=>ss(n)===e.id))},MY=async t=>(await xY()).indexOf(t)!==-1,$Y=async(t,e)=>{if(t===e)return!0;let n=(await t.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath);return r.some(s=>le(s.resolvedPath,t.parser.uri))&&n.length?n.every(s=>r.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>le(s,t.parser.uri))},LY=async t=>{if(!await o_(t))return;let e=await $x(),n=await Lx(),r=await Ld(e);if(Me.indexOf(t)===-1)return;let s=await Promise.all(r.flatMap(a=>[...n,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await $Y(a.context,c)})))),i=t.getContextFiles(),o=r.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==t&&le(a.context.parser.uri,t.parser.uri)&&i.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(i_)},ee=(0,tt.createConnection)(tt.ProposedFeatures.all),Rr=new tt.TextDocuments(md),qx=!1,n_=!1,jx=!1,Fx=!1,Bx=!1,r_;ee.onInitialize(t=>{r_=t.workspaceFolders,ee.console.log(`[Server(${process.pid}) ${r_?.[0].uri} Version 0.4.1 ] Started and initialize received`);let e=t.capabilities;qx=!!(e.workspace&&e.workspace.configuration),n_=!!(e.workspace&&e.workspace.workspaceFolders),jx=!!e.workspace?.diagnostics?.refreshSupport,Fx=!!e.workspace?.semanticTokens?.refreshSupport,Bx=!!e.workspace?.foldingRange?.refreshSupport;let n={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:tt.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[tt.CodeActionKind.QuickFix,tt.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:gd,tokenModifiers:yd},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return n_&&(n.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),n});ee.onInitialized(()=>{qx&&ee.client.register(tt.DidChangeConfigurationNotification.type,{}),n_&&ee.workspace.onDidChangeWorkspaceFolders(async t=>{ee.console.log("Workspace folder change event received"),await Ml()})});var qY=async()=>{let t=Ux();return t={...Yi,...t},Al(t,await xl())},s_=async()=>{let t=UY();return t={...Yi,...t},Al(t,await xl())},jY=async()=>{let t=VY();return t={...Yi,...t},Al(t,await xl())},Il=async()=>{let t=BY();return t={...Yi,...t},Al(t,await xl())},FY=new Map,xl=async()=>(await ee.workspace.getWorkspaceFolders()??r_)?.map(e=>Ke(e.uri))?.at(0),Ox=async t=>{let e=fr(Me,{id:ss(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 n=ss(t);console.log(`(ID: ${n}) New context [${t.ctxName}]`),console.log(`(ID: ${n}) Settings: ${JSON.stringify(t,void 0," ")}`);let r=new lf(t,t.bindingType?_x({zephyrBindings:t.zephyrBindings??[],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Me.push(r),xx(r),await r.stable();let s=await Ki(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(i=>i.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Fe,type:s.type}),await LY(r),await l_(),r},Ml=async()=>{let t=await s_(),e=await Il();e.allowAdhocContexts||(e=await s_());let n=e.contexts.map(ss);Me.filter(s=>!n.includes(s.id)).forEach(i_),await t.contexts?.reduce((s,i)=>s.then(async()=>{await Ox(i)}),Promise.resolve()),e.allowAdhocContexts&&await(await qY()).contexts?.reduce((i,o)=>i.then(async()=>{fr(Me,{uri:o.dtsFile})||await Ox(o)}),Promise.resolve()),wa?await Kt({uri:wa}):!Fe&&Me.length&&(console.log(`No active context using first context (ID: ${Me[0].id}) [${Me[0].ctxNames.join(",")}]`),await Kt({id:Me[0].id}))},ir,oi,Ol=new Map,Ea=new Map,BY=()=>!oi&&!ir?void 0:{...oi,...ir,contexts:[...ir?.contexts??[],...Array.from(Ea.values()),...Array.from(Ol.values())]},Ux=()=>!oi&&!ir?void 0:{...oi,...ir,contexts:[...Array.from(Ol.values())]},UY=()=>!oi&&!ir?void 0:{...oi,...ir,contexts:[...ir?.contexts??[],...Array.from(Ea.values())]},VY=()=>!oi&&!ir?void 0:{...ir,contexts:[...ir?.contexts??[]]};function zY(t){let e={...t};for(let n in e)e[n]===null&&delete e[n];return e}var Vx=async()=>{let t=await Il();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ee.sendNotification("devicetree/settingsChanged",t),await Ml(),Ue().then(()=>{jx&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(ir=zY(t.settings.devicetree),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await Vx())});var zx=()=>{let t=Fe?.getContextFiles();Array.from(Rr.keys()).forEach(e=>{t?.some(n=>le(n,Ke(e)))||ee.sendDiagnostics({uri:e,version:Rr.get(e)?.version,diagnostics:[{severity:tt.DiagnosticSeverity.Warning,range:tt.Range.create(tt.Position.create(0,0),tt.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},a_=async t=>{let e=wg(Me,t);if(e.length)e.forEach(n=>{gp.get(n)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=Fe===n,c=a?Wx(n):[];Mx(n),await n.reevaluate(t),xx(n),a&&c_(n).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));bp(n,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),i(),console.log("reevaluate",performance.now()-o)},50)});gp.set(n,{abort:r,promise:s})});else{if((await Il()).allowAdhocContexts===!1)return;await Ml(),await Kt({uri:t})}},WY=t=>Rr.keys().find(e=>le(Ke(e),t)),yp=t=>{let e=WY(t);if(e)return Rr.get(e)},Wx=t=>t.getContextFiles().map(e=>({uri:fe(e),version:yp(e)?.version,diagnostics:[]})),bp=async(t,e=Wx(t),n=!1)=>{!n&&t!==Fe||await Promise.all(e.filter(r=>t===Fe||!Fe?.getContextFiles().some(s=>le(Ke(r.uri),s))).map(r=>ee.sendDiagnostics({uri:r.uri,version:Rr.get(r.uri)?.version,diagnostics:[]})))},c_=async t=>{await t.stable();let e=performance.now(),n=await t.getDiagnostics(),r=t.getContextFiles().map(s=>({uri:fe(s),kind:tt.DocumentDiagnosticReportKind.Full,items:n.get(s)??[],version:yp(s)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},l_=async()=>{let t=await Promise.all(Me.map(Ki));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Fe===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Ki=async t=>{let e=await o_(t),n=!e&&await MY(t);return{ctx:t,type:e?"Ad Hoc":n?"User":"3rd Party"}},Kt=async(t,e=!1)=>{"uri"in t&&(wa=t.uri,console.log("Active File Uri",wa));let n=await Il();if(await Ue(),Fe&&!e&&!n.autoChangeContext||!e&&Fe?.getContextFiles().find(i=>"uri"in t&&le(i,t.uri)))return!1;let r=Fe,s=fr(Me,t);return r!==s&&(r&&bp(r),Fe=s,s?(Ki(s).then(async i=>{let o=await s.getFileTree();s!==Fe&&!Me.includes(s)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:s.ctxNames.map(a=>a.toString()),id:s.id,...o,settings:s.settings,active:Fe===s,type:i.type})}),c_(s).then(i=>{i.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await l_()):ee.sendNotification("devicetree/newActiveContext",void 0)),Bx&&ee.languages.foldingRange.refresh(),Fx&&ee.languages.semanticTokens.refresh(),zx(),!0};Rr.listen(ee);Rr.onDidClose(async t=>{let e=Ke(t.document.uri),n=wg(Me,e);if(n.length===0){Ol.delete(e),ee.sendDiagnostics({uri:t.document.uri,version:Rr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(n.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>yp(o))?Fe?.getContextFiles().some(o=>le(o,e))||ee.sendDiagnostics({uri:t.document.uri,version:Rr.get(t.document.uri)?.version,diagnostics:[]}):await o_(r)?(i_(r),Ol.delete(r.settings.dtsFile)):bp(r)})),FY.delete(t.document.uri)});Rr.onDidOpen(async t=>{await Ue(),zx();let e=Ke(t.document.uri),n=fr(Me,{uri:e});if(n)n!==Fe&&await Kt({id:n.id});else{let r={ctxName:(0,Ix.basename)(e),dtsFile:e};Ol.set(e,r),await a_(e)}});Rr.onDidChangeContent(async t=>{let e=Ke(t.document.uri),n=t.document.getText(),r=yr();r.needsRenew(e,n)&&(console.log("Content changed"),r.renewLexer(e,n),await a_(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await Ue();let t=Fe;return t?c_(t):{items:[]}});ee.onDidChangeWatchedFiles(t=>{ee.console.log("We received a file change event")});ee.onCompletion(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return n?[...await lR(t,n),...await vR(t,n)]:[]});ee.onCompletionResolve(t=>t);var On=t=>{let e=Ux();return fr(Me,{uri:t},Fe,e?.preferredContext)};ee.onDocumentSymbol(async t=>{await Ue();let e=Ke(t.textDocument.uri),n=On(e);return n?n.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await Ue();let t=Fe;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async t=>{try{await Ue();let e=Ke(t.textDocument.uri),n=On(e),r=new tt.SemanticTokensBuilder,s=n?.isInContext(e);return!n||!s?{data:[]}:((await n.getAllParsers()).forEach(i=>i.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async t=>{await Ue();let e=Ke(t.textDocument.uri);return On(e)?.getDocumentLinks(e)});ee.onPrepareRename(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return mR(t,n)});ee.onRenameRequest(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return pR(t,n)});ee.onReferences(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return uR(t,n)});ee.onDefinition(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e),r=(await n?.getDocumentLinks(e,t.position))?.filter(s=>s.target).map(s=>tt.Location.create(s.target,s.range))??[];return r.length?r:gR(t,n)});ee.onDeclaration(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return yR(t,n)});ee.onCodeAction(async t=>bR(t));ee.onDocumentFormatting(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return n?oN(t,n):[]});ee.onHover(async t=>{await Ue();let e=Ke(t.textDocument.uri),n=On(e);return(await TR(t,n)).at(0)});ee.onFoldingRanges(async t=>{await Ue();let e=Ke(t.textDocument.uri),n=On(e),r=n?.isInContext(e);if(!n||!r)return[];let s=(await n.getAllParsers()).find(i=>i.getFiles().some(o=>o===e));return s?Ex(e,s):[]});ee.onTypeDefinition(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return wx(t,n)});ee.onSignatureHelp(async t=>{await Ue();let e=Ke(t.textDocument.uri);Kt({uri:e});let n=On(e);return Ax(t,n)});ee.onRequest("devicetree/getContexts",async()=>(await Ue(),Promise.all(Me.map(async t=>{let e=await Ki(t);return{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Fe===t,type:e.type}}))));ee.onRequest("devicetree/setActive",async t=>(await Ue(),console.log("devicetree/setActive",t),await Kt(t,!0)));ee.onRequest("devicetree/getActiveContext",async t=>{if(await Ue(),console.log("devicetree/getActiveContext",t),await Kt({id:t},!0),!Fe)return;let e=await Ki(Fe);return Fe?{ctxNames:Fe.ctxNames.map(n=>n.toString()),id:t,...await Fe.getFileTree(),settings:Fe.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async t=>{await Ue(),oi=t,console.log("Integration Settings",t),await Vx()});ee.onRequest("devicetree/requestContext",async t=>{await Ue();let e=await Il(),n=await e_(t,e,await xl());console.log("devicetree/requestContext",n);let r=ss(n),s=Array.from(Ea).find(([,a])=>a.ctxName===t.ctxName);if(s){let a=s[0].split(":",1)[0];fr(Me,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),Ea.delete(s[0])}Ea.set(`${r}:${t.ctxName}`,t),await Ml();let i=Me.find(a=>a.id===r);if(!i)throw new Error("Failed to create context");let o=await Ki(i);return{ctxNames:i.ctxNames.map(a=>a.toString()),id:r,...await i.getFileTree(),settings:i.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await Ue(),Ea.delete(`${t}:${e}`);let n=fr(Me,{id:t});if(n){if(n.removeCtxName(e),n.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Ml()}});ee.onRequest("devicetree/compiledDtsOutput",async t=>(await Ue(),t?fr(Me,{id:t})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async t=>(await Ue(),t?fr(Me,{id:t})?.serialize():void 0));ee.onRequest("devicetree/customActions",async t=>(await Ue(),Cx(t,Fe)));ee.onRequest("devicetree/activeFileUri",async t=>{await Ue(),Kt({uri:t})});
|
|
297
|
+
${r}`])]},JY=(t,e)=>kx(t,e.split("/").filter(n=>n)),kx=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let n=e[0].split("@"),r=n[0],i=n.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(r,i);return s?kx(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var o_=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(i=>!(i?.value instanceof Me)))return r?.values.map(i=>(i?.value).value)}parseMetaSchema(e,n){Ms.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,i_.resolve)(e,i);try{let s=r_.default.parse((0,s_.readFileSync)(i,"utf-8"));n.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,n){Ms.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,i_.resolve)(e,i);try{let s=r_.default.parse((0,s_.readFileSync)(i,"utf-8"));n.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,n,r){let i=`${e.join(";")}::${n.join(";")}`,s=this.ajvMap.get(i);return s||(s=new Px.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(n_),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),n.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new bp(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)??[]}},Nx,Rx=()=>(Nx??=new o_,Nx);var Ix=K(qb());var Ea=require("path"),xx=require("fs");var Bn=K(J());var Cx=t=>{switch(t){case"string":return V("STRING");case"int":return V("U32");case"boolean":return V("EMPTY");case"array":return V("PROP_ENCODED_ARRAY");case"uint8-array":return V("BYTESTRING");case"string-array":return V("STRINGLIST");case"phandle":return V("U32");case"phandles":return V("PROP_ENCODED_ARRAY");case"phandle-array":return V("PROP_ENCODED_ARRAY");case"path":return V(["STRING","U32"]);case"compound":return V("ANY")}},Dx=(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(n=>typeof n=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},vp=(t,e)=>{if(e=e.include.reduce((n,r)=>{let i=t.find(s=>(0,Ea.basename)(s.filePath)===r.name);if(i){let s=r["property-blocklist"];return n.include=n.include.filter(o=>o!==r),QY(t,i,n,s)??n}return console.warn(`Unable to find ${r}`),n},e),e["child-binding"]&&(e["child-binding"].include=Mx(e["child-binding"].include),e["child-binding"]=vp(t,e["child-binding"])),!e.include.length)return e},QY=(t,e,n,r=[])=>{let i=vp(t,e),s=vp(t,n);if(!i||!s)return;let o=new Set;Object.keys(i?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:i.properties?.[d]??{},h=s.properties?.[d]??{};a={...a,[d]:{...f,...h}}}),s.properties=a;let c=new Set;return Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(i).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=i[d]??[],h=s[d]??[];s[d]=Array.from([...f,...h])}),s},Mx=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],a_=class t{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(i=>!(i?.value instanceof Me)))return r?.values.map(i=>(i?.value).value)}getNodeTypes(e,n){let r=t.getNodeCompatible(n);if(!r)return[ws(n)];let i=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);if(i.length)return i;this.loadTypeAndCache(e);let s=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);return s.length?s:[ws(n)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(n=>{if(this.readFolders.indexOf(n)!==-1)return;this.readFolders.push(n);let i=Ms.sync("**/*.yaml",{cwd:n,ignore:"test/*"}).map(o=>{o=(0,Ea.resolve)(n,o);try{let a=Ix.default.parse((0,xx.readFileSync)(o,"utf-8"));return{...a,include:Mx(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=i.map(o=>vp(i,o)).filter(o=>!!o&&!o.include.length);ZY(s,this.typeCache)})}},Ax,Lx=()=>(Ax??=new a_,Ax),ZY=(t,e)=>t.forEach(n=>{let r=n.compatible??(n.filePath?(0,Ea.basename)(n.filePath,"yaml"):void 0);r&&e.set(r,i=>$x(n,i))}),$x=(t,e)=>{let n=ws(e);n.compatible=t.compatible??(t.filePath?(0,Ea.basename)(t.filePath,"yaml"):void 0),n.description=t.description,n.bindingsPath=t.filePath,n.bus=typeof t.bus=="string"?[t.bus]:t.bus,n.onBus=t["on-bus"];let i=Object.keys(t).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:t[s]}));if(t.properties&&Object.keys(t.properties).forEach(s=>{let o=t.properties[s];eK(n,s,o),n.cellsValues=i}),t["child-binding"]){let s=t["child-binding"];n.childNodeType=o=>$x(s,o)}return n},eK=(t,e,n)=>{let r=t.properties.find(i=>i.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>n.required?"required":"optional",r.values=()=>n.enum??[],r.constValue=Dx(n.type,n.const),r.bindingType=n.type;let i=r.additionalTypeCheck;r.additionalTypeCheck=(s,o)=>[...Ox(n,e,r)(s,o),...i?.(s,o)??[]]}else{let i=n.type==="compound"?r?.type:Cx(n.type);i??=Cx(n.type);let s=new Y(e,i,n.required?"required":"optional",void 0,n.enum);s.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...Ox(n,e,s)(o,a)];return s.signatureArgs??=r?.signatureArgs,s.signatureArgsCyclic??=!!r?.signatureArgsCyclic,c},s.description=n.description?[n.description]:r?.description,s.bindingType=n.type,s.constValue=Dx(n.type,n.const),t.addProperty(s)}},Ox=(t,e,n)=>{let r=t;return(i,s)=>{let o=i.parent.root,a=[];if(r.const){let c=i.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push($(24,i.ast.values??i.ast,Bn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push($(14,i.ast,Bn.DiagnosticSeverity.Warning,[],[Bn.DiagnosticTag.Deprecated],[i.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&we(i.ast.values)?.forEach(l=>{$n(l,o)||a.push($(22,l,Bn.DiagnosticSeverity.Error))}),r.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Me){let c=i.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push($(23,c,Bn.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=we(i.ast.values),l=0,u=[],d=0;for(;c&&l<c.length;){let f=c.at(l),h=$n(f,o);if(!h){a.push($(22,f??i.ast,Bn.DiagnosticSeverity.Error));break}let y="";e.endsWith("-gpios")?y="gpio":y=r["specifier-space"]??e.slice(0,-1);let p=h.getProperty(`#${y}-cells`);if(!p){a.push($(16,i.ast,Bn.DiagnosticSeverity.Error,[...h.nodeNameOrLabelRef],[],[i.name,`#${y}-cells`,`/${h.path.slice(1).join("/")}`]));break}let T=p?Re(p,0,0,s)??0:0,S=h.nodeType?.cellsValues?.find(w=>w.specifier===y)?.values;if(u.push([`${d}_phandel`,...S?.map(w=>`${d}_${w}`)??[],...Array.from({length:T-(S?.length??0)},(w,C)=>`${d}_cell${T-(S?.length??0)?C:""}`)]),1+T>c.length-l){a.push($(19,f??i.ast,Bn.DiagnosticSeverity.Error,[],[],[i.name,`<${u.at(-1).join(" ")}>`]));break}l+=1+T;let b=c.slice(l-T,l),v=h.getProperty(`${y}-map`);if(v){let w=h.getNexusMapEntyMatch(y,s,b);w?.match?i.nexusMapsTo.push({mappingValuesAst:b,mapItem:w.match}):a.push($(31,w.entry,Bn.DiagnosticSeverity.Error,[v.ast]))}d++}u.push([`${d}_phandel`,`${d}_cell...`]),n.signatureArgs=u.map(f=>f.map(h=>Bn.ParameterInformation.create(h)))}return a}};var qx=(t,e)=>({files:t,type:e,getNodeTypes:async n=>{switch(e){case"Zephyr":return Lx().getNodeTypes(t.zephyrBindings,n);case"DevicetreeOrg":return Rx().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n)}}});var Tp=K(J());var tK=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:Tp.FoldingRangeKind.Comment}],c_=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(c_):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Tp.FoldingRangeKind.Region},...t.nodes.flatMap(c_)],jx=t=>{let e=[];return[...t instanceof Fi?t.ifBlocks.map(n=>({start:(n.expression??n.keyword).lastToken,end:n.content?.lastToken??(n.expression??n.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(n=>{!n||!n.end||e.push({startLine:n.start.pos.line,startCharacter:n.start.pos.col,endLine:n.end.pos.line,endCharacter:n.end.pos.colEnd,kind:Tp.FoldingRangeKind.Region})}),e},nK=t=>t instanceof Ye?c_(t):t instanceof Mo||t instanceof Fi?jx(t):t instanceof Mi?tK(t):[];function Fx(t,e){return e.allAstItems.flatMap(n=>[n,...n.allDescendants]).filter(n=>ue(n.uri,t)).flatMap(nK)}var Ys=K(J());function rK(t){if(!t||!(t.ast instanceof Fe)&&!(t.ast instanceof Wt))return[];let e=n=>n.nodeType?.bindingsPath?[Ys.Location.create(he(n.nodeType.bindingsPath),Ys.Range.create(Ys.Position.create(0,0),Ys.Position.create(0,0)))]:[];return t.item instanceof ke&&!At(t.ast)?e(t.item):t.ast instanceof Wt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof Fe&&t.ast.linksTo?e(t.ast.linksTo):[]}async function Bx(t,e){return _t(t,e,n=>[...rK(n)])}var Sp=require("fs");var iK=(t,e)=>{qn().reset(t),qn().requestTokens(t,!0),e(t)},_p=class{constructor(e,n,r){this.file=e;this.cb=n;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,n=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),iK(e,n)},(0,Sp.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Sp.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var Xt=K(require("path")),l_=require("fs");var Rr=t=>{if(t)return Array.isArray(t)?t:[t]},sK=t=>({...t,deviceOrgBindingsMetaSchema:Rr(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Rr(t.deviceOrgTreeBindings),includePaths:Rr(t.includePaths),lockRenameEdits:Rr(t.lockRenameEdits),zephyrBindings:Rr(t.zephyrBindings),overlays:Rr(t.overlays)}),Ux=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Rr(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Rr(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Rr(t.defaultIncludePaths),defaultLockRenameEdits:Rr(t.defaultLockRenameEdits),defaultZephyrBindings:Rr(t.defaultZephyrBindings),contexts:t.contexts?.map(sK)}),sr=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),Ks={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},u_=async(t,e,n)=>{let r=(t.cwd?await sr(t.cwd,n):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(f=>sr(f,n))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(f=>sr(f,n))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>sr(f,n))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>sr(f,n))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(f=>sr(f,n)));r&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[];return r&&(s=s.map(f=>(0,Xt.resolve)(r,f)).filter(f=>(0,l_.existsSync)(f)),a=a?.map(f=>(0,Xt.resolve)(r,f)),c=c.map(f=>(0,Xt.resolve)(r,f)),i=i.map(f=>(0,Xt.resolve)(r,f)),u=(0,Xt.resolve)(r,u),d=d.map(f=>(0,Xt.resolve)(r,f)),l=l.map(f=>(0,Xt.resolve)(r,f))),{ctxName:t.ctxName??(0,Xt.basename)(u),cwd:r?nt(r):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)}},Ml=async(t,e)=>{let n=t.cwd?await sr(t.cwd,e):void 0,r=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>sr(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>sr(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>sr(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>sr(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>sr(d,e)));n&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Xt.resolve)(n,d)),r==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Xt.resolve)(n,d)),i=i.map(d=>(0,Xt.resolve)(n,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Xt.resolve)(n,d)),c=c.map(d=>(0,Xt.resolve)(n,d)));let l={cwd:n,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:t.autoChangeContext??Ks.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Ks.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>u_(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,l_.existsSync)(f)&&Xt.default.isAbsolute(f)));return{...l,contexts:u}};var tM=require("path");var Vx=t=>`DT_PROP(${d_(t.parent)}, ${t.name.replaceAll("-","_")}))`,zx=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var d_=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Wx=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),Hx=t=>{let e=[];return qo.getNodeFromPath(["aliases"],t.root)?.property.filter(i=>{if(i.ast.quickValues?.at(0)===t.pathString)return!0;let s=i.ast.values?.values.at(0)?.value;if(s instanceof be&&s.linksTo===t||s instanceof Ln&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function oK(t,e){if(!t||!(t.item instanceof ze)||!(t.ast instanceof Ge))return[];let n=[];if(e.settings.bindingType==="Zephyr"){n.push({type:"dt_zephyr_macro_prop_node_path",data:Vx(t.item)});let r=t.item;zx(t.item).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_label",data:i})})}return n}function aK(t,e){if(!t||t.item===null)return[];let n;if(t.item instanceof ke?n=t.item:t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo?n=t.ast.parentNode.linksTo:t.ast instanceof Fe&&t.ast.linksTo&&(n=t.ast.linksTo),!n)return[];let r=[{type:"path",data:n.pathString}];return e.settings.bindingType==="Zephyr"&&(Wx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_node_label",data:i})}),r.push({type:"dt_zephyr_macro_node_path",data:d_(n)}),Hx(n).forEach(i=>{r.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),r}async function Gx(t,e){return e?_t(t,e,n=>[...aK(n,e),...oK(n,e)]):[]}var Yx=K(J());function cK(t){return!t||!(t.item instanceof ze)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function lK(t){let e=Xa(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let r=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!r||!(r instanceof Ur))return;let i=r.params.map(o=>({label:o instanceof Ot?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:[Yx.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 Kx(t,e){if(e)return(await _t(t,e,async n=>[await lK(n)||cK(n)])).at(0)}var Ll=class{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,c,r,i)}diffWithOptionsObj(e,n,r,i){var s;let o=b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},a=n.length,c=e.length,l=1,u=a+c;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));let d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(h[0],n,e,0,r);if(h[0].oldPos+1>=c&&y+1>=a)return o(this.buildValues(h[0].lastComponent,n,e));let p=-1/0,T=1/0,S=()=>{for(let b=Math.max(p,-l);b<=Math.min(T,l);b+=2){let v,w=h[b-1],C=h[b+1];w&&(h[b-1]=void 0);let L=!1;if(C){let q=C.oldPos-b;L=C&&0<=q&&q<a}let B=w&&w.oldPos+1<c;if(!L&&!B){h[b]=void 0;continue}if(!B||L&&w.oldPos<C.oldPos?v=this.addToPath(C,!0,!1,0,r):v=this.addToPath(w,!1,!0,1,r),y=this.extractCommon(v,n,e,b,r),v.oldPos+1>=c&&y+1>=a)return o(this.buildValues(v.lastComponent,n,e))||!0;h[b]=v,v.oldPos+1>=c&&(T=Math.min(T,b-1)),y+1>=a&&(p=Math.max(p,b+1))}l++};if(i)(function b(){setTimeout(function(){if(l>u||Date.now()>f)return i(void 0);S()||b()},0)})();else for(;l<=u&&Date.now()<=f;){let b=S();if(b)return b}}addToPath(e,n,r,i,s){let o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){let o=n.length,a=r.length,c=e.oldPos,l=c-i,u=0;for(;l+1<o&&c+1<a&&this.equals(r[c+1],n[l+1],s);)l++,c++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){let i=[],s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();let o=i.length,a=0,c=0,l=0;for(;a<o;a++){let u=i[a];if(u.removed)u.value=this.join(r.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=n.slice(c,c+u.count);d=d.map(function(f,h){let y=r[l+h];return y.length>f.length?y:f}),u.value=this.join(d)}else u.value=this.join(n.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return i}};var f_=class extends Ll{constructor(){super(...arguments),this.tokenize=dK}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
|
298
|
+
`))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(`
|
|
299
|
+
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
|
|
300
|
+
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
301
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,r)}},uK=new f_;function h_(t,e,n){return uK.diff(t,e,n)}function dK(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
302
|
+
`));let n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){let s=r[i];i%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function p_(t,e,n,r,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:u}=a;h_(n,r,Object.assign(Object.assign({},a),{callback:d=>{let f=l(d);u(f)}}))}else return l(h_(n,r,a));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(b){return b.map(function(v){return" "+v})}let f=[],h=0,y=0,p=[],T=1,S=1;for(let b=0;b<u.length;b++){let v=u[b],w=v.lines||fK(v.value);if(v.lines=w,v.added||v.removed){if(!h){let C=u[b-1];h=T,y=S,C&&(p=c>0?d(C.lines.slice(-c)):[],h-=p.length,y-=p.length)}for(let C of w)p.push((v.added?"+":"-")+C);v.added?S+=w.length:T+=w.length}else{if(h)if(w.length<=c*2&&b<u.length-2)for(let C of d(w))p.push(C);else{let C=Math.min(w.length,c);for(let B of d(w.slice(0,C)))p.push(B);let L={oldStart:h,oldLines:T-h+C,newStart:y,newLines:S-y+C,lines:p};f.push(L),h=0,y=0,p=[]}T+=w.length,S+=w.length}}for(let b of f)for(let v=0;v<b.lines.length;v++)b.lines[v].endsWith(`
|
|
303
|
+
`)?b.lines[v]=b.lines[v].slice(0,-1):(b.lines.splice(v+1,0,"\"),v++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:f}}}function Ep(t){if(Array.isArray(t))return t.map(Ep).join(`
|
|
304
|
+
`);let e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let n=0;n<t.hunks.length;n++){let r=t.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),e.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(let i of r.lines)e.push(i)}return e.join(`
|
|
305
|
+
`)+`
|
|
306
|
+
`}function Xx(t,e,n,r,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;p_(t,e,n,r,i,s,Object.assign(Object.assign({},o),{callback:c=>{a(c?Ep(c):void 0)}}))}else{let a=p_(t,e,n,r,i,s,o);return a?Ep(a):void 0}}function m_(t,e,n,r,i,s){return Xx(t,t,e,n,r,i,s)}function fK(t){let e=t.endsWith(`
|
|
307
|
+
`),n=t.split(`
|
|
308
|
+
`).map(r=>r+`
|
|
309
|
+
`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var Jx=require("timers"),Qx=require("events");var g_=class extends Qx.EventEmitter{constructor(e=3e3,n=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,Jx.setInterval)(()=>{let r=process.memoryUsage().heapUsed;r>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(r/1024/1024).toFixed(2),thresholdMb:e})},n)}stop(){clearInterval(this.interval)}},hK=new g_(3e3),Zx=()=>{hK.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),gR(),mR()})};var Le=[],Ue,ka,kp=new WeakMap,wp=new Map;Zx();var nM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>{wp.has(e)||wp.set(e,new _p(e,S_,n=>!!Np(n))),wp.get(e)?.watch()})},T_=async t=>{let e=Le.indexOf(t);if(e===-1)return;Pp(t,void 0,!0),kp.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let n=await Xs(t);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Ue===t,type:n.type}),Le.splice(e,1),await w_(),t===Ue&&(Ue=void 0,Le.length)){let r=ka?hr(Le,{uri:ka}):void 0;r??=Le[0],console.log("Active context was deleted. Forcing active to",r.id),await Mt({id:r.id},!0)}rM(t)},rM=async t=>{await t.stable(),t.getContextFiles().forEach(e=>wp.get(e)?.unwatch())},pK=t=>{let e=kp.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},$e=async()=>{await Promise.all(Le.map(pK))},__=async t=>(await iM()).indexOf(t)!==-1,iM=async()=>{let t=await sM();return Le.filter(e=>!t.some(n=>n===e))},sM=async()=>{let t=await v_();return Le.filter(e=>t.contexts.find(n=>ai(n)===e.id))},mK=async()=>{let t=await TK();return Le.filter(e=>t.contexts.find(n=>ai(n)===e.id))},gK=async t=>(await mK()).indexOf(t)!==-1,yK=async(t,e)=>{if(t===e)return!0;let n=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),r=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return r.some(i=>ue(i.resolvedPath,t.parser.uri))&&n.length?n.every(i=>r.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=>ue(i,t.parser.uri))},bK=async t=>{if(!await __(t))return;let e=await iM(),n=await sM(),r=await Bd(e);if(Le.indexOf(t)===-1)return;let i=await Promise.all(r.flatMap(a=>[...n,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await yK(a.context,c)})))),s=t.getContextFiles(),o=r.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&ue(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(T_)},ee=(0,rt.createConnection)(rt.ProposedFeatures.all),Cr=new rt.TextDocuments(ko),oM=!1,y_=!1,aM=!1,cM=!1,lM=!1,b_;ee.onInitialize(t=>{b_=t.workspaceFolders??[],ee.console.log(`[Server(${process.pid}) ${b_?.at(0)?.uri} Version 0.4.3 ] Started and initialize received`);let e=t.capabilities;oM=!!(e.workspace&&e.workspace.configuration),y_=!!(e.workspace&&e.workspace.workspaceFolders),aM=!!e.workspace?.diagnostics?.refreshSupport,cM=!!e.workspace?.semanticTokens?.refreshSupport,lM=!!e.workspace?.foldingRange?.refreshSupport;let n={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:rt.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[rt.CodeActionKind.QuickFix,rt.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:Td,tokenModifiers:_d},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return y_&&(n.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),n});ee.onInitialized(()=>{oM&&ee.client.register(rt.DidChangeConfigurationNotification.type,{}),y_&&ee.workspace.onDidChangeWorkspaceFolders(async t=>{ee.console.log("Workspace folder change event received"),await Fl()})});var vK=async()=>{let t=uM();return t={...Ks,...t},Ml(t,await jl())},v_=async()=>{let t=EK();return t={...Ks,...t},Ml(t,await jl())},TK=async()=>{let t=wK();return t={...Ks,...t},Ml(t,await jl())},ql=async()=>{let t=SK();return t={...Ks,...t},Ml(t,await jl())},_K=new Map,jl=async()=>(await ee.workspace.getWorkspaceFolders()??b_)?.map(e=>Ve(e.uri))?.at(0),eM=async t=>{let e=hr(Le,{id:ai(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 n=ai(t);console.log(`(ID: ${n}) New context [${t.ctxName}]`),console.log(`(ID: ${n}) Settings: ${JSON.stringify(t,void 0," ")}`);let r=new gf(t,t.bindingType?qx({zephyrBindings:t.zephyrBindings??[],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Le.push(r),nM(r),await r.stable();let i=await Xs(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(s=>s.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Ue,type:i.type}),await bK(r),await w_(),r},Fl=async()=>{let t=await v_(),e=await ql();e.allowAdhocContexts||(e=await v_());let n=e.contexts.map(ai);Le.filter(i=>!n.includes(i.id)).forEach(T_),await t.contexts?.reduce((i,s)=>i.then(async()=>{await eM(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await vK()).contexts?.reduce((s,o)=>s.then(async()=>{hr(Le,{uri:o.dtsFile})||await eM(o)}),Promise.resolve()),ka?await Mt({uri:ka}):!Ue&&Le.length&&(console.log(`No active context using first context (ID: ${Le[0].id}) [${Le[0].ctxNames.join(",")}]`),await Mt({id:Le[0].id}))},or,cs,$l=new Map,wa=new Map,SK=()=>!cs&&!or?void 0:{...cs,...or,contexts:[...or?.contexts??[],...Array.from(wa.values()),...Array.from($l.values())]},uM=()=>!cs&&!or?void 0:{...cs,...or,contexts:[...Array.from($l.values())]},EK=()=>!cs&&!or?void 0:{...cs,...or,contexts:[...or?.contexts??[],...Array.from(wa.values())]},wK=()=>!cs&&!or?void 0:{...or,contexts:[...or?.contexts??[]]};function kK(t){let e={...t};for(let n in e)e[n]===null&&delete e[n];return e}var dM=async()=>{let t=await ql();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ee.sendNotification("devicetree/settingsChanged",t),await Fl(),$e().then(()=>{aM&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(or=Ux(kK(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await dM())});var fM=()=>{let t=Ue?.getContextFiles();Array.from(Cr.keys()).forEach(e=>{t?.some(n=>ue(n,Ve(e)))||ee.sendDiagnostics({uri:e,version:Cr.get(e)?.version,diagnostics:[{severity:rt.DiagnosticSeverity.Warning,range:rt.Range.create(rt.Position.create(0,0),rt.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},S_=async t=>{let e=Ig(Le,t);if(e.length)e.forEach(n=>{kp.get(n)?.abort.abort();let r=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(r.signal.aborted){s();return}let o=performance.now(),a=Ue===n,c=a?hM(n):[];rM(n),await n.reevaluate(t),nM(n),a&&E_(n).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));Pp(n,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),s(),console.log("reevaluate",performance.now()-o)},50)});kp.set(n,{abort:r,promise:i})});else{if((await ql()).allowAdhocContexts===!1)return;await Fl(),await Mt({uri:t})}},NK=t=>Cr.keys().find(e=>ue(Ve(e),t)),Np=t=>{let e=NK(t);if(e)return Cr.get(e)},hM=t=>t.getContextFiles().map(e=>({uri:he(e),version:Np(e)?.version,diagnostics:[]})),Pp=async(t,e=hM(t),n=!1)=>{!n&&t!==Ue||await Promise.all(e.filter(r=>t===Ue||!Ue?.getContextFiles().some(i=>ue(Ve(r.uri),i))).map(r=>ee.sendDiagnostics({uri:r.uri,version:Cr.get(r.uri)?.version,diagnostics:[]})))},E_=async t=>{await t.stable();let e=performance.now(),n=await t.getDiagnostics(),r=t.getContextFiles().map(i=>({uri:he(i),kind:rt.DocumentDiagnosticReportKind.Full,items:n.get(i)??[],version:Np(i)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},w_=async()=>{let t=await Promise.all(Le.map(Xs));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Ue===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Xs=async t=>{let e=await __(t),n=!e&&await gK(t);return{ctx:t,type:e?"Ad Hoc":n?"User":"3rd Party"}},Mt=async(t,e=!1)=>{"uri"in t&&(ka=t.uri,console.log("Active File Uri",ka));let n=await ql();if(await $e(),Ue&&!e&&!n.autoChangeContext||!e&&Ue?.getContextFiles().find(s=>"uri"in t&&ue(s,t.uri)))return!1;let r=Ue,i=hr(Le,t);return r!==i&&(r&&Pp(r),Ue=i,i?(Xs(i).then(async s=>{let o=await i.getFileTree();i!==Ue&&!Le.includes(i)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(a=>a.toString()),id:i.id,...o,settings:i.settings,active:Ue===i,type:s.type})}),E_(i).then(s=>{s.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await w_()):ee.sendNotification("devicetree/newActiveContext",void 0)),lM&&ee.languages.foldingRange.refresh(),cM&&ee.languages.semanticTokens.refresh(),fM(),!0};Cr.listen(ee);Cr.onDidClose(async t=>{let e=Ve(t.document.uri),n=Ig(Le,e);if(n.length===0){$l.delete(e),ee.sendDiagnostics({uri:t.document.uri,version:Cr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(n.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>Np(o))?Ue?.getContextFiles().some(o=>ue(o,e))||ee.sendDiagnostics({uri:t.document.uri,version:Cr.get(t.document.uri)?.version,diagnostics:[]}):await __(r)?(T_(r),$l.delete(r.settings.dtsFile)):Pp(r)})),_K.delete(t.document.uri)});Cr.onDidOpen(async t=>{await $e(),fM();let e=Ve(t.document.uri),n=hr(Le,{uri:e});if(n)n!==Ue&&await Mt({id:n.id});else{let r={ctxName:(0,tM.basename)(e),dtsFile:e};$l.set(e,r),await S_(e)}});Cr.onDidChangeContent(async t=>{let e=Ve(t.document.uri),n=t.document.getText(),r=qn();r.needsRenew(e,n)&&(console.log("Content changed"),r.renewLexer(e,n),await S_(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await $e();let t=Ue;return t?E_(t):{items:[]}});ee.onDidChangeWatchedFiles(t=>{ee.console.log("We received a file change event")});ee.onCompletion(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return n?[...await NR(t,n),...await LR(t,n)]:[]});ee.onCompletionResolve(t=>t);var cn=t=>{let e=uM();return hr(Le,{uri:t},Ue,e?.preferredContext)};ee.onDocumentSymbol(async t=>{await $e();let e=Ve(t.textDocument.uri),n=cn(e);return n?n.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await $e();let t=Ue;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async t=>{try{await $e();let e=Ve(t.textDocument.uri),n=cn(e),r=new rt.SemanticTokensBuilder,i=n?.isInContext(e);return!n||!i?{data:[]}:((await n.getAllParsers()).forEach(s=>s.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async t=>{await $e();let e=Ve(t.textDocument.uri);return cn(e)?.getDocumentLinks(e)});ee.onPrepareRename(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return OR(t,n)});ee.onRenameRequest(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return AR(t,n)});ee.onReferences(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return PR(t,n)});ee.onDefinition(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e),r=(await n?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>rt.Location.create(i.target,i.range))??[];return r.length?r:IR(t,n)});ee.onDeclaration(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return xR(t,n)});ee.onCodeAction(async t=>MR(t));ee.onDocumentFormatting(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return n?Lg(t,n,qn().getDocument(e).getText()):[]});ee.onHover(async t=>{await $e();let e=Ve(t.textDocument.uri),n=cn(e);return(await $R(t,n)).at(0)});ee.onFoldingRanges(async t=>{await $e();let e=Ve(t.textDocument.uri),n=cn(e),r=n?.isInContext(e);if(!n||!r)return[];let i=(await n.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?Fx(e,i):[]});ee.onTypeDefinition(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return Bx(t,n)});ee.onSignatureHelp(async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);return Kx(t,n)});ee.onRequest("devicetree/getContexts",async()=>(await $e(),Promise.all(Le.map(async t=>{let e=await Xs(t);return{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Ue===t,type:e.type}}))));ee.onRequest("devicetree/setActive",async t=>(await $e(),console.log("devicetree/setActive",t),await Mt(t,!0)));ee.onRequest("devicetree/getActiveContext",async t=>{if(await $e(),console.log("devicetree/getActiveContext",t),await Mt({id:t},!0),!Ue)return;let e=await Xs(Ue);return Ue?{ctxNames:Ue.ctxNames.map(n=>n.toString()),id:t,...await Ue.getFileTree(),settings:Ue.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async t=>{await $e(),cs=t,console.log("Integration Settings",t),await dM()});ee.onRequest("devicetree/requestContext",async t=>{await $e();let e=await ql(),n=await u_(t,e,await jl());console.log("devicetree/requestContext",n);let r=ai(n),i=Array.from(wa).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];hr(Le,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),wa.delete(i[0])}wa.set(`${r}:${t.ctxName}`,t),await Fl();let s=Le.find(a=>a.id===r);if(!s)throw new Error("Failed to create context");let o=await Xs(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:r,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await $e(),wa.delete(`${t}:${e}`);let n=hr(Le,{id:t});if(n){if(n.removeCtxName(e),n.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Fl()}});ee.onRequest("devicetree/compiledDtsOutput",async t=>(await $e(),t?hr(Le,{id:t})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async t=>(await $e(),t?hr(Le,{id:t})?.serialize():void 0));ee.onRequest("devicetree/customActions",async t=>(await $e(),Gx(t,Ue)));ee.onRequest("devicetree/activeFileUri",async t=>{await $e(),Mt({uri:t})});ee.onRequest("devicetree/formatingDiff",async t=>{await $e();let e=Ve(t.textDocument.uri);Mt({uri:e});let n=cn(e);if(!n)return[];let r=qn().getDocument(e),i=await Lg(t,n,r.getText());if(i.length===0)return;let s=hN(r,i);return m_(r.uri,r.getText(),s)});ee.onRequest("devicetree/diagnosticIssues",async t=>{await $e();let e=Ve(t.uri);Mt({uri:e});let n=cn(e);if(!n)return[];let r=(await n.getDiagnostics()).get(e);if(r?.length)return r});
|