devicetree-language-server 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -1
- package/dist/server.js +171 -153
- package/package.json +6 -2
package/dist/server.js
CHANGED
|
@@ -1,186 +1,193 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Pw=Object.create;var Rp=Object.defineProperty;var Dw=Object.getOwnPropertyDescriptor;var Rw=Object.getOwnPropertyNames;var Cw=Object.getPrototypeOf,Ow=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Aw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Rw(e))!Ow.call(n,r)&&r!==t&&Rp(n,r,{get:()=>e[r],enumerable:!(i=Dw(e,r))||i.enumerable});return n};var z=(n,e,t)=>(t=n!=null?Pw(Cw(n)):{},Aw(e||!n||!n.__esModule?Rp(t,"default",{value:n,enumerable:!0}):t,n));var Ho=C(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.thenable=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function Iw(n){return n===!0||n===!1}Ye.boolean=Iw;function Cp(n){return typeof n=="string"||n instanceof String}Ye.string=Cp;function Lw(n){return typeof n=="number"||n instanceof Number}Ye.number=Lw;function xw(n){return n instanceof Error}Ye.error=xw;function Op(n){return typeof n=="function"}Ye.func=Op;function Ap(n){return Array.isArray(n)}Ye.array=Ap;function Mw(n){return Ap(n)&&n.every(e=>Cp(e))}Ye.stringArray=Mw;function qw(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=qw;function Fw(n){return n&&Op(n.then)}Ye.thenable=Fw});var or=C(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function Bw(n){return n===!0||n===!1}mt.boolean=Bw;function Ip(n){return typeof n=="string"||n instanceof String}mt.string=Ip;function jw(n){return typeof n=="number"||n instanceof Number}mt.number=jw;function Uw(n){return n instanceof Error}mt.error=Uw;function $w(n){return typeof n=="function"}mt.func=$w;function Lp(n){return Array.isArray(n)}mt.array=Lp;function Ww(n){return Lp(n)&&n.every(e=>Ip(e))}mt.stringArray=Ww});var Ou=C(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Message=Y.NotificationType9=Y.NotificationType8=Y.NotificationType7=Y.NotificationType6=Y.NotificationType5=Y.NotificationType4=Y.NotificationType3=Y.NotificationType2=Y.NotificationType1=Y.NotificationType0=Y.NotificationType=Y.RequestType9=Y.RequestType8=Y.RequestType7=Y.RequestType6=Y.RequestType5=Y.RequestType4=Y.RequestType3=Y.RequestType2=Y.RequestType1=Y.RequestType=Y.RequestType0=Y.AbstractMessageSignature=Y.ParameterStructures=Y.ResponseError=Y.ErrorCodes=void 0;var Ii=or(),au;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(au||(Y.ErrorCodes=au={}));var cu=class n extends Error{constructor(e,t,i){super(t),this.code=Ii.number(e)?e:au.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Y.ResponseError=cu;var Pt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Y.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var Oe=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Pt.auto}};Y.AbstractMessageSignature=Oe;var lu=class extends Oe{constructor(e){super(e,0)}};Y.RequestType0=lu;var uu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType=uu;var fu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType1=fu;var du=class extends Oe{constructor(e){super(e,2)}};Y.RequestType2=du;var hu=class extends Oe{constructor(e){super(e,3)}};Y.RequestType3=hu;var pu=class extends Oe{constructor(e){super(e,4)}};Y.RequestType4=pu;var mu=class extends Oe{constructor(e){super(e,5)}};Y.RequestType5=mu;var gu=class extends Oe{constructor(e){super(e,6)}};Y.RequestType6=gu;var yu=class extends Oe{constructor(e){super(e,7)}};Y.RequestType7=yu;var bu=class extends Oe{constructor(e){super(e,8)}};Y.RequestType8=bu;var Tu=class extends Oe{constructor(e){super(e,9)}};Y.RequestType9=Tu;var vu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType=vu;var Su=class extends Oe{constructor(e){super(e,0)}};Y.NotificationType0=Su;var ku=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType1=ku;var Eu=class extends Oe{constructor(e){super(e,2)}};Y.NotificationType2=Eu;var wu=class extends Oe{constructor(e){super(e,3)}};Y.NotificationType3=wu;var Nu=class extends Oe{constructor(e){super(e,4)}};Y.NotificationType4=Nu;var _u=class extends Oe{constructor(e){super(e,5)}};Y.NotificationType5=_u;var Pu=class extends Oe{constructor(e){super(e,6)}};Y.NotificationType6=Pu;var Du=class extends Oe{constructor(e){super(e,7)}};Y.NotificationType7=Du;var Ru=class extends Oe{constructor(e){super(e,8)}};Y.NotificationType8=Ru;var Cu=class extends Oe{constructor(e){super(e,9)}};Y.NotificationType9=Cu;var xp;(function(n){function e(r){let s=r;return s&&Ii.string(s.method)&&(Ii.string(s.id)||Ii.number(s.id))}n.isRequest=e;function t(r){let s=r;return s&&Ii.string(s.method)&&r.id===void 0}n.isNotification=t;function i(r){let s=r;return s&&(s.result!==void 0||!!s.error)&&(Ii.string(s.id)||Ii.number(s.id)||s.id===null)}n.isResponse=i})(xp||(Y.Message=xp={}))});var Iu=C(Kn=>{"use strict";var Mp;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LRUCache=Kn.LinkedMap=Kn.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt||(Kn.Touch=gt={}));var Yo=class{constructor(){this[Mp]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=gt.None){let i=this._map.get(e);if(i)return t!==gt.None&&this.touch(i,t),i.value}set(e,t,i=gt.None){let r=this._map.get(e);if(r)r.value=t,i!==gt.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case gt.None:this.addItemLast(r);break;case gt.First:this.addItemFirst(r);break;case gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.key,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}values(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.value,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}entries(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:[t.key,t.value],done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}[(Mp=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Kn.LinkedMap=Yo;var Au=class extends Yo{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Kn.LRUCache=Au});var Fp=C(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Disposable=void 0;var qp;(function(n){function e(t){return{dispose:t}}n.create=e})(qp||(Ko.Disposable=qp={}))});var zn=C(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});var Lu;function xu(){if(Lu===void 0)throw new Error("No runtime abstraction layer installed");return Lu}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Lu=t}n.install=e})(xu||(xu={}));Mu.default=xu});var cr=C(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.Emitter=ar.Event=void 0;var Vw=zn(),Bp;(function(n){let e={dispose(){}};n.None=function(){return e}})(Bp||(ar.Event=Bp={}));var qu=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let r=0,s=this._callbacks.length;r<s;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),r=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(r[s],e))}catch(a){(0,Vw.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},zo=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new qu),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ar.Emitter=zo;zo._noop=function(){}});var Qo=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CancellationTokenSource=lr.CancellationToken=void 0;var Hw=zn(),Yw=or(),Fu=cr(),Go;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Fu.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Fu.Event.None});function e(t){let i=t;return i&&(i===n.None||i===n.Cancelled||Yw.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Go||(lr.CancellationToken=Go={}));var Kw=Object.freeze(function(n,e){let t=(0,Hw.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Xo=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?Kw:(this._emitter||(this._emitter=new Fu.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Bu=class{get token(){return this._token||(this._token=new Xo),this._token}cancel(){this._token?this._token.cancel():this._token=Go.Cancelled}dispose(){this._token?this._token instanceof Xo&&this._token.dispose():this._token=Go.None}};lr.CancellationTokenSource=Bu});var jp=C(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.SharedArrayReceiverStrategy=ur.SharedArraySenderStrategy=void 0;var zw=Qo(),hs;(function(n){n.Continue=0,n.Cancelled=1})(hs||(hs={}));var ju=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=hs.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let i=this.buffers.get(t);if(i===void 0)return;let r=new Int32Array(i,0,1);Atomics.store(r,0,hs.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};ur.SharedArraySenderStrategy=ju;var Uu=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===hs.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$u=class{constructor(e){this.token=new Uu(e)}cancel(){}dispose(){}},Wu=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new zw.CancellationTokenSource:new $u(t)}};ur.SharedArrayReceiverStrategy=Wu});var Hu=C(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Semaphore=void 0;var Gw=zn(),Vu=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Gw.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Jo.Semaphore=Vu});var $p=C(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ReadableStreamMessageReader=Gn.AbstractMessageReader=Gn.MessageReader=void 0;var Ku=zn(),fr=or(),Yu=cr(),Xw=Hu(),Up;(function(n){function e(t){let i=t;return i&&fr.func(i.listen)&&fr.func(i.dispose)&&fr.func(i.onError)&&fr.func(i.onClose)&&fr.func(i.onPartialMessage)}n.is=e})(Up||(Gn.MessageReader=Up={}));var Zo=class{constructor(){this.errorEmitter=new Yu.Emitter,this.closeEmitter=new Yu.Emitter,this.partialMessageEmitter=new Yu.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: ${fr.string(e.message)?e.message:"unknown"}`)}};Gn.AbstractMessageReader=Zo;var zu;(function(n){function e(t){let i,r,s,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Ku.default)().applicationJson.decoder,c.set(a.name,a)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(zu||(zu={}));var Gu=class extends Zo{constructor(e,t){super(),this.readable=e,this.options=zu.fromOptions(t),this.buffer=(0,Ku.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Xw.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let r=i.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(
|
|
4
|
-
`,
|
|
5
|
-
`,
|
|
6
|
-
${u}`);let
|
|
7
|
-
${JSON.stringify(
|
|
8
|
-
${JSON.stringify(
|
|
2
|
+
"use strict";var SO=Object.create;var Jf=Object.defineProperty;var wO=Object.getOwnPropertyDescriptor;var EO=Object.getOwnPropertyNames;var kO=Object.getPrototypeOf,NO=Object.prototype.hasOwnProperty;var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),PO=(n,e)=>{for(var t in e)Jf(n,t,{get:e[t],enumerable:!0})},RO=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of EO(e))!NO.call(n,s)&&s!==t&&Jf(n,s,{get:()=>e[s],enumerable:!(r=wO(e,s))||r.enumerable});return n};var G=(n,e,t)=>(t=n!=null?SO(kO(n)):{},RO(e||!n||!n.__esModule?Jf(t,"default",{value:n,enumerable:!0}):t,n));var Zc=w(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.thenable=at.typedArray=at.stringArray=at.array=at.func=at.error=at.number=at.string=at.boolean=void 0;function DO(n){return n===!0||n===!1}at.boolean=DO;function Tv(n){return typeof n=="string"||n instanceof String}at.string=Tv;function CO(n){return typeof n=="number"||n instanceof Number}at.number=CO;function OO(n){return n instanceof Error}at.error=OO;function _v(n){return typeof n=="function"}at.func=_v;function Sv(n){return Array.isArray(n)}at.array=Sv;function AO(n){return Sv(n)&&n.every(e=>Tv(e))}at.stringArray=AO;function IO(n,e){return Array.isArray(n)&&n.every(e)}at.typedArray=IO;function $O(n){return n&&_v(n.then)}at.thenable=$O});var yi=w(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.stringArray=Lt.array=Lt.func=Lt.error=Lt.number=Lt.string=Lt.boolean=void 0;function MO(n){return n===!0||n===!1}Lt.boolean=MO;function wv(n){return typeof n=="string"||n instanceof String}Lt.string=wv;function LO(n){return typeof n=="number"||n instanceof Number}Lt.number=LO;function qO(n){return n instanceof Error}Lt.error=qO;function xO(n){return typeof n=="function"}Lt.func=xO;function Ev(n){return Array.isArray(n)}Lt.array=Ev;function jO(n){return Ev(n)&&n.every(e=>wv(e))}Lt.stringArray=jO});var _h=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 Cs=yi(),Xf;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(Xf||(z.ErrorCodes=Xf={}));var Qf=class n extends Error{constructor(e,t,r){super(t),this.code=Cs.number(e)?e:Xf.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};z.ResponseError=Qf;var Xt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};z.ParameterStructures=Xt;Xt.auto=new Xt("auto");Xt.byPosition=new Xt("byPosition");Xt.byName=new Xt("byName");var We=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Xt.auto}};z.AbstractMessageSignature=We;var Zf=class extends We{constructor(e){super(e,0)}};z.RequestType0=Zf;var eh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType=eh;var th=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType1=th;var nh=class extends We{constructor(e){super(e,2)}};z.RequestType2=nh;var rh=class extends We{constructor(e){super(e,3)}};z.RequestType3=rh;var sh=class extends We{constructor(e){super(e,4)}};z.RequestType4=sh;var ih=class extends We{constructor(e){super(e,5)}};z.RequestType5=ih;var oh=class extends We{constructor(e){super(e,6)}};z.RequestType6=oh;var ah=class extends We{constructor(e){super(e,7)}};z.RequestType7=ah;var ch=class extends We{constructor(e){super(e,8)}};z.RequestType8=ch;var lh=class extends We{constructor(e){super(e,9)}};z.RequestType9=lh;var uh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType=uh;var dh=class extends We{constructor(e){super(e,0)}};z.NotificationType0=dh;var fh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType1=fh;var hh=class extends We{constructor(e){super(e,2)}};z.NotificationType2=hh;var ph=class extends We{constructor(e){super(e,3)}};z.NotificationType3=ph;var mh=class extends We{constructor(e){super(e,4)}};z.NotificationType4=mh;var gh=class extends We{constructor(e){super(e,5)}};z.NotificationType5=gh;var yh=class extends We{constructor(e){super(e,6)}};z.NotificationType6=yh;var bh=class extends We{constructor(e){super(e,7)}};z.NotificationType7=bh;var vh=class extends We{constructor(e){super(e,8)}};z.NotificationType8=vh;var Th=class extends We{constructor(e){super(e,9)}};z.NotificationType9=Th;var kv;(function(n){function e(s){let i=s;return i&&Cs.string(i.method)&&(Cs.string(i.id)||Cs.number(i.id))}n.isRequest=e;function t(s){let i=s;return i&&Cs.string(i.method)&&s.id===void 0}n.isNotification=t;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(Cs.string(i.id)||Cs.number(i.id)||i.id===null)}n.isResponse=r})(kv||(z.Message=kv={}))});var wh=w(Fr=>{"use strict";var Nv;Object.defineProperty(Fr,"__esModule",{value:!0});Fr.LRUCache=Fr.LinkedMap=Fr.Touch=void 0;var qt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(qt||(Fr.Touch=qt={}));var el=class{constructor(){this[Nv]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=qt.None){let r=this._map.get(e);if(r)return t!==qt.None&&this.touch(r,t),r.value}set(e,t,r=qt.None){let s=this._map.get(e);if(s)s.value=t,r!==qt.None&&this.touch(s,r);else{switch(s={key:e,value:t,next:void 0,previous:void 0},r){case qt.None:this.addItemLast(s);break;case qt.First:this.addItemFirst(s);break;case qt.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 t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,s=this._head;for(;s;){if(t?e.bind(t)(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,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}[(Nv=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==qt.First&&t!==qt.Last)){if(t===qt.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(t===qt.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((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};Fr.LinkedMap=el;var Sh=class extends el{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=qt.AsNew){return super.get(e,t)}peek(e){return super.get(e,qt.None)}set(e,t){return super.set(e,t,qt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Fr.LRUCache=Sh});var Rv=w(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.Disposable=void 0;var Pv;(function(n){function e(t){return{dispose:t}}n.create=e})(Pv||(tl.Disposable=Pv={}))});var Br=w(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var Eh;function kh(){if(Eh===void 0)throw new Error("No runtime abstraction layer installed");return Eh}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Eh=t}n.install=e})(kh||(kh={}));Nh.default=kh});var vi=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Emitter=bi.Event=void 0;var FO=Br(),Dv;(function(n){let e={dispose(){}};n.None=function(){return e}})(Dv||(bi.Event=Dv={}));var Ph=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=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]===t){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 t=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{t.push(r[i].apply(s[i],e))}catch(a){(0,FO.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},nl=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new Ph),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=n._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)}};bi.Emitter=nl;nl._noop=function(){}});var il=w(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CancellationTokenSource=Ti.CancellationToken=void 0;var BO=Br(),UO=yi(),Rh=vi(),rl;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Rh.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Rh.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||UO.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(rl||(Ti.CancellationToken=rl={}));var VO=Object.freeze(function(n,e){let t=(0,BO.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),sl=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?VO:(this._emitter||(this._emitter=new Rh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Dh=class{get token(){return this._token||(this._token=new sl),this._token}cancel(){this._token?this._token.cancel():this._token=rl.Cancelled}dispose(){this._token?this._token instanceof sl&&this._token.dispose():this._token=rl.None}};Ti.CancellationTokenSource=Dh});var Cv=w(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.SharedArrayReceiverStrategy=_i.SharedArraySenderStrategy=void 0;var WO=il(),Wo;(function(n){n.Continue=0,n.Cancelled=1})(Wo||(Wo={}));var Ch=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=Wo.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Wo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};_i.SharedArraySenderStrategy=Ch;var Oh=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Wo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ah=class{constructor(e){this.token=new Oh(e)}cancel(){}dispose(){}},Ih=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new WO.CancellationTokenSource:new Ah(t)}};_i.SharedArrayReceiverStrategy=Ih});var Mh=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.Semaphore=void 0;var HO=Br(),$h=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,HO.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};ol.Semaphore=$h});var Av=w(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ReadableStreamMessageReader=Ur.AbstractMessageReader=Ur.MessageReader=void 0;var qh=Br(),Si=yi(),Lh=vi(),KO=Mh(),Ov;(function(n){function e(t){let r=t;return r&&Si.func(r.listen)&&Si.func(r.dispose)&&Si.func(r.onError)&&Si.func(r.onClose)&&Si.func(r.onPartialMessage)}n.is=e})(Ov||(Ur.MessageReader=Ov={}));var al=class{constructor(){this.errorEmitter=new Lh.Emitter,this.closeEmitter=new Lh.Emitter,this.partialMessageEmitter=new Lh.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: ${Si.string(e.message)?e.message:"unknown"}`)}};Ur.AbstractMessageReader=al;var xh;(function(n){function e(t){let r,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(i=t.contentDecoder,o.set(i.name,i)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,qh.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(xh||(xh={}));var jh=class extends al{constructor(e,t){super(),this.readable=e,this.options=xh.fromOptions(t),this.buffer=(0,qh.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new KO.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}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 i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===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(t):t,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).catch(r=>{this.fireError(r)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,qh.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Ur.ReadableStreamMessageReader=jh});var qv=w(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.WriteableStreamMessageWriter=Vr.AbstractMessageWriter=Vr.MessageWriter=void 0;var Iv=Br(),Ho=yi(),zO=Mh(),$v=vi(),GO="Content-Length: ",Mv=`\r
|
|
4
|
+
`,Lv;(function(n){function e(t){let r=t;return r&&Ho.func(r.dispose)&&Ho.func(r.onClose)&&Ho.func(r.onError)&&Ho.func(r.write)}n.is=e})(Lv||(Vr.MessageWriter=Lv={}));var cl=class{constructor(){this.errorEmitter=new $v.Emitter,this.closeEmitter=new $v.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,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: ${Ho.string(e.message)?e.message:"unknown"}`)}};Vr.AbstractMessageWriter=cl;var Fh;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Iv.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Iv.default)().applicationJson.encoder}}n.fromOptions=e})(Fh||(Fh={}));var Bh=class extends cl{constructor(e,t){super(),this.writable=e,this.options=Fh.fromOptions(t),this.errorCount=0,this.writeSemaphore=new zO.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 s=[];return s.push(GO,r.byteLength.toString(),Mv),s.push(Mv),this.doWrite(e,s,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Vr.WriteableStreamMessageWriter=Bh});var xv=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.AbstractMessageBuffer=void 0;var YO=13,JO=10,XO=`\r
|
|
5
|
+
`,Uh=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,r=0,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case YO:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case JO:switch(t){case 1:t=2;break;case 3:t=4,s++;break e;default:t=0}break;default:t=0}s++}i+=l.byteLength,r++}if(t!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(XO);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),m=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,m)}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 i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);t.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else t.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return t}};ll.AbstractMessageBuffer=Uh});var Vv=w(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.createMessageConnection=ie.ConnectionOptions=ie.MessageStrategy=ie.CancellationStrategy=ie.CancellationSenderStrategy=ie.CancellationReceiverStrategy=ie.RequestCancellationReceiverStrategy=ie.IdCancellationReceiverStrategy=ie.ConnectionStrategy=ie.ConnectionError=ie.ConnectionErrors=ie.LogTraceNotification=ie.SetTraceNotification=ie.TraceFormat=ie.TraceValues=ie.Trace=ie.NullLogger=ie.ProgressType=ie.ProgressToken=void 0;var jv=Br(),Ze=yi(),Q=_h(),Fv=wh(),Ko=vi(),Vh=il(),Yo;(function(n){n.type=new Q.NotificationType("$/cancelRequest")})(Yo||(Yo={}));var Wh;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Wh||(ie.ProgressToken=Wh={}));var zo;(function(n){n.type=new Q.NotificationType("$/progress")})(zo||(zo={}));var Hh=class{constructor(){}};ie.ProgressType=Hh;var Kh;(function(n){function e(t){return Ze.func(t)}n.is=e})(Kh||(Kh={}));ie.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ne;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(Ne||(ie.Trace=Ne={}));var Bv;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(Bv||(ie.TraceValues=Bv={}));(function(n){function e(r){if(!Ze.string(r))return n.Off;switch(r=r.toLowerCase(),r){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(r){switch(r){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(Ne||(ie.Trace=Ne={}));var dn;(function(n){n.Text="text",n.JSON="json"})(dn||(ie.TraceFormat=dn={}));(function(n){function e(t){return Ze.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(dn||(ie.TraceFormat=dn={}));var zh;(function(n){n.type=new Q.NotificationType("$/setTrace")})(zh||(ie.SetTraceNotification=zh={}));var ul;(function(n){n.type=new Q.NotificationType("$/logTrace")})(ul||(ie.LogTraceNotification=ul={}));var Go;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(Go||(ie.ConnectionErrors=Go={}));var wi=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};ie.ConnectionError=wi;var Gh;(function(n){function e(t){let r=t;return r&&Ze.func(r.cancelUndispatched)}n.is=e})(Gh||(ie.ConnectionStrategy=Gh={}));var dl;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&Ze.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Ze.func(r.dispose))}n.is=e})(dl||(ie.IdCancellationReceiverStrategy=dl={}));var Yh;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&Ze.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Ze.func(r.dispose))}n.is=e})(Yh||(ie.RequestCancellationReceiverStrategy=Yh={}));var fl;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Vh.CancellationTokenSource}});function e(t){return dl.is(t)||Yh.is(t)}n.is=e})(fl||(ie.CancellationReceiverStrategy=fl={}));var hl;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(Yo.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&Ze.func(r.sendCancellation)&&Ze.func(r.cleanup)}n.is=e})(hl||(ie.CancellationSenderStrategy=hl={}));var pl;(function(n){n.Message=Object.freeze({receiver:fl.Message,sender:hl.Message});function e(t){let r=t;return r&&fl.is(r.receiver)&&hl.is(r.sender)}n.is=e})(pl||(ie.CancellationStrategy=pl={}));var ml;(function(n){function e(t){let r=t;return r&&Ze.func(r.handleMessage)}n.is=e})(ml||(ie.MessageStrategy=ml={}));var Uv;(function(n){function e(t){let r=t;return r&&(pl.is(r.cancellationStrategy)||Gh.is(r.connectionStrategy)||ml.is(r.messageStrategy))}n.is=e})(Uv||(ie.ConnectionOptions=Uv={}));var qn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(qn||(qn={}));function QO(n,e,t,r){let s=t!==void 0?t:ie.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,m=new Map,T,g=new Fv.LinkedMap,S=new Map,E=new Set,v=new Map,b=Ne.Off,R=dn.Text,O,L=qn.New,V=new Ko.Emitter,j=new Ko.Emitter,re=new Ko.Emitter,Ae=new Ko.Emitter,yt=new Ko.Emitter,de=r&&r.cancellationStrategy?r.cancellationStrategy:pl.Message;function yn(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+k.toString()}function xr(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function qc(){return"not-"+(++o).toString()}function Yf(k,$){Q.Message.isRequest($)?k.set(yn($.id),$):Q.Message.isResponse($)?k.set(xr($.id),$):k.set(qc(),$)}function xc(k){}function xo(){return L===qn.Listening}function Ps(){return L===qn.Closed}function Tr(){return L===qn.Disposed}function fi(){(L===qn.New||L===qn.Listening)&&(L=qn.Closed,j.fire(void 0))}function Rs(k){V.fire([k,void 0,void 0])}function jc(k){V.fire(k)}n.onClose(fi),n.onError(Rs),e.onClose(fi),e.onError(jc);function jo(){T||g.size===0||(T=(0,jv.default)().timer.setImmediate(()=>{T=void 0,Fc()}))}function Fo(k){Q.Message.isRequest(k)?Uc(k):Q.Message.isNotification(k)?Wc(k):Q.Message.isResponse(k)?Vc(k):hi(k)}function Fc(){if(g.size===0)return;let k=g.shift();try{let $=r?.messageStrategy;ml.is($)?$.handleMessage(k,Fo):Fo(k)}finally{jo()}}let Bc=k=>{try{if(Q.Message.isNotification(k)&&k.method===Yo.type.method){let $=k.params.id,F=yn($),W=g.get(F);if(Q.Message.isRequest(W)){let Re=r?.connectionStrategy,Ve=Re&&Re.cancelUndispatched?Re.cancelUndispatched(W,xc):void 0;if(Ve&&(Ve.error!==void 0||Ve.result!==void 0)){g.delete(F),v.delete($),Ve.id=W.id,Ds(Ve,k.method,Date.now()),e.write(Ve).catch(()=>s.error("Sending response for canceled message failed."));return}}let Ie=v.get($);if(Ie!==void 0){Ie.cancel(),pi(k);return}else E.add($)}Yf(g,k)}finally{jo()}};function Uc(k){if(Tr())return;function $(fe,Le,_e){let tt={jsonrpc:c,id:k.id};fe instanceof Q.ResponseError?tt.error=fe.toJson():tt.result=fe===void 0?null:fe,Ds(tt,Le,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}function F(fe,Le,_e){let tt={jsonrpc:c,id:k.id,error:fe.toJson()};Ds(tt,Le,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}function W(fe,Le,_e){fe===void 0&&(fe=null);let tt={jsonrpc:c,id:k.id,result:fe};Ds(tt,Le,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}zc(k);let Ie=u.get(k.method),Re,Ve;Ie&&(Re=Ie.type,Ve=Ie.handler);let Ye=Date.now();if(Ve||l){let fe=k.id??String(Date.now()),Le=dl.is(de.receiver)?de.receiver.createCancellationTokenSource(fe):de.receiver.createCancellationTokenSource(k);k.id!==null&&E.has(k.id)&&Le.cancel(),k.id!==null&&v.set(fe,Le);try{let _e;if(Ve)if(k.params===void 0){if(Re!==void 0&&Re.numberOfParams!==0){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${k.method} defines ${Re.numberOfParams} params but received none.`),k.method,Ye);return}_e=Ve(Le.token)}else if(Array.isArray(k.params)){if(Re!==void 0&&Re.parameterStructures===Q.ParameterStructures.byName){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,Ye);return}_e=Ve(...k.params,Le.token)}else{if(Re!==void 0&&Re.parameterStructures===Q.ParameterStructures.byPosition){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,Ye);return}_e=Ve(k.params,Le.token)}else l&&(_e=l(k.method,k.params,Le.token));let tt=_e;_e?tt.then?tt.then(_t=>{v.delete(fe),$(_t,k.method,Ye)},_t=>{v.delete(fe),_t instanceof Q.ResponseError?F(_t,k.method,Ye):_t&&Ze.string(_t.message)?F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${_t.message}`),k.method,Ye):F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Ye)}):(v.delete(fe),$(_e,k.method,Ye)):(v.delete(fe),W(_e,k.method,Ye))}catch(_e){v.delete(fe),_e instanceof Q.ResponseError?$(_e,k.method,Ye):_e&&Ze.string(_e.message)?F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${_e.message}`),k.method,Ye):F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Ye)}}else F(new Q.ResponseError(Q.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,Ye)}function Vc(k){if(!Tr())if(k.id===null)k.error?s.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(k.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let $=k.id,F=S.get($);if(Gc(k,F),F!==void 0){S.delete($);try{if(k.error){let W=k.error;F.reject(new Q.ResponseError(W.code,W.message,W.data))}else if(k.result!==void 0)F.resolve(k.result);else throw new Error("Should never happen.")}catch(W){W.message?s.error(`Response handler '${F.method}' failed with message: ${W.message}`):s.error(`Response handler '${F.method}' failed unexpectedly.`)}}}}function Wc(k){if(Tr())return;let $,F;if(k.method===Yo.type.method){let W=k.params.id;E.delete(W),pi(k);return}else{let W=f.get(k.method);W&&(F=W.handler,$=W.type)}if(F||d)try{if(pi(k),F)if(k.params===void 0)$!==void 0&&$.numberOfParams!==0&&$.parameterStructures!==Q.ParameterStructures.byName&&s.error(`Notification ${k.method} defines ${$.numberOfParams} params but received none.`),F();else if(Array.isArray(k.params)){let W=k.params;k.method===zo.type.method&&W.length===2&&Wh.is(W[0])?F({token:W[0],value:W[1]}):($!==void 0&&($.parameterStructures===Q.ParameterStructures.byName&&s.error(`Notification ${k.method} defines parameters by name but received parameters by position`),$.numberOfParams!==k.params.length&&s.error(`Notification ${k.method} defines ${$.numberOfParams} params but received ${W.length} arguments`)),F(...W))}else $!==void 0&&$.parameterStructures===Q.ParameterStructures.byPosition&&s.error(`Notification ${k.method} defines parameters by position but received parameters by name`),F(k.params);else d&&d(k.method,k.params)}catch(W){W.message?s.error(`Notification handler '${k.method}' failed with message: ${W.message}`):s.error(`Notification handler '${k.method}' failed unexpectedly.`)}else re.fire(k)}function hi(k){if(!k){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(k,null,4)}`);let $=k;if(Ze.string($.id)||Ze.number($.id)){let F=$.id,W=S.get(F);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function $n(k){if(k!=null)switch(b){case Ne.Verbose:return JSON.stringify(k,null,4);case Ne.Compact:return JSON.stringify(k);default:return}}function Hc(k){if(!(b===Ne.Off||!O))if(R===dn.Text){let $;(b===Ne.Verbose||b===Ne.Compact)&&k.params&&($=`Params: ${$n(k.params)}
|
|
9
9
|
|
|
10
|
-
`),
|
|
10
|
+
`),O.log(`Sending request '${k.method} - (${k.id})'.`,$)}else _r("send-request",k)}function Kc(k){if(!(b===Ne.Off||!O))if(R===dn.Text){let $;(b===Ne.Verbose||b===Ne.Compact)&&(k.params?$=`Params: ${$n(k.params)}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
`:$=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),
|
|
14
|
+
`),O.log(`Sending notification '${k.method}'.`,$)}else _r("send-notification",k)}function Ds(k,$,F){if(!(b===Ne.Off||!O))if(R===dn.Text){let W;(b===Ne.Verbose||b===Ne.Compact)&&(k.error&&k.error.data?W=`Error data: ${$n(k.error.data)}
|
|
15
15
|
|
|
16
|
-
`:
|
|
16
|
+
`:k.result?W=`Result: ${$n(k.result)}
|
|
17
17
|
|
|
18
|
-
`:
|
|
18
|
+
`:k.error===void 0&&(W=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),
|
|
20
|
+
`)),O.log(`Sending response '${$} - (${k.id})'. Processing request took ${Date.now()-F}ms`,W)}else _r("send-response",k)}function zc(k){if(!(b===Ne.Off||!O))if(R===dn.Text){let $;(b===Ne.Verbose||b===Ne.Compact)&&k.params&&($=`Params: ${$n(k.params)}
|
|
21
21
|
|
|
22
|
-
`),
|
|
22
|
+
`),O.log(`Received request '${k.method} - (${k.id})'.`,$)}else _r("receive-request",k)}function pi(k){if(!(b===Ne.Off||!O||k.method===ul.type.method))if(R===dn.Text){let $;(b===Ne.Verbose||b===Ne.Compact)&&(k.params?$=`Params: ${$n(k.params)}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
`:$=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),
|
|
26
|
+
`),O.log(`Received notification '${k.method}'.`,$)}else _r("receive-notification",k)}function Gc(k,$){if(!(b===Ne.Off||!O))if(R===dn.Text){let F;if((b===Ne.Verbose||b===Ne.Compact)&&(k.error&&k.error.data?F=`Error data: ${$n(k.error.data)}
|
|
27
27
|
|
|
28
|
-
`:
|
|
28
|
+
`:k.result?F=`Result: ${$n(k.result)}
|
|
29
29
|
|
|
30
|
-
`:
|
|
30
|
+
`:k.error===void 0&&(F=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),I){let W=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";L.log(`Received response '${I.method} - (${S.id})' in ${Date.now()-I.timerStart}ms.${W}`,B)}else L.log(`Received response ${S.id} without active response promise.`,B)}else In("receive-response",S)}function In(S,I){if(!L||T===me.Off)return;let B={isLSPMessage:!0,type:S,message:I,timestamp:Date.now()};L.log(B)}function Yn(){if(Ci())throw new dr(ys.Closed,"Connection is closed.");if(An())throw new dr(ys.Disposed,"Connection is disposed.")}function Uo(){if(as())throw new dr(ys.AlreadyListening,"Connection is already listening")}function $o(){if(!as())throw new Error("Call listen() first.")}function mn(S){return S===void 0?null:S}function us(S){if(S!==null)return S}function fs(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function rr(S,I){switch(S){case X.ParameterStructures.auto:return fs(I)?us(I):[mn(I)];case X.ParameterStructures.byName:if(!fs(I))throw new Error("Received parameters by name but param is not an object literal.");return us(I);case X.ParameterStructures.byPosition:return[mn(I)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function ds(S,I){let B,W=S.numberOfParams;switch(W){case 0:B=void 0;break;case 1:B=rr(S.parameterStructures,I[0]);break;default:B=[];for(let Ee=0;Ee<I.length&&Ee<W;Ee++)B.push(mn(I[Ee]));if(I.length<W)for(let Ee=I.length;Ee<W;Ee++)B.push(null);break}return B}let Ln={sendNotification:(S,...I)=>{Yn();let B,W;if(qe.string(S)){B=S;let ye=I[0],Ce=0,Le=X.ParameterStructures.auto;X.ParameterStructures.is(ye)&&(Ce=1,Le=ye);let se=I.length,we=se-Ce;switch(we){case 0:W=void 0;break;case 1:W=rr(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${we} parameters for 'by Name' notification parameter structure.`);W=I.slice(Ce,se).map(fe=>mn(fe));break}}else{let ye=I;B=S.method,W=ds(S,ye)}let Ee={jsonrpc:c,method:B,params:W};return Fo(Ee),e.write(Ee).catch(ye=>{throw r.error("Sending notification failed."),ye})},onNotification:(S,I)=>{Yn();let B;return qe.func(S)?d=S:I&&(qe.string(S)?(B=S,p.set(S,{type:void 0,handler:I})):(B=S.method,p.set(S.method,{type:S,handler:I}))),{dispose:()=>{B!==void 0?p.delete(B):d=void 0}}},onProgress:(S,I,B)=>{if(g.has(I))throw new Error(`Progress handler for token ${I} already registered`);return g.set(I,B),{dispose:()=>{g.delete(I)}}},sendProgress:(S,I,B)=>Ln.sendNotification(gs.type,{token:I,value:B}),onUnhandledProgress:Be.event,sendRequest:(S,...I)=>{Yn(),$o();let B,W,Ee;if(qe.string(S)){B=S;let se=I[0],we=I[I.length-1],fe=0,je=X.ParameterStructures.auto;X.ParameterStructures.is(se)&&(fe=1,je=se);let nt=I.length;Zu.CancellationToken.is(we)&&(nt=nt-1,Ee=we);let Lt=nt-fe;switch(Lt){case 0:W=void 0;break;case 1:W=rr(je,I[fe]);break;default:if(je===X.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);W=I.slice(fe,nt).map(Wo=>mn(Wo));break}}else{let se=I;B=S.method,W=ds(S,se);let we=S.numberOfParams;Ee=Zu.CancellationToken.is(se[we])?se[we]:void 0}let ye=s++,Ce;Ee&&(Ce=Ee.onCancellationRequested(()=>{let se=ce.sender.sendCancellation(Ln,ye);return se===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${ye}`),Promise.resolve()):se.catch(()=>{r.log(`Sending cancellation messages for id ${ye} failed`)})}));let Le={jsonrpc:c,id:ye,method:B,params:W};return qo(Le),typeof ce.sender.enableCancellation=="function"&&ce.sender.enableCancellation(Le),new Promise(async(se,we)=>{let fe=Lt=>{se(Lt),ce.sender.cleanup(ye),Ce?.dispose()},je=Lt=>{we(Lt),ce.sender.cleanup(ye),Ce?.dispose()},nt={method:B,timerStart:Date.now(),resolve:fe,reject:je};try{await e.write(Le),w.set(ye,nt)}catch(Lt){throw r.error("Sending request failed."),nt.reject(new X.ResponseError(X.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(S,I)=>{Yn();let B=null;return nf.is(S)?(B=void 0,l=S):qe.string(S)?(B=null,I!==void 0&&(B=S,u.set(S,{handler:I,type:void 0}))):I!==void 0&&(B=S.method,u.set(S.method,{type:S,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>w.size>0,trace:async(S,I,B)=>{let W=!1,Ee=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,Ee=B.traceFormat||xt.Text)),T=S,N=Ee,T===me.Off?L=void 0:L=I,W&&!Ci()&&!An()&&await Ln.sendNotification(rf.type,{value:me.toString(S)})},onError:H.event,onClose:j.event,onUnhandledNotification:re.event,onDispose:Et.event,end:()=>{e.end()},dispose:()=>{if(An())return;q=nn.Disposed,Et.fire(void 0);let S=new X.ResponseError(X.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of w.values())I.reject(S);w=new Map,v=new Map,R=new Set,y=new Xp.LinkedMap,qe.func(e.dispose)&&e.dispose(),qe.func(n.dispose)&&n.dispose()},listen:()=>{Yn(),Uo(),q=nn.Listening,n.listen(Io)},inspect:()=>{(0,Gp.default)().console.log("inspect")}};return Ln.onNotification(na.type,S=>{if(T===me.Off||!L)return;let I=T===me.Verbose||T===me.Compact;L.log(S.message,I?S.verbose:void 0)}),Ln.onNotification(gs.type,S=>{let I=g.get(S.token);I?I(S.value):Be.fire(S)}),Ln}te.createMessageConnection=nN});var ca=C(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var _e=Ou();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return _e.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return _e.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return _e.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return _e.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return _e.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return _e.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return _e.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return _e.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return _e.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return _e.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return _e.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return _e.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return _e.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return _e.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return _e.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return _e.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return _e.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return _e.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return _e.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return _e.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return _e.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return _e.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return _e.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return _e.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return _e.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return _e.ParameterStructures}});var af=Iu();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return af.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return af.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return af.Touch}});var iN=Fp();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return iN.Disposable}});var em=cr();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return em.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return em.Emitter}});var tm=Qo();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return tm.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return tm.CancellationToken}});var nm=jp();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return nm.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return nm.SharedArrayReceiverStrategy}});var cf=$p();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return cf.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return cf.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return cf.ReadableStreamMessageReader}});var lf=Kp();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return lf.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return lf.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return lf.WriteableStreamMessageWriter}});var rN=zp();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return rN.AbstractMessageBuffer}});var ft=Zp();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return ft.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return ft.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return ft.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return ft.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return ft.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return ft.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return ft.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return ft.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return ft.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return ft.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return ft.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return ft.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return ft.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ft.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ft.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return ft.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return ft.MessageStrategy}});var sN=zn();O.RAL=sN.default});var sm=C(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var im=require("util"),Mn=ca(),la=class n extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new im.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};la.emptyBuffer=Buffer.allocUnsafe(0);var uf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},ff=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let s=o=>{o==null?i():r(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},rm=Object.freeze({messageBuffer:Object.freeze({create:n=>new la(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new im.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new uf(n),asWritableStream:n=>new ff(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function df(){return rm}(function(n){function e(){Mn.RAL.install(rm)}n.install=e})(df||(df={}));hf.default=df});var Mi=C(ae=>{"use strict";var oN=ae&&ae.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),aN=ae&&ae.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&oN(e,n,t)};Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.createServerSocketTransport=ae.createClientSocketTransport=ae.createServerPipeTransport=ae.createClientPipeTransport=ae.generateRandomPipeName=ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;var hr=sm();hr.default.install();var om=require("path"),cN=require("os"),lN=require("crypto"),da=require("net"),Mt=ca();aN(ca(),ae);var pf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mt.Disposable.create(()=>this.process.off("message",e))}};ae.IPCMessageReader=pf;var mf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.IPCMessageWriter=mf;var gf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.onData=new Mt.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ae.PortMessageReader=gf;var yf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.PortMessageWriter=yf;var Li=class extends Mt.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,hr.default)().stream.asReadableStream(e),t)}};ae.SocketMessageReader=Li;var xi=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,hr.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=xi;var ua=class extends Mt.ReadableStreamMessageReader{constructor(e,t){super((0,hr.default)().stream.asReadableStream(e),t)}};ae.StreamMessageReader=ua;var fa=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,hr.default)().stream.asWritableStream(e),t)}};ae.StreamMessageWriter=fa;var am=process.env.XDG_RUNTIME_DIR,uN=new Map([["linux",107],["darwin",103]]);function fN(){let n=(0,lN.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;am?e=om.join(am,`vscode-ipc-${n}.sock`):e=om.join(cN.tmpdir(),`vscode-${n}.sock`);let t=uN.get(process.platform);return t!==void 0&&e.length>t&&(0,hr.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ae.generateRandomPipeName=fN;function dN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,da.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientPipeTransport=dN;function hN(n,e="utf-8"){let t=(0,da.createConnection)(n);return[new Li(t,e),new xi(t,e)]}ae.createServerPipeTransport=hN;function pN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,da.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientSocketTransport=pN;function mN(n,e="utf-8"){let t=(0,da.createConnection)(n,"127.0.0.1");return[new Li(t,e),new xi(t,e)]}ae.createServerSocketTransport=mN;function gN(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function yN(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function bN(n,e,t,i){t||(t=Mt.NullLogger);let r=gN(n)?new ua(n):n,s=yN(e)?new fa(e):e;return Mt.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Mt.createMessageConnection)(r,s,t,i)}ae.createMessageConnection=bN});var bf=C((WA,cm)=>{"use strict";cm.exports=Mi()});var pa=C((lm,ha)=>{(function(n){if(typeof ha=="object"&&typeof ha.exports=="object"){var e=n(require,lm);e!==void 0&&(ha.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(h){function k(E){return typeof E=="string"}h.is=k})(t||(e.DocumentUri=t={}));var i;(function(h){function k(E){return typeof E=="string"}h.is=k})(i||(e.URI=i={}));var r;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(r||(e.integer=r={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(s||(e.uinteger=s={}));var o;(function(h){function k(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=E})(o||(e.Position=o={}));var a;(function(h){function k(m,f,P,x){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(P)&&D.uinteger(x))return{start:o.create(m,f),end:o.create(P,x)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(P,", ").concat(x,"]"))}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=E})(a||(e.Range=a={}));var c;(function(h){function k(m,f){return{uri:m,range:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=E})(c||(e.Location=c={}));var l;(function(h){function k(m,f,P,x){return{targetUri:m,targetRange:f,targetSelectionRange:P,originSelectionRange:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=E})(l||(e.LocationLink=l={}));var u;(function(h){function k(m,f,P,x){return{red:m,green:f,blue:P,alpha:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=E})(u||(e.Color=u={}));var d;(function(h){function k(m,f){return{range:m,color:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&u.is(f.color)}h.is=E})(d||(e.ColorInformation=d={}));var p;(function(h){function k(m,f,P){return{label:m,textEdit:f,additionalTextEdits:P}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||L.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,L.is))}h.is=E})(p||(e.ColorPresentation=p={}));var g;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(h){function k(m,f,P,x,ee,Ue){var Ne={startLine:m,endLine:f};return D.defined(P)&&(Ne.startCharacter=P),D.defined(x)&&(Ne.endCharacter=x),D.defined(ee)&&(Ne.kind=ee),D.defined(Ue)&&(Ne.collapsedText=Ue),Ne}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=E})(_||(e.FoldingRange=_={}));var y;(function(h){function k(m,f){return{location:m,message:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&c.is(f.location)&&D.string(f.message)}h.is=E})(y||(e.DiagnosticRelatedInformation=y={}));var w;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(w||(e.DiagnosticSeverity=w={}));var R;(function(h){h.Unnecessary=1,h.Deprecated=2})(R||(e.DiagnosticTag=R={}));var v;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&D.string(m.href)}h.is=k})(v||(e.CodeDescription=v={}));var T;(function(h){function k(m,f,P,x,ee,Ue){var Ne={range:m,message:f};return D.defined(P)&&(Ne.severity=P),D.defined(x)&&(Ne.code=x),D.defined(ee)&&(Ne.source=ee),D.defined(Ue)&&(Ne.relatedInformation=Ue),Ne}h.create=k;function E(m){var f,P=m;return D.defined(P)&&a.is(P.range)&&D.string(P.message)&&(D.number(P.severity)||D.undefined(P.severity))&&(D.integer(P.code)||D.string(P.code)||D.undefined(P.code))&&(D.undefined(P.codeDescription)||D.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(P.source)||D.undefined(P.source))&&(D.undefined(P.relatedInformation)||D.typedArray(P.relatedInformation,y.is))}h.is=E})(T||(e.Diagnostic=T={}));var N;(function(h){function k(m,f){for(var P=[],x=2;x<arguments.length;x++)P[x-2]=arguments[x];var ee={title:m,command:f};return D.defined(P)&&P.length>0&&(ee.arguments=P),ee}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=E})(N||(e.Command=N={}));var L;(function(h){function k(P,x){return{range:P,newText:x}}h.replace=k;function E(P,x){return{range:{start:P,end:P},newText:x}}h.insert=E;function m(P){return{range:P,newText:""}}h.del=m;function f(P){var x=P;return D.objectLiteral(x)&&D.string(x.newText)&&a.is(x.range)}h.is=f})(L||(e.TextEdit=L={}));var q;(function(h){function k(m,f,P){var x={label:m};return f!==void 0&&(x.needsConfirmation=f),P!==void 0&&(x.description=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=E})(q||(e.ChangeAnnotation=q={}));var H;(function(h){function k(E){var m=E;return D.string(m)}h.is=k})(H||(e.ChangeAnnotationIdentifier=H={}));var j;(function(h){function k(P,x,ee){return{range:P,newText:x,annotationId:ee}}h.replace=k;function E(P,x,ee){return{range:{start:P,end:P},newText:x,annotationId:ee}}h.insert=E;function m(P,x){return{range:P,newText:"",annotationId:x}}h.del=m;function f(P){var x=P;return L.is(x)&&(q.is(x.annotationId)||H.is(x.annotationId))}h.is=f})(j||(e.AnnotatedTextEdit=j={}));var re;(function(h){function k(m,f){return{textDocument:m,edits:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&Ci.is(f.textDocument)&&Array.isArray(f.edits)}h.is=E})(re||(e.TextDocumentEdit=re={}));var Be;(function(h){function k(m,f,P){var x={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Be||(e.CreateFile=Be={}));var Et;(function(h){function k(m,f,P,x){var ee={kind:"rename",oldUri:m,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ee.options=P),x!==void 0&&(ee.annotationId=x),ee}h.create=k;function E(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Et||(e.RenameFile=Et={}));var ce;(function(h){function k(m,f,P){var x={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(ce||(e.DeleteFile=ce={}));var On;(function(h){function k(E){var m=E;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?Be.is(f)||Et.is(f)||ce.is(f):re.is(f)}))}h.is=k})(On||(e.WorkspaceEdit=On={}));var er=function(){function h(k,E){this.edits=k,this.changeAnnotations=E}return h.prototype.insert=function(k,E,m){var f,P;if(m===void 0?f=L.insert(k,E):H.is(m)?(P=m,f=j.insert(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.insert(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.replace=function(k,E,m){var f,P;if(m===void 0?f=L.replace(k,E):H.is(m)?(P=m,f=j.replace(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.replace(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.delete=function(k,E){var m,f;if(E===void 0?m=L.del(k):H.is(E)?(f=E,m=j.del(k,E)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(E),m=j.del(k,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(k){this.edits.push(k)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(k){if(k===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),Ro=function(){function h(k){this._annotations=k===void 0?Object.create(null):k,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(k,E){var m;if(H.is(k)?m=k:(m=this.nextId(),E=k),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=E,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),ou=function(){function h(k){var E=this;this._textEditChanges=Object.create(null),k!==void 0?(this._workspaceEdit=k,k.documentChanges?(this._changeAnnotations=new Ro(k.changeAnnotations),k.changeAnnotations=this._changeAnnotations.all(),k.documentChanges.forEach(function(m){if(re.is(m)){var f=new er(m.edits,E._changeAnnotations);E._textEditChanges[m.textDocument.uri]=f}})):k.changes&&Object.keys(k.changes).forEach(function(m){var f=new er(k.changes[m]);E._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(k){if(Ci.is(k)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:k.uri,version:k.version},m=this._textEditChanges[E.uri];if(!m){var f=[],P={textDocument:E,edits:f};this._workspaceEdit.documentChanges.push(P),m=new er(f,this._changeAnnotations),this._textEditChanges[E.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[k];if(!m){var f=[];this._workspaceEdit.changes[k]=f,m=new er(f),this._textEditChanges[k]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ro,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=Be.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=Be.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h.prototype.renameFile=function(k,E,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;q.is(m)||H.is(m)?P=m:f=m;var x,ee;if(P===void 0?x=Et.create(k,E,f):(ee=H.is(P)?P:this._changeAnnotations.manage(P),x=Et.create(k,E,f,ee)),this._workspaceEdit.documentChanges.push(x),ee!==void 0)return ee},h.prototype.deleteFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=ce.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=ce.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h}();e.WorkspaceChange=ou;var Co;(function(h){function k(m){return{uri:m}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=E})(Co||(e.TextDocumentIdentifier=Co={}));var as;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=E})(as||(e.VersionedTextDocumentIdentifier=as={}));var Ci;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=E})(Ci||(e.OptionalVersionedTextDocumentIdentifier=Ci={}));var An;(function(h){function k(m,f,P,x){return{uri:m,languageId:f,version:P,text:x}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=E})(An||(e.TextDocumentItem=An={}));var tr;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function k(E){var m=E;return m===h.PlainText||m===h.Markdown}h.is=k})(tr||(e.MarkupKind=tr={}));var Oi;(function(h){function k(E){var m=E;return D.objectLiteral(E)&&tr.is(m.kind)&&D.string(m.value)}h.is=k})(Oi||(e.MarkupContent=Oi={}));var Oo;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Oo||(e.CompletionItemKind=Oo={}));var cs;(function(h){h.PlainText=1,h.Snippet=2})(cs||(e.InsertTextFormat=cs={}));var ls;(function(h){h.Deprecated=1})(ls||(e.CompletionItemTag=ls={}));var Ao;(function(h){function k(m,f,P){return{newText:m,insert:f,replace:P}}h.create=k;function E(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=E})(Ao||(e.InsertReplaceEdit=Ao={}));var Io;(function(h){h.asIs=1,h.adjustIndentation=2})(Io||(e.InsertTextMode=Io={}));var Lo;(function(h){function k(E){var m=E;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=k})(Lo||(e.CompletionItemLabelDetails=Lo={}));var xo;(function(h){function k(E){return{label:E}}h.create=k})(xo||(e.CompletionItem=xo={}));var Mo;(function(h){function k(E,m){return{items:E||[],isIncomplete:!!m}}h.create=k})(Mo||(e.CompletionList=Mo={}));var nr;(function(h){function k(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=k;function E(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=E})(nr||(e.MarkedString=nr={}));var Zt;(function(h){function k(E){var m=E;return!!m&&D.objectLiteral(m)&&(Oi.is(m.contents)||nr.is(m.contents)||D.typedArray(m.contents,nr.is))&&(E.range===void 0||a.is(E.range))}h.is=k})(Zt||(e.Hover=Zt={}));var qo;(function(h){function k(E,m){return m?{label:E,documentation:m}:{label:E}}h.create=k})(qo||(e.ParameterInformation=qo={}));var Fo;(function(h){function k(E,m){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var x={label:E};return D.defined(m)&&(x.documentation=m),D.defined(f)?x.parameters=f:x.parameters=[],x}h.create=k})(Fo||(e.SignatureInformation=Fo={}));var Ai;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ai||(e.DocumentHighlightKind=Ai={}));var Bo;(function(h){function k(E,m){var f={range:E};return D.number(m)&&(f.kind=m),f}h.create=k})(Bo||(e.DocumentHighlight=Bo={}));var ir;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(ir||(e.SymbolKind=ir={}));var jo;(function(h){h.Deprecated=1})(jo||(e.SymbolTag=jo={}));var In;(function(h){function k(E,m,f,P,x){var ee={name:E,kind:m,location:{uri:P,range:f}};return x&&(ee.containerName=x),ee}h.create=k})(In||(e.SymbolInformation=In={}));var Yn;(function(h){function k(E,m,f,P){return P!==void 0?{name:E,kind:m,location:{uri:f,range:P}}:{name:E,kind:m,location:{uri:f}}}h.create=k})(Yn||(e.WorkspaceSymbol=Yn={}));var Uo;(function(h){function k(m,f,P,x,ee,Ue){var Ne={name:m,detail:f,kind:P,range:x,selectionRange:ee};return Ue!==void 0&&(Ne.children=Ue),Ne}h.create=k;function E(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=E})(Uo||(e.DocumentSymbol=Uo={}));var $o;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})($o||(e.CodeActionKind=$o={}));var mn;(function(h){h.Invoked=1,h.Automatic=2})(mn||(e.CodeActionTriggerKind=mn={}));var us;(function(h){function k(m,f,P){var x={diagnostics:m};return f!=null&&(x.only=f),P!=null&&(x.triggerKind=P),x}h.create=k;function E(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,T.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===mn.Invoked||f.triggerKind===mn.Automatic)}h.is=E})(us||(e.CodeActionContext=us={}));var fs;(function(h){function k(m,f,P){var x={title:m},ee=!0;return typeof f=="string"?(ee=!1,x.kind=f):N.is(f)?x.command=f:x.edit=f,ee&&P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||N.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||On.is(f.edit))}h.is=E})(fs||(e.CodeAction=fs={}));var rr;(function(h){function k(m,f){var P={range:m};return D.defined(f)&&(P.data=f),P}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||N.is(f.command))}h.is=E})(rr||(e.CodeLens=rr={}));var ds;(function(h){function k(m,f){return{tabSize:m,insertSpaces:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=E})(ds||(e.FormattingOptions=ds={}));var Ln;(function(h){function k(m,f,P){return{range:m,target:f,data:P}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=E})(Ln||(e.DocumentLink=Ln={}));var S;(function(h){function k(m,f){return{range:m,parent:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=E})(S||(e.SelectionRange=S={}));var I;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var W;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=k})(W||(e.SemanticTokens=W={}));var Ee;(function(h){function k(m,f){return{range:m,text:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=E})(Ee||(e.InlineValueText=Ee={}));var ye;(function(h){function k(m,f,P){return{range:m,variableName:f,caseSensitiveLookup:P}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=E})(ye||(e.InlineValueVariableLookup=ye={}));var Ce;(function(h){function k(m,f){return{range:m,expression:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=E})(Ce||(e.InlineValueEvaluatableExpression=Ce={}));var Le;(function(h){function k(m,f){return{frameId:m,stoppedLocation:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=E})(Le||(e.InlineValueContext=Le={}));var se;(function(h){h.Type=1,h.Parameter=2;function k(E){return E===1||E===2}h.is=k})(se||(e.InlayHintKind=se={}));var we;(function(h){function k(m){return{value:m}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.location===void 0||c.is(f.location))&&(f.command===void 0||N.is(f.command))}h.is=E})(we||(e.InlayHintLabelPart=we={}));var fe;(function(h){function k(m,f,P){var x={position:m,label:f};return P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,we.is))&&(f.kind===void 0||se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=E})(fe||(e.InlayHint=fe={}));var je;(function(h){function k(E){return{kind:"snippet",value:E}}h.createSnippet=k})(je||(e.StringValue=je={}));var nt;(function(h){function k(E,m,f,P){return{insertText:E,filterText:m,range:f,command:P}}h.create=k})(nt||(e.InlineCompletionItem=nt={}));var Lt;(function(h){function k(E){return{items:E}}h.create=k})(Lt||(e.InlineCompletionList=Lt={}));var Wo;(function(h){h.Invoked=0,h.Automatic=1})(Wo||(e.InlineCompletionTriggerKind=Wo={}));var wp;(function(h){function k(E,m){return{range:E,text:m}}h.create=k})(wp||(e.SelectedCompletionInfo=wp={}));var Np;(function(h){function k(E,m){return{triggerKind:E,selectedCompletionInfo:m}}h.create=k})(Np||(e.InlineCompletionContext=Np={}));var _p;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&i.is(m.uri)&&D.string(m.name)}h.is=k})(_p||(e.WorkspaceFolder=_p={})),e.EOL=[`
|
|
32
|
+
`)),$){let W=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";O.log(`Received response '${$.method} - (${k.id})' in ${Date.now()-$.timerStart}ms.${W}`,F)}else O.log(`Received response ${k.id} without active response promise.`,F)}else _r("receive-response",k)}function _r(k,$){if(!O||b===Ne.Off)return;let F={isLSPMessage:!0,type:k,message:$,timestamp:Date.now()};O.log(F)}function jr(){if(Ps())throw new wi(Go.Closed,"Connection is closed.");if(Tr())throw new wi(Go.Disposed,"Connection is disposed.")}function Yc(){if(xo())throw new wi(Go.AlreadyListening,"Connection is already listening")}function Jc(){if(!xo())throw new Error("Call listen() first.")}function Zn(k){return k===void 0?null:k}function Bo(k){if(k!==null)return k}function Uo(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function mi(k,$){switch(k){case Q.ParameterStructures.auto:return Uo($)?Bo($):[Zn($)];case Q.ParameterStructures.byName:if(!Uo($))throw new Error("Received parameters by name but param is not an object literal.");return Bo($);case Q.ParameterStructures.byPosition:return[Zn($)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function Vo(k,$){let F,W=k.numberOfParams;switch(W){case 0:F=void 0;break;case 1:F=mi(k.parameterStructures,$[0]);break;default:F=[];for(let Ie=0;Ie<$.length&&Ie<W;Ie++)F.push(Zn($[Ie]));if($.length<W)for(let Ie=$.length;Ie<W;Ie++)F.push(null);break}return F}let Sr={sendNotification:(k,...$)=>{jr();let F,W;if(Ze.string(k)){F=k;let Re=$[0],Ve=0,Ye=Q.ParameterStructures.auto;Q.ParameterStructures.is(Re)&&(Ve=1,Ye=Re);let fe=$.length,Le=fe-Ve;switch(Le){case 0:W=void 0;break;case 1:W=mi(Ye,$[Ve]);break;default:if(Ye===Q.ParameterStructures.byName)throw new Error(`Received ${Le} parameters for 'by Name' notification parameter structure.`);W=$.slice(Ve,fe).map(_e=>Zn(_e));break}}else{let Re=$;F=k.method,W=Vo(k,Re)}let Ie={jsonrpc:c,method:F,params:W};return Kc(Ie),e.write(Ie).catch(Re=>{throw s.error("Sending notification failed."),Re})},onNotification:(k,$)=>{jr();let F;return Ze.func(k)?d=k:$&&(Ze.string(k)?(F=k,f.set(k,{type:void 0,handler:$})):(F=k.method,f.set(k.method,{type:k,handler:$}))),{dispose:()=>{F!==void 0?f.delete(F):d=void 0}}},onProgress:(k,$,F)=>{if(m.has($))throw new Error(`Progress handler for token ${$} already registered`);return m.set($,F),{dispose:()=>{m.delete($)}}},sendProgress:(k,$,F)=>Sr.sendNotification(zo.type,{token:$,value:F}),onUnhandledProgress:Ae.event,sendRequest:(k,...$)=>{jr(),Jc();let F,W,Ie;if(Ze.string(k)){F=k;let fe=$[0],Le=$[$.length-1],_e=0,tt=Q.ParameterStructures.auto;Q.ParameterStructures.is(fe)&&(_e=1,tt=fe);let _t=$.length;Vh.CancellationToken.is(Le)&&(_t=_t-1,Ie=Le);let un=_t-_e;switch(un){case 0:W=void 0;break;case 1:W=mi(tt,$[_e]);break;default:if(tt===Q.ParameterStructures.byName)throw new Error(`Received ${un} parameters for 'by Name' request parameter structure.`);W=$.slice(_e,_t).map(Xc=>Zn(Xc));break}}else{let fe=$;F=k.method,W=Vo(k,fe);let Le=k.numberOfParams;Ie=Vh.CancellationToken.is(fe[Le])?fe[Le]:void 0}let Re=i++,Ve;Ie&&(Ve=Ie.onCancellationRequested(()=>{let fe=de.sender.sendCancellation(Sr,Re);return fe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${Re}`),Promise.resolve()):fe.catch(()=>{s.log(`Sending cancellation messages for id ${Re} failed`)})}));let Ye={jsonrpc:c,id:Re,method:F,params:W};return Hc(Ye),typeof de.sender.enableCancellation=="function"&&de.sender.enableCancellation(Ye),new Promise(async(fe,Le)=>{let _e=un=>{fe(un),de.sender.cleanup(Re),Ve?.dispose()},tt=un=>{Le(un),de.sender.cleanup(Re),Ve?.dispose()},_t={method:F,timerStart:Date.now(),resolve:_e,reject:tt};try{await e.write(Ye),S.set(Re,_t)}catch(un){throw s.error("Sending request failed."),_t.reject(new Q.ResponseError(Q.ErrorCodes.MessageWriteError,un.message?un.message:"Unknown reason")),un}})},onRequest:(k,$)=>{jr();let F=null;return Kh.is(k)?(F=void 0,l=k):Ze.string(k)?(F=null,$!==void 0&&(F=k,u.set(k,{handler:$,type:void 0}))):$!==void 0&&(F=k.method,u.set(k.method,{type:k,handler:$})),{dispose:()=>{F!==null&&(F!==void 0?u.delete(F):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(k,$,F)=>{let W=!1,Ie=dn.Text;F!==void 0&&(Ze.boolean(F)?W=F:(W=F.sendNotification||!1,Ie=F.traceFormat||dn.Text)),b=k,R=Ie,b===Ne.Off?O=void 0:O=$,W&&!Ps()&&!Tr()&&await Sr.sendNotification(zh.type,{value:Ne.toString(k)})},onError:V.event,onClose:j.event,onUnhandledNotification:re.event,onDispose:yt.event,end:()=>{e.end()},dispose:()=>{if(Tr())return;L=qn.Disposed,yt.fire(void 0);let k=new Q.ResponseError(Q.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let $ of S.values())$.reject(k);S=new Map,v=new Map,E=new Set,g=new Fv.LinkedMap,Ze.func(e.dispose)&&e.dispose(),Ze.func(n.dispose)&&n.dispose()},listen:()=>{jr(),Yc(),L=qn.Listening,n.listen(Bc)},inspect:()=>{(0,jv.default)().console.log("inspect")}};return Sr.onNotification(ul.type,k=>{if(b===Ne.Off||!O)return;let $=b===Ne.Verbose||b===Ne.Compact;O.log(k.message,$?k.verbose:void 0)}),Sr.onNotification(zo.type,k=>{let $=m.get(k.token);$?$(k.value):Ae.fire(k)}),Sr}ie.createMessageConnection=QO});var gl=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 je=_h();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return je.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return je.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return je.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return je.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return je.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return je.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return je.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return je.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return je.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return je.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return je.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return je.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return je.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return je.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return je.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return je.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return je.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return je.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return je.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return je.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return je.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return je.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return je.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return je.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return je.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return je.ParameterStructures}});var Jh=wh();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return Jh.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return Jh.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return Jh.Touch}});var ZO=Rv();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return ZO.Disposable}});var Wv=vi();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return Wv.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return Wv.Emitter}});var Hv=il();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return Hv.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return Hv.CancellationToken}});var Kv=Cv();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Kv.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Kv.SharedArrayReceiverStrategy}});var Xh=Av();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return Xh.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return Xh.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Xh.ReadableStreamMessageReader}});var Qh=qv();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return Qh.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return Qh.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Qh.WriteableStreamMessageWriter}});var eA=xv();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return eA.AbstractMessageBuffer}});var Ct=Vv();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Ct.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Ct.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Ct.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Ct.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Ct.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Ct.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Ct.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Ct.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Ct.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Ct.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Ct.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Ct.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Ct.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ct.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ct.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Ct.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Ct.MessageStrategy}});var tA=Br();I.RAL=tA.default});var Yv=w(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var zv=require("util"),Er=gl(),yl=class n extends Er.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new zv.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};yl.emptyBuffer=Buffer.allocUnsafe(0);var Zh=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Er.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Er.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Er.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Er.Disposable.create(()=>this.stream.off("data",e))}},ep=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Er.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Er.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Er.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},Gv=Object.freeze({messageBuffer:Object.freeze({create:n=>new yl(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new zv.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new Zh(n),asWritableStream:n=>new ep(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let r=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(r)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let r=setInterval(n,e,...t);return{dispose:()=>clearInterval(r)}}})});function tp(){return Gv}(function(n){function e(){Er.RAL.install(Gv)}n.install=e})(tp||(tp={}));np.default=tp});var Is=w(me=>{"use strict";var nA=me&&me.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),rA=me&&me.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&nA(e,n,t)};Object.defineProperty(me,"__esModule",{value:!0});me.createMessageConnection=me.createServerSocketTransport=me.createClientSocketTransport=me.createServerPipeTransport=me.createClientPipeTransport=me.generateRandomPipeName=me.StreamMessageWriter=me.StreamMessageReader=me.SocketMessageWriter=me.SocketMessageReader=me.PortMessageWriter=me.PortMessageReader=me.IPCMessageWriter=me.IPCMessageReader=void 0;var Ei=Yv();Ei.default.install();var Jv=require("path"),sA=require("os"),iA=require("crypto"),Tl=require("net"),fn=gl();rA(gl(),me);var rp=class extends fn.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),fn.Disposable.create(()=>this.process.off("message",e))}};me.IPCMessageReader=rp;var sp=class extends fn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};me.IPCMessageWriter=sp;var ip=class extends fn.AbstractMessageReader{constructor(e){super(),this.onData=new fn.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};me.PortMessageReader=ip;var op=class extends fn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};me.PortMessageWriter=op;var Os=class extends fn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,Ei.default)().stream.asReadableStream(e),t)}};me.SocketMessageReader=Os;var As=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,Ei.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};me.SocketMessageWriter=As;var bl=class extends fn.ReadableStreamMessageReader{constructor(e,t){super((0,Ei.default)().stream.asReadableStream(e),t)}};me.StreamMessageReader=bl;var vl=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,Ei.default)().stream.asWritableStream(e),t)}};me.StreamMessageWriter=vl;var Xv=process.env.XDG_RUNTIME_DIR,oA=new Map([["linux",107],["darwin",103]]);function aA(){let n=(0,iA.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;Xv?e=Jv.join(Xv,`vscode-ipc-${n}.sock`):e=Jv.join(sA.tmpdir(),`vscode-${n}.sock`);let t=oA.get(process.platform);return t!==void 0&&e.length>t&&(0,Ei.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}me.generateRandomPipeName=aA;function cA(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Tl.createServer)(a=>{o.close(),t([new Os(a,e),new As(a,e)])});o.on("error",i),o.listen(n,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}me.createClientPipeTransport=cA;function lA(n,e="utf-8"){let t=(0,Tl.createConnection)(n);return[new Os(t,e),new As(t,e)]}me.createServerPipeTransport=lA;function uA(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Tl.createServer)(a=>{o.close(),t([new Os(a,e),new As(a,e)])});o.on("error",i),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}me.createClientSocketTransport=uA;function dA(n,e="utf-8"){let t=(0,Tl.createConnection)(n,"127.0.0.1");return[new Os(t,e),new As(t,e)]}me.createServerSocketTransport=dA;function fA(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function hA(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function pA(n,e,t,r){t||(t=fn.NullLogger);let s=fA(n)?new bl(n):n,i=hA(e)?new vl(e):e;return fn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,fn.createMessageConnection)(s,i,t,r)}me.createMessageConnection=pA});var ap=w((mH,Qv)=>{"use strict";Qv.exports=Is()});var Sl=w((Zv,_l)=>{(function(n){if(typeof _l=="object"&&typeof _l.exports=="object"){var e=n(require,Zv);e!==void 0&&(_l.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(p){function N(P){return typeof P=="string"}p.is=N})(t||(e.DocumentUri=t={}));var r;(function(p){function N(P){return typeof P=="string"}p.is=N})(r||(e.URI=r={}));var s;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&p.MIN_VALUE<=P&&P<=p.MAX_VALUE}p.is=N})(s||(e.integer=s={}));var i;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&p.MIN_VALUE<=P&&P<=p.MAX_VALUE}p.is=N})(i||(e.uinteger=i={}));var o;(function(p){function N(y,h){return y===Number.MAX_VALUE&&(y=i.MAX_VALUE),h===Number.MAX_VALUE&&(h=i.MAX_VALUE),{line:y,character:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.uinteger(h.line)&&C.uinteger(h.character)}p.is=P})(o||(e.Position=o={}));var a;(function(p){function N(y,h,D,M){if(C.uinteger(y)&&C.uinteger(h)&&C.uinteger(D)&&C.uinteger(M))return{start:o.create(y,h),end:o.create(D,M)};if(o.is(y)&&o.is(h))return{start:y,end:h};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(h,", ").concat(D,", ").concat(M,"]"))}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&o.is(h.start)&&o.is(h.end)}p.is=P})(a||(e.Range=a={}));var c;(function(p){function N(y,h){return{uri:y,range:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&(C.string(h.uri)||C.undefined(h.uri))}p.is=P})(c||(e.Location=c={}));var l;(function(p){function N(y,h,D,M){return{targetUri:y,targetRange:h,targetSelectionRange:D,originSelectionRange:M}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.targetRange)&&C.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||C.undefined(h.originSelectionRange))}p.is=P})(l||(e.LocationLink=l={}));var u;(function(p){function N(y,h,D,M){return{red:y,green:h,blue:D,alpha:M}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.numberRange(h.red,0,1)&&C.numberRange(h.green,0,1)&&C.numberRange(h.blue,0,1)&&C.numberRange(h.alpha,0,1)}p.is=P})(u||(e.Color=u={}));var d;(function(p){function N(y,h){return{range:y,color:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&u.is(h.color)}p.is=P})(d||(e.ColorInformation=d={}));var f;(function(p){function N(y,h,D){return{label:y,textEdit:h,additionalTextEdits:D}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.string(h.label)&&(C.undefined(h.textEdit)||O.is(h))&&(C.undefined(h.additionalTextEdits)||C.typedArray(h.additionalTextEdits,O.is))}p.is=P})(f||(e.ColorPresentation=f={}));var m;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(m||(e.FoldingRangeKind=m={}));var T;(function(p){function N(y,h,D,M,se,nt){var xe={startLine:y,endLine:h};return C.defined(D)&&(xe.startCharacter=D),C.defined(M)&&(xe.endCharacter=M),C.defined(se)&&(xe.kind=se),C.defined(nt)&&(xe.collapsedText=nt),xe}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.uinteger(h.startLine)&&C.uinteger(h.startLine)&&(C.undefined(h.startCharacter)||C.uinteger(h.startCharacter))&&(C.undefined(h.endCharacter)||C.uinteger(h.endCharacter))&&(C.undefined(h.kind)||C.string(h.kind))}p.is=P})(T||(e.FoldingRange=T={}));var g;(function(p){function N(y,h){return{location:y,message:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&c.is(h.location)&&C.string(h.message)}p.is=P})(g||(e.DiagnosticRelatedInformation=g={}));var S;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(S||(e.DiagnosticSeverity=S={}));var E;(function(p){p.Unnecessary=1,p.Deprecated=2})(E||(e.DiagnosticTag=E={}));var v;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&C.string(y.href)}p.is=N})(v||(e.CodeDescription=v={}));var b;(function(p){function N(y,h,D,M,se,nt){var xe={range:y,message:h};return C.defined(D)&&(xe.severity=D),C.defined(M)&&(xe.code=M),C.defined(se)&&(xe.source=se),C.defined(nt)&&(xe.relatedInformation=nt),xe}p.create=N;function P(y){var h,D=y;return C.defined(D)&&a.is(D.range)&&C.string(D.message)&&(C.number(D.severity)||C.undefined(D.severity))&&(C.integer(D.code)||C.string(D.code)||C.undefined(D.code))&&(C.undefined(D.codeDescription)||C.string((h=D.codeDescription)===null||h===void 0?void 0:h.href))&&(C.string(D.source)||C.undefined(D.source))&&(C.undefined(D.relatedInformation)||C.typedArray(D.relatedInformation,g.is))}p.is=P})(b||(e.Diagnostic=b={}));var R;(function(p){function N(y,h){for(var D=[],M=2;M<arguments.length;M++)D[M-2]=arguments[M];var se={title:y,command:h};return C.defined(D)&&D.length>0&&(se.arguments=D),se}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.title)&&C.string(h.command)}p.is=P})(R||(e.Command=R={}));var O;(function(p){function N(D,M){return{range:D,newText:M}}p.replace=N;function P(D,M){return{range:{start:D,end:D},newText:M}}p.insert=P;function y(D){return{range:D,newText:""}}p.del=y;function h(D){var M=D;return C.objectLiteral(M)&&C.string(M.newText)&&a.is(M.range)}p.is=h})(O||(e.TextEdit=O={}));var L;(function(p){function N(y,h,D){var M={label:y};return h!==void 0&&(M.needsConfirmation=h),D!==void 0&&(M.description=D),M}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.string(h.label)&&(C.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(C.string(h.description)||h.description===void 0)}p.is=P})(L||(e.ChangeAnnotation=L={}));var V;(function(p){function N(P){var y=P;return C.string(y)}p.is=N})(V||(e.ChangeAnnotationIdentifier=V={}));var j;(function(p){function N(D,M,se){return{range:D,newText:M,annotationId:se}}p.replace=N;function P(D,M,se){return{range:{start:D,end:D},newText:M,annotationId:se}}p.insert=P;function y(D,M){return{range:D,newText:"",annotationId:M}}p.del=y;function h(D){var M=D;return O.is(M)&&(L.is(M.annotationId)||V.is(M.annotationId))}p.is=h})(j||(e.AnnotatedTextEdit=j={}));var re;(function(p){function N(y,h){return{textDocument:y,edits:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&Ps.is(h.textDocument)&&Array.isArray(h.edits)}p.is=P})(re||(e.TextDocumentEdit=re={}));var Ae;(function(p){function N(y,h,D){var M={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&(M.options=h),D!==void 0&&(M.annotationId=D),M}p.create=N;function P(y){var h=y;return h&&h.kind==="create"&&C.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(Ae||(e.CreateFile=Ae={}));var yt;(function(p){function N(y,h,D,M){var se={kind:"rename",oldUri:y,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(se.options=D),M!==void 0&&(se.annotationId=M),se}p.create=N;function P(y){var h=y;return h&&h.kind==="rename"&&C.string(h.oldUri)&&C.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(yt||(e.RenameFile=yt={}));var de;(function(p){function N(y,h,D){var M={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&(M.options=h),D!==void 0&&(M.annotationId=D),M}p.create=N;function P(y){var h=y;return h&&h.kind==="delete"&&C.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||C.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||C.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(de||(e.DeleteFile=de={}));var yn;(function(p){function N(P){var y=P;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(h){return C.string(h.kind)?Ae.is(h)||yt.is(h)||de.is(h):re.is(h)}))}p.is=N})(yn||(e.WorkspaceEdit=yn={}));var xr=function(){function p(N,P){this.edits=N,this.changeAnnotations=P}return p.prototype.insert=function(N,P,y){var h,D;if(y===void 0?h=O.insert(N,P):V.is(y)?(D=y,h=j.insert(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.insert(N,P,D)),this.edits.push(h),D!==void 0)return D},p.prototype.replace=function(N,P,y){var h,D;if(y===void 0?h=O.replace(N,P):V.is(y)?(D=y,h=j.replace(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.replace(N,P,D)),this.edits.push(h),D!==void 0)return D},p.prototype.delete=function(N,P){var y,h;if(P===void 0?y=O.del(N):V.is(P)?(h=P,y=j.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),h=this.changeAnnotations.manage(P),y=j.del(N,h)),this.edits.push(y),h!==void 0)return h},p.prototype.add=function(N){this.edits.push(N)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),qc=function(){function p(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(N,P){var y;if(V.is(N)?y=N:(y=this.nextId(),P=N),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=P,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),Yf=function(){function p(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new qc(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(re.is(y)){var h=new xr(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new xr(N.changes[y]);P._textEditChanges[y]=h})):this._workspaceEdit={}}return Object.defineProperty(p.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}),p.prototype.getTextEditChange=function(N){if(Ps.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},y=this._textEditChanges[P.uri];if(!y){var h=[],D={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(D),y=new xr(h,this._changeAnnotations),this._textEditChanges[P.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[N];if(!y){var h=[];this._workspaceEdit.changes[N]=h,y=new xr(h),this._textEditChanges[N]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new qc,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||V.is(P)?h=P:y=P;var D,M;if(h===void 0?D=Ae.create(N,y):(M=V.is(h)?h:this._changeAnnotations.manage(h),D=Ae.create(N,y,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},p.prototype.renameFile=function(N,P,y,h){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(y)||V.is(y)?D=y:h=y;var M,se;if(D===void 0?M=yt.create(N,P,h):(se=V.is(D)?D:this._changeAnnotations.manage(D),M=yt.create(N,P,h,se)),this._workspaceEdit.documentChanges.push(M),se!==void 0)return se},p.prototype.deleteFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||V.is(P)?h=P:y=P;var D,M;if(h===void 0?D=de.create(N,y):(M=V.is(h)?h:this._changeAnnotations.manage(h),D=de.create(N,y,M)),this._workspaceEdit.documentChanges.push(D),M!==void 0)return M},p}();e.WorkspaceChange=Yf;var xc;(function(p){function N(y){return{uri:y}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)}p.is=P})(xc||(e.TextDocumentIdentifier=xc={}));var xo;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&C.integer(h.version)}p.is=P})(xo||(e.VersionedTextDocumentIdentifier=xo={}));var Ps;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&(h.version===null||C.integer(h.version))}p.is=P})(Ps||(e.OptionalVersionedTextDocumentIdentifier=Ps={}));var Tr;(function(p){function N(y,h,D,M){return{uri:y,languageId:h,version:D,text:M}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&C.string(h.languageId)&&C.integer(h.version)&&C.string(h.text)}p.is=P})(Tr||(e.TextDocumentItem=Tr={}));var fi;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function N(P){var y=P;return y===p.PlainText||y===p.Markdown}p.is=N})(fi||(e.MarkupKind=fi={}));var Rs;(function(p){function N(P){var y=P;return C.objectLiteral(P)&&fi.is(y.kind)&&C.string(y.value)}p.is=N})(Rs||(e.MarkupContent=Rs={}));var jc;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(jc||(e.CompletionItemKind=jc={}));var jo;(function(p){p.PlainText=1,p.Snippet=2})(jo||(e.InsertTextFormat=jo={}));var Fo;(function(p){p.Deprecated=1})(Fo||(e.CompletionItemTag=Fo={}));var Fc;(function(p){function N(y,h,D){return{newText:y,insert:h,replace:D}}p.create=N;function P(y){var h=y;return h&&C.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}p.is=P})(Fc||(e.InsertReplaceEdit=Fc={}));var Bc;(function(p){p.asIs=1,p.adjustIndentation=2})(Bc||(e.InsertTextMode=Bc={}));var Uc;(function(p){function N(P){var y=P;return y&&(C.string(y.detail)||y.detail===void 0)&&(C.string(y.description)||y.description===void 0)}p.is=N})(Uc||(e.CompletionItemLabelDetails=Uc={}));var Vc;(function(p){function N(P){return{label:P}}p.create=N})(Vc||(e.CompletionItem=Vc={}));var Wc;(function(p){function N(P,y){return{items:P||[],isIncomplete:!!y}}p.create=N})(Wc||(e.CompletionList=Wc={}));var hi;(function(p){function N(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=N;function P(y){var h=y;return C.string(h)||C.objectLiteral(h)&&C.string(h.language)&&C.string(h.value)}p.is=P})(hi||(e.MarkedString=hi={}));var $n;(function(p){function N(P){var y=P;return!!y&&C.objectLiteral(y)&&(Rs.is(y.contents)||hi.is(y.contents)||C.typedArray(y.contents,hi.is))&&(P.range===void 0||a.is(P.range))}p.is=N})($n||(e.Hover=$n={}));var Hc;(function(p){function N(P,y){return y?{label:P,documentation:y}:{label:P}}p.create=N})(Hc||(e.ParameterInformation=Hc={}));var Kc;(function(p){function N(P,y){for(var h=[],D=2;D<arguments.length;D++)h[D-2]=arguments[D];var M={label:P};return C.defined(y)&&(M.documentation=y),C.defined(h)?M.parameters=h:M.parameters=[],M}p.create=N})(Kc||(e.SignatureInformation=Kc={}));var Ds;(function(p){p.Text=1,p.Read=2,p.Write=3})(Ds||(e.DocumentHighlightKind=Ds={}));var zc;(function(p){function N(P,y){var h={range:P};return C.number(y)&&(h.kind=y),h}p.create=N})(zc||(e.DocumentHighlight=zc={}));var pi;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(pi||(e.SymbolKind=pi={}));var Gc;(function(p){p.Deprecated=1})(Gc||(e.SymbolTag=Gc={}));var _r;(function(p){function N(P,y,h,D,M){var se={name:P,kind:y,location:{uri:D,range:h}};return M&&(se.containerName=M),se}p.create=N})(_r||(e.SymbolInformation=_r={}));var jr;(function(p){function N(P,y,h,D){return D!==void 0?{name:P,kind:y,location:{uri:h,range:D}}:{name:P,kind:y,location:{uri:h}}}p.create=N})(jr||(e.WorkspaceSymbol=jr={}));var Yc;(function(p){function N(y,h,D,M,se,nt){var xe={name:y,detail:h,kind:D,range:M,selectionRange:se};return nt!==void 0&&(xe.children=nt),xe}p.create=N;function P(y){var h=y;return h&&C.string(h.name)&&C.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||C.string(h.detail))&&(h.deprecated===void 0||C.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}p.is=P})(Yc||(e.DocumentSymbol=Yc={}));var Jc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Jc||(e.CodeActionKind=Jc={}));var Zn;(function(p){p.Invoked=1,p.Automatic=2})(Zn||(e.CodeActionTriggerKind=Zn={}));var Bo;(function(p){function N(y,h,D){var M={diagnostics:y};return h!=null&&(M.only=h),D!=null&&(M.triggerKind=D),M}p.create=N;function P(y){var h=y;return C.defined(h)&&C.typedArray(h.diagnostics,b.is)&&(h.only===void 0||C.typedArray(h.only,C.string))&&(h.triggerKind===void 0||h.triggerKind===Zn.Invoked||h.triggerKind===Zn.Automatic)}p.is=P})(Bo||(e.CodeActionContext=Bo={}));var Uo;(function(p){function N(y,h,D){var M={title:y},se=!0;return typeof h=="string"?(se=!1,M.kind=h):R.is(h)?M.command=h:M.edit=h,se&&D!==void 0&&(M.kind=D),M}p.create=N;function P(y){var h=y;return h&&C.string(h.title)&&(h.diagnostics===void 0||C.typedArray(h.diagnostics,b.is))&&(h.kind===void 0||C.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||C.boolean(h.isPreferred))&&(h.edit===void 0||yn.is(h.edit))}p.is=P})(Uo||(e.CodeAction=Uo={}));var mi;(function(p){function N(y,h){var D={range:y};return C.defined(h)&&(D.data=h),D}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.command)||R.is(h.command))}p.is=P})(mi||(e.CodeLens=mi={}));var Vo;(function(p){function N(y,h){return{tabSize:y,insertSpaces:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.uinteger(h.tabSize)&&C.boolean(h.insertSpaces)}p.is=P})(Vo||(e.FormattingOptions=Vo={}));var Sr;(function(p){function N(y,h,D){return{range:y,target:h,data:D}}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.target)||C.string(h.target))}p.is=P})(Sr||(e.DocumentLink=Sr={}));var k;(function(p){function N(y,h){return{range:y,parent:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||p.is(h.parent))}p.is=P})(k||(e.SelectionRange=k={}));var $;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})($||(e.SemanticTokenTypes=$={}));var F;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(F||(e.SemanticTokenModifiers=F={}));var W;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=N})(W||(e.SemanticTokens=W={}));var Ie;(function(p){function N(y,h){return{range:y,text:h}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&C.string(h.text)}p.is=P})(Ie||(e.InlineValueText=Ie={}));var Re;(function(p){function N(y,h,D){return{range:y,variableName:h,caseSensitiveLookup:D}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&C.boolean(h.caseSensitiveLookup)&&(C.string(h.variableName)||h.variableName===void 0)}p.is=P})(Re||(e.InlineValueVariableLookup=Re={}));var Ve;(function(p){function N(y,h){return{range:y,expression:h}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&(C.string(h.expression)||h.expression===void 0)}p.is=P})(Ve||(e.InlineValueEvaluatableExpression=Ve={}));var Ye;(function(p){function N(y,h){return{frameId:y,stoppedLocation:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(y.stoppedLocation)}p.is=P})(Ye||(e.InlineValueContext=Ye={}));var fe;(function(p){p.Type=1,p.Parameter=2;function N(P){return P===1||P===2}p.is=N})(fe||(e.InlayHintKind=fe={}));var Le;(function(p){function N(y){return{value:y}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&(h.tooltip===void 0||C.string(h.tooltip)||Rs.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}p.is=P})(Le||(e.InlayHintLabelPart=Le={}));var _e;(function(p){function N(y,h,D){var M={position:y,label:h};return D!==void 0&&(M.kind=D),M}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&o.is(h.position)&&(C.string(h.label)||C.typedArray(h.label,Le.is))&&(h.kind===void 0||fe.is(h.kind))&&h.textEdits===void 0||C.typedArray(h.textEdits,O.is)&&(h.tooltip===void 0||C.string(h.tooltip)||Rs.is(h.tooltip))&&(h.paddingLeft===void 0||C.boolean(h.paddingLeft))&&(h.paddingRight===void 0||C.boolean(h.paddingRight))}p.is=P})(_e||(e.InlayHint=_e={}));var tt;(function(p){function N(P){return{kind:"snippet",value:P}}p.createSnippet=N})(tt||(e.StringValue=tt={}));var _t;(function(p){function N(P,y,h,D){return{insertText:P,filterText:y,range:h,command:D}}p.create=N})(_t||(e.InlineCompletionItem=_t={}));var un;(function(p){function N(P){return{items:P}}p.create=N})(un||(e.InlineCompletionList=un={}));var Xc;(function(p){p.Invoked=0,p.Automatic=1})(Xc||(e.InlineCompletionTriggerKind=Xc={}));var mv;(function(p){function N(P,y){return{range:P,text:y}}p.create=N})(mv||(e.SelectedCompletionInfo=mv={}));var gv;(function(p){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}p.create=N})(gv||(e.InlineCompletionContext=gv={}));var yv;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&r.is(y.uri)&&C.string(y.name)}p.is=N})(yv||(e.WorkspaceFolder=yv={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
35
|
-
`,
|
|
36
|
-
`&&f++}m&&E.length>0&&k.push(E.length),this._lineOffsets=k}return this._lineOffsets},h.prototype.positionAt=function(k){k=Math.max(Math.min(k,this._content.length),0);var E=this.getLineOffsets(),m=0,f=E.length;if(f===0)return o.create(0,k);for(;m<f;){var P=Math.floor((m+f)/2);E[P]>k?f=P:m=P+1}var x=m-1;return o.create(x,k-E[x])},h.prototype.offsetAt=function(k){var E=this.getLineOffsets();if(k.line>=E.length)return this._content.length;if(k.line<0)return 0;var m=E[k.line],f=k.line+1<E.length?E[k.line+1]:this._content.length;return Math.max(Math.min(m+k.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var k=Object.prototype.toString;function E(oe){return typeof oe<"u"}h.defined=E;function m(oe){return typeof oe>"u"}h.undefined=m;function f(oe){return oe===!0||oe===!1}h.boolean=f;function P(oe){return k.call(oe)==="[object String]"}h.string=P;function x(oe){return k.call(oe)==="[object Number]"}h.number=x;function ee(oe,sr,Vo){return k.call(oe)==="[object Number]"&&sr<=oe&&oe<=Vo}h.numberRange=ee;function Ue(oe){return k.call(oe)==="[object Number]"&&-2147483648<=oe&&oe<=2147483647}h.integer=Ue;function Ne(oe){return k.call(oe)==="[object Number]"&&0<=oe&&oe<=2147483647}h.uinteger=Ne;function en(oe){return k.call(oe)==="[object Function]"}h.func=en;function tn(oe){return oe!==null&&typeof oe=="object"}h.objectLiteral=tn;function xn(oe,sr){return Array.isArray(oe)&&oe.every(sr)}h.typedArray=xn})(D||(D={}))})});var xe=C(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var pr=Mi(),um;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(um||(Dt.MessageDirection=um={}));var Tf=class{constructor(e){this.method=e}};Dt.RegistrationType=Tf;var vf=class extends pr.RequestType0{constructor(e){super(e)}};Dt.ProtocolRequestType0=vf;var Sf=class extends pr.RequestType{constructor(e){super(e,pr.ParameterStructures.byName)}};Dt.ProtocolRequestType=Sf;var kf=class extends pr.NotificationType0{constructor(e){super(e)}};Dt.ProtocolNotificationType0=kf;var Ef=class extends pr.NotificationType{constructor(e){super(e,pr.ParameterStructures.byName)}};Dt.ProtocolNotificationType=Ef});var ma=C(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.objectLiteral=Ke.typedArray=Ke.stringArray=Ke.array=Ke.func=Ke.error=Ke.number=Ke.string=Ke.boolean=void 0;function TN(n){return n===!0||n===!1}Ke.boolean=TN;function fm(n){return typeof n=="string"||n instanceof String}Ke.string=fm;function vN(n){return typeof n=="number"||n instanceof Number}Ke.number=vN;function SN(n){return n instanceof Error}Ke.error=SN;function kN(n){return typeof n=="function"}Ke.func=kN;function dm(n){return Array.isArray(n)}Ke.array=dm;function EN(n){return dm(n)&&n.every(e=>fm(e))}Ke.stringArray=EN;function wN(n,e){return Array.isArray(n)&&n.every(e)}Ke.typedArray=wN;function NN(n){return n!==null&&typeof n=="object"}Ke.objectLiteral=NN});var mm=C(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.ImplementationRequest=void 0;var hm=xe(),pm;(function(n){n.method="textDocument/implementation",n.messageDirection=hm.MessageDirection.clientToServer,n.type=new hm.ProtocolRequestType(n.method)})(pm||(ga.ImplementationRequest=pm={}))});var bm=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.TypeDefinitionRequest=void 0;var gm=xe(),ym;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=gm.MessageDirection.clientToServer,n.type=new gm.ProtocolRequestType(n.method)})(ym||(ya.TypeDefinitionRequest=ym={}))});var Sm=C(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.DidChangeWorkspaceFoldersNotification=mr.WorkspaceFoldersRequest=void 0;var ba=xe(),Tm;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=ba.MessageDirection.serverToClient,n.type=new ba.ProtocolRequestType0(n.method)})(Tm||(mr.WorkspaceFoldersRequest=Tm={}));var vm;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolNotificationType(n.method)})(vm||(mr.DidChangeWorkspaceFoldersNotification=vm={}))});var wm=C(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ConfigurationRequest=void 0;var km=xe(),Em;(function(n){n.method="workspace/configuration",n.messageDirection=km.MessageDirection.serverToClient,n.type=new km.ProtocolRequestType(n.method)})(Em||(Ta.ConfigurationRequest=Em={}))});var Pm=C(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.ColorPresentationRequest=gr.DocumentColorRequest=void 0;var va=xe(),Nm;(function(n){n.method="textDocument/documentColor",n.messageDirection=va.MessageDirection.clientToServer,n.type=new va.ProtocolRequestType(n.method)})(Nm||(gr.DocumentColorRequest=Nm={}));var _m;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=va.MessageDirection.clientToServer,n.type=new va.ProtocolRequestType(n.method)})(_m||(gr.ColorPresentationRequest=_m={}))});var Cm=C(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.FoldingRangeRefreshRequest=yr.FoldingRangeRequest=void 0;var Sa=xe(),Dm;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Sa.MessageDirection.clientToServer,n.type=new Sa.ProtocolRequestType(n.method)})(Dm||(yr.FoldingRangeRequest=Dm={}));var Rm;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Sa.MessageDirection.serverToClient,n.type=new Sa.ProtocolRequestType0(n.method)})(Rm||(yr.FoldingRangeRefreshRequest=Rm={}))});var Im=C(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.DeclarationRequest=void 0;var Om=xe(),Am;(function(n){n.method="textDocument/declaration",n.messageDirection=Om.MessageDirection.clientToServer,n.type=new Om.ProtocolRequestType(n.method)})(Am||(ka.DeclarationRequest=Am={}))});var Mm=C(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.SelectionRangeRequest=void 0;var Lm=xe(),xm;(function(n){n.method="textDocument/selectionRange",n.messageDirection=Lm.MessageDirection.clientToServer,n.type=new Lm.ProtocolRequestType(n.method)})(xm||(Ea.SelectionRangeRequest=xm={}))});var jm=C(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.WorkDoneProgressCancelNotification=Qn.WorkDoneProgressCreateRequest=Qn.WorkDoneProgress=void 0;var _N=Mi(),wa=xe(),qm;(function(n){n.type=new _N.ProgressType;function e(t){return t===n.type}n.is=e})(qm||(Qn.WorkDoneProgress=qm={}));var Fm;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=wa.MessageDirection.serverToClient,n.type=new wa.ProtocolRequestType(n.method)})(Fm||(Qn.WorkDoneProgressCreateRequest=Fm={}));var Bm;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=wa.MessageDirection.clientToServer,n.type=new wa.ProtocolNotificationType(n.method)})(Bm||(Qn.WorkDoneProgressCancelNotification=Bm={}))});var Vm=C(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.CallHierarchyOutgoingCallsRequest=Jn.CallHierarchyIncomingCallsRequest=Jn.CallHierarchyPrepareRequest=void 0;var br=xe(),Um;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(Um||(Jn.CallHierarchyPrepareRequest=Um={}));var $m;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})($m||(Jn.CallHierarchyIncomingCallsRequest=$m={}));var Wm;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(Wm||(Jn.CallHierarchyOutgoingCallsRequest=Wm={}))});var Xm=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var qn=xe(),Hm;(function(n){n.Relative="relative"})(Hm||(Rt.TokenFormat=Hm={}));var Ts;(function(n){n.method="textDocument/semanticTokens",n.type=new qn.RegistrationType(n.method)})(Ts||(Rt.SemanticTokensRegistrationType=Ts={}));var Ym;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(Ym||(Rt.SemanticTokensRequest=Ym={}));var Km;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(Km||(Rt.SemanticTokensDeltaRequest=Km={}));var zm;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(zm||(Rt.SemanticTokensRangeRequest=zm={}));var Gm;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=qn.MessageDirection.serverToClient,n.type=new qn.ProtocolRequestType0(n.method)})(Gm||(Rt.SemanticTokensRefreshRequest=Gm={}))});var Zm=C(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.ShowDocumentRequest=void 0;var Qm=xe(),Jm;(function(n){n.method="window/showDocument",n.messageDirection=Qm.MessageDirection.serverToClient,n.type=new Qm.ProtocolRequestType(n.method)})(Jm||(Na.ShowDocumentRequest=Jm={}))});var ng=C(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.LinkedEditingRangeRequest=void 0;var eg=xe(),tg;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=eg.MessageDirection.clientToServer,n.type=new eg.ProtocolRequestType(n.method)})(tg||(_a.LinkedEditingRangeRequest=tg={}))});var ug=C(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var $t=xe(),ig;(function(n){n.file="file",n.folder="folder"})(ig||(yt.FileOperationPatternKind=ig={}));var rg;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(rg||(yt.WillCreateFilesRequest=rg={}));var sg;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(sg||(yt.DidCreateFilesNotification=sg={}));var og;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(og||(yt.WillRenameFilesRequest=og={}));var ag;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(ag||(yt.DidRenameFilesNotification=ag={}));var cg;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(cg||(yt.DidDeleteFilesNotification=cg={}));var lg;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(lg||(yt.WillDeleteFilesRequest=lg={}))});var mg=C(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.MonikerRequest=Zn.MonikerKind=Zn.UniquenessLevel=void 0;var fg=xe(),dg;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(dg||(Zn.UniquenessLevel=dg={}));var hg;(function(n){n.$import="import",n.$export="export",n.local="local"})(hg||(Zn.MonikerKind=hg={}));var pg;(function(n){n.method="textDocument/moniker",n.messageDirection=fg.MessageDirection.clientToServer,n.type=new fg.ProtocolRequestType(n.method)})(pg||(Zn.MonikerRequest=pg={}))});var Tg=C(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.TypeHierarchySubtypesRequest=ei.TypeHierarchySupertypesRequest=ei.TypeHierarchyPrepareRequest=void 0;var Tr=xe(),gg;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(gg||(ei.TypeHierarchyPrepareRequest=gg={}));var yg;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(yg||(ei.TypeHierarchySupertypesRequest=yg={}));var bg;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(bg||(ei.TypeHierarchySubtypesRequest=bg={}))});var kg=C(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.InlineValueRefreshRequest=vr.InlineValueRequest=void 0;var Pa=xe(),vg;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Pa.MessageDirection.clientToServer,n.type=new Pa.ProtocolRequestType(n.method)})(vg||(vr.InlineValueRequest=vg={}));var Sg;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Pa.MessageDirection.serverToClient,n.type=new Pa.ProtocolRequestType0(n.method)})(Sg||(vr.InlineValueRefreshRequest=Sg={}))});var _g=C(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.InlayHintRefreshRequest=ti.InlayHintResolveRequest=ti.InlayHintRequest=void 0;var Sr=xe(),Eg;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method)})(Eg||(ti.InlayHintRequest=Eg={}));var wg;(function(n){n.method="inlayHint/resolve",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method)})(wg||(ti.InlayHintResolveRequest=wg={}));var Ng;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Sr.MessageDirection.serverToClient,n.type=new Sr.ProtocolRequestType0(n.method)})(Ng||(ti.InlayHintRefreshRequest=Ng={}))});var Ig=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.DiagnosticRefreshRequest=Wt.WorkspaceDiagnosticRequest=Wt.DocumentDiagnosticRequest=Wt.DocumentDiagnosticReportKind=Wt.DiagnosticServerCancellationData=void 0;var Ag=Mi(),PN=ma(),kr=xe(),Pg;(function(n){function e(t){let i=t;return i&&PN.boolean(i.retriggerRequest)}n.is=e})(Pg||(Wt.DiagnosticServerCancellationData=Pg={}));var Dg;(function(n){n.Full="full",n.Unchanged="unchanged"})(Dg||(Wt.DocumentDiagnosticReportKind=Dg={}));var Rg;(function(n){n.method="textDocument/diagnostic",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.partialResult=new Ag.ProgressType})(Rg||(Wt.DocumentDiagnosticRequest=Rg={}));var Cg;(function(n){n.method="workspace/diagnostic",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.partialResult=new Ag.ProgressType})(Cg||(Wt.WorkspaceDiagnosticRequest=Cg={}));var Og;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=kr.MessageDirection.serverToClient,n.type=new kr.ProtocolRequestType0(n.method)})(Og||(Wt.DiagnosticRefreshRequest=Og={}))});var jg=C($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var vs=pa(),rn=ma(),gn=xe(),wf;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(wf||($e.NotebookCellKind=wf={}));var Nf;(function(n){function e(r,s){let o={executionOrder:r};return(s===!0||s===!1)&&(o.success=s),o}n.create=e;function t(r){let s=r;return rn.objectLiteral(s)&&vs.uinteger.is(s.executionOrder)&&(s.success===void 0||rn.boolean(s.success))}n.is=t;function i(r,s){return r===s?!0:r==null||s===null||s===void 0?!1:r.executionOrder===s.executionOrder&&r.success===s.success}n.equals=i})(Nf||($e.ExecutionSummary=Nf={}));var Da;(function(n){function e(s,o){return{kind:s,document:o}}n.create=e;function t(s){let o=s;return rn.objectLiteral(o)&&wf.is(o.kind)&&vs.DocumentUri.is(o.document)&&(o.metadata===void 0||rn.objectLiteral(o.metadata))}n.is=t;function i(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!r(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Nf.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function r(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!r(s[l],o[l]))return!1}if(rn.objectLiteral(s)&&rn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!r(l,u)))return!1;for(let d=0;d<l.length;d++){let p=l[d];if(!r(s[p],o[p]))return!1}}return!0}})(Da||($e.NotebookCell=Da={}));var Lg;(function(n){function e(i,r,s,o){return{uri:i,notebookType:r,version:s,cells:o}}n.create=e;function t(i){let r=i;return rn.objectLiteral(r)&&rn.string(r.uri)&&vs.integer.is(r.version)&&rn.typedArray(r.cells,Da.is)}n.is=t})(Lg||($e.NotebookDocument=Lg={}));var Er;(function(n){n.method="notebookDocument/sync",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.RegistrationType(n.method)})(Er||($e.NotebookDocumentSyncRegistrationType=Er={}));var xg;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(xg||($e.DidOpenNotebookDocumentNotification=xg={}));var Mg;(function(n){function e(i){let r=i;return rn.objectLiteral(r)&&vs.uinteger.is(r.start)&&vs.uinteger.is(r.deleteCount)&&(r.cells===void 0||rn.typedArray(r.cells,Da.is))}n.is=e;function t(i,r,s){let o={start:i,deleteCount:r};return s!==void 0&&(o.cells=s),o}n.create=t})(Mg||($e.NotebookCellArrayChange=Mg={}));var qg;(function(n){n.method="notebookDocument/didChange",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(qg||($e.DidChangeNotebookDocumentNotification=qg={}));var Fg;(function(n){n.method="notebookDocument/didSave",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(Fg||($e.DidSaveNotebookDocumentNotification=Fg={}));var Bg;(function(n){n.method="notebookDocument/didClose",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(Bg||($e.DidCloseNotebookDocumentNotification=Bg={}))});var Wg=C(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.InlineCompletionRequest=void 0;var Ug=xe(),$g;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=Ug.MessageDirection.clientToServer,n.type=new Ug.ProtocolRequestType(n.method)})($g||(Ra.InlineCompletionRequest=$g={}))});var nb=C(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var F=xe(),Vg=pa(),it=ma(),DN=mm();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return DN.ImplementationRequest}});var RN=bm();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return RN.TypeDefinitionRequest}});var Jy=Sm();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Jy.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Jy.DidChangeWorkspaceFoldersNotification}});var CN=wm();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return CN.ConfigurationRequest}});var Zy=Pm();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return Zy.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return Zy.ColorPresentationRequest}});var eb=Cm();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRefreshRequest}});var ON=Im();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return ON.DeclarationRequest}});var AN=Mm();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return AN.SelectionRangeRequest}});var Cf=jm();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return Cf.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCancelNotification}});var Of=Vm();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Of.CallHierarchyPrepareRequest}});var wr=Xm();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return wr.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return wr.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return wr.SemanticTokensRegistrationType}});var IN=Zm();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return IN.ShowDocumentRequest}});var LN=ng();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return LN.LinkedEditingRangeRequest}});var qi=ug();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Af=mg();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Af.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Af.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Af.MonikerRequest}});var If=Tg();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return If.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySupertypesRequest}});var tb=kg();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return tb.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return tb.InlineValueRefreshRequest}});var Lf=_g();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return Lf.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Lf.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Lf.InlayHintRefreshRequest}});var Ss=Ig();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ss.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ss.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ss.DiagnosticRefreshRequest}});var yn=jg();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return yn.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return yn.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return yn.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return yn.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return yn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return yn.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidCloseNotebookDocumentNotification}});var xN=Wg();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return xN.InlineCompletionRequest}});var _f;(function(n){function e(t){let i=t;return it.string(i)||it.string(i.language)||it.string(i.scheme)||it.string(i.pattern)}n.is=e})(_f||(b.TextDocumentFilter=_f={}));var Pf;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebookType)||it.string(i.scheme)||it.string(i.pattern))}n.is=e})(Pf||(b.NotebookDocumentFilter=Pf={}));var Df;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebook)||Pf.is(i.notebook))&&(i.language===void 0||it.string(i.language))}n.is=e})(Df||(b.NotebookCellTextDocumentFilter=Df={}));var Rf;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!it.string(i)&&!_f.is(i)&&!Df.is(i))return!1;return!0}n.is=e})(Rf||(b.DocumentSelector=Rf={}));var Hg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Hg||(b.RegistrationRequest=Hg={}));var Yg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Yg||(b.UnregistrationRequest=Yg={}));var Kg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Kg||(b.ResourceOperationKind=Kg={}));var zg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(zg||(b.FailureHandlingKind=zg={}));var Gg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Gg||(b.PositionEncodingKind=Gg={}));var Xg;(function(n){function e(t){let i=t;return i&&it.string(i.id)&&i.id.length>0}n.hasId=e})(Xg||(b.StaticRegistrationOptions=Xg={}));var Qg;(function(n){function e(t){let i=t;return i&&(i.documentSelector===null||Rf.is(i.documentSelector))}n.is=e})(Qg||(b.TextDocumentRegistrationOptions=Qg={}));var Jg;(function(n){function e(i){let r=i;return it.objectLiteral(r)&&(r.workDoneProgress===void 0||it.boolean(r.workDoneProgress))}n.is=e;function t(i){let r=i;return r&&it.boolean(r.workDoneProgress)}n.hasWorkDoneProgress=t})(Jg||(b.WorkDoneProgressOptions=Jg={}));var Zg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Zg||(b.InitializeRequest=Zg={}));var ey;(function(n){n.unknownProtocolVersion=1})(ey||(b.InitializeErrorCodes=ey={}));var ty;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ty||(b.InitializedNotification=ty={}));var ny;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ny||(b.ShutdownRequest=ny={}));var iy;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(iy||(b.ExitNotification=iy={}));var ry;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ry||(b.DidChangeConfigurationNotification=ry={}));var sy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(sy||(b.MessageType=sy={}));var oy;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(b.ShowMessageNotification=oy={}));var ay;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(ay||(b.ShowMessageRequest=ay={}));var cy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(cy||(b.LogMessageNotification=cy={}));var ly;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ly||(b.TelemetryEventNotification=ly={}));var uy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(uy||(b.TextDocumentSyncKind=uy={}));var fy;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(b.DidOpenTextDocumentNotification=fy={}));var dy;(function(n){function e(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}n.isIncremental=e;function t(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}n.isFull=t})(dy||(b.TextDocumentContentChangeEvent=dy={}));var hy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(b.DidChangeTextDocumentNotification=hy={}));var py;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(py||(b.DidCloseTextDocumentNotification=py={}));var my;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(b.DidSaveTextDocumentNotification=my={}));var gy;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(gy||(b.TextDocumentSaveReason=gy={}));var yy;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(b.WillSaveTextDocumentNotification=yy={}));var by;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(by||(b.WillSaveTextDocumentWaitUntilRequest=by={}));var Ty;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Ty||(b.DidChangeWatchedFilesNotification=Ty={}));var vy;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(vy||(b.FileChangeType=vy={}));var Sy;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(Vg.URI.is(i.baseUri)||Vg.WorkspaceFolder.is(i.baseUri))&&it.string(i.pattern)}n.is=e})(Sy||(b.RelativePattern=Sy={}));var ky;(function(n){n.Create=1,n.Change=2,n.Delete=4})(ky||(b.WatchKind=ky={}));var Ey;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Ey||(b.PublishDiagnosticsNotification=Ey={}));var wy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(wy||(b.CompletionTriggerKind=wy={}));var Ny;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(b.CompletionRequest=Ny={}));var _y;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(_y||(b.CompletionResolveRequest=_y={}));var Py;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(b.HoverRequest=Py={}));var Dy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(Dy||(b.SignatureHelpTriggerKind=Dy={}));var Ry;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(b.SignatureHelpRequest=Ry={}));var Cy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(b.DefinitionRequest=Cy={}));var Oy;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(b.ReferencesRequest=Oy={}));var Ay;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(b.DocumentHighlightRequest=Ay={}));var Iy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(b.DocumentSymbolRequest=Iy={}));var Ly;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(b.CodeActionRequest=Ly={}));var xy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(b.CodeActionResolveRequest=xy={}));var My;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(b.WorkspaceSymbolRequest=My={}));var qy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(b.WorkspaceSymbolResolveRequest=qy={}));var Fy;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Fy||(b.CodeLensRequest=Fy={}));var By;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(b.CodeLensResolveRequest=By={}));var jy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(jy||(b.CodeLensRefreshRequest=jy={}));var Uy;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(b.DocumentLinkRequest=Uy={}));var $y;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(b.DocumentLinkResolveRequest=$y={}));var Wy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(b.DocumentFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(b.DocumentRangeFormattingRequest=Vy={}));var Hy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Hy||(b.DocumentRangesFormattingRequest=Hy={}));var Yy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(b.DocumentOnTypeFormattingRequest=Yy={}));var Ky;(function(n){n.Identifier=1})(Ky||(b.PrepareSupportDefaultBehavior=Ky={}));var zy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(b.RenameRequest=zy={}));var Gy;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Gy||(b.PrepareRenameRequest=Gy={}));var Xy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Xy||(b.ExecuteCommandRequest=Xy={}));var Qy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Qy||(b.ApplyWorkspaceEditRequest=Qy={}))});var rb=C(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createProtocolConnection=void 0;var ib=Mi();function MN(n,e,t,i){return ib.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,ib.createMessageConnection)(n,e,t,i)}Ca.createProtocolConnection=MN});var ob=C(Ct=>{"use strict";var qN=Ct&&Ct.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Oa=Ct&&Ct.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qN(e,n,t)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LSPErrorCodes=Ct.createProtocolConnection=void 0;Oa(Mi(),Ct);Oa(pa(),Ct);Oa(xe(),Ct);Oa(nb(),Ct);var FN=rb();Object.defineProperty(Ct,"createProtocolConnection",{enumerable:!0,get:function(){return FN.createProtocolConnection}});var sb;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(sb||(Ct.LSPErrorCodes=sb={}))});var We=C(bn=>{"use strict";var BN=bn&&bn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),ab=bn&&bn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&BN(e,n,t)};Object.defineProperty(bn,"__esModule",{value:!0});bn.createProtocolConnection=void 0;var jN=bf();ab(bf(),bn);ab(ob(),bn);function UN(n,e,t,i){return(0,jN.createMessageConnection)(n,e,t,i)}bn.createProtocolConnection=UN});var xf=C(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.generateUuid=Vt.parse=Vt.isUUID=Vt.v4=Vt.empty=void 0;var ks=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Es=class n extends ks{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};Es._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Es._timeHighBits=["8","9","a","b"];Vt.empty=new ks("00000000-0000-0000-0000-000000000000");function cb(){return new Es}Vt.v4=cb;var $N=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lb(n){return $N.test(n)}Vt.isUUID=lb;function WN(n){if(!lb(n))throw new Error("invalid uuid");return new ks(n)}Vt.parse=WN;function VN(){return cb().asHex()}Vt.generateUuid=VN});var ub=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.attachPartialResult=ii.ProgressFeature=ii.attachWorkDone=void 0;var ni=We(),HN=xf(),Fi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,i,r){let s={kind:"begin",title:e,percentage:t,message:i,cancellable:r};this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,s)}report(e,t){let i={kind:"report"};typeof e=="number"?(i.percentage=e,t!==void 0&&(i.message=t)):i.message=e,this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,i)}done(){n.Instances.delete(this._token),this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,{kind:"end"})}};Fi.Instances=new Map;var Aa=class extends Fi{constructor(e,t){super(e,t),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ws=class{constructor(){}begin(){}report(){}done(){}},Ia=class extends ws{constructor(){super(),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function YN(n,e){if(e===void 0||e.workDoneToken===void 0)return new ws;let t=e.workDoneToken;return delete e.workDoneToken,new Fi(n,t)}ii.attachWorkDone=YN;var KN=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ni.WorkDoneProgressCancelNotification.type,t=>{let i=Fi.Instances.get(t.token);(i instanceof Aa||i instanceof Ia)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ws:new Fi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,HN.generateUuid)();return this.connection.sendRequest(ni.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Aa(this.connection,e))}else return Promise.resolve(new Ia)}};ii.ProgressFeature=KN;var Mf;(function(n){n.type=new ni.ProgressType})(Mf||(Mf={}));var qf=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Mf.type,this._token,e)}};function zN(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new qf(n,t)}ii.attachPartialResult=zN});var fb=C(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.ConfigurationFeature=void 0;var GN=We(),XN=Ho(),QN=n=>class extends n{getConfiguration(e){return e?XN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(GN.ConfigurationRequest.type,t).then(i=>Array.isArray(i)?Array.isArray(e)?i:i[0]:Array.isArray(e)?[]:null)}};La.ConfigurationFeature=QN});var db=C(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.WorkspaceFoldersFeature=void 0;var xa=We(),JN=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new xa.Emitter,this.connection.onNotification(xa.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(xa.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(xa.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ma.WorkspaceFoldersFeature=JN});var hb=C(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.CallHierarchyFeature=void 0;var Ff=We(),ZN=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ff.CallHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Ff.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onOutgoingCalls:e=>{let t=Ff.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};qa.CallHierarchyFeature=ZN});var jf=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.SemanticTokensBuilder=ri.SemanticTokensDiff=ri.SemanticTokensFeature=void 0;var Fa=We(),e_=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Fa.SemanticTokensRefreshRequest.type),on:e=>{let t=Fa.SemanticTokensRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onDelta:e=>{let t=Fa.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onRange:e=>{let t=Fa.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};ri.SemanticTokensFeature=e_;var Ba=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,i=0;for(;i<t&&i<e&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<t&&i<e){let r=e-1,s=t-1;for(;r>=i&&s>=i&&this.originalSequence[r]===this.modifiedSequence[s];)r--,s--;(r<i||s<i)&&(r++,s++);let o=r-i+1,a=this.modifiedSequence.slice(i,s+1);return a.length===1&&a[0]===this.originalSequence[r]?[{start:i,deleteCount:o-1}]:[{start:i,deleteCount:o,data:a}]}else return i<t?[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}]:i<e?[{start:i,deleteCount:e-i}]:[]}};ri.SemanticTokensDiff=Ba;var Bf=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,i,r,s){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Ba(this._prevData,this._data).computeDiff()}:this.build()}};ri.SemanticTokensBuilder=Bf});var pb=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.ShowDocumentFeature=void 0;var t_=We(),n_=n=>class extends n{showDocument(e){return this.connection.sendRequest(t_.ShowDocumentRequest.type,e)}};ja.ShowDocumentFeature=n_});var mb=C(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.FileOperationsFeature=void 0;var Nr=We(),i_=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(Nr.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Nr.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Nr.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Nr.WillCreateFilesRequest.type,(t,i)=>e(t,i))}onWillRenameFiles(e){return this.connection.onRequest(Nr.WillRenameFilesRequest.type,(t,i)=>e(t,i))}onWillDeleteFiles(e){return this.connection.onRequest(Nr.WillDeleteFilesRequest.type,(t,i)=>e(t,i))}};Ua.FileOperationsFeature=i_});var gb=C($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.LinkedEditingRangeFeature=void 0;var r_=We(),s_=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(r_.LinkedEditingRangeRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0))}};$a.LinkedEditingRangeFeature=s_});var yb=C(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.TypeHierarchyFeature=void 0;var Uf=We(),o_=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Uf.TypeHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=Uf.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onSubtypes:e=>{let t=Uf.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Wa.TypeHierarchyFeature=o_});var Tb=C(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.InlineValueFeature=void 0;var bb=We(),a_=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(bb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(bb.InlineValueRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};Va.InlineValueFeature=a_});var Sb=C(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.FoldingRangeFeature=void 0;var vb=We(),c_=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(vb.FoldingRangeRefreshRequest.type),on:e=>{let t=vb.FoldingRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Ha.FoldingRangeFeature=c_});var kb=C(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.InlayHintFeature=void 0;var $f=We(),l_=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest($f.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest($f.InlayHintRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest($f.InlayHintResolveRequest.type,(t,i)=>e(t,i))}}};Ya.InlayHintFeature=l_});var Eb=C(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.DiagnosticFeature=void 0;var Ns=We(),u_=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ns.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ns.DocumentDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ns.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Ns.WorkspaceDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ns.WorkspaceDiagnosticRequest.partialResult,t)))}}};Ka.DiagnosticFeature=u_});var Vf=C(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.TextDocuments=void 0;var Bi=We(),Wf=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Bi.Emitter,this._onDidOpen=new Bi.Emitter,this._onDidClose=new Bi.Emitter,this._onDidSave=new Bi.Emitter,this._onWillSave=new Bi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Bi.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(i=>{let r=i.textDocument,s=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(i=>{let r=i.textDocument,s=i.contentChanges;if(s.length===0)return;let{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),t.push(e.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((i,r)=>{let s=this._syncedDocuments.get(i.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:i.reason}),r):[]})),t.push(e.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Bi.Disposable.create(()=>{t.forEach(i=>i.dispose())})}};za.TextDocuments=Wf});var Yf=C(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.NotebookDocuments=_r.NotebookSyncFeature=void 0;var Ht=We(),wb=Vf(),f_=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Ht.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Ht.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Ht.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Ht.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};_r.NotebookSyncFeature=f_;var Ga=class n{onDidOpenTextDocument(e){return this.openHandler=e,Ht.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ht.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ht.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Ga.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Hf=class{constructor(e){e instanceof wb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new wb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ht.Emitter,this._onDidChange=new Ht.Emitter,this._onDidSave=new Ht.Emitter,this._onDidClose=new Ht.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,i=this.notebookCellMap.get(t);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Ga,i=[];return i.push(this.cellTextDocuments.listen(t)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let s of r.cellTextDocuments)t.openTextDocument({textDocument:s});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s===void 0)return;s.version=r.notebookDocument.version;let o=s.metadata,a=!1,c=r.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],p=[];if(c.cells!==void 0){let R=c.cells;if(R.structure!==void 0){let v=R.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),R.structure.didOpen!==void 0)for(let T of R.structure.didOpen)t.openTextDocument({textDocument:T}),l.push(T.uri);if(R.structure.didClose)for(let T of R.structure.didClose)t.closeTextDocument({textDocument:T}),u.push(T.uri)}if(R.data!==void 0){let v=new Map(R.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let N=v.get(s.cells[T].document);if(N!==void 0){let L=s.cells.splice(T,1,N);if(d.push({old:L[0],new:N}),v.delete(N.document),v.size===0)break}}}if(R.textContent!==void 0)for(let v of R.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),p.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let R of l)_.push(this.getNotebookCell(R));let y=[];for(let R of u)y.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||y.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:y,changed:{data:d,textContent:w}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of r.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(r.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Ht.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};_r.NotebookDocuments=Hf});var Nb=C(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.MonikerFeature=void 0;var d_=We(),h_=n=>class extends n{get moniker(){return{on:e=>{let t=d_.MonikerRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Xa.MonikerFeature=h_});var Jf=C(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.createConnection=de.combineFeatures=de.combineNotebooksFeatures=de.combineLanguagesFeatures=de.combineWorkspaceFeatures=de.combineWindowFeatures=de.combineClientFeatures=de.combineTracerFeatures=de.combineTelemetryFeatures=de.combineConsoleFeatures=de._NotebooksImpl=de._LanguagesImpl=de.BulkUnregistration=de.BulkRegistration=de.ErrorMessageTracker=void 0;var U=We(),Yt=Ho(),zf=xf(),Z=ub(),p_=fb(),m_=db(),g_=hb(),y_=jf(),b_=pb(),T_=mb(),v_=gb(),S_=yb(),k_=Tb(),E_=Sb(),w_=kb(),N_=Eb(),__=Yf(),P_=Nb();function Kf(n){if(n!==null)return n}var Gf=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};de.ErrorMessageTracker=Gf;var Qa=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Xf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let i={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}showWarningMessage(e,...t){let i={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}showInformationMessage(e,...t){let i={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}},_b=(0,b_.ShowDocumentFeature)((0,Z.ProgressFeature)(Xf)),Pb;(function(n){function e(){return new Ja}n.create=e})(Pb||(de.BulkRegistration=Pb={}));var Ja=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let i=Yt.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);let r=zf.generateUuid();this._registrations.push({id:r,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},Db;(function(n){function e(){return new _s(void 0,[])}n.create=e})(Db||(de.BulkUnregistration=Db={}));var _s=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let i of this._unregistrations.values())e.push(i);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Yt.string(e)?e:e.method,i=this._unregistrations.get(t);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(U.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(t)},s=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},Za=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,i){return e instanceof Ja?this.registerMany(e):e instanceof _s?this.registerSingle1(e,t,i):this.registerSingle2(e,t)}registerSingle1(e,t,i){let r=Yt.string(t)?t:t.method,s=zf.generateUuid(),o={registrations:[{id:s,method:r,registerOptions:i||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:r}),e),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(e,t){let i=Yt.string(e)?e:e.method,r=zf.generateUuid(),s={registrations:[{id:r,method:i,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,s).then(o=>U.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let i={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new _s(this._connection,t.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}},Qf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(r){return r&&!!r.edit}let i=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,i)}},Rb=(0,T_.FileOperationsFeature)((0,m_.WorkspaceFoldersFeature)((0,p_.ConfigurationFeature)(Qf))),ec=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},tc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},nc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._LanguagesImpl=nc;var Cb=(0,E_.FoldingRangeFeature)((0,P_.MonikerFeature)((0,N_.DiagnosticFeature)((0,w_.InlayHintFeature)((0,k_.InlineValueFeature)((0,S_.TypeHierarchyFeature)((0,v_.LinkedEditingRangeFeature)((0,y_.SemanticTokensFeature)((0,g_.CallHierarchyFeature)(nc))))))))),ic=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._NotebooksImpl=ic;var Ob=(0,__.NotebookSyncFeature)(ic);function Ab(n,e){return function(t){return e(n(t))}}de.combineConsoleFeatures=Ab;function Ib(n,e){return function(t){return e(n(t))}}de.combineTelemetryFeatures=Ib;function Lb(n,e){return function(t){return e(n(t))}}de.combineTracerFeatures=Lb;function xb(n,e){return function(t){return e(n(t))}}de.combineClientFeatures=xb;function Mb(n,e){return function(t){return e(n(t))}}de.combineWindowFeatures=Mb;function qb(n,e){return function(t){return e(n(t))}}de.combineWorkspaceFeatures=qb;function Fb(n,e){return function(t){return e(n(t))}}de.combineLanguagesFeatures=Fb;function Bb(n,e){return function(t){return e(n(t))}}de.combineNotebooksFeatures=Bb;function D_(n,e){function t(r,s,o){return r&&s?o(r,s):r||s}return{__brand:"features",console:t(n.console,e.console,Ab),tracer:t(n.tracer,e.tracer,Lb),telemetry:t(n.telemetry,e.telemetry,Ib),client:t(n.client,e.client,xb),window:t(n.window,e.window,Mb),workspace:t(n.workspace,e.workspace,qb),languages:t(n.languages,e.languages,Fb),notebooks:t(n.notebooks,e.notebooks,Bb)}}de.combineFeatures=D_;function R_(n,e,t){let i=t&&t.console?new(t.console(Qa)):new Qa,r=n(i);i.rawAttach(r);let s=t&&t.tracer?new(t.tracer(ec)):new ec,o=t&&t.telemetry?new(t.telemetry(tc)):new tc,a=t&&t.client?new(t.client(Za)):new Za,c=t&&t.window?new(t.window(_b)):new _b,l=t&&t.workspace?new(t.workspace(Rb)):new Rb,u=t&&t.languages?new(t.languages(Cb)):new Cb,d=t&&t.notebooks?new(t.notebooks(Ob)):new Ob,p=[i,s,o,a,c,l,u,d];function g(v){return v instanceof Promise?v:Yt.thenable(v)?new Promise((T,N)=>{v.then(L=>T(L),L=>N(L))}):Promise.resolve(v)}let _,y,w,R={listen:()=>r.listen(),sendRequest:(v,...T)=>r.sendRequest(Yt.string(v)?v:v.method,...T),onRequest:(v,T)=>r.onRequest(v,T),sendNotification:(v,T)=>{let N=Yt.string(v)?v:v.method;return r.sendNotification(N,T)},onNotification:(v,T)=>r.onNotification(v,T),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:v=>(y=v,{dispose:()=>{y=void 0}}),onInitialized:v=>r.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(_=v,{dispose:()=>{_=void 0}}),onExit:v=>(w=v,{dispose:()=>{w=void 0}}),get console(){return i},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>r.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>r.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>r.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>r.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>r.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>r.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>r.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>r.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>r.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>r.onRequest(U.HoverRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onCompletion:v=>r.onRequest(U.CompletionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCompletionResolve:v=>r.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>r.onRequest(U.SignatureHelpRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDeclaration:v=>r.onRequest(U.DeclarationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDefinition:v=>r.onRequest(U.DefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onTypeDefinition:v=>r.onRequest(U.TypeDefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onImplementation:v=>r.onRequest(U.ImplementationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onReferences:v=>r.onRequest(U.ReferencesRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentHighlight:v=>r.onRequest(U.DocumentHighlightRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentSymbol:v=>r.onRequest(U.DocumentSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbol:v=>r.onRequest(U.WorkspaceSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbolResolve:v=>r.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>r.onRequest(U.CodeActionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeActionResolve:v=>r.onRequest(U.CodeActionResolveRequest.type,(T,N)=>v(T,N)),onCodeLens:v=>r.onRequest(U.CodeLensRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeLensResolve:v=>r.onRequest(U.CodeLensResolveRequest.type,(T,N)=>v(T,N)),onDocumentFormatting:v=>r.onRequest(U.DocumentFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentRangeFormatting:v=>r.onRequest(U.DocumentRangeFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentOnTypeFormatting:v=>r.onRequest(U.DocumentOnTypeFormattingRequest.type,(T,N)=>v(T,N)),onRenameRequest:v=>r.onRequest(U.RenameRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onPrepareRename:v=>r.onRequest(U.PrepareRenameRequest.type,(T,N)=>v(T,N)),onDocumentLinks:v=>r.onRequest(U.DocumentLinkRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentLinkResolve:v=>r.onRequest(U.DocumentLinkResolveRequest.type,(T,N)=>v(T,N)),onDocumentColor:v=>r.onRequest(U.DocumentColorRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onColorPresentation:v=>r.onRequest(U.ColorPresentationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onFoldingRanges:v=>r.onRequest(U.FoldingRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onSelectionRanges:v=>r.onRequest(U.SelectionRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onExecuteCommand:v=>r.onRequest(U.ExecuteCommandRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),dispose:()=>r.dispose()};for(let v of p)v.attach(R);return r.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Yt.string(v.trace)&&(s.trace=U.Trace.fromString(v.trace));for(let T of p)T.initialize(v.capabilities);if(y){let T=y(v,new U.CancellationTokenSource().token,(0,Z.attachWorkDone)(r,v),void 0);return g(T).then(N=>{if(N instanceof U.ResponseError)return N;let L=N;L||(L={capabilities:{}});let q=L.capabilities;q||(q={},L.capabilities=q),q.textDocumentSync===void 0||q.textDocumentSync===null?q.textDocumentSync=Yt.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None:!Yt.number(q.textDocumentSync)&&!Yt.number(q.textDocumentSync.change)&&(q.textDocumentSync.change=Yt.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(q);return L})}else{let T={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let N of p)N.fillServerCapabilities(T.capabilities);return T}}),r.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new U.CancellationTokenSource().token)}),r.onNotification(U.ExitNotification.type,()=>{try{w&&w()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),r.onNotification(U.SetTraceNotification.type,v=>{s.trace=U.Trace.fromString(v.value)}),R}de.createConnection=R_});var jb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.resolveModulePath=Ot.FileSystem=Ot.resolveGlobalYarnPath=Ot.resolveGlobalNodePath=Ot.resolve=Ot.uriToFilePath=void 0;var C_=require("url"),sn=require("path"),Zf=require("fs"),id=require("child_process");function O_(n){let e=C_.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var i=0,r=t.length;i<r;i++)t[i]=decodeURIComponent(t[i]);if(process.platform==="win32"&&t.length>1){let s=t[0],o=t[1];s.length===0&&o.length>1&&o[1]===":"&&t.shift()}return sn.normalize(t.join("/"))}Ot.uriToFilePath=O_;function ed(){return process.platform==="win32"}function rc(n,e,t,i){let r="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Zf.existsSync(e)&&(l[r]?l[r]=e+sn.delimiter+l[r]:l[r]=e,i&&i(`NODE_PATH value is: ${l[r]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,id.fork)("",[],{cwd:t,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",p=>{a(p)}),u.on("message",p=>{p.c==="r"&&(u.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}Ot.resolve=rc;function td(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(s=>t[s]=process.env[s]),t.NO_UPDATE_NOTIFIER="true";let i={encoding:"utf8",env:t};ed()&&(e="npm.cmd",i.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,id.spawnSync)(e,["config","get","prefix"],i).stdout;if(!s){n&&n("'npm config get prefix' didn't return a value.");return}let o=s.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?ed()?sn.join(o,"node_modules"):sn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}Ot.resolveGlobalNodePath=td;function A_(n){let e="yarn",t={encoding:"utf8"};ed()&&(e="yarn.cmd",t.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let r=(0,id.spawnSync)(e,["global","dir","--json"],t),s=r.stdout;if(!s){n&&(n("'yarn global dir' didn't return a value."),r.stderr&&n(r.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return sn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",i)}}Ot.resolveGlobalYarnPath=A_;var nd;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Zf.existsSync(__filename.toUpperCase())||!Zf.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function i(r,s){return t()?sn.normalize(s).indexOf(sn.normalize(r))===0:sn.normalize(s).toLowerCase().indexOf(sn.normalize(r).toLowerCase())===0}n.isParent=i})(nd||(Ot.FileSystem=nd={}));function I_(n,e,t,i){return t?(sn.isAbsolute(t)||(t=sn.join(n,t)),rc(e,t,t,i).then(r=>nd.isParent(t,r)?r:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,r=>rc(e,td(i),n,i))):rc(e,td(i),n,i)}Ot.resolveModulePath=I_});var rd=C((QI,Ub)=>{"use strict";Ub.exports=We()});var $b=C(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.InlineCompletionFeature=void 0;var L_=We(),x_=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(L_.InlineCompletionRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};sc.InlineCompletionFeature=x_});var Hb=C(bt=>{"use strict";var M_=bt&&bt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Vb=bt&&bt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&M_(e,n,t)};Object.defineProperty(bt,"__esModule",{value:!0});bt.ProposedFeatures=bt.NotebookDocuments=bt.TextDocuments=bt.SemanticTokensBuilder=void 0;var q_=jf();Object.defineProperty(bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return q_.SemanticTokensBuilder}});var F_=$b();Vb(We(),bt);var B_=Vf();Object.defineProperty(bt,"TextDocuments",{enumerable:!0,get:function(){return B_.TextDocuments}});var j_=Yf();Object.defineProperty(bt,"NotebookDocuments",{enumerable:!0,get:function(){return j_.NotebookDocuments}});Vb(Jf(),bt);var Wb;(function(n){n.all={__brand:"features",languages:F_.InlineCompletionFeature}})(Wb||(bt.ProposedFeatures=Wb={}))});var Q=C(Kt=>{"use strict";var U_=Kt&&Kt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Gb=Kt&&Kt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&U_(e,n,t)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.createConnection=Kt.Files=void 0;var Yb=require("node:util"),sd=Ho(),$_=Jf(),Ps=jb(),ji=rd();Gb(rd(),Kt);Gb(Hb(),Kt);var Kb;(function(n){n.uriToFilePath=Ps.uriToFilePath,n.resolveGlobalNodePath=Ps.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ps.resolveGlobalYarnPath,n.resolve=Ps.resolve,n.resolveModulePath=Ps.resolveModulePath})(Kb||(Kt.Files=Kb={}));var zb;function oc(){if(zb!==void 0)try{zb.end()}catch{}}var Pr=!1,Xb;function W_(){let n="--clientProcessId";function e(t){try{let i=parseInt(t);isNaN(i)||(Xb=setInterval(()=>{try{process.kill(i,0)}catch{oc(),process.exit(Pr?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let i=process.argv[t];if(i===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let r=i.split("=");r[0]===n&&e(r[1])}}}W_();var V_={initialize:n=>{let e=n.processId;sd.number(e)&&Xb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Pr?0:1)}},3e3)},get shutdownReceived(){return Pr},set shutdownReceived(n){Pr=n},exit:n=>{oc(),process.exit(n)}};function H_(n,e,t,i){let r,s,o,a;return n!==void 0&&n.__brand==="features"&&(r=n,n=e,e=t,t=i),ji.ConnectionStrategy.is(n)||ji.ConnectionOptions.is(n)?a=n:(s=n,o=e,a=t),Y_(s,o,a,r)}Kt.createConnection=H_;function Y_(n,e,t,i){let r=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let p=u[d];if(p==="--node-ipc"){n=new ji.IPCMessageReader(process),e=new ji.IPCMessageWriter(process);break}else if(p==="--stdio"){r=!0,n=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(u[d+1]);break}else if(p==="--pipe"){l=u[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,ji.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ji.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(sd.func(n.read)&&sd.func(n.on)){let c=n;c.on("end",()=>{oc(),process.exit(Pr?0:1)}),c.on("close",()=>{oc(),process.exit(Pr?0:1)})}let a=c=>{let l=(0,ji.createProtocolConnection)(n,e,c,t);return r&&K_(c),l};return(0,$_.createConnection)(a,V_,i)}function K_(n){function e(i){return i.map(r=>typeof r=="string"?r:(0,Yb.inspect)(r)).join(" ")}let t=new Map;console.assert=function(r,...s){if(!r)if(s.length===0)n.error("Assertion failed");else{let[o,...a]=s;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(r="default"){let s=String(r),o=t.get(s)??0;o+=1,t.set(s,o),n.log(`${s}: ${s}`)},console.countReset=function(r){r===void 0?t.clear():t.delete(String(r))},console.debug=function(...r){n.log(e(r))},console.dir=function(r,s){n.log((0,Yb.inspect)(r,s))},console.log=function(...r){n.log(e(r))},console.error=function(...r){n.error(e(r))},console.trace=function(...r){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";r.length!==0&&(o+=`: ${e(r)}`),n.log(`${o}
|
|
37
|
-
${
|
|
38
|
-
`)}};
|
|
39
|
-
`)?
|
|
34
|
+
`,"\r"];var bv;(function(p){function N(D,M,se,nt){return new _O(D,M,se,nt)}p.create=N;function P(D){var M=D;return!!(C.defined(M)&&C.string(M.uri)&&(C.undefined(M.languageId)||C.string(M.languageId))&&C.uinteger(M.lineCount)&&C.func(M.getText)&&C.func(M.positionAt)&&C.func(M.offsetAt))}p.is=P;function y(D,M){for(var se=D.getText(),nt=h(M,function(gi,Qc){var vv=gi.range.start.line-Qc.range.start.line;return vv===0?gi.range.start.character-Qc.range.start.character:vv}),xe=se.length,Mn=nt.length-1;Mn>=0;Mn--){var Ln=nt[Mn],wr=D.offsetAt(Ln.range.start),pe=D.offsetAt(Ln.range.end);if(pe<=xe)se=se.substring(0,wr)+Ln.newText+se.substring(pe,se.length);else throw new Error("Overlapping edit");xe=wr}return se}p.applyEdits=y;function h(D,M){if(D.length<=1)return D;var se=D.length/2|0,nt=D.slice(0,se),xe=D.slice(se);h(nt,M),h(xe,M);for(var Mn=0,Ln=0,wr=0;Mn<nt.length&&Ln<xe.length;){var pe=M(nt[Mn],xe[Ln]);pe<=0?D[wr++]=nt[Mn++]:D[wr++]=xe[Ln++]}for(;Mn<nt.length;)D[wr++]=nt[Mn++];for(;Ln<xe.length;)D[wr++]=xe[Ln++];return D}})(bv||(e.TextDocument=bv={}));var _O=function(){function p(N,P,y,h){this._uri=N,this._languageId=P,this._version=y,this._content=h,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(N){if(N){var P=this.offsetAt(N.start),y=this.offsetAt(N.end);return this._content.substring(P,y)}return this._content},p.prototype.update=function(N,P){this._content=N.text,this._version=P,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],P=this._content,y=!0,h=0;h<P.length;h++){y&&(N.push(h),y=!1);var D=P.charAt(h);y=D==="\r"||D===`
|
|
35
|
+
`,D==="\r"&&h+1<P.length&&P.charAt(h+1)===`
|
|
36
|
+
`&&h++}y&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},p.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),y=0,h=P.length;if(h===0)return o.create(0,N);for(;y<h;){var D=Math.floor((y+h)/2);P[D]>N?h=D:y=D+1}var M=y-1;return o.create(M,N-P[M])},p.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var y=P[N.line],h=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(y+N.character,h),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),C;(function(p){var N=Object.prototype.toString;function P(pe){return typeof pe<"u"}p.defined=P;function y(pe){return typeof pe>"u"}p.undefined=y;function h(pe){return pe===!0||pe===!1}p.boolean=h;function D(pe){return N.call(pe)==="[object String]"}p.string=D;function M(pe){return N.call(pe)==="[object Number]"}p.number=M;function se(pe,gi,Qc){return N.call(pe)==="[object Number]"&&gi<=pe&&pe<=Qc}p.numberRange=se;function nt(pe){return N.call(pe)==="[object Number]"&&-2147483648<=pe&&pe<=2147483647}p.integer=nt;function xe(pe){return N.call(pe)==="[object Number]"&&0<=pe&&pe<=2147483647}p.uinteger=xe;function Mn(pe){return N.call(pe)==="[object Function]"}p.func=Mn;function Ln(pe){return pe!==null&&typeof pe=="object"}p.objectLiteral=Ln;function wr(pe,gi){return Array.isArray(pe)&&pe.every(gi)}p.typedArray=wr})(C||(C={}))})});var Je=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ProtocolNotificationType=Qt.ProtocolNotificationType0=Qt.ProtocolRequestType=Qt.ProtocolRequestType0=Qt.RegistrationType=Qt.MessageDirection=void 0;var ki=Is(),eT;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(eT||(Qt.MessageDirection=eT={}));var cp=class{constructor(e){this.method=e}};Qt.RegistrationType=cp;var lp=class extends ki.RequestType0{constructor(e){super(e)}};Qt.ProtocolRequestType0=lp;var up=class extends ki.RequestType{constructor(e){super(e,ki.ParameterStructures.byName)}};Qt.ProtocolRequestType=up;var dp=class extends ki.NotificationType0{constructor(e){super(e)}};Qt.ProtocolNotificationType0=dp;var fp=class extends ki.NotificationType{constructor(e){super(e,ki.ParameterStructures.byName)}};Qt.ProtocolNotificationType=fp});var wl=w(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.objectLiteral=ct.typedArray=ct.stringArray=ct.array=ct.func=ct.error=ct.number=ct.string=ct.boolean=void 0;function mA(n){return n===!0||n===!1}ct.boolean=mA;function tT(n){return typeof n=="string"||n instanceof String}ct.string=tT;function gA(n){return typeof n=="number"||n instanceof Number}ct.number=gA;function yA(n){return n instanceof Error}ct.error=yA;function bA(n){return typeof n=="function"}ct.func=bA;function nT(n){return Array.isArray(n)}ct.array=nT;function vA(n){return nT(n)&&n.every(e=>tT(e))}ct.stringArray=vA;function TA(n,e){return Array.isArray(n)&&n.every(e)}ct.typedArray=TA;function _A(n){return n!==null&&typeof n=="object"}ct.objectLiteral=_A});var iT=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.ImplementationRequest=void 0;var rT=Je(),sT;(function(n){n.method="textDocument/implementation",n.messageDirection=rT.MessageDirection.clientToServer,n.type=new rT.ProtocolRequestType(n.method)})(sT||(El.ImplementationRequest=sT={}))});var cT=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.TypeDefinitionRequest=void 0;var oT=Je(),aT;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=oT.MessageDirection.clientToServer,n.type=new oT.ProtocolRequestType(n.method)})(aT||(kl.TypeDefinitionRequest=aT={}))});var dT=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.DidChangeWorkspaceFoldersNotification=Ni.WorkspaceFoldersRequest=void 0;var Nl=Je(),lT;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Nl.MessageDirection.serverToClient,n.type=new Nl.ProtocolRequestType0(n.method)})(lT||(Ni.WorkspaceFoldersRequest=lT={}));var uT;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Nl.MessageDirection.clientToServer,n.type=new Nl.ProtocolNotificationType(n.method)})(uT||(Ni.DidChangeWorkspaceFoldersNotification=uT={}))});var pT=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.ConfigurationRequest=void 0;var fT=Je(),hT;(function(n){n.method="workspace/configuration",n.messageDirection=fT.MessageDirection.serverToClient,n.type=new fT.ProtocolRequestType(n.method)})(hT||(Pl.ConfigurationRequest=hT={}))});var yT=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ColorPresentationRequest=Pi.DocumentColorRequest=void 0;var Rl=Je(),mT;(function(n){n.method="textDocument/documentColor",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(mT||(Pi.DocumentColorRequest=mT={}));var gT;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(gT||(Pi.ColorPresentationRequest=gT={}))});var TT=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.FoldingRangeRefreshRequest=Ri.FoldingRangeRequest=void 0;var Dl=Je(),bT;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Dl.MessageDirection.clientToServer,n.type=new Dl.ProtocolRequestType(n.method)})(bT||(Ri.FoldingRangeRequest=bT={}));var vT;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Dl.MessageDirection.serverToClient,n.type=new Dl.ProtocolRequestType0(n.method)})(vT||(Ri.FoldingRangeRefreshRequest=vT={}))});var wT=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.DeclarationRequest=void 0;var _T=Je(),ST;(function(n){n.method="textDocument/declaration",n.messageDirection=_T.MessageDirection.clientToServer,n.type=new _T.ProtocolRequestType(n.method)})(ST||(Cl.DeclarationRequest=ST={}))});var NT=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.SelectionRangeRequest=void 0;var ET=Je(),kT;(function(n){n.method="textDocument/selectionRange",n.messageDirection=ET.MessageDirection.clientToServer,n.type=new ET.ProtocolRequestType(n.method)})(kT||(Ol.SelectionRangeRequest=kT={}))});var CT=w(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.WorkDoneProgressCancelNotification=Wr.WorkDoneProgressCreateRequest=Wr.WorkDoneProgress=void 0;var SA=Is(),Al=Je(),PT;(function(n){n.type=new SA.ProgressType;function e(t){return t===n.type}n.is=e})(PT||(Wr.WorkDoneProgress=PT={}));var RT;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Al.MessageDirection.serverToClient,n.type=new Al.ProtocolRequestType(n.method)})(RT||(Wr.WorkDoneProgressCreateRequest=RT={}));var DT;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Al.MessageDirection.clientToServer,n.type=new Al.ProtocolNotificationType(n.method)})(DT||(Wr.WorkDoneProgressCancelNotification=DT={}))});var $T=w(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.CallHierarchyOutgoingCallsRequest=Hr.CallHierarchyIncomingCallsRequest=Hr.CallHierarchyPrepareRequest=void 0;var Di=Je(),OT;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(OT||(Hr.CallHierarchyPrepareRequest=OT={}));var AT;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(AT||(Hr.CallHierarchyIncomingCallsRequest=AT={}));var IT;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(IT||(Hr.CallHierarchyOutgoingCallsRequest=IT={}))});var FT=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.SemanticTokensRefreshRequest=Zt.SemanticTokensRangeRequest=Zt.SemanticTokensDeltaRequest=Zt.SemanticTokensRequest=Zt.SemanticTokensRegistrationType=Zt.TokenFormat=void 0;var kr=Je(),MT;(function(n){n.Relative="relative"})(MT||(Zt.TokenFormat=MT={}));var Jo;(function(n){n.method="textDocument/semanticTokens",n.type=new kr.RegistrationType(n.method)})(Jo||(Zt.SemanticTokensRegistrationType=Jo={}));var LT;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(LT||(Zt.SemanticTokensRequest=LT={}));var qT;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(qT||(Zt.SemanticTokensDeltaRequest=qT={}));var xT;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(xT||(Zt.SemanticTokensRangeRequest=xT={}));var jT;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=kr.MessageDirection.serverToClient,n.type=new kr.ProtocolRequestType0(n.method)})(jT||(Zt.SemanticTokensRefreshRequest=jT={}))});var VT=w(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.ShowDocumentRequest=void 0;var BT=Je(),UT;(function(n){n.method="window/showDocument",n.messageDirection=BT.MessageDirection.serverToClient,n.type=new BT.ProtocolRequestType(n.method)})(UT||(Il.ShowDocumentRequest=UT={}))});var KT=w($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.LinkedEditingRangeRequest=void 0;var WT=Je(),HT;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=WT.MessageDirection.clientToServer,n.type=new WT.ProtocolRequestType(n.method)})(HT||($l.LinkedEditingRangeRequest=HT={}))});var e_=w(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.WillDeleteFilesRequest=xt.DidDeleteFilesNotification=xt.DidRenameFilesNotification=xt.WillRenameFilesRequest=xt.DidCreateFilesNotification=xt.WillCreateFilesRequest=xt.FileOperationPatternKind=void 0;var bn=Je(),zT;(function(n){n.file="file",n.folder="folder"})(zT||(xt.FileOperationPatternKind=zT={}));var GT;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(GT||(xt.WillCreateFilesRequest=GT={}));var YT;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(YT||(xt.DidCreateFilesNotification=YT={}));var JT;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(JT||(xt.WillRenameFilesRequest=JT={}));var XT;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(XT||(xt.DidRenameFilesNotification=XT={}));var QT;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(QT||(xt.DidDeleteFilesNotification=QT={}));var ZT;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(ZT||(xt.WillDeleteFilesRequest=ZT={}))});var i_=w(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.MonikerRequest=Kr.MonikerKind=Kr.UniquenessLevel=void 0;var t_=Je(),n_;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(n_||(Kr.UniquenessLevel=n_={}));var r_;(function(n){n.$import="import",n.$export="export",n.local="local"})(r_||(Kr.MonikerKind=r_={}));var s_;(function(n){n.method="textDocument/moniker",n.messageDirection=t_.MessageDirection.clientToServer,n.type=new t_.ProtocolRequestType(n.method)})(s_||(Kr.MonikerRequest=s_={}))});var l_=w(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.TypeHierarchySubtypesRequest=zr.TypeHierarchySupertypesRequest=zr.TypeHierarchyPrepareRequest=void 0;var Ci=Je(),o_;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(o_||(zr.TypeHierarchyPrepareRequest=o_={}));var a_;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(a_||(zr.TypeHierarchySupertypesRequest=a_={}));var c_;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(c_||(zr.TypeHierarchySubtypesRequest=c_={}))});var f_=w(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.InlineValueRefreshRequest=Oi.InlineValueRequest=void 0;var Ml=Je(),u_;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Ml.MessageDirection.clientToServer,n.type=new Ml.ProtocolRequestType(n.method)})(u_||(Oi.InlineValueRequest=u_={}));var d_;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Ml.MessageDirection.serverToClient,n.type=new Ml.ProtocolRequestType0(n.method)})(d_||(Oi.InlineValueRefreshRequest=d_={}))});var g_=w(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.InlayHintRefreshRequest=Gr.InlayHintResolveRequest=Gr.InlayHintRequest=void 0;var Ai=Je(),h_;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(h_||(Gr.InlayHintRequest=h_={}));var p_;(function(n){n.method="inlayHint/resolve",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(p_||(Gr.InlayHintResolveRequest=p_={}));var m_;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Ai.MessageDirection.serverToClient,n.type=new Ai.ProtocolRequestType0(n.method)})(m_||(Gr.InlayHintRefreshRequest=m_={}))});var w_=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DiagnosticRefreshRequest=vn.WorkspaceDiagnosticRequest=vn.DocumentDiagnosticRequest=vn.DocumentDiagnosticReportKind=vn.DiagnosticServerCancellationData=void 0;var S_=Is(),wA=wl(),Ii=Je(),y_;(function(n){function e(t){let r=t;return r&&wA.boolean(r.retriggerRequest)}n.is=e})(y_||(vn.DiagnosticServerCancellationData=y_={}));var b_;(function(n){n.Full="full",n.Unchanged="unchanged"})(b_||(vn.DocumentDiagnosticReportKind=b_={}));var v_;(function(n){n.method="textDocument/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new S_.ProgressType})(v_||(vn.DocumentDiagnosticRequest=v_={}));var T_;(function(n){n.method="workspace/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new S_.ProgressType})(T_||(vn.WorkspaceDiagnosticRequest=T_={}));var __;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=Ii.MessageDirection.serverToClient,n.type=new Ii.ProtocolRequestType0(n.method)})(__||(vn.DiagnosticRefreshRequest=__={}))});var C_=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DidCloseNotebookDocumentNotification=rt.DidSaveNotebookDocumentNotification=rt.DidChangeNotebookDocumentNotification=rt.NotebookCellArrayChange=rt.DidOpenNotebookDocumentNotification=rt.NotebookDocumentSyncRegistrationType=rt.NotebookDocument=rt.NotebookCell=rt.ExecutionSummary=rt.NotebookCellKind=void 0;var Xo=Sl(),xn=wl(),er=Je(),hp;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(hp||(rt.NotebookCellKind=hp={}));var pp;(function(n){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}n.create=e;function t(s){let i=s;return xn.objectLiteral(i)&&Xo.uinteger.is(i.executionOrder)&&(i.success===void 0||xn.boolean(i.success))}n.is=t;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}n.equals=r})(pp||(rt.ExecutionSummary=pp={}));var Ll;(function(n){function e(i,o){return{kind:i,document:o}}n.create=e;function t(i){let o=i;return xn.objectLiteral(o)&&hp.is(o.kind)&&Xo.DocumentUri.is(o.document)&&(o.metadata===void 0||xn.objectLiteral(o.metadata))}n.is=t;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)&&!pp.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.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(xn.objectLiteral(i)&&xn.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}})(Ll||(rt.NotebookCell=Ll={}));var E_;(function(n){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}n.create=e;function t(r){let s=r;return xn.objectLiteral(s)&&xn.string(s.uri)&&Xo.integer.is(s.version)&&xn.typedArray(s.cells,Ll.is)}n.is=t})(E_||(rt.NotebookDocument=E_={}));var $i;(function(n){n.method="notebookDocument/sync",n.messageDirection=er.MessageDirection.clientToServer,n.type=new er.RegistrationType(n.method)})($i||(rt.NotebookDocumentSyncRegistrationType=$i={}));var k_;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=er.MessageDirection.clientToServer,n.type=new er.ProtocolNotificationType(n.method),n.registrationMethod=$i.method})(k_||(rt.DidOpenNotebookDocumentNotification=k_={}));var N_;(function(n){function e(r){let s=r;return xn.objectLiteral(s)&&Xo.uinteger.is(s.start)&&Xo.uinteger.is(s.deleteCount)&&(s.cells===void 0||xn.typedArray(s.cells,Ll.is))}n.is=e;function t(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}n.create=t})(N_||(rt.NotebookCellArrayChange=N_={}));var P_;(function(n){n.method="notebookDocument/didChange",n.messageDirection=er.MessageDirection.clientToServer,n.type=new er.ProtocolNotificationType(n.method),n.registrationMethod=$i.method})(P_||(rt.DidChangeNotebookDocumentNotification=P_={}));var R_;(function(n){n.method="notebookDocument/didSave",n.messageDirection=er.MessageDirection.clientToServer,n.type=new er.ProtocolNotificationType(n.method),n.registrationMethod=$i.method})(R_||(rt.DidSaveNotebookDocumentNotification=R_={}));var D_;(function(n){n.method="notebookDocument/didClose",n.messageDirection=er.MessageDirection.clientToServer,n.type=new er.ProtocolNotificationType(n.method),n.registrationMethod=$i.method})(D_||(rt.DidCloseNotebookDocumentNotification=D_={}))});var I_=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.InlineCompletionRequest=void 0;var O_=Je(),A_;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=O_.MessageDirection.clientToServer,n.type=new O_.ProtocolRequestType(n.method)})(A_||(ql.InlineCompletionRequest=A_={}))});var KS=w(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRefreshRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangesFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.InlineCompletionRequest=_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=void 0;var x=Je(),$_=Sl(),St=wl(),EA=iT();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return EA.ImplementationRequest}});var kA=cT();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return kA.TypeDefinitionRequest}});var US=dT();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return US.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return US.DidChangeWorkspaceFoldersNotification}});var NA=pT();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return NA.ConfigurationRequest}});var VS=yT();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return VS.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return VS.ColorPresentationRequest}});var WS=TT();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return WS.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return WS.FoldingRangeRefreshRequest}});var PA=wT();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return PA.DeclarationRequest}});var RA=NT();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return RA.SelectionRangeRequest}});var vp=CT();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return vp.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return vp.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return vp.WorkDoneProgressCancelNotification}});var Tp=$T();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyPrepareRequest}});var Mi=FT();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return Mi.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return Mi.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Mi.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Mi.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Mi.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Mi.SemanticTokensRegistrationType}});var DA=VT();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return DA.ShowDocumentRequest}});var CA=KT();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return CA.LinkedEditingRangeRequest}});var $s=e_();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return $s.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return $s.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return $s.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return $s.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return $s.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return $s.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return $s.WillDeleteFilesRequest}});var _p=i_();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return _p.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return _p.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return _p.MonikerRequest}});var Sp=l_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Sp.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Sp.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Sp.TypeHierarchySupertypesRequest}});var HS=f_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return HS.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return HS.InlineValueRefreshRequest}});var wp=g_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return wp.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return wp.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return wp.InlayHintRefreshRequest}});var Qo=w_();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Qo.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Qo.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Qo.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Qo.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Qo.DiagnosticRefreshRequest}});var tr=C_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return tr.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return tr.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return tr.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return tr.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return tr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return tr.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return tr.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return tr.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return tr.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return tr.DidCloseNotebookDocumentNotification}});var OA=I_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return OA.InlineCompletionRequest}});var mp;(function(n){function e(t){let r=t;return St.string(r)||St.string(r.language)||St.string(r.scheme)||St.string(r.pattern)}n.is=e})(mp||(_.TextDocumentFilter=mp={}));var gp;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(St.string(r.notebookType)||St.string(r.scheme)||St.string(r.pattern))}n.is=e})(gp||(_.NotebookDocumentFilter=gp={}));var yp;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(St.string(r.notebook)||gp.is(r.notebook))&&(r.language===void 0||St.string(r.language))}n.is=e})(yp||(_.NotebookCellTextDocumentFilter=yp={}));var bp;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let r of t)if(!St.string(r)&&!mp.is(r)&&!yp.is(r))return!1;return!0}n.is=e})(bp||(_.DocumentSelector=bp={}));var M_;(function(n){n.method="client/registerCapability",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolRequestType(n.method)})(M_||(_.RegistrationRequest=M_={}));var L_;(function(n){n.method="client/unregisterCapability",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolRequestType(n.method)})(L_||(_.UnregistrationRequest=L_={}));var q_;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(q_||(_.ResourceOperationKind=q_={}));var x_;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(x_||(_.FailureHandlingKind=x_={}));var j_;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(j_||(_.PositionEncodingKind=j_={}));var F_;(function(n){function e(t){let r=t;return r&&St.string(r.id)&&r.id.length>0}n.hasId=e})(F_||(_.StaticRegistrationOptions=F_={}));var B_;(function(n){function e(t){let r=t;return r&&(r.documentSelector===null||bp.is(r.documentSelector))}n.is=e})(B_||(_.TextDocumentRegistrationOptions=B_={}));var U_;(function(n){function e(r){let s=r;return St.objectLiteral(s)&&(s.workDoneProgress===void 0||St.boolean(s.workDoneProgress))}n.is=e;function t(r){let s=r;return s&&St.boolean(s.workDoneProgress)}n.hasWorkDoneProgress=t})(U_||(_.WorkDoneProgressOptions=U_={}));var V_;(function(n){n.method="initialize",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(V_||(_.InitializeRequest=V_={}));var W_;(function(n){n.unknownProtocolVersion=1})(W_||(_.InitializeErrorCodes=W_={}));var H_;(function(n){n.method="initialized",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(H_||(_.InitializedNotification=H_={}));var K_;(function(n){n.method="shutdown",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType0(n.method)})(K_||(_.ShutdownRequest=K_={}));var z_;(function(n){n.method="exit",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType0(n.method)})(z_||(_.ExitNotification=z_={}));var G_;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(G_||(_.DidChangeConfigurationNotification=G_={}));var Y_;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(Y_||(_.MessageType=Y_={}));var J_;(function(n){n.method="window/showMessage",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolNotificationType(n.method)})(J_||(_.ShowMessageNotification=J_={}));var X_;(function(n){n.method="window/showMessageRequest",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolRequestType(n.method)})(X_||(_.ShowMessageRequest=X_={}));var Q_;(function(n){n.method="window/logMessage",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolNotificationType(n.method)})(Q_||(_.LogMessageNotification=Q_={}));var Z_;(function(n){n.method="telemetry/event",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolNotificationType(n.method)})(Z_||(_.TelemetryEventNotification=Z_={}));var eS;(function(n){n.None=0,n.Full=1,n.Incremental=2})(eS||(_.TextDocumentSyncKind=eS={}));var tS;(function(n){n.method="textDocument/didOpen",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(tS||(_.DidOpenTextDocumentNotification=tS={}));var nS;(function(n){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")}n.isIncremental=e;function t(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}n.isFull=t})(nS||(_.TextDocumentContentChangeEvent=nS={}));var rS;(function(n){n.method="textDocument/didChange",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(rS||(_.DidChangeTextDocumentNotification=rS={}));var sS;(function(n){n.method="textDocument/didClose",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(sS||(_.DidCloseTextDocumentNotification=sS={}));var iS;(function(n){n.method="textDocument/didSave",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(iS||(_.DidSaveTextDocumentNotification=iS={}));var oS;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(oS||(_.TextDocumentSaveReason=oS={}));var aS;(function(n){n.method="textDocument/willSave",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(aS||(_.WillSaveTextDocumentNotification=aS={}));var cS;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(cS||(_.WillSaveTextDocumentWaitUntilRequest=cS={}));var lS;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolNotificationType(n.method)})(lS||(_.DidChangeWatchedFilesNotification=lS={}));var uS;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(uS||(_.FileChangeType=uS={}));var dS;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&($_.URI.is(r.baseUri)||$_.WorkspaceFolder.is(r.baseUri))&&St.string(r.pattern)}n.is=e})(dS||(_.RelativePattern=dS={}));var fS;(function(n){n.Create=1,n.Change=2,n.Delete=4})(fS||(_.WatchKind=fS={}));var hS;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolNotificationType(n.method)})(hS||(_.PublishDiagnosticsNotification=hS={}));var pS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(pS||(_.CompletionTriggerKind=pS={}));var mS;(function(n){n.method="textDocument/completion",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(mS||(_.CompletionRequest=mS={}));var gS;(function(n){n.method="completionItem/resolve",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(gS||(_.CompletionResolveRequest=gS={}));var yS;(function(n){n.method="textDocument/hover",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(yS||(_.HoverRequest=yS={}));var bS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(bS||(_.SignatureHelpTriggerKind=bS={}));var vS;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(vS||(_.SignatureHelpRequest=vS={}));var TS;(function(n){n.method="textDocument/definition",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(TS||(_.DefinitionRequest=TS={}));var _S;(function(n){n.method="textDocument/references",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(_S||(_.ReferencesRequest=_S={}));var SS;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(SS||(_.DocumentHighlightRequest=SS={}));var wS;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(wS||(_.DocumentSymbolRequest=wS={}));var ES;(function(n){n.method="textDocument/codeAction",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(ES||(_.CodeActionRequest=ES={}));var kS;(function(n){n.method="codeAction/resolve",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(kS||(_.CodeActionResolveRequest=kS={}));var NS;(function(n){n.method="workspace/symbol",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(NS||(_.WorkspaceSymbolRequest=NS={}));var PS;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(PS||(_.WorkspaceSymbolResolveRequest=PS={}));var RS;(function(n){n.method="textDocument/codeLens",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(RS||(_.CodeLensRequest=RS={}));var DS;(function(n){n.method="codeLens/resolve",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(DS||(_.CodeLensResolveRequest=DS={}));var CS;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolRequestType0(n.method)})(CS||(_.CodeLensRefreshRequest=CS={}));var OS;(function(n){n.method="textDocument/documentLink",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(OS||(_.DocumentLinkRequest=OS={}));var AS;(function(n){n.method="documentLink/resolve",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(AS||(_.DocumentLinkResolveRequest=AS={}));var IS;(function(n){n.method="textDocument/formatting",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(IS||(_.DocumentFormattingRequest=IS={}));var $S;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})($S||(_.DocumentRangeFormattingRequest=$S={}));var MS;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(MS||(_.DocumentRangesFormattingRequest=MS={}));var LS;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(LS||(_.DocumentOnTypeFormattingRequest=LS={}));var qS;(function(n){n.Identifier=1})(qS||(_.PrepareSupportDefaultBehavior=qS={}));var xS;(function(n){n.method="textDocument/rename",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(xS||(_.RenameRequest=xS={}));var jS;(function(n){n.method="textDocument/prepareRename",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(jS||(_.PrepareRenameRequest=jS={}));var FS;(function(n){n.method="workspace/executeCommand",n.messageDirection=x.MessageDirection.clientToServer,n.type=new x.ProtocolRequestType(n.method)})(FS||(_.ExecuteCommandRequest=FS={}));var BS;(function(n){n.method="workspace/applyEdit",n.messageDirection=x.MessageDirection.serverToClient,n.type=new x.ProtocolRequestType("workspace/applyEdit")})(BS||(_.ApplyWorkspaceEditRequest=BS={}))});var GS=w(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.createProtocolConnection=void 0;var zS=Is();function AA(n,e,t,r){return zS.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,zS.createMessageConnection)(n,e,t,r)}xl.createProtocolConnection=AA});var JS=w(en=>{"use strict";var IA=en&&en.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),jl=en&&en.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&IA(e,n,t)};Object.defineProperty(en,"__esModule",{value:!0});en.LSPErrorCodes=en.createProtocolConnection=void 0;jl(Is(),en);jl(Sl(),en);jl(Je(),en);jl(KS(),en);var $A=GS();Object.defineProperty(en,"createProtocolConnection",{enumerable:!0,get:function(){return $A.createProtocolConnection}});var YS;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(YS||(en.LSPErrorCodes=YS={}))});var st=w(nr=>{"use strict";var MA=nr&&nr.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),XS=nr&&nr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&MA(e,n,t)};Object.defineProperty(nr,"__esModule",{value:!0});nr.createProtocolConnection=void 0;var LA=ap();XS(ap(),nr);XS(JS(),nr);function qA(n,e,t,r){return(0,LA.createMessageConnection)(n,e,t,r)}nr.createProtocolConnection=qA});var Ep=w(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.generateUuid=Tn.parse=Tn.isUUID=Tn.v4=Tn.empty=void 0;var Zo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ea=class n extends Zo{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};ea._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ea._timeHighBits=["8","9","a","b"];Tn.empty=new Zo("00000000-0000-0000-0000-000000000000");function QS(){return new ea}Tn.v4=QS;var xA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ZS(n){return xA.test(n)}Tn.isUUID=ZS;function jA(n){if(!ZS(n))throw new Error("invalid uuid");return new Zo(n)}Tn.parse=jA;function FA(){return QS().asHex()}Tn.generateUuid=FA});var ew=w(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.attachPartialResult=Jr.ProgressFeature=Jr.attachWorkDone=void 0;var Yr=st(),BA=Ep(),Ms=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,r,s){let i={kind:"begin",title:e,percentage:t,message:r,cancellable:s};this._connection.sendProgress(Yr.WorkDoneProgress.type,this._token,i)}report(e,t){let r={kind:"report"};typeof e=="number"?(r.percentage=e,t!==void 0&&(r.message=t)):r.message=e,this._connection.sendProgress(Yr.WorkDoneProgress.type,this._token,r)}done(){n.Instances.delete(this._token),this._connection.sendProgress(Yr.WorkDoneProgress.type,this._token,{kind:"end"})}};Ms.Instances=new Map;var Fl=class extends Ms{constructor(e,t){super(e,t),this._source=new Yr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ta=class{constructor(){}begin(){}report(){}done(){}},Bl=class extends ta{constructor(){super(),this._source=new Yr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function UA(n,e){if(e===void 0||e.workDoneToken===void 0)return new ta;let t=e.workDoneToken;return delete e.workDoneToken,new Ms(n,t)}Jr.attachWorkDone=UA;var VA=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Yr.WorkDoneProgressCancelNotification.type,t=>{let r=Ms.Instances.get(t.token);(r instanceof Fl||r instanceof Bl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ta:new Ms(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,BA.generateUuid)();return this.connection.sendRequest(Yr.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fl(this.connection,e))}else return Promise.resolve(new Bl)}};Jr.ProgressFeature=VA;var kp;(function(n){n.type=new Yr.ProgressType})(kp||(kp={}));var Np=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(kp.type,this._token,e)}};function WA(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Np(n,t)}Jr.attachPartialResult=WA});var tw=w(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ConfigurationFeature=void 0;var HA=st(),KA=Zc(),zA=n=>class extends n{getConfiguration(e){return e?KA.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(HA.ConfigurationRequest.type,t).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ul.ConfigurationFeature=zA});var nw=w(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.WorkspaceFoldersFeature=void 0;var Vl=st(),GA=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Vl.Emitter,this.connection.onNotification(Vl.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Vl.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(Vl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Wl.WorkspaceFoldersFeature=GA});var rw=w(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.CallHierarchyFeature=void 0;var Pp=st(),YA=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Pp.CallHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Pp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onOutgoingCalls:e=>{let t=Pp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Hl.CallHierarchyFeature=YA});var Dp=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.SemanticTokensBuilder=Xr.SemanticTokensDiff=Xr.SemanticTokensFeature=void 0;var Kl=st(),JA=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Kl.SemanticTokensRefreshRequest.type),on:e=>{let t=Kl.SemanticTokensRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onDelta:e=>{let t=Kl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onRange:e=>{let t=Kl.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Xr.SemanticTokensFeature=JA;var zl=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,r=0;for(;r<t&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<t&&r<e){let s=e-1,i=t-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<t?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Xr.SemanticTokensDiff=zl;var Rp=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,r,s,i){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new zl(this._prevData,this._data).computeDiff()}:this.build()}};Xr.SemanticTokensBuilder=Rp});var sw=w(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.ShowDocumentFeature=void 0;var XA=st(),QA=n=>class extends n{showDocument(e){return this.connection.sendRequest(XA.ShowDocumentRequest.type,e)}};Gl.ShowDocumentFeature=QA});var iw=w(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.FileOperationsFeature=void 0;var Li=st(),ZA=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(Li.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Li.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Li.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Li.WillCreateFilesRequest.type,(t,r)=>e(t,r))}onWillRenameFiles(e){return this.connection.onRequest(Li.WillRenameFilesRequest.type,(t,r)=>e(t,r))}onWillDeleteFiles(e){return this.connection.onRequest(Li.WillDeleteFilesRequest.type,(t,r)=>e(t,r))}};Yl.FileOperationsFeature=ZA});var ow=w(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.LinkedEditingRangeFeature=void 0;var eI=st(),tI=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(eI.LinkedEditingRangeRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0))}};Jl.LinkedEditingRangeFeature=tI});var aw=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.TypeHierarchyFeature=void 0;var Cp=st(),nI=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Cp.TypeHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=Cp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onSubtypes:e=>{let t=Cp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Xl.TypeHierarchyFeature=nI});var lw=w(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.InlineValueFeature=void 0;var cw=st(),rI=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(cw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(cw.InlineValueRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Ql.InlineValueFeature=rI});var dw=w(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.FoldingRangeFeature=void 0;var uw=st(),sI=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(uw.FoldingRangeRefreshRequest.type),on:e=>{let t=uw.FoldingRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Zl.FoldingRangeFeature=sI});var fw=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.InlayHintFeature=void 0;var Op=st(),iI=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Op.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Op.InlayHintRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Op.InlayHintResolveRequest.type,(t,r)=>e(t,r))}}};eu.InlayHintFeature=iI});var hw=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.DiagnosticFeature=void 0;var na=st(),oI=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(na.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(na.DocumentDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(na.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(na.WorkspaceDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(na.WorkspaceDiagnosticRequest.partialResult,t)))}}};tu.DiagnosticFeature=oI});var Ip=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.TextDocuments=void 0;var Ls=st(),Ap=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ls.Emitter,this._onDidOpen=new Ls.Emitter,this._onDidClose=new Ls.Emitter,this._onDidSave=new Ls.Emitter,this._onWillSave=new Ls.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=Ls.TextDocumentSyncKind.Incremental;let t=[];return t.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)})),t.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})))})),t.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})))})),t.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}))})),t.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):[]})),t.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),Ls.Disposable.create(()=>{t.forEach(r=>r.dispose())})}};nu.TextDocuments=Ap});var Mp=w(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.NotebookDocuments=qi.NotebookSyncFeature=void 0;var _n=st(),pw=Ip(),aI=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(_n.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(_n.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(_n.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(_n.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};qi.NotebookSyncFeature=aI;var ru=class n{onDidOpenTextDocument(e){return this.openHandler=e,_n.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,_n.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,_n.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};ru.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var $p=class{constructor(e){e instanceof pw.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new pw.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new _n.Emitter,this._onDidChange=new _n.Emitter,this._onDidSave=new _n.Emitter,this._onDidClose=new _n.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(t);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 t=new ru,r=[];return r.push(this.cellTextDocuments.listen(t)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)t.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 v=E.structure.array;if(i.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),E.structure.didOpen!==void 0)for(let b of E.structure.didOpen)t.openTextDocument({textDocument:b}),l.push(b.uri);if(E.structure.didClose)for(let b of E.structure.didClose)t.closeTextDocument({textDocument:b}),u.push(b.uri)}if(E.data!==void 0){let v=new Map(E.data.map(b=>[b.document,b]));for(let b=0;b<=i.cells.length;b++){let R=v.get(i.cells[b].document);if(R!==void 0){let O=i.cells.splice(b,1,R);if(d.push({old:O[0],new:R}),v.delete(R.document),v.size===0)break}}}if(E.textContent!==void 0)for(let v of E.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),f.push(v.document.uri)}this.updateCellMap(i);let m={notebookDocument:i};a&&(m.metadata={old:o,new:i.metadata});let T=[];for(let E of l)T.push(this.getNotebookCell(E));let g=[];for(let E of u)g.push(this.getNotebookCell(E));let S=[];for(let E of f)S.push(this.getNotebookCell(E));(T.length>0||g.length>0||d.length>0||S.length>0)&&(m.cells={added:T,removed:g,changed:{data:d,textContent:S}}),(m.metadata!==void 0||m.cells!==void 0)&&this._onDidChange.fire(m)})),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)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),_n.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};qi.NotebookDocuments=$p});var mw=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MonikerFeature=void 0;var cI=st(),lI=n=>class extends n{get moniker(){return{on:e=>{let t=cI.MonikerRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};su.MonikerFeature=lI});var Bp=w(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.createConnection=Se.combineFeatures=Se.combineNotebooksFeatures=Se.combineLanguagesFeatures=Se.combineWorkspaceFeatures=Se.combineWindowFeatures=Se.combineClientFeatures=Se.combineTracerFeatures=Se.combineTelemetryFeatures=Se.combineConsoleFeatures=Se._NotebooksImpl=Se._LanguagesImpl=Se.BulkUnregistration=Se.BulkRegistration=Se.ErrorMessageTracker=void 0;var U=st(),Sn=Zc(),qp=Ep(),ne=ew(),uI=tw(),dI=nw(),fI=rw(),hI=Dp(),pI=sw(),mI=iw(),gI=ow(),yI=aw(),bI=lw(),vI=dw(),TI=fw(),_I=hw(),SI=Mp(),wI=mw();function Lp(n){if(n!==null)return n}var xp=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};Se.ErrorMessageTracker=xp;var iu=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},jp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let r={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Lp)}showWarningMessage(e,...t){let r={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Lp)}showInformationMessage(e,...t){let r={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Lp)}},gw=(0,pI.ShowDocumentFeature)((0,ne.ProgressFeature)(jp)),yw;(function(n){function e(){return new ou}n.create=e})(yw||(Se.BulkRegistration=yw={}));var ou=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let r=Sn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=qp.generateUuid();this._registrations.push({id:s,method:r,registerOptions:t||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},bw;(function(n){function e(){return new ra(void 0,[])}n.create=e})(bw||(Se.BulkUnregistration=bw={}));var ra=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.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 t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Sn.string(e)?e:e.method,r=this._unregistrations.get(t);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},au=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,r){return e instanceof ou?this.registerMany(e):e instanceof ra?this.registerSingle1(e,t,r):this.registerSingle2(e,t)}registerSingle1(e,t,r){let s=Sn.string(t)?t:t.method,i=qp.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.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,t){let r=Sn.string(e)?e:e.method,s=qp.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.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,t){let r={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new ra(this._connection,t.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Fp=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(s){return s&&!!s.edit}let r=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,r)}},vw=(0,mI.FileOperationsFeature)((0,dI.WorkspaceFoldersFeature)((0,uI.ConfigurationFeature)(Fp))),cu=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},lu=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},uu=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,ne.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,ne.attachPartialResult)(this.connection,t)}};Se._LanguagesImpl=uu;var Tw=(0,vI.FoldingRangeFeature)((0,wI.MonikerFeature)((0,_I.DiagnosticFeature)((0,TI.InlayHintFeature)((0,bI.InlineValueFeature)((0,yI.TypeHierarchyFeature)((0,gI.LinkedEditingRangeFeature)((0,hI.SemanticTokensFeature)((0,fI.CallHierarchyFeature)(uu))))))))),du=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,ne.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,ne.attachPartialResult)(this.connection,t)}};Se._NotebooksImpl=du;var _w=(0,SI.NotebookSyncFeature)(du);function Sw(n,e){return function(t){return e(n(t))}}Se.combineConsoleFeatures=Sw;function ww(n,e){return function(t){return e(n(t))}}Se.combineTelemetryFeatures=ww;function Ew(n,e){return function(t){return e(n(t))}}Se.combineTracerFeatures=Ew;function kw(n,e){return function(t){return e(n(t))}}Se.combineClientFeatures=kw;function Nw(n,e){return function(t){return e(n(t))}}Se.combineWindowFeatures=Nw;function Pw(n,e){return function(t){return e(n(t))}}Se.combineWorkspaceFeatures=Pw;function Rw(n,e){return function(t){return e(n(t))}}Se.combineLanguagesFeatures=Rw;function Dw(n,e){return function(t){return e(n(t))}}Se.combineNotebooksFeatures=Dw;function EI(n,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(n.console,e.console,Sw),tracer:t(n.tracer,e.tracer,Ew),telemetry:t(n.telemetry,e.telemetry,ww),client:t(n.client,e.client,kw),window:t(n.window,e.window,Nw),workspace:t(n.workspace,e.workspace,Pw),languages:t(n.languages,e.languages,Rw),notebooks:t(n.notebooks,e.notebooks,Dw)}}Se.combineFeatures=EI;function kI(n,e,t){let r=t&&t.console?new(t.console(iu)):new iu,s=n(r);r.rawAttach(s);let i=t&&t.tracer?new(t.tracer(cu)):new cu,o=t&&t.telemetry?new(t.telemetry(lu)):new lu,a=t&&t.client?new(t.client(au)):new au,c=t&&t.window?new(t.window(gw)):new gw,l=t&&t.workspace?new(t.workspace(vw)):new vw,u=t&&t.languages?new(t.languages(Tw)):new Tw,d=t&&t.notebooks?new(t.notebooks(_w)):new _w,f=[r,i,o,a,c,l,u,d];function m(v){return v instanceof Promise?v:Sn.thenable(v)?new Promise((b,R)=>{v.then(O=>b(O),O=>R(O))}):Promise.resolve(v)}let T,g,S,E={listen:()=>s.listen(),sendRequest:(v,...b)=>s.sendRequest(Sn.string(v)?v:v.method,...b),onRequest:(v,b)=>s.onRequest(v,b),sendNotification:(v,b)=>{let R=Sn.string(v)?v:v.method;return s.sendNotification(R,b)},onNotification:(v,b)=>s.onNotification(v,b),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:v=>(g=v,{dispose:()=>{g=void 0}}),onInitialized:v=>s.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(T=v,{dispose:()=>{T=void 0}}),onExit:v=>(S=v,{dispose:()=>{S=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:v=>s.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>s.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>s.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>s.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>s.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>s.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>s.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>s.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>s.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>s.onRequest(U.HoverRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onCompletion:v=>s.onRequest(U.CompletionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCompletionResolve:v=>s.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>s.onRequest(U.SignatureHelpRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDeclaration:v=>s.onRequest(U.DeclarationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDefinition:v=>s.onRequest(U.DefinitionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onTypeDefinition:v=>s.onRequest(U.TypeDefinitionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onImplementation:v=>s.onRequest(U.ImplementationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onReferences:v=>s.onRequest(U.ReferencesRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentHighlight:v=>s.onRequest(U.DocumentHighlightRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentSymbol:v=>s.onRequest(U.DocumentSymbolRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onWorkspaceSymbol:v=>s.onRequest(U.WorkspaceSymbolRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onWorkspaceSymbolResolve:v=>s.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>s.onRequest(U.CodeActionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCodeActionResolve:v=>s.onRequest(U.CodeActionResolveRequest.type,(b,R)=>v(b,R)),onCodeLens:v=>s.onRequest(U.CodeLensRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCodeLensResolve:v=>s.onRequest(U.CodeLensResolveRequest.type,(b,R)=>v(b,R)),onDocumentFormatting:v=>s.onRequest(U.DocumentFormattingRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDocumentRangeFormatting:v=>s.onRequest(U.DocumentRangeFormattingRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDocumentOnTypeFormatting:v=>s.onRequest(U.DocumentOnTypeFormattingRequest.type,(b,R)=>v(b,R)),onRenameRequest:v=>s.onRequest(U.RenameRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onPrepareRename:v=>s.onRequest(U.PrepareRenameRequest.type,(b,R)=>v(b,R)),onDocumentLinks:v=>s.onRequest(U.DocumentLinkRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentLinkResolve:v=>s.onRequest(U.DocumentLinkResolveRequest.type,(b,R)=>v(b,R)),onDocumentColor:v=>s.onRequest(U.DocumentColorRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onColorPresentation:v=>s.onRequest(U.ColorPresentationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onFoldingRanges:v=>s.onRequest(U.FoldingRangeRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onSelectionRanges:v=>s.onRequest(U.SelectionRangeRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onExecuteCommand:v=>s.onRequest(U.ExecuteCommandRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),dispose:()=>s.dispose()};for(let v of f)v.attach(E);return s.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Sn.string(v.trace)&&(i.trace=U.Trace.fromString(v.trace));for(let b of f)b.initialize(v.capabilities);if(g){let b=g(v,new U.CancellationTokenSource().token,(0,ne.attachWorkDone)(s,v),void 0);return m(b).then(R=>{if(R instanceof U.ResponseError)return R;let O=R;O||(O={capabilities:{}});let L=O.capabilities;L||(L={},O.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Sn.number(E.__textDocumentSync)?E.__textDocumentSync:U.TextDocumentSyncKind.None:!Sn.number(L.textDocumentSync)&&!Sn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Sn.number(E.__textDocumentSync)?E.__textDocumentSync:U.TextDocumentSyncKind.None);for(let V of f)V.fillServerCapabilities(L);return O})}else{let b={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(b.capabilities);return b}}),s.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,T)return T(new U.CancellationTokenSource().token)}),s.onNotification(U.ExitNotification.type,()=>{try{S&&S()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(U.SetTraceNotification.type,v=>{i.trace=U.Trace.fromString(v.value)}),E}Se.createConnection=kI});var Cw=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.resolveModulePath=tn.FileSystem=tn.resolveGlobalYarnPath=tn.resolveGlobalNodePath=tn.resolve=tn.uriToFilePath=void 0;var NI=require("url"),jn=require("path"),Up=require("fs"),Kp=require("child_process");function PI(n){let e=NI.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var r=0,s=t.length;r<s;r++)t[r]=decodeURIComponent(t[r]);if(process.platform==="win32"&&t.length>1){let i=t[0],o=t[1];i.length===0&&o.length>1&&o[1]===":"&&t.shift()}return jn.normalize(t.join("/"))}tn.uriToFilePath=PI;function Vp(){return process.platform==="win32"}function fu(n,e,t,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&&Up.existsSync(e)&&(l[s]?l[s]=e+jn.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Kp.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} 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: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}tn.resolve=fu;function Wp(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:t};Vp()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,Kp.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){n&&n("'npm config get prefix' didn't return a value.");return}let o=i.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Vp()?jn.join(o,"node_modules"):jn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}tn.resolveGlobalNodePath=Wp;function RI(n){let e="yarn",t={encoding:"utf8"};Vp()&&(e="yarn.cmd",t.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,Kp.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){n&&(n("'yarn global dir' didn't return a value."),s.stderr&&n(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 jn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}tn.resolveGlobalYarnPath=RI;var Hp;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Up.existsSync(__filename.toUpperCase())||!Up.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function r(s,i){return t()?jn.normalize(i).indexOf(jn.normalize(s))===0:jn.normalize(i).toLowerCase().indexOf(jn.normalize(s).toLowerCase())===0}n.isParent=r})(Hp||(tn.FileSystem=Hp={}));function DI(n,e,t,r){return t?(jn.isAbsolute(t)||(t=jn.join(n,t)),fu(e,t,t,r).then(s=>Hp.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>fu(e,Wp(r),n,r))):fu(e,Wp(r),n,r)}tn.resolveModulePath=DI});var zp=w((wK,Ow)=>{"use strict";Ow.exports=st()});var Aw=w(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.InlineCompletionFeature=void 0;var CI=st(),OI=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(CI.InlineCompletionRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};hu.InlineCompletionFeature=OI});var Mw=w(jt=>{"use strict";var AI=jt&&jt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),$w=jt&&jt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AI(e,n,t)};Object.defineProperty(jt,"__esModule",{value:!0});jt.ProposedFeatures=jt.NotebookDocuments=jt.TextDocuments=jt.SemanticTokensBuilder=void 0;var II=Dp();Object.defineProperty(jt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return II.SemanticTokensBuilder}});var $I=Aw();$w(st(),jt);var MI=Ip();Object.defineProperty(jt,"TextDocuments",{enumerable:!0,get:function(){return MI.TextDocuments}});var LI=Mp();Object.defineProperty(jt,"NotebookDocuments",{enumerable:!0,get:function(){return LI.NotebookDocuments}});$w(Bp(),jt);var Iw;(function(n){n.all={__brand:"features",languages:$I.InlineCompletionFeature}})(Iw||(jt.ProposedFeatures=Iw={}))});var X=w(wn=>{"use strict";var qI=wn&&wn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),jw=wn&&wn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qI(e,n,t)};Object.defineProperty(wn,"__esModule",{value:!0});wn.createConnection=wn.Files=void 0;var Lw=require("node:util"),Gp=Zc(),xI=Bp(),sa=Cw(),qs=zp();jw(zp(),wn);jw(Mw(),wn);var qw;(function(n){n.uriToFilePath=sa.uriToFilePath,n.resolveGlobalNodePath=sa.resolveGlobalNodePath,n.resolveGlobalYarnPath=sa.resolveGlobalYarnPath,n.resolve=sa.resolve,n.resolveModulePath=sa.resolveModulePath})(qw||(wn.Files=qw={}));var xw;function pu(){if(xw!==void 0)try{xw.end()}catch{}}var xi=!1,Fw;function jI(){let n="--clientProcessId";function e(t){try{let r=parseInt(t);isNaN(r)||(Fw=setInterval(()=>{try{process.kill(r,0)}catch{pu(),process.exit(xi?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let r=process.argv[t];if(r===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=r.split("=");s[0]===n&&e(s[1])}}}jI();var FI={initialize:n=>{let e=n.processId;Gp.number(e)&&Fw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(xi?0:1)}},3e3)},get shutdownReceived(){return xi},set shutdownReceived(n){xi=n},exit:n=>{pu(),process.exit(n)}};function BI(n,e,t,r){let s,i,o,a;return n!==void 0&&n.__brand==="features"&&(s=n,n=e,e=t,t=r),qs.ConnectionStrategy.is(n)||qs.ConnectionOptions.is(n)?a=n:(i=n,o=e,a=t),UI(i,o,a,s)}wn.createConnection=BI;function UI(n,e,t,r){let s=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){n=new qs.IPCMessageReader(process),e=new qs.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,n=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,qs.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,qs.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Gp.func(n.read)&&Gp.func(n.on)){let c=n;c.on("end",()=>{pu(),process.exit(xi?0:1)}),c.on("close",()=>{pu(),process.exit(xi?0:1)})}let a=c=>{let l=(0,qs.createProtocolConnection)(n,e,c,t);return s&&VI(c),l};return(0,xI.createConnection)(a,FI,r)}function VI(n){function e(r){return r.map(s=>typeof s=="string"?s:(0,Lw.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)n.error("Assertion failed");else{let[o,...a]=i;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=t.get(i)??0;o+=1,t.set(i,o),n.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){n.log(e(s))},console.dir=function(s,i){n.log((0,Lw.inspect)(s,i))},console.log=function(...s){n.log(e(s))},console.error=function(...s){n.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),n.log(`${o}
|
|
37
|
+
${i}`)},console.warn=function(...s){n.warn(e(s))}}});var Uw=w((RK,Bw)=>{"use strict";Bw.exports=X()});var ye=w(At=>{"use strict";var sm=Symbol.for("yaml.alias"),uk=Symbol.for("yaml.document"),Yu=Symbol.for("yaml.map"),dk=Symbol.for("yaml.pair"),im=Symbol.for("yaml.scalar"),Ju=Symbol.for("yaml.seq"),Rr=Symbol.for("yaml.node.type"),E$=n=>!!n&&typeof n=="object"&&n[Rr]===sm,k$=n=>!!n&&typeof n=="object"&&n[Rr]===uk,N$=n=>!!n&&typeof n=="object"&&n[Rr]===Yu,P$=n=>!!n&&typeof n=="object"&&n[Rr]===dk,fk=n=>!!n&&typeof n=="object"&&n[Rr]===im,R$=n=>!!n&&typeof n=="object"&&n[Rr]===Ju;function hk(n){if(n&&typeof n=="object")switch(n[Rr]){case Yu:case Ju:return!0}return!1}function D$(n){if(n&&typeof n=="object")switch(n[Rr]){case sm:case Yu:case im:case Ju:return!0}return!1}var C$=n=>(fk(n)||hk(n))&&!!n.anchor;At.ALIAS=sm;At.DOC=uk;At.MAP=Yu;At.NODE_TYPE=Rr;At.PAIR=dk;At.SCALAR=im;At.SEQ=Ju;At.hasAnchor=C$;At.isAlias=E$;At.isCollection=hk;At.isDocument=k$;At.isMap=N$;At.isNode=D$;At.isPair=P$;At.isScalar=fk;At.isSeq=R$});var da=w(om=>{"use strict";var vt=ye(),rn=Symbol("break visit"),pk=Symbol("skip children"),lr=Symbol("remove node");function Xu(n,e){let t=mk(e);vt.isDocument(n)?no(null,n.contents,t,Object.freeze([n]))===lr&&(n.contents=null):no(null,n,t,Object.freeze([]))}Xu.BREAK=rn;Xu.SKIP=pk;Xu.REMOVE=lr;function no(n,e,t,r){let s=gk(n,e,t,r);if(vt.isNode(s)||vt.isPair(s))return yk(n,r,s),no(n,s,t,r);if(typeof s!="symbol"){if(vt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=no(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===rn)return rn;o===lr&&(e.items.splice(i,1),i-=1)}}}else if(vt.isPair(e)){r=Object.freeze(r.concat(e));let i=no("key",e.key,t,r);if(i===rn)return rn;i===lr&&(e.key=null);let o=no("value",e.value,t,r);if(o===rn)return rn;o===lr&&(e.value=null)}}return s}async function Qu(n,e){let t=mk(e);vt.isDocument(n)?await ro(null,n.contents,t,Object.freeze([n]))===lr&&(n.contents=null):await ro(null,n,t,Object.freeze([]))}Qu.BREAK=rn;Qu.SKIP=pk;Qu.REMOVE=lr;async function ro(n,e,t,r){let s=await gk(n,e,t,r);if(vt.isNode(s)||vt.isPair(s))return yk(n,r,s),ro(n,s,t,r);if(typeof s!="symbol"){if(vt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await ro(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===rn)return rn;o===lr&&(e.items.splice(i,1),i-=1)}}}else if(vt.isPair(e)){r=Object.freeze(r.concat(e));let i=await ro("key",e.key,t,r);if(i===rn)return rn;i===lr&&(e.key=null);let o=await ro("value",e.value,t,r);if(o===rn)return rn;o===lr&&(e.value=null)}}return s}function mk(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function gk(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(vt.isMap(e))return t.Map?.(n,e,r);if(vt.isSeq(e))return t.Seq?.(n,e,r);if(vt.isPair(e))return t.Pair?.(n,e,r);if(vt.isScalar(e))return t.Scalar?.(n,e,r);if(vt.isAlias(e))return t.Alias?.(n,e,r)}function yk(n,e,t){let r=e[e.length-1];if(vt.isCollection(r))r.items[n]=t;else if(vt.isPair(r))n==="key"?r.key=t:r.value=t;else if(vt.isDocument(r))r.contents=t;else{let s=vt.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}om.visit=Xu;om.visitAsync=Qu});var am=w(vk=>{"use strict";var bk=ye(),O$=da(),A$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},I$=n=>n.replace(/[!,[\]{}]/g,e=>A$[e]),fa=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+I$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&bk.isNode(e.contents)){let i={};O$.visit(e.contents,(o,a)=>{bk.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
38
|
+
`)}};fa.defaultYaml={explicit:!1,version:"1.2"};fa.defaultTags={"!!":"tag:yaml.org,2002:"};vk.Directives=fa});var Zu=w(ha=>{"use strict";var Tk=ye(),$$=da();function M$(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function _k(n){let e=new Set;return $$.visit(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function Sk(n,e){for(let t=1;;++t){let r=`${n}${t}`;if(!e.has(r))return r}}function L$(n,e){let t=[],r=new Map,s=null;return{onAnchor:i=>{t.push(i),s||(s=_k(n));let o=Sk(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(Tk.isScalar(o.node)||Tk.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=i,a}}},sourceObjects:r}}ha.anchorIsValid=M$;ha.anchorNames=_k;ha.createNodeAnchors=L$;ha.findNewAnchor=Sk});var cm=w(wk=>{"use strict";function pa(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=pa(n,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=pa(n,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=pa(n,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=pa(n,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return n.call(e,t,r)}wk.applyReviver=pa});var os=w(kk=>{"use strict";var q$=ye();function Ek(n,e,t){if(Array.isArray(n))return n.map((r,s)=>Ek(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!q$.hasAnchor(n))return n.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=i=>{r.res=i,delete t.onCreate};let s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!t?.keep?Number(n):n}kk.toJS=Ek});var ed=w(Pk=>{"use strict";var x$=cm(),Nk=ye(),j$=os(),lm=class{constructor(e){Object.defineProperty(this,Nk.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Nk.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=j$.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?x$.applyReviver(i,{"":a},"",a):a}};Pk.NodeBase=lm});var ma=w(Dk=>{"use strict";var F$=Zu(),Rk=da(),td=ye(),B$=ed(),U$=os(),um=class extends B$.NodeBase{constructor(e){super(td.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Rk.visit(e,{Node:(r,s)=>{if(s===this)return Rk.visit.BREAK;s.anchor===this.source&&(t=s)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=t,o=this.resolve(s);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||(U$.toJS(o,null,t),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(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=nd(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,r){let s=`*${this.source}`;if(e){if(F$.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function nd(n,e,t){if(td.isAlias(e)){let r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(td.isCollection(e)){let r=0;for(let s of e.items){let i=nd(n,s,t);i>r&&(r=i)}return r}else if(td.isPair(e)){let r=nd(n,e.key,t),s=nd(n,e.value,t);return Math.max(r,s)}return 1}Dk.Alias=um});var gt=w(dm=>{"use strict";var V$=ye(),W$=ed(),H$=os(),K$=n=>!n||typeof n!="function"&&typeof n!="object",as=class extends W$.NodeBase{constructor(e){super(V$.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:H$.toJS(this.value,e,t)}toString(){return String(this.value)}};as.BLOCK_FOLDED="BLOCK_FOLDED";as.BLOCK_LITERAL="BLOCK_LITERAL";as.PLAIN="PLAIN";as.QUOTE_DOUBLE="QUOTE_DOUBLE";as.QUOTE_SINGLE="QUOTE_SINGLE";dm.Scalar=as;dm.isScalarValue=K$});var ga=w(Ok=>{"use strict";var z$=ma(),Vs=ye(),Ck=gt(),G$="tag:yaml.org,2002:";function Y$(n,e,t){if(e){let r=t.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(r=>r.identify?.(n)&&!r.format)}function J$(n,e,t){if(Vs.isDocument(n)&&(n=n.contents),Vs.isNode(n))return n;if(Vs.isPair(n)){let d=t.schema[Vs.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(r&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=s(n)),new z$.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=G$+e.slice(2));let l=Y$(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new Ck.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[Vs.MAP]:Symbol.iterator in Object(n)?o[Vs.SEQ]:o[Vs.MAP]}i&&(i(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new Ck.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Ok.createNode=J$});var sd=w(rd=>{"use strict";var X$=ga(),ur=ye(),Q$=ed();function fm(n,e,t){let r=t;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return X$.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Ak=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,hm=class extends Q$.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>ur.isNode(r)||ur.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ak(e))this.add(t);else{let[r,...s]=e,i=this.get(r,!0);if(ur.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,fm(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let s=this.get(t,!0);if(ur.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!t&&ur.isScalar(i)?i.value:i:ur.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ur.isPair(t))return!1;let r=t.value;return r==null||e&&ur.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let s=this.get(t,!0);return ur.isCollection(s)?s.hasIn(r):!1}setIn(e,t){let[r,...s]=e;if(s.length===0)this.set(r,t);else{let i=this.get(r,!0);if(ur.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,fm(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};rd.Collection=hm;rd.collectionFromPath=fm;rd.isEmptyPath=Ak});var ya=w(id=>{"use strict";var Z$=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function pm(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var eM=(n,e,t)=>n.endsWith(`
|
|
39
|
+
`)?pm(t,e):t.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)t===
|
|
43
|
-
`&&
|
|
44
|
-
`&&
|
|
45
|
-
${e}${n.slice(0,
|
|
46
|
-
${e}${n.slice(
|
|
47
|
-
`);
|
|
48
|
-
`){if(
|
|
41
|
+
`+pm(t,e):(n.endsWith(" ")?"":" ")+t;id.indentComment=pm;id.lineComment=eM;id.stringifyComment=Z$});var $k=w(ba=>{"use strict";var tM="flow",mm="block",od="quoted";function nM(n,e,t="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return n;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(n.length<=c)return n;let l=[],u={},d=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f,m,T=!1,g=-1,S=-1,E=-1;t===mm&&(g=Ik(n,g,e.length),g!==-1&&(d=g+c));for(let b;b=n[g+=1];){if(t===od&&b==="\\"){switch(S=g,n[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}E=g}if(b===`
|
|
42
|
+
`)t===mm&&(g=Ik(n,g,e.length)),d=g+e.length+c,f=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
43
|
+
`&&m!==" "){let R=n[g+1];R&&R!==" "&&R!==`
|
|
44
|
+
`&&R!==" "&&(f=g)}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===od){for(;m===" "||m===" ";)m=b,b=n[g+=1],T=!0;let R=g>E+1?g-2:S-1;if(u[R])return n;l.push(R),u[R]=!0,d=R+c,f=void 0}else T=!0}m=b}if(T&&a&&a(),l.length===0)return n;o&&o();let v=n.slice(0,l[0]);for(let b=0;b<l.length;++b){let R=l[b],O=l[b+1]||n.length;R===0?v=`
|
|
45
|
+
${e}${n.slice(0,O)}`:(t===od&&u[R]&&(v+=`${n[R]}\\`),v+=`
|
|
46
|
+
${e}${n.slice(R+1,O)}`)}return v}function Ik(n,e,t){let r=e,s=e+1,i=n[s];for(;i===" "||i===" ";)if(e<s+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
|
|
47
|
+
`);r=e,s=e+1,i=n[s]}return r}ba.FOLD_BLOCK=mm;ba.FOLD_FLOW=tM;ba.FOLD_QUOTED=od;ba.foldFlowLines=nM});var Ta=w(Mk=>{"use strict";var Vn=gt(),cs=$k(),cd=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),ld=n=>/^(%|---|\.\.\.)/m.test(n);function rM(n,e,t){if(!e||e<0)return!1;let r=e-t,s=n.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(n[i]===`
|
|
48
|
+
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function va(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(ld(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||t[c+2]==='"'||t.length<s)c+=1;else{for(o+=t.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
51
|
-
`,c+=2;o+=
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return
|
|
53
|
-
${t}`)+"'";return e.implicitKey?
|
|
51
|
+
`,c+=2;o+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,r?o:cs.foldFlowLines(o,i,cs.FOLD_QUOTED,cd(e,!1))}function gm(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return va(n,e);let t=e.indent||(ld(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${t}`)+"'";return e.implicitKey?r:cs.foldFlowLines(r,t,cs.FOLD_FLOW,cd(e,!1))}function so(n,e){let{singleQuote:t}=e.options,r;if(t===!1)r=va;else{let s=n.includes('"'),i=n.includes("'");s&&!i?r=gm:i&&!s?r=va:r=t?gm:va}return r(n,e)}var ym;try{ym=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{ym=/\n+(?!\n|$)/g}function ad({comment:n,type:e,value:t},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return so(t,r);let l=r.indent||(r.forceBlockIndent||ld(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===Vn.Scalar.BLOCK_FOLDED?!1:e===Vn.Scalar.BLOCK_LITERAL?!0:!rM(t,c,l.length);if(!t)return u?`|
|
|
57
57
|
`:`>
|
|
58
|
-
`;let d,
|
|
59
|
-
`&&
|
|
60
|
-
`);
|
|
61
|
-
`&&(
|
|
62
|
-
`)
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),
|
|
64
|
-
${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${
|
|
65
|
-
${l}${v}${t}${
|
|
66
|
-
`)||u&&/[[\]{},]/.test(
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
69
|
-
${c}`);if(o){let
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(
|
|
72
|
-
`:"",v){let
|
|
73
|
-
${
|
|
74
|
-
`&&(
|
|
75
|
-
|
|
76
|
-
`):
|
|
77
|
-
${t.indent}`}else if(!
|
|
78
|
-
`),re=j!==-1,
|
|
79
|
-
${t.indent}`)}}else(
|
|
80
|
-
`)&&(
|
|
81
|
-
${c}${
|
|
82
|
-
`}}return n?(
|
|
83
|
-
`+
|
|
84
|
-
`))&&(l=!0),d.push(
|
|
85
|
-
${
|
|
86
|
-
`;return`${
|
|
87
|
-
${
|
|
88
|
-
`:" ")}return
|
|
89
|
-
${
|
|
90
|
-
${s.comment}`:i.comment}i=r}n.items[t]=yl.isPair(i)?i:new Qd.Pair(i)}}else e("Expected a sequence for this tag");return n}function ES(n,e,t){let{replacer:i}=t,r=new gR.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Qd.createPair(a,c,t))}return r}var yR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:kS,createNode:ES};bl.createPairs=ES;bl.pairs=yR;bl.resolvePairs=kS});var eh=C(Zd=>{"use strict";var wS=le(),Jd=gi(),zs=ki(),bR=Ei(),NS=Tl(),Yi=class n extends bR.YAMLSeq{constructor(){super(),this.add=zs.YAMLMap.prototype.add.bind(this),this.delete=zs.YAMLMap.prototype.delete.bind(this),this.get=zs.YAMLMap.prototype.get.bind(this),this.has=zs.YAMLMap.prototype.has.bind(this),this.set=zs.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let r of this.items){let s,o;if(wS.isPair(r)?(s=Jd.toJS(r.key,"",t),o=Jd.toJS(r.value,s,t)):s=Jd.toJS(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,t,i){let r=NS.createPairs(e,t,i),s=new this;return s.items=r.items,s}};Yi.tag="tag:yaml.org,2002:omap";var TR={collection:"seq",identify:n=>n instanceof Map,nodeClass:Yi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=NS.resolvePairs(n,e),i=[];for(let{key:r}of t.items)wS.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Yi,t)},createNode:(n,e,t)=>Yi.from(n,e,t)};Zd.YAMLOMap=Yi;Zd.omap=TR});var CS=C(th=>{"use strict";var _S=Je();function PS({value:n,source:e},t){return e&&(n?DS:RS).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var DS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _S.Scalar(!0),stringify:PS},RS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _S.Scalar(!1),stringify:PS};th.falseTag=RS;th.trueTag=DS});var OS=C(vl=>{"use strict";var vR=Je(),nh=Vr(),SR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nh.stringifyNumber},kR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():nh.stringifyNumber(n)}},ER={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new vR.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:nh.stringifyNumber};vl.float=ER;vl.floatExp=kR;vl.floatNaN=SR});var IS=C(Xs=>{"use strict";var AS=Vr(),Gs=n=>typeof n=="bigint"||Number.isInteger(n);function Sl(n,e,t,{intAsBigInt:i}){let r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return r==="-"?BigInt(-1)*o:o}let s=parseInt(n,t);return r==="-"?-1*s:s}function ih(n,e,t){let{value:i}=n;if(Gs(i)){let r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return AS.stringifyNumber(n)}var wR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Sl(n,2,2,t),stringify:n=>ih(n,2,"0b")},NR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Sl(n,1,8,t),stringify:n=>ih(n,8,"0")},_R={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Sl(n,0,10,t),stringify:AS.stringifyNumber},PR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Sl(n,2,16,t),stringify:n=>ih(n,16,"0x")};Xs.int=_R;Xs.intBin=wR;Xs.intHex=PR;Xs.intOct=NR});var sh=C(rh=>{"use strict";var wl=le(),kl=vi(),El=ki(),Ki=class n extends El.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;wl.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new kl.Pair(e.key,null):t=new kl.Pair(e,null),El.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let i=El.findPair(this.items,e);return!t&&wl.isPair(i)?wl.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=El.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new kl.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),s.items.push(kl.createPair(o,null,i));return s}};Ki.tag="tag:yaml.org,2002:set";var DR={collection:"map",identify:n=>n instanceof Set,nodeClass:Ki,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Ki.from(n,e,t),resolve(n,e){if(wl.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Ki,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};rh.YAMLSet=Ki;rh.set=DR});var ah=C(Nl=>{"use strict";var RR=Vr();function oh(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*s:s}function LS(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return RR.stringifyNumber(n);let i="";e<0&&(i="-",e*=t(-1));let r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var CR={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>oh(n,t),stringify:LS},OR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>oh(n,!1),stringify:LS},xS={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(xS.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=oh(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Nl.floatTime=OR;Nl.intTime=CR;Nl.timestamp=xS});var FS=C(qS=>{"use strict";var AR=$r(),IR=dl(),LR=Wr(),xR=Ks(),MR=Xd(),MS=CS(),ch=OS(),_l=IS(),qR=rl(),FR=eh(),BR=Tl(),jR=sh(),lh=ah(),UR=[AR.map,LR.seq,xR.string,IR.nullTag,MS.trueTag,MS.falseTag,_l.intBin,_l.intOct,_l.int,_l.intHex,ch.floatNaN,ch.floatExp,ch.float,MR.binary,qR.merge,FR.omap,BR.pairs,jR.set,lh.intTime,lh.floatTime,lh.timestamp];qS.schema=UR});var zS=C(dh=>{"use strict";var $S=$r(),$R=dl(),WS=Wr(),WR=Ks(),VR=$d(),uh=Vd(),fh=Yd(),HR=yS(),YR=vS(),VS=Xd(),Qs=rl(),HS=eh(),YS=Tl(),BS=FS(),KS=sh(),Pl=ah(),jS=new Map([["core",HR.schema],["failsafe",[$S.map,WS.seq,WR.string]],["json",YR.schema],["yaml11",BS.schema],["yaml-1.1",BS.schema]]),US={binary:VS.binary,bool:VR.boolTag,float:uh.float,floatExp:uh.floatExp,floatNaN:uh.floatNaN,floatTime:Pl.floatTime,int:fh.int,intHex:fh.intHex,intOct:fh.intOct,intTime:Pl.intTime,map:$S.map,merge:Qs.merge,null:$R.nullTag,omap:HS.omap,pairs:YS.pairs,seq:WS.seq,set:KS.set,timestamp:Pl.timestamp},KR={"tag:yaml.org,2002:binary":VS.binary,"tag:yaml.org,2002:merge":Qs.merge,"tag:yaml.org,2002:omap":HS.omap,"tag:yaml.org,2002:pairs":YS.pairs,"tag:yaml.org,2002:set":KS.set,"tag:yaml.org,2002:timestamp":Pl.timestamp};function zR(n,e,t){let i=jS.get(e);if(i&&!n)return t&&!i.includes(Qs.merge)?i.concat(Qs.merge):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{let s=Array.from(jS.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(let s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(Qs.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?US[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(US).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},[])}dh.coreKnownTags=KR;dh.getTags=zR});var mh=C(GS=>{"use strict";var hh=le(),GR=$r(),XR=Wr(),QR=Ks(),Dl=zS(),JR=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,ph=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Dl.getTags(e,"compat"):e?Dl.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Dl.coreKnownTags:{},this.tags=Dl.getTags(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,hh.MAP,{value:GR.map}),Object.defineProperty(this,hh.SCALAR,{value:QR.string}),Object.defineProperty(this,hh.SEQ,{value:XR.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?JR:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};GS.Schema=ph});var QS=C(XS=>{"use strict";var ZR=le(),gh=Ws(),Js=Bs();function eC(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let r=gh.createStringifyContext(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=s(n.commentBefore);t.unshift(Js.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(ZR.isNode(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let u=s(n.contents.commentBefore);t.push(Js.indentComment(u,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=gh.stringify(n.contents,r,()=>a=null,c);a&&(l+=Js.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(gh.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=s(n.comment);c.includes(`
|
|
91
|
-
`)?(t.push("..."),t.push(
|
|
58
|
+
`;let d,f;for(f=t.length;f>0;--f){let O=t[f-1];if(O!==`
|
|
59
|
+
`&&O!==" "&&O!==" ")break}let m=t.substring(f),T=m.indexOf(`
|
|
60
|
+
`);T===-1?d="-":t===m||T!==m.length-1?(d="+",i&&i()):d="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
61
|
+
`&&(m=m.slice(0,-1)),m=m.replace(ym,`$&${l}`));let g=!1,S,E=-1;for(S=0;S<t.length;++S){let O=t[S];if(O===" ")g=!0;else if(O===`
|
|
62
|
+
`)E=S;else break}let v=t.substring(0,E<S?E+1:S);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let R=(g?l?"2":"1":"")+d;if(n&&(R+=" "+a(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let O=t.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,V=cd(r,!0);o!=="folded"&&e!==Vn.Scalar.BLOCK_FOLDED&&(V.onOverflow=()=>{L=!0});let j=cs.foldFlowLines(`${v}${O}${m}`,l,cs.FOLD_BLOCK,V);if(!L)return`>${R}
|
|
64
|
+
${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${R}
|
|
65
|
+
${l}${v}${t}${m}`}function sM(n,e,t,r){let{type:s,value:i}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(i))return so(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
67
|
+
`)?so(i,e):ad(n,e,t,r);if(!a&&!u&&s!==Vn.Scalar.PLAIN&&i.includes(`
|
|
68
|
+
`))return ad(n,e,t,r);if(ld(i)){if(c==="")return e.forceBlockIndent=!0,ad(n,e,t,r);if(a&&c===l)return so(i,e)}let d=i.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let f=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:m,tags:T}=e.doc.schema;if(T.some(f)||m?.some(f))return so(i,e)}return a?d:cs.foldFlowLines(d,c,cs.FOLD_FLOW,cd(e,!1))}function iM(n,e,t,r){let{implicitKey:s,inFlow:i}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==Vn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Vn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Vn.Scalar.BLOCK_FOLDED:case Vn.Scalar.BLOCK_LITERAL:return s||i?so(o.value,e):ad(o,e,t,r);case Vn.Scalar.QUOTE_DOUBLE:return va(o.value,e);case Vn.Scalar.QUOTE_SINGLE:return gm(o.value,e);case Vn.Scalar.PLAIN:return sM(o,e,t,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=s&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Mk.stringifyString=iM});var _a=w(bm=>{"use strict";var oM=Zu(),ls=ye(),aM=ya(),cM=Ta();function lM(n,e){let t=Object.assign({blockQuote:!0,commentString:aM.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function uM(n,e){if(e.tag){let s=n.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,r;if(ls.isScalar(e)){r=e.value;let s=n.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}t=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,t=n.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!t){let s=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${s} value`)}return t}function dM(n,e,{anchors:t,doc:r}){if(!r.directives)return"";let s=[],i=(ls.isScalar(n)||ls.isCollection(n))&&n.anchor;i&&oM.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&s.push(r.directives.tagString(o)),s.join(" ")}function fM(n,e,t,r){if(ls.isPair(n))return n.toString(e,t,r);if(ls.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s,i=ls.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>s=c});s||(s=uM(e.doc.schema.tags,i));let o=dM(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,t,r):ls.isScalar(i)?cM.stringifyString(i,e,t,r):i.toString(e,t,r);return o?ls.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}bm.createStringifyContext=lM;bm.stringify=fM});var jk=w(xk=>{"use strict";var Dr=ye(),Lk=gt(),qk=_a(),Sa=ya();function hM({key:n,value:e},t,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,f=Dr.isNode(n)&&n.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Dr.isCollection(n)||!Dr.isNode(n)&&typeof n=="object"){let V="With simple keys, collection cannot be used as a key value";throw new Error(V)}}let m=!d&&(!n||f&&e==null&&!t.inFlow||Dr.isCollection(n)||(Dr.isScalar(n)?n.type===Lk.Scalar.BLOCK_FOLDED||n.type===Lk.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(d||!i),indent:a+c});let T=!1,g=!1,S=qk.stringify(n,t,()=>T=!0,()=>g=!0);if(!m&&!t.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return T&&r&&r(),S===""?"?":m?`? ${S}`:S}else if(i&&!d||e==null&&m)return S=`? ${S}`,f&&!T?S+=Sa.lineComment(S,t.indent,l(f)):g&&s&&s(),S;T&&(f=null),m?(f&&(S+=Sa.lineComment(S,t.indent,l(f))),S=`? ${S}
|
|
71
|
+
${a}:`):(S=`${S}:`,f&&(S+=Sa.lineComment(S,t.indent,l(f))));let E,v,b;Dr.isNode(e)?(E=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(E=!1,v=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&Dr.isScalar(e)&&(t.indentAtStart=S.length+1),g=!1,!u&&c.length>=2&&!t.inFlow&&!m&&Dr.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let R=!1,O=qk.stringify(e,t,()=>R=!0,()=>g=!0),L=" ";if(f||E||v){if(L=E?`
|
|
72
|
+
`:"",v){let V=l(v);L+=`
|
|
73
|
+
${Sa.indentComment(V,t.indent)}`}O===""&&!t.inFlow?L===`
|
|
74
|
+
`&&(L=`
|
|
75
|
+
|
|
76
|
+
`):L+=`
|
|
77
|
+
${t.indent}`}else if(!m&&Dr.isCollection(e)){let V=O[0],j=O.indexOf(`
|
|
78
|
+
`),re=j!==-1,Ae=t.inFlow??e.flow??e.items.length===0;if(re||!Ae){let yt=!1;if(re&&(V==="&"||V==="!")){let de=O.indexOf(" ");V==="&"&&de!==-1&&de<j&&O[de+1]==="!"&&(de=O.indexOf(" ",de+1)),(de===-1||j<de)&&(yt=!0)}yt||(L=`
|
|
79
|
+
${t.indent}`)}}else(O===""||O[0]===`
|
|
80
|
+
`)&&(L="");return S+=L+O,t.inFlow?R&&r&&r():b&&!R?S+=Sa.lineComment(S,t.indent,l(b)):g&&s&&s(),S}xk.stringifyPair=hM});var Tm=w(vm=>{"use strict";function pM(n,...e){n==="debug"&&console.log(...e)}function mM(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}vm.debug=pM;vm.warn=mM});var hd=w(fd=>{"use strict";var wa=ye(),Fk=gt(),ud="<<",dd={identify:n=>n===ud||typeof n=="symbol"&&n.description===ud,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Fk.Scalar(Symbol(ud)),{addToJSMap:Bk}),stringify:()=>ud},gM=(n,e)=>(dd.identify(e)||wa.isScalar(e)&&(!e.type||e.type===Fk.Scalar.PLAIN)&&dd.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===dd.tag&&t.default);function Bk(n,e,t){if(t=n&&wa.isAlias(t)?t.resolve(n.doc):t,wa.isSeq(t))for(let r of t.items)_m(n,e,r);else if(Array.isArray(t))for(let r of t)_m(n,e,r);else _m(n,e,t)}function _m(n,e,t){let r=n&&wa.isAlias(t)?t.resolve(n.doc):t;if(!wa.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,n,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}fd.addMergeToJSMap=Bk;fd.isMergeKey=gM;fd.merge=dd});var wm=w(Wk=>{"use strict";var yM=Tm(),Uk=hd(),bM=_a(),Vk=ye(),Sm=os();function vM(n,e,{key:t,value:r}){if(Vk.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(Uk.isMergeKey(n,t))Uk.addMergeToJSMap(n,e,r);else{let s=Sm.toJS(t,"",n);if(e instanceof Map)e.set(s,Sm.toJS(r,s,n));else if(e instanceof Set)e.add(s);else{let i=TM(t,s,n),o=Sm.toJS(r,i,n);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function TM(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Vk.isNode(n)&&t?.doc){let r=bM.createStringifyContext(t.doc,{});r.anchors=new Set;for(let i of t.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=n.toString(r);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),yM.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}Wk.addPairToJSMap=vM});var us=w(Em=>{"use strict";var Hk=ga(),_M=jk(),SM=wm(),pd=ye();function wM(n,e,t){let r=Hk.createNode(n,void 0,t),s=Hk.createNode(e,void 0,t);return new md(r,s)}var md=class n{constructor(e,t=null){Object.defineProperty(this,pd.NODE_TYPE,{value:pd.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return pd.isNode(t)&&(t=t.clone(e)),pd.isNode(r)&&(r=r.clone(e)),new n(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return SM.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?_M.stringifyPair(this,e,t,r):JSON.stringify(this)}};Em.Pair=md;Em.createPair=wM});var km=w(zk=>{"use strict";var Ws=ye(),Kk=_a(),gd=ya();function EM(n,e,t){return(e.inFlow??n.flow?NM:kM)(n,e,t)}function kM({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:i,type:null}),d=!1,f=[];for(let T=0;T<e.length;++T){let g=e[T],S=null;if(Ws.isNode(g))!d&&g.spaceBefore&&f.push(""),yd(t,f,g.commentBefore,d),g.comment&&(S=g.comment);else if(Ws.isPair(g)){let v=Ws.isNode(g.key)?g.key:null;v&&(!d&&v.spaceBefore&&f.push(""),yd(t,f,v.commentBefore,d))}d=!1;let E=Kk.stringify(g,u,()=>S=null,()=>d=!0);S&&(E+=gd.lineComment(E,i,l(S))),d&&S&&(d=!1),f.push(r+E)}let m;if(f.length===0)m=s.start+s.end;else{m=f[0];for(let T=1;T<f.length;++T){let g=f[T];m+=g?`
|
|
81
|
+
${c}${g}`:`
|
|
82
|
+
`}}return n?(m+=`
|
|
83
|
+
`+gd.indentComment(l(n),c),a&&a()):d&&o&&o(),m}function NM({items:n},e,{flowChars:t,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let T=0;T<n.length;++T){let g=n[T],S=null;if(Ws.isNode(g))g.spaceBefore&&d.push(""),yd(e,d,g.commentBefore,!1),g.comment&&(S=g.comment);else if(Ws.isPair(g)){let v=Ws.isNode(g.key)?g.key:null;v&&(v.spaceBefore&&d.push(""),yd(e,d,v.commentBefore,!1),v.comment&&(l=!0));let b=Ws.isNode(g.value)?g.value:null;b?(b.comment&&(S=b.comment),b.commentBefore&&(l=!0)):g.value==null&&v?.comment&&(S=v.comment)}S&&(l=!0);let E=Kk.stringify(g,c,()=>S=null);T<n.length-1&&(E+=","),S&&(E+=gd.lineComment(E,r,a(S))),!l&&(d.length>u||E.includes(`
|
|
84
|
+
`))&&(l=!0),d.push(E),u=d.length}let{start:f,end:m}=t;if(d.length===0)return f+m;if(!l){let T=d.reduce((g,S)=>g+S.length+2,2);l=e.options.lineWidth>0&&T>e.options.lineWidth}if(l){let T=f;for(let g of d)T+=g?`
|
|
85
|
+
${i}${s}${g}`:`
|
|
86
|
+
`;return`${T}
|
|
87
|
+
${s}${m}`}else return`${f}${o}${d.join(" ")}${o}${m}`}function yd({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=gd.indentComment(e(r),n);t.push(i.trimStart())}}zk.stringifyCollection=EM});var fs=w(Pm=>{"use strict";var PM=km(),RM=wm(),DM=sd(),ds=ye(),bd=us(),CM=gt();function Ea(n,e){let t=ds.isScalar(e)?e.value:e;for(let r of n)if(ds.isPair(r)&&(r.key===e||r.key===t||ds.isScalar(r.key)&&r.key.value===t))return r}var Nm=class extends DM.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ds.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(t,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(bd.createPair(c,l,r))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let r;ds.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new bd.Pair(e,e?.value):r=new bd.Pair(e.key,e.value);let s=Ea(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);ds.isScalar(s.value)&&CM.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=Ea(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=Ea(this.items,e)?.value;return(!t&&ds.isScalar(s)?s.value:s)??void 0}has(e){return!!Ea(this.items,e)}set(e,t){this.add(new bd.Pair(e,t),!0)}toJSON(e,t,r){let s=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)RM.addPairToJSMap(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!ds.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),PM.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};Pm.YAMLMap=Nm;Pm.findPair=Ea});var io=w(Yk=>{"use strict";var OM=ye(),Gk=fs(),AM={collection:"map",default:!0,nodeClass:Gk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return OM.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Gk.YAMLMap.from(n,e,t)};Yk.map=AM});var hs=w(Jk=>{"use strict";var IM=ga(),$M=km(),MM=sd(),Td=ye(),LM=gt(),qM=os(),Rm=class extends MM.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Td.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=vd(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=vd(e);if(typeof r!="number")return;let s=this.items[r];return!t&&Td.isScalar(s)?s.value:s}has(e){let t=vd(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=vd(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];Td.isScalar(s)&&LM.isScalarValue(t)?s.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let s=0;for(let i of this.items)r.push(qM.toJS(i,String(s++),t));return r}toString(e,t,r){return e?$M.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let c=t instanceof Set?a:String(o++);a=s.call(t,c,a)}i.items.push(IM.createNode(a,void 0,r))}}return i}};function vd(n){let e=Td.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Jk.YAMLSeq=Rm});var oo=w(Qk=>{"use strict";var xM=ye(),Xk=hs(),jM={collection:"seq",default:!0,nodeClass:Xk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return xM.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Xk.YAMLSeq.from(n,e,t)};Qk.seq=jM});var ka=w(Zk=>{"use strict";var FM=Ta(),BM={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),FM.stringifyString(n,e,t,r)}};Zk.string=BM});var _d=w(nN=>{"use strict";var eN=gt(),tN={identify:n=>n==null,createNode:()=>new eN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eN.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&tN.test.test(n)?n:e.options.nullStr};nN.nullTag=tN});var Dm=w(sN=>{"use strict";var UM=gt(),rN={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new UM.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&rN.test.test(n)){let r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};sN.boolTag=rN});var ao=w(iN=>{"use strict";function VM({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}iN.stringifyNumber=VM});var Om=w(Sd=>{"use strict";var WM=gt(),Cm=ao(),HM={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Cm.stringifyNumber},KM={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Cm.stringifyNumber(n)}},zM={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new WM.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Cm.stringifyNumber};Sd.float=zM;Sd.floatExp=KM;Sd.floatNaN=HM});var Im=w(Ed=>{"use strict";var oN=ao(),wd=n=>typeof n=="bigint"||Number.isInteger(n),Am=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function aN(n,e,t){let{value:r}=n;return wd(r)&&r>=0?t+r.toString(e):oN.stringifyNumber(n)}var GM={identify:n=>wd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Am(n,2,8,t),stringify:n=>aN(n,8,"0o")},YM={identify:wd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Am(n,0,10,t),stringify:oN.stringifyNumber},JM={identify:n=>wd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Am(n,2,16,t),stringify:n=>aN(n,16,"0x")};Ed.int=YM;Ed.intHex=JM;Ed.intOct=GM});var lN=w(cN=>{"use strict";var XM=io(),QM=_d(),ZM=oo(),e1=ka(),t1=Dm(),$m=Om(),Mm=Im(),n1=[XM.map,ZM.seq,e1.string,QM.nullTag,t1.boolTag,Mm.intOct,Mm.int,Mm.intHex,$m.floatNaN,$m.floatExp,$m.float];cN.schema=n1});var fN=w(dN=>{"use strict";var r1=gt(),s1=io(),i1=oo();function uN(n){return typeof n=="bigint"||Number.isInteger(n)}var kd=({value:n})=>JSON.stringify(n),o1=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:kd},{identify:n=>n==null,createNode:()=>new r1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:kd},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:kd},{identify:uN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>uN(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:kd}],a1={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},c1=[s1.map,i1.seq].concat(o1,a1);dN.schema=c1});var qm=w(hN=>{"use strict";var Lm=gt(),l1=Ta(),u1={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let s=0;s<t.length;++s)r[s]=t.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,s,i){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Lm.Scalar.BLOCK_LITERAL),e!==Lm.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===Lm.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return l1.stringifyString({comment:n,type:e,value:a},r,s,i)}};hN.binary=u1});var Rd=w(Pd=>{"use strict";var Nd=ye(),xm=us(),d1=gt(),f1=hs();function pN(n,e){if(Nd.isSeq(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!Nd.isPair(r)){if(Nd.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new xm.Pair(new d1.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
89
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
90
|
+
${i.comment}`:r.comment}r=s}n.items[t]=Nd.isPair(r)?r:new xm.Pair(r)}}else e("Expected a sequence for this tag");return n}function mN(n,e,t){let{replacer:r}=t,s=new f1.YAMLSeq(n);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(xm.createPair(a,c,t))}return s}var h1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:pN,createNode:mN};Pd.createPairs=mN;Pd.pairs=h1;Pd.resolvePairs=pN});var Bm=w(Fm=>{"use strict";var gN=ye(),jm=os(),Na=fs(),p1=hs(),yN=Rd(),Hs=class n extends p1.YAMLSeq{constructor(){super(),this.add=Na.YAMLMap.prototype.add.bind(this),this.delete=Na.YAMLMap.prototype.delete.bind(this),this.get=Na.YAMLMap.prototype.get.bind(this),this.has=Na.YAMLMap.prototype.has.bind(this),this.set=Na.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let s of this.items){let i,o;if(gN.isPair(s)?(i=jm.toJS(s.key,"",t),o=jm.toJS(s.value,i,t)):i=jm.toJS(s,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let s=yN.createPairs(e,t,r),i=new this;return i.items=s.items,i}};Hs.tag="tag:yaml.org,2002:omap";var m1={collection:"seq",identify:n=>n instanceof Map,nodeClass:Hs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=yN.resolvePairs(n,e),r=[];for(let{key:s}of t.items)gN.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Hs,t)},createNode:(n,e,t)=>Hs.from(n,e,t)};Fm.YAMLOMap=Hs;Fm.omap=m1});var SN=w(Um=>{"use strict";var bN=gt();function vN({value:n,source:e},t){return e&&(n?TN:_N).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var TN={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new bN.Scalar(!0),stringify:vN},_N={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new bN.Scalar(!1),stringify:vN};Um.falseTag=_N;Um.trueTag=TN});var wN=w(Dd=>{"use strict";var g1=gt(),Vm=ao(),y1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Vm.stringifyNumber},b1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Vm.stringifyNumber(n)}},v1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new g1.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Vm.stringifyNumber};Dd.float=v1;Dd.floatExp=b1;Dd.floatNaN=y1});var kN=w(Ra=>{"use strict";var EN=ao(),Pa=n=>typeof n=="bigint"||Number.isInteger(n);function Cd(n,e,t,{intAsBigInt:r}){let s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return s==="-"?BigInt(-1)*o:o}let i=parseInt(n,t);return s==="-"?-1*i:i}function Wm(n,e,t){let{value:r}=n;if(Pa(r)){let s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return EN.stringifyNumber(n)}var T1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Cd(n,2,2,t),stringify:n=>Wm(n,2,"0b")},_1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Cd(n,1,8,t),stringify:n=>Wm(n,8,"0")},S1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Cd(n,0,10,t),stringify:EN.stringifyNumber},w1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Cd(n,2,16,t),stringify:n=>Wm(n,16,"0x")};Ra.int=S1;Ra.intBin=T1;Ra.intHex=w1;Ra.intOct=_1});var Km=w(Hm=>{"use strict";var Id=ye(),Od=us(),Ad=fs(),Ks=class n extends Ad.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Id.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Od.Pair(e.key,null):t=new Od.Pair(e,null),Ad.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=Ad.findPair(this.items,e);return!t&&Id.isPair(r)?Id.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Ad.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new Od.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(Od.createPair(o,null,r));return i}};Ks.tag="tag:yaml.org,2002:set";var E1={collection:"map",identify:n=>n instanceof Set,nodeClass:Ks,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Ks.from(n,e,t),resolve(n,e){if(Id.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Ks,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};Hm.YAMLSet=Ks;Hm.set=E1});var Gm=w($d=>{"use strict";var k1=ao();function zm(n,e){let t=n[0],r=t==="-"||t==="+"?n.substring(1):n,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function NN(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return k1.stringifyNumber(n);let r="";e<0&&(r="-",e*=t(-1));let s=t(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 N1={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>zm(n,t),stringify:NN},P1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>zm(n,!1),stringify:NN},PN={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(PN.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=zm(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};$d.floatTime=P1;$d.intTime=N1;$d.timestamp=PN});var CN=w(DN=>{"use strict";var R1=io(),D1=_d(),C1=oo(),O1=ka(),A1=qm(),RN=SN(),Ym=wN(),Md=kN(),I1=hd(),$1=Bm(),M1=Rd(),L1=Km(),Jm=Gm(),q1=[R1.map,C1.seq,O1.string,D1.nullTag,RN.trueTag,RN.falseTag,Md.intBin,Md.intOct,Md.int,Md.intHex,Ym.floatNaN,Ym.floatExp,Ym.float,A1.binary,I1.merge,$1.omap,M1.pairs,L1.set,Jm.intTime,Jm.floatTime,Jm.timestamp];DN.schema=q1});var FN=w(Zm=>{"use strict";var $N=io(),x1=_d(),MN=oo(),j1=ka(),F1=Dm(),Xm=Om(),Qm=Im(),B1=lN(),U1=fN(),LN=qm(),Da=hd(),qN=Bm(),xN=Rd(),ON=CN(),jN=Km(),Ld=Gm(),AN=new Map([["core",B1.schema],["failsafe",[$N.map,MN.seq,j1.string]],["json",U1.schema],["yaml11",ON.schema],["yaml-1.1",ON.schema]]),IN={binary:LN.binary,bool:F1.boolTag,float:Xm.float,floatExp:Xm.floatExp,floatNaN:Xm.floatNaN,floatTime:Ld.floatTime,int:Qm.int,intHex:Qm.intHex,intOct:Qm.intOct,intTime:Ld.intTime,map:$N.map,merge:Da.merge,null:x1.nullTag,omap:qN.omap,pairs:xN.pairs,seq:MN.seq,set:jN.set,timestamp:Ld.timestamp},V1={"tag:yaml.org,2002:binary":LN.binary,"tag:yaml.org,2002:merge":Da.merge,"tag:yaml.org,2002:omap":qN.omap,"tag:yaml.org,2002:pairs":xN.pairs,"tag:yaml.org,2002:set":jN.set,"tag:yaml.org,2002:timestamp":Ld.timestamp};function W1(n,e,t){let r=AN.get(e);if(r&&!n)return t&&!r.includes(Da.merge)?r.concat(Da.merge):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{let i=Array.from(AN.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(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(Da.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?IN[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(IN).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},[])}Zm.coreKnownTags=V1;Zm.getTags=W1});var ng=w(BN=>{"use strict";var eg=ye(),H1=io(),K1=oo(),z1=ka(),qd=FN(),G1=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,tg=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?qd.getTags(e,"compat"):e?qd.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?qd.coreKnownTags:{},this.tags=qd.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,eg.MAP,{value:H1.map}),Object.defineProperty(this,eg.SCALAR,{value:z1.string}),Object.defineProperty(this,eg.SEQ,{value:K1.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?G1:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};BN.Schema=tg});var VN=w(UN=>{"use strict";var Y1=ye(),rg=_a(),Ca=ya();function J1(n,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");let s=rg.createStringifyContext(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=i(n.commentBefore);t.unshift(Ca.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(Y1.isNode(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){let u=i(n.contents.commentBefore);t.push(Ca.indentComment(u,""))}s.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=rg.stringify(n.contents,s,()=>a=null,c);a&&(l+=Ca.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(rg.stringify(n.contents,s));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
|
|
91
|
+
`)?(t.push("..."),t.push(Ca.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ca.indentComment(i(c),"")))}return t.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}
|
|
94
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===
|
|
93
|
+
`}UN.stringifyDocument=J1});var Oa=w(WN=>{"use strict";var X1=ma(),co=sd(),kn=ye(),Q1=us(),Z1=os(),eL=ng(),tL=VN(),sg=Zu(),nL=cm(),rL=ga(),ig=am(),og=class n{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,kn.NODE_TYPE,{value:kn.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:r===void 0&&t&&(r=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ig.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(n.prototype,{[kn.NODE_TYPE]:{value:kn.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=kn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){lo(this.contents)&&this.contents.add(e)}addIn(e,t){lo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=sg.anchorNames(this);e.anchor=!t||r.has(t)?sg.findNewAnchor(t||"a",r):t}return new X1.Alias(e.anchor)}createNode(e,t,r){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let S=v=>typeof v=="number"||v instanceof String||v instanceof Number,E=t.filter(S).map(String);E.length>0&&(t=t.concat(E)),s=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:m}=sg.createNodeAnchors(this,o||"a"),T={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=rL.createNode(e,u,T);return a&&kn.isCollection(g)&&(g.flow=!0),f(),g}createPair(e,t,r={}){let s=this.createNode(e,null,r),i=this.createNode(t,null,r);return new Q1.Pair(s,i)}delete(e){return lo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return co.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):lo(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return kn.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return co.isEmptyPath(e)?!t&&kn.isScalar(this.contents)?this.contents.value:this.contents:kn.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return kn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return co.isEmptyPath(e)?this.contents!==void 0:kn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=co.collectionFromPath(this.schema,[e],t):lo(this.contents)&&this.contents.set(e,t)}setIn(e,t){co.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=co.collectionFromPath(this.schema,Array.from(e),t):lo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ig.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 ig.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new eL.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Z1.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?nL.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return tL.stringifyDocument(this,e)}};function lo(n){if(kn.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}WN.Document=og});var $a=w(Ia=>{"use strict";var Aa=class extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}},ag=class extends Aa{constructor(e,t,r){super("YAMLParseError",e,t,r)}},cg=class extends Aa{constructor(e,t,r){super("YAMLWarning",e,t,r)}},sL=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:s}=t.linePos[0];t.message+=` at line ${r}, column ${s}`;let i=s-1,o=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=n.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=t.linePos[1];c&&c.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
95
95
|
|
|
96
96
|
${o}
|
|
97
97
|
${l}
|
|
98
|
-
`}};
|
|
99
|
-
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(
|
|
100
|
-
`+
|
|
101
|
-
`+
|
|
102
|
-
`+
|
|
103
|
-
`+
|
|
104
|
-
`+re.comment:j.comment=re.comment);let
|
|
105
|
-
`+
|
|
106
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
107
|
-
`;for(let
|
|
108
|
-
`):
|
|
109
|
-
`:!
|
|
110
|
-
`&&(
|
|
111
|
-
|
|
112
|
-
`),d+=
|
|
113
|
-
`,
|
|
98
|
+
`}};Ia.YAMLError=Aa;Ia.YAMLParseError=ag;Ia.YAMLWarning=cg;Ia.prettifyError=sL});var Ma=w(HN=>{"use strict";function iL(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",m=!1,T=!1,g=null,S=null,E=null,v=null,b=null,R=null,O=null;for(let j of n)switch(T&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&i(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T=!1),g&&(l&&j.type!=="comment"&&j.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),j.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&j.source.includes(" ")&&(g=j),u=!0;break;case"comment":{u||i(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let re=j.source.substring(1)||" ";d?d+=f+re:d=re,f="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:f+=j.source,l=!0,m=!0,(S||E)&&(v=j),u=!0;break;case"anchor":S&&i(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&i(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=j,O===null&&(O=j.offset),l=!1,u=!1,T=!0;break;case"tag":{E&&i(j,"MULTIPLE_TAGS","A node can have at most one tag"),E=j,O===null&&(O=j.offset),l=!1,u=!1,T=!0;break}case t:(S||E)&&i(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),R&&i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),R=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&i(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=j,l=!1,u=!1;break}default:i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let L=n[n.length-1],V=L?L.offset+L.source.length:s;return T&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:R,spaceBefore:c,comment:d,hasNewline:m,anchor:S,tag:E,newlineAfterProp:v,end:V,start:O??V}}HN.resolveProps=iL});var xd=w(KN=>{"use strict";function lg(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
99
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(lg(e.key)||lg(e.value))return!0}return!1;default:return!0}}KN.containsNewline=lg});var ug=w(zN=>{"use strict";var oL=xd();function aL(n,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&oL.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}zN.flowIndentCheck=aL});var dg=w(YN=>{"use strict";var GN=ye();function cL(n,e,t){let{uniqueKeys:r}=n.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||GN.isScalar(i)&&GN.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}YN.mapIncludes=cL});var tP=w(eP=>{"use strict";var JN=us(),lL=fs(),XN=Ma(),uL=xd(),QN=ug(),dL=dg(),ZN="All mapping items must start at the same column";function fL({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??lL.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:m,value:T}=u,g=XN.resolveProps(d,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!g.found;if(S){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&s(c,"BAD_INDENT",ZN)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||uL.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",ZN);t.atKey=!0;let E=g.end,v=f?n(t,f,g,s):e(t,E,d,null,g,s);t.schema.compat&&QN.flowIndentCheck(r.indent,f,s),t.atKey=!1,dL.mapIncludes(t,a.items,v)&&s(E,"DUPLICATE_KEY","Map keys must be unique");let b=XN.resolveProps(m??[],{indicator:"map-value-ind",next:T,offset:v.range[2],onError:s,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=b.end,b.found){S&&(T?.type==="block-map"&&!b.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<b.found.offset-1024&&s(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=T?n(t,T,b,s):e(t,c,m,null,b,s);t.schema.compat&&QN.flowIndentCheck(r.indent,T,s),c=R.range[2];let O=new JN.Pair(v,R);t.options.keepSourceTokens&&(O.srcToken=u),a.items.push(O)}else{S&&s(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(v.comment?v.comment+=`
|
|
101
|
+
`+b.comment:v.comment=b.comment);let R=new JN.Pair(v);t.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}eP.resolveBlockMap=fL});var rP=w(nP=>{"use strict";var hL=hs(),pL=Ma(),mL=ug();function gL({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??hL.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=pL.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let m=d?n(t,d,f,s):e(t,f.end,u,null,f,s);t.schema.compat&&mL.flowIndentCheck(r.indent,d,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}nP.resolveBlockSeq=gL});var uo=w(sP=>{"use strict";function yL(n,e,t,r){let s="";if(n){let i=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}sP.resolveEnd=yL});var cP=w(aP=>{"use strict";var bL=ye(),vL=us(),iP=fs(),TL=hs(),_L=uo(),oP=Ma(),SL=xd(),wL=dg(),fg="Block collections are not allowed within flow collections",hg=n=>n&&(n.type==="block-map"||n.type==="block-seq");function EL({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?iP.YAMLMap:TL.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){let E=r.items[S],{start:v,key:b,sep:R,value:O}=E,L=oP.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:b??R?.[0],offset:d,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!R&&!O){S===0&&L.comma?s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<r.items.length-1&&s(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&&t.options.strict&&SL.containsNewline(b)&&s(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)L.comma&&s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||s(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let V="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":V=j.source.substring(1);break e;default:break e}if(V){let j=l.items[l.items.length-1];bL.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
|
|
103
|
+
`+V:j.comment=V,L.comment=L.comment.substring(V.length+1)}}if(!o&&!R&&!L.found){let V=O?n(t,O,L,s):e(t,L.end,R,null,L,s);l.items.push(V),d=V.range[2],hg(O)&&s(V.range,"BLOCK_IN_FLOW",fg)}else{t.atKey=!0;let V=L.end,j=b?n(t,b,L,s):e(t,V,v,null,L,s);hg(b)&&s(j.range,"BLOCK_IN_FLOW",fg),t.atKey=!1;let re=oP.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:O,offset:j.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(re.found){if(!o&&!L.found&&t.options.strict){if(R)for(let de of R){if(de===re.found)break;if(de.type==="newline"){s(de,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<re.found.offset-1024&&s(re.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source&&O.source[0]===":"?s(O,"MISSING_CHAR",`Missing space after : in ${a}`):s(re.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Ae=O?n(t,O,re,s):re.found?e(t,re.end,R,null,re,s):null;Ae?hg(O)&&s(Ae.range,"BLOCK_IN_FLOW",fg):re.comment&&(j.comment?j.comment+=`
|
|
104
|
+
`+re.comment:j.comment=re.comment);let yt=new vL.Pair(j,Ae);if(t.options.keepSourceTokens&&(yt.srcToken=E),o){let de=l;wL.mapIncludes(t,de.items,j)&&s(V,"DUPLICATE_KEY","Map keys must be unique"),de.items.push(yt)}else{let de=new iP.YAMLMap(t.schema);de.flow=!0,de.items.push(yt);let yn=(Ae??j).range;de.range=[j.range[0],yn[1],yn[2]],l.items.push(de)}d=Ae?Ae.range[2]:re.end}}let f=o?"}":"]",[m,...T]=r.end,g=d;if(m&&m.source===f)g=m.offset+m.source.length;else{let S=a[0].toUpperCase()+a.substring(1),E=u?`${S} must end with a ${f}`:`${S} in block collection must be sufficiently indented and end with a ${f}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",E),m&&m.source.length!==1&&T.unshift(m)}if(T.length>0){let S=_L.resolveEnd(T,g,t.options.strict,s);S.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+S.comment:l.comment=S.comment),l.range=[r.offset,g,S.offset]}else l.range=[r.offset,g,g];return l}aP.resolveFlowCollection=EL});var uP=w(lP=>{"use strict";var kL=ye(),NL=gt(),PL=fs(),RL=hs(),DL=tP(),CL=rP(),OL=cP();function pg(n,e,t,r,s,i){let o=t.type==="block-map"?DL.resolveBlockMap(n,e,t,r,i):t.type==="block-seq"?CL.resolveBlockSeq(n,e,t,r,i):OL.resolveFlowCollection(n,e,t,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function AL(n,e,t,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=r,T=f&&i?f.offset>i.offset?f:i:f??i;T&&(!m||m.offset<T.offset)&&s(T,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===PL.YAMLMap.tagName&&a==="map"||o===RL.YAMLSeq.tagName&&a==="seq")return pg(n,e,t,s,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?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),pg(n,e,t,s,o)}let l=pg(n,e,t,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=kL.isNode(u)?u:new NL.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}lP.composeCollection=AL});var gg=w(dP=>{"use strict";var mg=gt();function IL(n,e,t){let r=e.offset,s=$L(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?mg.Scalar.BLOCK_FOLDED:mg.Scalar.BLOCK_LITERAL,o=e.source?ML(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let S=o[g][1];if(S===""||S==="\r")a=g;else break}if(a===0){let g=s.chomp==="+"&&o.length>0?`
|
|
106
|
+
`.repeat(Math.max(1,o.length-1)):"",S=r+s.length;return e.source&&(S+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,S,S]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let g=0;g<a;++g){let[S,E]=o[g];if(E===""||E==="\r")s.indent===0&&S.length>c&&(c=S.length);else{S.length<c&&t(l+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=S.length),u=g,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=S.length+E.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let d="",f="",m=!1;for(let g=0;g<u;++g)d+=o[g][0].slice(c)+`
|
|
107
|
+
`;for(let g=u;g<a;++g){let[S,E]=o[g];l+=S.length+E.length+1;let v=E[E.length-1]==="\r";if(v&&(E=E.slice(0,-1)),E&&S.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-E.length-(v?2:1),"BAD_INDENT",R),S=""}i===mg.Scalar.BLOCK_LITERAL?(d+=f+S.slice(c)+E,f=`
|
|
108
|
+
`):S.length>c||E[0]===" "?(f===" "?f=`
|
|
109
|
+
`:!m&&f===`
|
|
110
|
+
`&&(f=`
|
|
111
|
+
|
|
112
|
+
`),d+=f+S.slice(c)+E,f=`
|
|
113
|
+
`,m=!0):E===""?f===`
|
|
114
114
|
`?d+=`
|
|
115
|
-
`:
|
|
116
|
-
`:(d+=
|
|
117
|
-
`+o[
|
|
115
|
+
`:f=`
|
|
116
|
+
`:(d+=f+E,f=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)d+=`
|
|
117
|
+
`+o[g][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let
|
|
120
|
+
`}let T=r+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[r,T,T]}}function $L({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let f=1;f<s.length;++f){let m=s[f];if(!a&&(m==="-"||m==="+"))a=m;else{let T=Number(m);!o&&T?o=T:c===-1&&(c=n+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",d=s.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":l=!0;case"newline":d+=m.source.length;break;case"comment":t&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let T=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",T);let g=m.source;g&&typeof g=="string"&&(d+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function ML(n){let e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),i=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}dP.resolveBlockScalar=IL});var bg=w(hP=>{"use strict";var yg=gt(),LL=uo();function qL(n,e,t){let{offset:r,type:s,source:i,end:o}=n,a,c,l=(f,m,T)=>t(r+f,m,T);switch(s){case"scalar":a=yg.Scalar.PLAIN,c=xL(i,l);break;case"single-quoted-scalar":a=yg.Scalar.QUOTE_SINGLE,c=jL(i,l);break;case"double-quoted-scalar":a=yg.Scalar.QUOTE_DOUBLE,c=FL(i,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,d=LL.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function xL(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),fP(n)}function jL(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),fP(n.slice(1,-1)).replace(/''/g,"'")}function fP(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let
|
|
123
|
-
`?
|
|
124
|
-
`:(
|
|
125
|
-
`))if(
|
|
126
|
-
`){let{fold:
|
|
127
|
-
`)for(
|
|
128
|
-
`)for(
|
|
129
|
-
`&&!(o==="\r"&&n[
|
|
130
|
-
`)&&(t+=i
|
|
131
|
-
`||
|
|
132
|
-
`);)
|
|
122
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let s=r[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(n);)r[1]===""?i===`
|
|
123
|
+
`?s+=i:i=`
|
|
124
|
+
`:(s+=i+r[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(n),s+i+(r?.[1]??"")}function FL(n,e){let t="";for(let r=1;r<n.length-1;++r){let s=n[r];if(!(s==="\r"&&n[r+1]===`
|
|
125
|
+
`))if(s===`
|
|
126
|
+
`){let{fold:i,offset:o}=BL(n,r);t+=i,r=o}else if(s==="\\"){let i=n[++r],o=UL[i];if(o)t+=o;else if(i===`
|
|
127
|
+
`)for(i=n[r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="\r"&&n[r+1]===`
|
|
128
|
+
`)for(i=n[++r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=VL(n,r+1,a,e),r+=a}else{let a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=r,o=n[r+1];for(;o===" "||o===" ";)o=n[++r+1];o!==`
|
|
129
|
+
`&&!(o==="\r"&&n[r+2]===`
|
|
130
|
+
`)&&(t+=r>i?n.slice(i,r+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function BL(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
|
|
131
|
+
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
|
|
132
|
+
`);)r===`
|
|
133
133
|
`&&(t+=`
|
|
134
|
-
`),e+=1,
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}var UL={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 VL(n,e,t,r){let s=n.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}hP.resolveFlowScalar=qL});var gP=w(mP=>{"use strict";var zs=ye(),pP=gt(),WL=gg(),HL=bg();function KL(n,e,t,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?WL.resolveBlockScalar(n,e,r):HL.resolveFlowScalar(e,n.options.strict,r),c=t?n.directives.tagName(t.source,d=>r(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[zs.SCALAR]:c?l=zL(n.schema,s,c,t,r):e.type==="scalar"?l=GL(n,s,e,r):l=n.schema[zs.SCALAR];let u;try{let d=l.resolve(s,f=>r(t??e,"TAG_RESOLVE_FAILED",f),n.options);u=zs.isScalar(d)?d:new pP.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(t??e,"TAG_RESOLVE_FAILED",f),u=new pP.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function zL(n,e,t,r,s){if(t==="!")return n[zs.SCALAR];let i=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[zs.SCALAR])}function GL({atKey:n,directives:e,schema:t},r,s,i){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[zs.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(r))??t[zs.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}mP.composeScalar=KL});var bP=w(yP=>{"use strict";function YL(n,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++r];s?.type==="space";)n+=s.source.length,s=e[++r];break}}return n}yP.emptyScalarPosition=YL});var _P=w(Tg=>{"use strict";var JL=ma(),XL=ye(),QL=uP(),vP=gP(),ZL=uo(),eq=bP(),tq={composeNode:TP,composeEmptyNode:vg};function TP(n,e,t,r){let s=n.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=nq(n,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=vP.composeScalar(n,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=QL.composeCollection(tq,n,e,t,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=vg(n,e.offset,void 0,null,t,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!XL.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"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function vg(n,e,t,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:eq.emptyScalarPosition(e,t,r),indent:-1,source:""},d=vP.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function nq({options:n},{offset:e,source:t,end:r},s){let i=new JL.Alias(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=ZL.resolveEnd(r,o,n.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Tg.composeEmptyNode=vg;Tg.composeNode=TP});var EP=w(wP=>{"use strict";var rq=Oa(),SP=_P(),sq=uo(),iq=Ma();function oq(n,e,{offset:t,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},n),c=new rq.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=iq.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?SP.composeNode(l,s,u,o):SP.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=sq.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,d,f.offset],c}wP.composeDoc=oq});var Sg=w(PP=>{"use strict";var aq=am(),cq=Oa(),La=$a(),kP=ye(),lq=EP(),uq=uo();function qa(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function NP(n){let e="",t=!1,r=!1;for(let s=0;s<n.length;++s){let i=n[s];switch(i[0]){case"#":e+=(e===""?"":r?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(
|
|
139
|
-
${
|
|
140
|
-
${a}`:
|
|
141
|
-
${o}`:
|
|
142
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
138
|
+
`)+(i.substring(1)||" "),t=!0,r=!1;break;case"%":n[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var _g=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,s,i)=>{let o=qa(t);i?this.warnings.push(new La.YAMLWarning(o,r,s)):this.errors.push(new La.YAMLParseError(o,r,s))},this.directives=new aq.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:s}=NP(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(kP.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];kP.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
|
|
140
|
+
${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
|
|
141
|
+
${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:NP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,s)=>{let i=qa(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=lq.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new La.YAMLParseError(qa(e),"UNEXPECTED_TOKEN",t);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 La.YAMLParseError(qa(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=uq.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
142
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new La.YAMLParseError(qa(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new cq.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};PP.Composer=_g});var CP=w(jd=>{"use strict";var dq=gg(),fq=bg(),hq=$a(),RP=Ta();function pq(n,e=!0,t){if(n){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,i,o);else throw new hq.YAMLParseError([a,a+1],i,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fq.resolveFlowScalar(n,e,r);case"block-scalar":return dq.resolveBlockScalar({options:{strict:e}},n,r)}}return null}function mq(n,e){let{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=RP.stringifyString({type:o,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:s,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
|
-
`,
|
|
146
|
-
`}),{type:"block-scalar",offset:
|
|
147
|
-
`),
|
|
148
|
-
`;if(n.type==="block-scalar"){let
|
|
149
|
-
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:
|
|
150
|
-
`};delete n.items,Object.assign(n,{type:t,source:e,end:[
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return DP(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:i,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function gq(n,e,t={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in n?n.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=RP.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":yq(n,c);break;case'"':wg(n,c,"double-quoted-scalar");break;case"'":wg(n,c,"single-quoted-scalar");break;default:wg(n,c,"scalar")}}function yq(n,e){let t=e.indexOf(`
|
|
147
|
+
`),r=e.substring(0,t),s=e.substring(t+1)+`
|
|
148
|
+
`;if(n.type==="block-scalar"){let i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,n.source=s}else{let{offset:i}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];DP(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
|
+
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:s})}}function DP(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function wg(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let r=n.props.slice(1),s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(let i of r)i.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
150
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{let r="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:r,source:e,end:s})}}}jd.createScalarToken=mq;jd.resolveAsScalar=pq;jd.setScalarValue=gq});var AP=w(OP=>{"use strict";var bq=n=>"type"in n?Bd(n):Fd(n);function Bd(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Bd(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Fd(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Fd(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Fd(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Fd({start:n,key:e,sep:t,value:r}){let s="";for(let i of n)s+=i.source;if(e&&(s+=Bd(e)),t)for(let i of t)s+=i.source;return r&&(s+=Bd(r)),s}OP.stringify=bq});var LP=w(MP=>{"use strict";var Eg=Symbol("break visit"),vq=Symbol("skip children"),IP=Symbol("remove item");function Gs(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),$P(Object.freeze([]),n,e)}Gs.BREAK=Eg;Gs.SKIP=vq;Gs.REMOVE=IP;Gs.itemAtPath=(n,e)=>{let t=n;for(let[r,s]of e){let i=t?.[r];if(i&&"items"in i)t=i.items[s];else return}return t};Gs.parentCollection=(n,e)=>{let t=Gs.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],s=t?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function $P(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=$P(Object.freeze(n.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Eg)return Eg;a===IP&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}MP.visit=Gs});var Ud=w(sn=>{"use strict";var kg=CP(),Tq=AP(),_q=LP(),Ng="\uFEFF",Pg="",Rg="",Dg="",Sq=n=>!!n&&"items"in n,wq=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Eq(n){switch(n){case Ng:return"<BOM>";case Pg:return"<DOC>";case Rg:return"<FLOW_END>";case Dg:return"<SCALAR>";default:return JSON.stringify(n)}}function kq(n){switch(n){case Ng:return"byte-order-mark";case Pg:return"doc-mode";case Rg:return"flow-error-end";case Dg:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
151
151
|
`:case`\r
|
|
152
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
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(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}sn.createScalarToken=kg.createScalarToken;sn.resolveAsScalar=kg.resolveAsScalar;sn.setScalarValue=kg.setScalarValue;sn.stringify=Tq.stringify;sn.visit=_q.visit;sn.BOM=Ng;sn.DOCUMENT=Pg;sn.FLOW_END=Rg;sn.SCALAR=Dg;sn.isCollection=Sq;sn.isScalar=wq;sn.prettyToken=Eq;sn.tokenType=kq});var Ag=w(xP=>{"use strict";var xa=Ud();function Wn(n){switch(n){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var qP=new Set("0123456789ABCDEFabcdef"),Nq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vd=new Set(",[]{}"),Pq=new Set(` ,[]{}
|
|
154
|
+
\r `),Cg=n=>!n||Pq.has(n),Og=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
155
155
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
156
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let
|
|
157
|
-
`||!
|
|
158
|
-
`||
|
|
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(!
|
|
164
|
-
`,
|
|
165
|
-
`;)
|
|
166
|
-
`&&
|
|
167
|
-
`?(
|
|
168
|
-
`,
|
|
169
|
-
`){let o=this.continueScalar(
|
|
156
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let s=this.buffer[r+e+1];if(s===`
|
|
157
|
+
`||!s&&!this.atEnd)return e+r+1}return t===`
|
|
158
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Wn(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]===xa.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield xa.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&Wn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Wn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Wn(t)){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 t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Cg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Wn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield xa.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"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(Cg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Wn(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),s=r.indexOf(`
|
|
160
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
161
|
+
`,i)}s!==-1&&(t=s-(r[s-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Wn(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
|
|
162
|
+
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+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(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
164
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
165
|
+
`;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
166
|
+
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield xa.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(Wn(i)||e&&Vd.has(i))break;t=r}else if(Wn(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
167
|
+
`?(r+=1,s=`
|
|
168
|
+
`,i=this.buffer[r+1]):t=r),i==="#"||e&&Vd.has(i))break;if(s===`
|
|
169
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Vd.has(s))break;t=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield xa.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Cg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Wn(t)||e&&Vd.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Wn(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Nq.has(t))t=this.buffer[++e];else if(t==="%"&&qP.has(this.buffer[e+1])&&qP.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
170
170
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
171
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};xP.Lexer=Og});var $g=w(jP=>{"use strict";var Ig=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let i=t+r>>1;this.lineStarts[i]<e?t=i+1:r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};jP.LineCounter=Ig});var Lg=w(WP=>{"use strict";var FP=Ud(),Rq=Ag();function Ys(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function BP(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function VP(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wd(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function fo(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function UP(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!Ys(e.start,"explicit-key-ind")&&!Ys(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,VP(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 Mg=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 Rq.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",FP.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=FP.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let 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 t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&UP(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&BP(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{BP(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Wd(this.peek(2)),r=fo(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
173
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let
|
|
173
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.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 t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ys(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(VP(t.key)&&!Ys(t.sep,"newline")){let o=fo(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(Ys(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=fo(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ys(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:i}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.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 t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Ys(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.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 t=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":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,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 s=Wd(r),i=fo(s);UP(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:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
175
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=xl(e),i=zr(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=xl(e),i=zr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Jk.Parser=zh});var iE=C(co=>{"use strict";var Zk=xh(),IO=Zs(),ao=no(),LO=Id(),xO=le(),MO=Kh(),eE=Gh();function tE(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new MO.LineCounter||null,prettyErrors:e}}function qO(n,e={}){let{lineCounter:t,prettyErrors:i}=tE(e),r=new eE.Parser(t?.addNewLine),s=new Zk.Composer(e),o=Array.from(s.compose(r.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(ao.prettifyError(n,t)),a.warnings.forEach(ao.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function nE(n,e={}){let{lineCounter:t,prettyErrors:i}=tE(e),r=new eE.Parser(t?.addNewLine),s=new Zk.Composer(e),o=null;for(let a of s.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ao.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(ao.prettifyError(n,t)),o.warnings.forEach(ao.prettifyError(n,t))),o}function FO(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=nE(n,t);if(!r)return null;if(r.warnings.forEach(s=>LO.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function BO(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return xO.isDocument(n)&&!i?n.toString(t):new IO.Document(n,i,t).toString(t)}co.parse=FO;co.parseAllDocuments=qO;co.parseDocument=nE;co.stringify=BO});var sE=C(Te=>{"use strict";var jO=xh(),UO=Zs(),$O=mh(),Xh=no(),WO=qs(),wi=le(),VO=vi(),HO=Je(),YO=ki(),KO=Ei(),zO=Il(),GO=Hh(),XO=Kh(),QO=Gh(),Ml=iE(),rE=Is();Te.Composer=jO.Composer;Te.Document=UO.Document;Te.Schema=$O.Schema;Te.YAMLError=Xh.YAMLError;Te.YAMLParseError=Xh.YAMLParseError;Te.YAMLWarning=Xh.YAMLWarning;Te.Alias=WO.Alias;Te.isAlias=wi.isAlias;Te.isCollection=wi.isCollection;Te.isDocument=wi.isDocument;Te.isMap=wi.isMap;Te.isNode=wi.isNode;Te.isPair=wi.isPair;Te.isScalar=wi.isScalar;Te.isSeq=wi.isSeq;Te.Pair=VO.Pair;Te.Scalar=HO.Scalar;Te.YAMLMap=YO.YAMLMap;Te.YAMLSeq=KO.YAMLSeq;Te.CST=zO;Te.Lexer=GO.Lexer;Te.LineCounter=XO.LineCounter;Te.Parser=QO.Parser;Te.parse=Ml.parse;Te.parseAllDocuments=Ml.parseAllDocuments;Te.parseDocument=Ml.parseDocument;Te.stringify=Ml.stringify;Te.visit=rE.visit;Te.visitAsync=rE.visitAsync});var uE=C((H$,lE)=>{"use strict";lE.exports=aE;function aE(n,e,t){n instanceof RegExp&&(n=oE(n,t)),e instanceof RegExp&&(e=oE(e,t));var i=cE(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function oE(n,e){var t=e.match(n);return t?t[0]:null}aE.range=cE;function cE(n,e,t){var i,r,s,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],s=t.length;u>=0&&!a;)u==c?(i.push(u),c=t.indexOf(n,u+1)):i.length==1?a=[i.pop(),l]:(r=i.pop(),r<s&&(s=r,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}});var bE=C((Y$,yE)=>{var fE=uE();yE.exports=e0;var dE="\0SLASH"+Math.random()+"\0",hE="\0OPEN"+Math.random()+"\0",Jh="\0CLOSE"+Math.random()+"\0",pE="\0COMMA"+Math.random()+"\0",mE="\0PERIOD"+Math.random()+"\0";function Qh(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function JO(n){return n.split("\\\\").join(dE).split("\\{").join(hE).split("\\}").join(Jh).split("\\,").join(pE).split("\\.").join(mE)}function ZO(n){return n.split(dE).join("\\").split(hE).join("{").split(Jh).join("}").split(pE).join(",").split(mE).join(".")}function gE(n){if(!n)return[""];var e=[],t=fE("{","}",n);if(!t)return n.split(",");var i=t.pre,r=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+r+"}";var a=gE(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function e0(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),lo(JO(n),!0).map(ZO)):[]}function t0(n){return"{"+n+"}"}function n0(n){return/^-?0\d/.test(n)}function i0(n,e){return n<=e}function r0(n,e){return n>=e}function lo(n,e){var t=[],i=fE("{","}",n);if(!i)return[n];var r=i.pre,s=i.post.length?lo(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o<s.length;o++){var a=r+"{"+i.body+"}"+s[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+Jh+i.post,lo(n)):[n];var p;if(u)p=i.body.split(/\.\./);else if(p=gE(i.body),p.length===1&&(p=lo(p[0],!1).map(t0),p.length===1))return s.map(function(Be){return i.pre+p[0]+Be});var g;if(u){var _=Qh(p[0]),y=Qh(p[1]),w=Math.max(p[0].length,p[1].length),R=p.length==3?Math.abs(Qh(p[2])):1,v=i0,T=y<_;T&&(R*=-1,v=r0);var N=p.some(n0);g=[];for(var L=_;v(L,y);L+=R){var q;if(l)q=String.fromCharCode(L),q==="\\"&&(q="");else if(q=String(L),N){var H=w-q.length;if(H>0){var j=new Array(H+1).join("0");L<0?q="-"+j+q.slice(1):q=j+q}}g.push(q)}}else{g=[];for(var re=0;re<p.length;re++)g.push.apply(g,lo(p[re],!1))}for(var re=0;re<g.length;re++)for(var o=0;o<s.length;o++){var a=r+g[re]+s[o];(!e||u||a)&&t.push(a)}}return t}});var ge=z(Jb());var ac=class n{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(n.isIncremental(i)){let r=eT(i.range),s=this.offsetAt(r.start),o=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(o,this._content.length);let a=Math.max(r.start.line,0),c=Math.max(r.end.line,0),l=this._lineOffsets,u=Zb(i.text,!1,s);if(c-a===u.length)for(let p=0,g=u.length;p<g;p++)l[p+a+1]=u[p];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=i.text.length-(o-s);if(d!==0)for(let p=a+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+d}else if(n.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Zb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},cc;(function(n){function e(r,s,o,a){return new ac(r,s,o,a)}n.create=e;function t(r,s,o){if(r instanceof ac)return r.update(s,o),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function i(r,s){let o=r.getText(),a=od(s.map(z_),(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=0,l=[];for(let u of a){let d=r.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=r.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=i})(cc||(cc={}));function od(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);od(i,e),od(r,e);let s=0,o=0,a=0;for(;s<i.length&&o<r.length;)e(i[s],r[o])<=0?n[a++]=i[s++]:n[a++]=r[o++];for(;s<i.length;)n[a++]=i[s++];for(;o<r.length;)n[a++]=r[o++];return n}function Zb(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function eT(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function z_(n){let e=eT(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var lc=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],uc=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var tT=z(Q());var ne=n=>({start:{line:n.tokenIndexes?.start?.pos.line??0,character:n.tokenIndexes?.start?.pos.col??0},end:{line:n.tokenIndexes?.end?.pos.line??0,character:(n.tokenIndexes?.end?.pos.col??0)+(n.tokenIndexes?.end?.pos.len??0)}}),nT=" ",iT=n=>{nT=n},ad=()=>nT,si=n=>lc.findIndex(e=>e===n),oi=n=>uc.findIndex(e=>e===n),qt=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),rT=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),sT=(n,e,t)=>{if(!n)return!1;let r=n.filter(s=>s.pos.line===t.line).at(-1);return r&&r.pos.col>=t.character?!1:e.tokenIndexes?.end===r};var Tn=(n,e,t)=>{let i=n,r=n;for(;r;)i=r,r=[...i.children].reverse().find(s=>qt(s,e,t));return i},A=(n,e,t=tT.DiagnosticSeverity.Error,i=[],r=void 0,s=[],o)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:i,tags:r,templateStrings:s,edit:o}),oT=n=>[...n].sort((t,i)=>{if(t.sortKey===void 0||i.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==i.sortKey)return t.sortKey-i.sortKey;if(!t.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function dt(n,e,t,i){let r=n.textDocument.uri.replace("file://",""),s=await Ui(e,r,i);if(!s)return[];console.time("search");let a=(await s.context.getRuntime()).getDeepestAstNode(r,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===r?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function G(n,e){return{start:n,end:e??n}}var M=(n,e)=>n?.tokens.some(t=>t===e),Ve=n=>e=>e?.value&&n===e.value?"yes":G_(n)(e),Se=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",G_=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Fn=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,Bn=(n,e)=>!!n&&!!e&&Fn(n,e)&&n.pos.col+n.pos.len===e.pos.col,fc=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),Ui=async(n,e,t)=>(await fc(n)).sort(r=>r.context.name===t?-1:0).find(r=>r.files.some(s=>s===e)),aT=async(n,e)=>(await fc(n)).filter(i=>i.files.some(r=>r===e));var Dr=z(Q()),$=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(i=>i.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=ne(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(i=>i.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=ne(this);return[{location:Dr.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Dr.SymbolKind.File||t.kind===Dr.SymbolKind.Class||t.kind===Dr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(si(this.semanticTokenType),oi(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Rr=z(Q());var dT=z(Q());var cT=z(Q()),Tt=class extends ${constructor(t,i){super(i);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:cT.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}};var lT=z(Q()),ze=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:lT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}};var uT=z(Q());var vn=class extends ${},Ds=class extends vn{constructor(t,i){super();this.expression=t;this.join=i;this.addChild(t),i&&(this.addChild(i.operator),this.addChild(i.expression))}addExpression(t,i){this.addChild(t),this.addChild(i)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var vt=class extends vn{constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:uT.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}};var fT=z(Q()),ai=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:fT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}};var Pe=class extends ${constructor(t,i){super(i);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Me=class extends ${constructor(t,i=[]){super();this.propertyName=t;this.labels=i;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:dT.SymbolKind.Property},this.labels.forEach(r=>this.addChild(r)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Tt?t.value.value:t.value instanceof ze?t.value.values.map(i=>i.value instanceof vt?i.value.value:NaN):t.value instanceof ai?t.value.values.map(i=>i.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var hT=z(Q()),Sn=class extends ${constructor(t,i){super();this.keyword=i;this.addChild(i),this.docSymbolsMeta={name:t,kind:hT.SymbolKind.Function}}};var zt=class extends Sn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ae=class extends Sn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var De=class n extends ${constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Ft)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof zt)}addNodeChild(e){this.addChild(e)}},Ft=class extends De{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Rr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Me)}get deleteProperties(){return this.children.filter(e=>e instanceof Ae)}get nodes(){return this.children.filter(e=>e instanceof he)}get pathName(){return"/"}},rt=class extends De{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},t.forEach(i=>{super.addChild(i)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof he)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},he=class n extends De{constructor(t=[],i){super();this.labels=t;this.omitIfNoRef=i;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},i&&this.addChild(i),t.forEach(r=>{this.addChild(r)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},ke=class extends ${constructor(t,i,r){super(i);this.name=t;this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}toString(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let i={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};if(t(si("type"),oi("declaration"),{start:i,end:i}),this.address!==void 0){let r={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.tokenIndexes.start.pos.col+this.name.length+1,len:this.tokenIndexes.start.pos.len-this.name.length-1}},s={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.name.length+2,len:1}};t(si("decorator"),oi("declaration"),{start:s,end:s}),t(si("number"),oi("declaration"),{start:r,end:r})}}};var pT=z(Q()),pe=class extends ${constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:pT.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}};var En=z(Q());var Ze=n=>n instanceof Sn?!0:n instanceof De?!1:n.parentNode?Ze(n.parentNode):!1;var dc=n=>[...n.filter(t=>t instanceof he||t instanceof rt).map(t=>t instanceof he?t.name:t.labelReference)].filter(t=>!!t);var et=z(Q());var mT=z(Q());var jn=class extends ${constructor(){super();this._pathParts=[]}addPath(t,i){this._pathParts.push(t),i&&this.addChild(i),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},on=class extends ${constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:mT.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}};var Fe=z(Q());var hc=z(Q());var gT=require("path"),ci=class extends ${constructor(t,i){super();this.keyword=t;this.path=i;this.docSymbolsMeta={name:`Include ${i}`,kind:hc.SymbolKind.File},this.addChild(t),this.addChild(i)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:hc.SymbolKind.File},this._reolvedPath=t}},Cr=class extends ${constructor(t,i,r){super(r);this._path=t;this.relative=i;this.docSymbolsMeta={name:(0,gT.basename)(this.path),kind:hc.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var kn=class extends ${constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var X_=async(n,e,t)=>{let i=Fe.Position.create(n.pos.line,n.pos.col),r=t.find(s=>qt(s,e,i));if(r)return Tn(r,e,i)},cd=n=>{if(n)return n instanceof De?n:cd(n?.parentNode)},pc=(n,e,t=0)=>!e||e.uri!==n?t:pc(n,cd(e.parentNode),t+1),Q_=(n,e)=>async t=>{let i=await X_(t.firstToken,e,n);return!i||i===t||t.allDescendants.some(s=>s===i)?0:i instanceof De?pc(e,cd(i)):void 0};async function yT(n,e){let t=[],i=n.textDocument.uri.replace("file://",""),r=(await e.getRuntime()).fileTopMostAst(i);return t.push(...(await Promise.all(r.flatMap(async s=>await bT(n,s,i,Q_(r,i))))).flat()),t}var $i=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),Fe.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
|
|
176
|
-
`))}},Or=(n,e,t,i="")=>{if(n.pos.line===n.prevToken?.pos.line)return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col),Fe.Position.create(n.pos.line,n.pos.col)),`
|
|
177
|
-
|
|
175
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Wd(e),r=fo(t);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 t=Wd(e),r=fo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!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())}}};WP.Parser=Mg});var YP=w(Fa=>{"use strict";var HP=Sg(),Dq=Oa(),ja=$a(),Cq=Tm(),Oq=ye(),Aq=$g(),KP=Lg();function zP(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Aq.LineCounter||null,prettyErrors:e}}function Iq(n,e={}){let{lineCounter:t,prettyErrors:r}=zP(e),s=new KP.Parser(t?.addNewLine),i=new HP.Composer(e),o=Array.from(i.compose(s.parse(n)));if(r&&t)for(let a of o)a.errors.forEach(ja.prettifyError(n,t)),a.warnings.forEach(ja.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function GP(n,e={}){let{lineCounter:t,prettyErrors:r}=zP(e),s=new KP.Parser(t?.addNewLine),i=new HP.Composer(e),o=null;for(let a of i.compose(s.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ja.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(ja.prettifyError(n,t)),o.warnings.forEach(ja.prettifyError(n,t))),o}function $q(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=GP(n,t);if(!s)return null;if(s.warnings.forEach(i=>Cq.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},t))}function Mq(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return Oq.isDocument(n)&&!r?n.toString(t):new Dq.Document(n,r,t).toString(t)}Fa.parse=$q;Fa.parseAllDocuments=Iq;Fa.parseDocument=GP;Fa.stringify=Mq});var xg=w(De=>{"use strict";var Lq=Sg(),qq=Oa(),xq=ng(),qg=$a(),jq=ma(),ps=ye(),Fq=us(),Bq=gt(),Uq=fs(),Vq=hs(),Wq=Ud(),Hq=Ag(),Kq=$g(),zq=Lg(),Hd=YP(),JP=da();De.Composer=Lq.Composer;De.Document=qq.Document;De.Schema=xq.Schema;De.YAMLError=qg.YAMLError;De.YAMLParseError=qg.YAMLParseError;De.YAMLWarning=qg.YAMLWarning;De.Alias=jq.Alias;De.isAlias=ps.isAlias;De.isCollection=ps.isCollection;De.isDocument=ps.isDocument;De.isMap=ps.isMap;De.isNode=ps.isNode;De.isPair=ps.isPair;De.isScalar=ps.isScalar;De.isSeq=ps.isSeq;De.Pair=Fq.Pair;De.Scalar=Bq.Scalar;De.YAMLMap=Uq.YAMLMap;De.YAMLSeq=Vq.YAMLSeq;De.CST=Wq;De.Lexer=Hq.Lexer;De.LineCounter=Kq.LineCounter;De.Parser=zq.Parser;De.parse=Hd.parse;De.parseAllDocuments=Hd.parseAllDocuments;De.parseDocument=Hd.parseDocument;De.stringify=Hd.stringify;De.visit=JP.visit;De.visitAsync=JP.visitAsync});var t0=w((wQ,e0)=>{"use strict";e0.exports=QP;function QP(n,e,t){n instanceof RegExp&&(n=XP(n,t)),e instanceof RegExp&&(e=XP(e,t));var r=ZP(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}function XP(n,e){var t=e.match(n);return t?t[0]:null}QP.range=ZP;function ZP(n,e,t){var r,s,i,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(r=[],i=t.length;u>=0&&!a;)u==c?(r.push(u),c=t.indexOf(n,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var l0=w((EQ,c0)=>{var n0=t0();c0.exports=Jq;var r0="\0SLASH"+Math.random()+"\0",s0="\0OPEN"+Math.random()+"\0",Fg="\0CLOSE"+Math.random()+"\0",i0="\0COMMA"+Math.random()+"\0",o0="\0PERIOD"+Math.random()+"\0";function jg(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function Gq(n){return n.split("\\\\").join(r0).split("\\{").join(s0).split("\\}").join(Fg).split("\\,").join(i0).split("\\.").join(o0)}function Yq(n){return n.split(r0).join("\\").split(s0).join("{").split(Fg).join("}").split(i0).join(",").split(o0).join(".")}function a0(n){if(!n)return[""];var e=[],t=n0("{","}",n);if(!t)return n.split(",");var r=t.pre,s=t.body,i=t.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=a0(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Jq(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Ba(Gq(n),!0).map(Yq)):[]}function Xq(n){return"{"+n+"}"}function Qq(n){return/^-?0\d/.test(n)}function Zq(n,e){return n<=e}function ex(n,e){return n>=e}function Ba(n,e){var t=[],r=n0("{","}",n);if(!r)return[n];var s=r.pre,i=r.post.length?Ba(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];t.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(/,.*\}/)?(n=r.pre+"{"+r.body+Fg+r.post,Ba(n)):[n];var f;if(u)f=r.body.split(/\.\./);else if(f=a0(r.body),f.length===1&&(f=Ba(f[0],!1).map(Xq),f.length===1))return i.map(function(Ae){return r.pre+f[0]+Ae});var m;if(u){var T=jg(f[0]),g=jg(f[1]),S=Math.max(f[0].length,f[1].length),E=f.length==3?Math.abs(jg(f[2])):1,v=Zq,b=g<T;b&&(E*=-1,v=ex);var R=f.some(Qq);m=[];for(var O=T;v(O,g);O+=E){var L;if(l)L=String.fromCharCode(O),L==="\\"&&(L="");else if(L=String(O),R){var V=S-L.length;if(V>0){var j=new Array(V+1).join("0");O<0?L="-"+j+L.slice(1):L=j+L}}m.push(L)}}else{m=[];for(var re=0;re<f.length;re++)m.push.apply(m,Ba(f[re],!1))}for(var re=0;re<m.length;re++)for(var o=0;o<i.length;o++){var a=s+m[re]+i[o];(!e||u||a)&&t.push(a)}}return t}});var ic=w(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.regexpCode=Te.getEsmExportName=Te.getProperty=Te.safeStringify=Te.stringify=Te.strConcat=Te.addCodeArg=Te.str=Te._=Te.nil=Te._Code=Te.Name=Te.IDENTIFIER=Te._CodeOrName=void 0;var rc=class{};Te._CodeOrName=rc;Te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Zs=class extends rc{constructor(e){if(super(),!Te.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}}};Te.Name=Zs;var Dn=class extends rc{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((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>(r instanceof Zs&&(t[r.str]=(t[r.str]||0)+1),t),{})}};Te._Code=Dn;Te.nil=new Dn("");function J0(n,...e){let t=[n[0]],r=0;for(;r<e.length;)iy(t,e[r]),t.push(n[++r]);return new Dn(t)}Te._=J0;var sy=new Dn("+");function X0(n,...e){let t=[sc(n[0])],r=0;for(;r<e.length;)t.push(sy),iy(t,e[r]),t.push(sy,sc(n[++r]));return cj(t),new Dn(t)}Te.str=X0;function iy(n,e){e instanceof Dn?n.push(...e._items):e instanceof Zs?n.push(e):n.push(dj(e))}Te.addCodeArg=iy;function cj(n){let e=1;for(;e<n.length-1;){if(n[e]===sy){let t=lj(n[e-1],n[e+1]);if(t!==void 0){n.splice(e-1,3,t);continue}n[e++]="+"}e++}}function lj(n,e){if(e==='""')return n;if(n==='""')return e;if(typeof n=="string")return e instanceof Zs||n[n.length-1]!=='"'?void 0:typeof e!="string"?`${n.slice(0,-1)}${e}"`:e[0]==='"'?n.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(n instanceof Zs))return`"${n}${e.slice(1)}`}function uj(n,e){return e.emptyStr()?n:n.emptyStr()?e:X0`${n}${e}`}Te.strConcat=uj;function dj(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:sc(Array.isArray(n)?n.join(","):n)}function fj(n){return new Dn(sc(n))}Te.stringify=fj;function sc(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Te.safeStringify=sc;function hj(n){return typeof n=="string"&&Te.IDENTIFIER.test(n)?new Dn(`.${n}`):J0`[${n}]`}Te.getProperty=hj;function pj(n){if(typeof n=="string"&&Te.IDENTIFIER.test(n))return new Dn(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}Te.getEsmExportName=pj;function mj(n){return new Dn(n.toString())}Te.regexpCode=mj});var cy=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ValueScope=an.ValueScopeName=an.Scope=an.varKinds=an.UsedValueState=void 0;var on=ic(),oy=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ff;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(ff||(an.UsedValueState=ff={}));an.varKinds={const:new on.Name("const"),let:new on.Name("let"),var:new on.Name("var")};var hf=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof on.Name?e:this.name(e)}name(e){return new on.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(!((r=(t=this._parent)===null||t===void 0?void 0:t._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}}};an.Scope=hf;var pf=class extends on.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,on._)`.${new on.Name(t)}[${r}]`}};an.ValueScopeName=pf;var gj=(0,on._)`\n`,ay=class extends hf{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?gj:on.nil}}get(){return this._scope}name(e){return new pf(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=t.key)!==null&&r!==void 0?r:t.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]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,on._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,r)}_reduceValues(e,t,r={},s){let i=on.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,ff.Started);let u=t(l);if(u){let d=this.opts.es5?an.varKinds.var:an.varKinds.const;i=(0,on._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,on._)`${i}${u}${this.opts._n}`;else throw new oy(l);c.set(l,ff.Completed)})}return i}};an.ValueScope=ay});var ae=w(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var ge=ic(),Yn=cy(),vs=ic();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return vs.Name}});var bf=cy();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return bf.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return bf.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return bf.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return bf.varKinds}});le.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var Ar=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},ly=class extends Ar{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Yn.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=ko(this.rhs,e,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},mf=class extends Ar{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ko(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return yf(e,this.rhs)}},uy=class extends mf{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},dy=class extends Ar{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fy=class extends Ar{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},hy=class extends Ar{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},py=class extends Ar{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=ko(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},oc=class extends Ar{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,t)||(yj(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ni(e,t.names),{})}},Ir=class extends oc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},my=class extends oc{},Eo=class extends Ir{};Eo.kind="else";var ei=class n extends Ir{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Eo(r):r}if(t)return e===!1?t instanceof n?t:t.nodes:this.nodes.length?this:new n(Q0(e),t instanceof n?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=ko(this.condition,e,t),this}get names(){let e=super.names;return yf(e,this.condition),this.else&&ni(e,this.else.names),e}};ei.kind="if";var ti=class extends Ir{};ti.kind="for";var gy=class extends ti{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=ko(this.iteration,e,t),this}get names(){return ni(super.names,this.iteration.names)}},yy=class extends ti{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?Yn.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${t} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=yf(super.names,this.from);return yf(e,this.to)}},gf=class extends ti{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=ko(this.iterable,e,t),this}get names(){return ni(super.names,this.iterable.names)}},ac=class extends Ir{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};ac.kind="func";var cc=class extends oc{render(e){return"return "+super.render(e)}};cc.kind="return";var by=class extends Ir{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ni(e,this.catch.names),this.finally&&ni(e,this.finally.names),e}},lc=class extends Ir{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};lc.kind="catch";var uc=class extends Ir{render(e){return"finally"+super.render(e)}};uc.kind="finally";var vy=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new Yn.Scope({parent:e}),this._nodes=[new my]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let i=this._scope.toName(t);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new ly(e,i,r)),i}const(e,t,r){return this._def(Yn.varKinds.const,e,t,r)}let(e,t,r){return this._def(Yn.varKinds.let,e,t,r)}var(e,t,r){return this._def(Yn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new mf(e,t,r))}add(e,t){return this._leafNode(new uy(e,le.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==ge.nil&&this._leafNode(new py(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,ge.addCodeArg)(t,s));return t.push("}"),new ge._Code(t)}if(e,t,r){if(this._blockNode(new ei(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ei(e))}else(){return this._elseNode(new Eo)}endIf(){return this._endBlockNode(ei,Eo)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new gy(e),t)}forRange(e,t,r,s,i=this.opts.es5?Yn.varKinds.var:Yn.varKinds.let){let o=this._scope.toName(e);return this._for(new yy(i,o,t,r),()=>s(o))}forOf(e,t,r,s=Yn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,ge._)`${o}.length`,a=>{this.var(i,(0,ge._)`${o}[${a}]`),r(i)})}return this._for(new gf("of",s,i,t),()=>r(i))}forIn(e,t,r,s=this.opts.es5?Yn.varKinds.var:Yn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ge._)`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new gf("in",s,i,t),()=>r(i))}endFor(){return this._endBlockNode(ti)}label(e){return this._leafNode(new dy(e))}break(e){return this._leafNode(new fy(e))}return(e){let t=new cc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(cc)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new by;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new lc(i),t(i)}return r&&(this._currNode=s.finally=new uc,this.code(r)),this._endBlockNode(lc,uc)}throw(e){return this._leafNode(new hy(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=ge.nil,r,s){return this._blockNode(new ac(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(ac)}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,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ei))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};le.CodeGen=vy;function ni(n,e){for(let t in e)n[t]=(n[t]||0)+(e[t]||0);return n}function yf(n,e){return e instanceof ge._CodeOrName?ni(n,e.names):n}function ko(n,e,t){if(n instanceof ge.Name)return r(n);if(!s(n))return n;return new ge._Code(n._items.reduce((i,o)=>(o instanceof ge.Name&&(o=r(o)),o instanceof ge._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof ge._Code&&i._items.some(o=>o instanceof ge.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function yj(n,e){for(let t in e)n[t]=(n[t]||0)-(e[t]||0)}function Q0(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,ge._)`!${Ty(n)}`}le.not=Q0;var bj=Z0(le.operators.AND);function vj(...n){return n.reduce(bj)}le.and=vj;var Tj=Z0(le.operators.OR);function _j(...n){return n.reduce(Tj)}le.or=_j;function Z0(n){return(e,t)=>e===ge.nil?t:t===ge.nil?e:(0,ge._)`${Ty(e)} ${n} ${Ty(t)}`}function Ty(n){return n instanceof ge.Name?n:(0,ge._)`(${n})`}});var he=w(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var qe=ae(),Sj=ic();function wj(n){let e={};for(let t of n)e[t]=!0;return e}ue.toHash=wj;function Ej(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(nR(n,e),!rR(e,n.self.RULES.all))}ue.alwaysValidSchema=Ej;function nR(n,e=n.schema){let{opts:t,self:r}=n;if(!t.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||oR(n,`unknown keyword: "${i}"`)}ue.checkUnknownRules=nR;function rR(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(e[t])return!0;return!1}ue.schemaHasRules=rR;function kj(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(t!=="$ref"&&e.all[t])return!0;return!1}ue.schemaHasRulesButRef=kj;function Nj({topSchemaRef:n,schemaPath:e},t,r,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,qe._)`${t}`}return(0,qe._)`${n}${e}${(0,qe.getProperty)(r)}`}ue.schemaRefOrVal=Nj;function Pj(n){return sR(decodeURIComponent(n))}ue.unescapeFragment=Pj;function Rj(n){return encodeURIComponent(Sy(n))}ue.escapeFragment=Rj;function Sy(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Sy;function sR(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=sR;function Dj(n,e){if(Array.isArray(n))for(let t of n)e(t);else e(n)}ue.eachItem=Dj;function eR({mergeNames:n,mergeToName:e,mergeValues:t,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof qe.Name?(i instanceof qe.Name?n(s,i,o):e(s,i,o),o):i instanceof qe.Name?(e(s,o,i),i):t(i,o);return a===qe.Name&&!(c instanceof qe.Name)?r(s,c):c}}ue.mergeEvaluated={props:eR({mergeNames:(n,e,t)=>n.if((0,qe._)`${t} !== true && ${e} !== undefined`,()=>{n.if((0,qe._)`${e} === true`,()=>n.assign(t,!0),()=>n.assign(t,(0,qe._)`${t} || {}`).code((0,qe._)`Object.assign(${t}, ${e})`))}),mergeToName:(n,e,t)=>n.if((0,qe._)`${t} !== true`,()=>{e===!0?n.assign(t,!0):(n.assign(t,(0,qe._)`${t} || {}`),wy(n,t,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:iR}),items:eR({mergeNames:(n,e,t)=>n.if((0,qe._)`${t} !== true && ${e} !== undefined`,()=>n.assign(t,(0,qe._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(n,e,t)=>n.if((0,qe._)`${t} !== true`,()=>n.assign(t,e===!0?!0:(0,qe._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function iR(n,e){if(e===!0)return n.var("props",!0);let t=n.var("props",(0,qe._)`{}`);return e!==void 0&&wy(n,t,e),t}ue.evaluatedPropsToName=iR;function wy(n,e,t){Object.keys(t).forEach(r=>n.assign((0,qe._)`${e}${(0,qe.getProperty)(r)}`,!0))}ue.setEvaluated=wy;var tR={};function Cj(n,e){return n.scopeValue("func",{ref:e,code:tR[e.code]||(tR[e.code]=new Sj._Code(e.code))})}ue.useFunc=Cj;var _y;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(_y||(ue.Type=_y={}));function Oj(n,e,t){if(n instanceof qe.Name){let r=e===_y.Num;return t?r?(0,qe._)`"[" + ${n} + "]"`:(0,qe._)`"['" + ${n} + "']"`:r?(0,qe._)`"/" + ${n}`:(0,qe._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,qe.getProperty)(n).toString():"/"+Sy(n)}ue.getErrorPath=Oj;function oR(n,e,t=n.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);n.self.logger.warn(e)}}ue.checkStrictMode=oR});var Cn=w(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var Ut=ae(),Aj={data:new Ut.Name("data"),valCxt:new Ut.Name("valCxt"),instancePath:new Ut.Name("instancePath"),parentData:new Ut.Name("parentData"),parentDataProperty:new Ut.Name("parentDataProperty"),rootData:new Ut.Name("rootData"),dynamicAnchors:new Ut.Name("dynamicAnchors"),vErrors:new Ut.Name("vErrors"),errors:new Ut.Name("errors"),this:new Ut.Name("this"),self:new Ut.Name("self"),scope:new Ut.Name("scope"),json:new Ut.Name("json"),jsonPos:new Ut.Name("jsonPos"),jsonLen:new Ut.Name("jsonLen"),jsonPart:new Ut.Name("jsonPart")};Ey.default=Aj});var dc=w(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.extendErrors=Vt.resetErrorsCount=Vt.reportExtraError=Vt.reportError=Vt.keyword$DataError=Vt.keywordError=void 0;var be=ae(),vf=he(),Yt=Cn();Vt.keywordError={message:({keyword:n})=>(0,be.str)`must pass "${n}" keyword validation`};Vt.keyword$DataError={message:({keyword:n,schemaType:e})=>e?(0,be.str)`"${n}" keyword must be ${e} ($data)`:(0,be.str)`"${n}" keyword is invalid ($data)`};function Ij(n,e=Vt.keywordError,t,r){let{it:s}=n,{gen:i,compositeRule:o,allErrors:a}=s,c=lR(n,e,t);r??(o||a)?aR(i,c):cR(s,(0,be._)`[${c}]`)}Vt.reportError=Ij;function $j(n,e=Vt.keywordError,t){let{it:r}=n,{gen:s,compositeRule:i,allErrors:o}=r,a=lR(n,e,t);aR(s,a),i||o||cR(r,Yt.default.vErrors)}Vt.reportExtraError=$j;function Mj(n,e){n.assign(Yt.default.errors,e),n.if((0,be._)`${Yt.default.vErrors} !== null`,()=>n.if(e,()=>n.assign((0,be._)`${Yt.default.vErrors}.length`,e),()=>n.assign(Yt.default.vErrors,null)))}Vt.resetErrorsCount=Mj;function Lj({gen:n,keyword:e,schemaValue:t,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=n.name("err");n.forRange("i",s,Yt.default.errors,a=>{n.const(o,(0,be._)`${Yt.default.vErrors}[${a}]`),n.if((0,be._)`${o}.instancePath === undefined`,()=>n.assign((0,be._)`${o}.instancePath`,(0,be.strConcat)(Yt.default.instancePath,i.errorPath))),n.assign((0,be._)`${o}.schemaPath`,(0,be.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(n.assign((0,be._)`${o}.schema`,t),n.assign((0,be._)`${o}.data`,r))})}Vt.extendErrors=Lj;function aR(n,e){let t=n.const("err",e);n.if((0,be._)`${Yt.default.vErrors} === null`,()=>n.assign(Yt.default.vErrors,(0,be._)`[${t}]`),(0,be._)`${Yt.default.vErrors}.push(${t})`),n.code((0,be._)`${Yt.default.errors}++`)}function cR(n,e){let{gen:t,validateName:r,schemaEnv:s}=n;s.$async?t.throw((0,be._)`new ${n.ValidationError}(${e})`):(t.assign((0,be._)`${r}.errors`,e),t.return(!1))}var ri={keyword:new be.Name("keyword"),schemaPath:new be.Name("schemaPath"),params:new be.Name("params"),propertyName:new be.Name("propertyName"),message:new be.Name("message"),schema:new be.Name("schema"),parentSchema:new be.Name("parentSchema")};function lR(n,e,t){let{createErrors:r}=n.it;return r===!1?(0,be._)`{}`:qj(n,e,t)}function qj(n,e,t={}){let{gen:r,it:s}=n,i=[xj(s,t),jj(n,t)];return Fj(n,e,i),r.object(...i)}function xj({errorPath:n},{instancePath:e}){let t=e?(0,be.str)`${n}${(0,vf.getErrorPath)(e,vf.Type.Str)}`:n;return[Yt.default.instancePath,(0,be.strConcat)(Yt.default.instancePath,t)]}function jj({keyword:n,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:r}){let s=r?e:(0,be.str)`${e}/${n}`;return t&&(s=(0,be.str)`${s}${(0,vf.getErrorPath)(t,vf.Type.Str)}`),[ri.schemaPath,s]}function Fj(n,{params:e,message:t},r){let{keyword:s,data:i,schemaValue:o,it:a}=n,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([ri.keyword,s],[ri.params,typeof e=="function"?e(n):e||(0,be._)`{}`]),c.messages&&r.push([ri.message,typeof t=="function"?t(n):t]),c.verbose&&r.push([ri.schema,o],[ri.parentSchema,(0,be._)`${u}${d}`],[Yt.default.data,i]),l&&r.push([ri.propertyName,l])}});var dR=w(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.boolOrEmptySchema=No.topBoolOrEmptySchema=void 0;var Bj=dc(),Uj=ae(),Vj=Cn(),Wj={message:"boolean schema is false"};function Hj(n){let{gen:e,schema:t,validateName:r}=n;t===!1?uR(n,!1):typeof t=="object"&&t.$async===!0?e.return(Vj.default.data):(e.assign((0,Uj._)`${r}.errors`,null),e.return(!0))}No.topBoolOrEmptySchema=Hj;function Kj(n,e){let{gen:t,schema:r}=n;r===!1?(t.var(e,!1),uR(n)):t.var(e,!0)}No.boolOrEmptySchema=Kj;function uR(n,e){let{gen:t,data:r}=n,s={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,Bj.reportError)(s,Wj,void 0,e)}});var ky=w(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getRules=Po.isJSONType=void 0;var zj=["string","number","integer","boolean","null","object","array"],Gj=new Set(zj);function Yj(n){return typeof n=="string"&&Gj.has(n)}Po.isJSONType=Yj;function Jj(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}Po.getRules=Jj});var Ny=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.shouldUseRule=Ts.shouldUseGroup=Ts.schemaHasRulesForType=void 0;function Xj({schema:n,self:e},t){let r=e.RULES.types[t];return r&&r!==!0&&fR(n,r)}Ts.schemaHasRulesForType=Xj;function fR(n,e){return e.rules.some(t=>hR(n,t))}Ts.shouldUseGroup=fR;function hR(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}Ts.shouldUseRule=hR});var fc=w(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.reportTypeError=Wt.checkDataTypes=Wt.checkDataType=Wt.coerceAndCheckDataType=Wt.getJSONTypes=Wt.getSchemaTypes=Wt.DataType=void 0;var Qj=ky(),Zj=Ny(),eF=dc(),ce=ae(),pR=he(),Ro;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(Ro||(Wt.DataType=Ro={}));function tF(n){let e=mR(n.type);if(e.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&e.push("null")}return e}Wt.getSchemaTypes=tF;function mR(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(Qj.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Wt.getJSONTypes=mR;function nF(n,e){let{gen:t,data:r,opts:s}=n,i=rF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,Zj.schemaHasRulesForType)(n,e[0]));if(o){let a=Ry(e,r,s.strictNumbers,Ro.Wrong);t.if(a,()=>{i.length?sF(n,e,i):Dy(n)})}return o}Wt.coerceAndCheckDataType=nF;var gR=new Set(["string","number","integer","boolean","null"]);function rF(n,e){return e?n.filter(t=>gR.has(t)||e==="array"&&t==="array"):[]}function sF(n,e,t){let{gen:r,data:s,opts:i}=n,o=r.let("dataType",(0,ce._)`typeof ${s}`),a=r.let("coerced",(0,ce._)`undefined`);i.coerceTypes==="array"&&r.if((0,ce._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,ce._)`${s}[0]`).assign(o,(0,ce._)`typeof ${s}`).if(Ry(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,ce._)`${a} !== undefined`);for(let l of t)(gR.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),Dy(n),r.endIf(),r.if((0,ce._)`${a} !== undefined`,()=>{r.assign(s,a),iF(n,a)});function c(l){switch(l){case"string":r.elseIf((0,ce._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ce._)`"" + ${s}`).elseIf((0,ce._)`${s} === null`).assign(a,(0,ce._)`""`);return;case"number":r.elseIf((0,ce._)`${o} == "boolean" || ${s} === null
|
|
177
|
+
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,ce._)`+${s}`);return;case"integer":r.elseIf((0,ce._)`${o} === "boolean" || ${s} === null
|
|
178
|
+
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,ce._)`+${s}`);return;case"boolean":r.elseIf((0,ce._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,ce._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":r.elseIf((0,ce._)`${s} === "" || ${s} === 0 || ${s} === false`),r.assign(a,null);return;case"array":r.elseIf((0,ce._)`${o} === "string" || ${o} === "number"
|
|
179
|
+
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,ce._)`[${s}]`)}}}function iF({gen:n,parentData:e,parentDataProperty:t},r){n.if((0,ce._)`${e} !== undefined`,()=>n.assign((0,ce._)`${e}[${t}]`,r))}function Py(n,e,t,r=Ro.Correct){let s=r===Ro.Correct?ce.operators.EQ:ce.operators.NEQ,i;switch(n){case"null":return(0,ce._)`${e} ${s} null`;case"array":i=(0,ce._)`Array.isArray(${e})`;break;case"object":i=(0,ce._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,ce._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,ce._)`typeof ${e} ${s} ${n}`}return r===Ro.Correct?i:(0,ce.not)(i);function o(a=ce.nil){return(0,ce.and)((0,ce._)`typeof ${e} == "number"`,a,t?(0,ce._)`isFinite(${e})`:ce.nil)}}Wt.checkDataType=Py;function Ry(n,e,t,r){if(n.length===1)return Py(n[0],e,t,r);let s,i=(0,pR.toHash)(n);if(i.array&&i.object){let o=(0,ce._)`typeof ${e} != "object"`;s=i.null?o:(0,ce._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=ce.nil;i.number&&delete i.integer;for(let o in i)s=(0,ce.and)(s,Py(o,e,t,r));return s}Wt.checkDataTypes=Ry;var oF={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,ce._)`{type: ${n}}`:(0,ce._)`{type: ${e}}`};function Dy(n){let e=aF(n);(0,eF.reportError)(e,oF)}Wt.reportTypeError=Dy;function aF(n){let{gen:e,data:t,schema:r}=n,s=(0,pR.schemaRefOrVal)(n,r,"type");return{gen:e,keyword:"type",data:t,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:n}}});var bR=w(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.assignDefaults=void 0;var Do=ae(),cF=he();function lF(n,e){let{properties:t,items:r}=n.schema;if(e==="object"&&t)for(let s in t)yR(n,s,t[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>yR(n,i,s.default))}Tf.assignDefaults=lF;function yR(n,e,t){let{gen:r,compositeRule:s,data:i,opts:o}=n;if(t===void 0)return;let a=(0,Do._)`${i}${(0,Do.getProperty)(e)}`;if(s){(0,cF.checkStrictMode)(n,`default is ignored for: ${a}`);return}let c=(0,Do._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Do._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,Do._)`${a} = ${(0,Do.stringify)(t)}`)}});var On=w(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.validateUnion=Me.validateArray=Me.usePattern=Me.callValidateCode=Me.schemaProperties=Me.allSchemaProperties=Me.noPropertyInData=Me.propertyInData=Me.isOwnProperty=Me.hasPropFunc=Me.reportMissingProp=Me.checkMissingProp=Me.checkReportMissingProp=void 0;var ze=ae(),Cy=he(),_s=Cn(),uF=he();function dF(n,e){let{gen:t,data:r,it:s}=n;t.if(Ay(t,r,e,s.opts.ownProperties),()=>{n.setParams({missingProperty:(0,ze._)`${e}`},!0),n.error()})}Me.checkReportMissingProp=dF;function fF({gen:n,data:e,it:{opts:t}},r,s){return(0,ze.or)(...r.map(i=>(0,ze.and)(Ay(n,e,i,t.ownProperties),(0,ze._)`${s} = ${i}`)))}Me.checkMissingProp=fF;function hF(n,e){n.setParams({missingProperty:e},!0),n.error()}Me.reportMissingProp=hF;function vR(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ze._)`Object.prototype.hasOwnProperty`})}Me.hasPropFunc=vR;function Oy(n,e,t){return(0,ze._)`${vR(n)}.call(${e}, ${t})`}Me.isOwnProperty=Oy;function pF(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} !== undefined`;return r?(0,ze._)`${s} && ${Oy(n,e,t)}`:s}Me.propertyInData=pF;function Ay(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} === undefined`;return r?(0,ze.or)(s,(0,ze.not)(Oy(n,e,t))):s}Me.noPropertyInData=Ay;function TR(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}Me.allSchemaProperties=TR;function mF(n,e){return TR(e).filter(t=>!(0,Cy.alwaysValidSchema)(n,e[t]))}Me.schemaProperties=mF;function gF({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,ze._)`${n}, ${e}, ${r}${s}`:e,d=[[_s.default.instancePath,(0,ze.strConcat)(_s.default.instancePath,i)],[_s.default.parentData,o.parentData],[_s.default.parentDataProperty,o.parentDataProperty],[_s.default.rootData,_s.default.rootData]];o.opts.dynamicRef&&d.push([_s.default.dynamicAnchors,_s.default.dynamicAnchors]);let f=(0,ze._)`${u}, ${t.object(...d)}`;return c!==ze.nil?(0,ze._)`${a}.call(${c}, ${f})`:(0,ze._)`${a}(${f})`}Me.callValidateCode=gF;var yF=(0,ze._)`new RegExp`;function bF({gen:n,it:{opts:e}},t){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,r);return n.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ze._)`${s.code==="new RegExp"?yF:(0,uF.useFunc)(n,s)}(${t}, ${r})`})}Me.usePattern=bF;function vF(n){let{gen:e,data:t,keyword:r,it:s}=n,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,ze._)`${t}.length`);e.forRange("i",0,c,l=>{n.subschema({keyword:r,dataProp:l,dataPropType:Cy.Type.Num},i),e.if((0,ze.not)(i),a)})}}Me.validateArray=vF;function TF(n){let{gen:e,schema:t,keyword:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,Cy.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let u=n.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ze._)`${o} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,ze.not)(o))})),n.result(o,()=>n.reset(),()=>n.error(!0))}Me.validateUnion=TF});var wR=w(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.validateKeywordUsage=pr.validSchemaType=pr.funcKeywordCode=pr.macroKeywordCode=void 0;var Jt=ae(),si=Cn(),_F=On(),SF=dc();function wF(n,e){let{gen:t,keyword:r,schema:s,parentSchema:i,it:o}=n,a=e.macro.call(o.self,s,i,o),c=SR(t,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");n.subschema({schema:a,schemaPath:Jt.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),n.pass(l,()=>n.error(!0))}pr.macroKeywordCode=wF;function EF(n,e){var t;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=n;NF(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=SR(r,s,l),d=r.let("valid");n.block$data(d,f),n.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)g(),e.modifying&&_R(n),S(()=>n.error());else{let E=e.async?m():T();e.modifying&&_R(n),S(()=>kF(n,E))}}function m(){let E=r.let("ruleErrs",null);return r.try(()=>g((0,Jt._)`await `),v=>r.assign(d,!1).if((0,Jt._)`${v} instanceof ${c.ValidationError}`,()=>r.assign(E,(0,Jt._)`${v}.errors`),()=>r.throw(v))),E}function T(){let E=(0,Jt._)`${u}.errors`;return r.assign(E,null),g(Jt.nil),E}function g(E=e.async?(0,Jt._)`await `:Jt.nil){let v=c.opts.passContext?si.default.this:si.default.self,b=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,Jt._)`${E}${(0,_F.callValidateCode)(n,u,v,b)}`,e.modifying)}function S(E){var v;r.if((0,Jt.not)((v=e.valid)!==null&&v!==void 0?v:d),E)}}pr.funcKeywordCode=EF;function _R(n){let{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,Jt._)`${r.parentData}[${r.parentDataProperty}]`))}function kF(n,e){let{gen:t}=n;t.if((0,Jt._)`Array.isArray(${e})`,()=>{t.assign(si.default.vErrors,(0,Jt._)`${si.default.vErrors} === null ? ${e} : ${si.default.vErrors}.concat(${e})`).assign(si.default.errors,(0,Jt._)`${si.default.vErrors}.length`),(0,SF.extendErrors)(n)},()=>n.error())}function NF({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function SR(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Jt.stringify)(t)})}function PF(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n>"u")}pr.validSchemaType=PF;function RF({schema:n,opts:e,self:t,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(n,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(n[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}pr.validateKeywordUsage=RF});var kR=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.extendSubschemaMode=Ss.extendSubschemaData=Ss.getSubschema=void 0;var mr=ae(),ER=he();function DF(n,{keyword:e,schemaProp:t,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=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,mr._)`${n.schemaPath}${(0,mr.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,mr._)`${n.schemaPath}${(0,mr.getProperty)(e)}${(0,mr.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,ER.escapeFragment)(t)}`}}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')}Ss.getSubschema=DF;function CF(n,e,{dataProp:t,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,mr._)`${e.data}${(0,mr.getProperty)(t)}`,!0);c(f),n.errorPath=(0,mr.str)`${l}${(0,ER.getErrorPath)(t,r,d.jsPropertySyntax)}`,n.parentDataProperty=(0,mr._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(s!==void 0){let l=s instanceof mr.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(n.propertyName=o)}i&&(n.dataTypes=i);function c(l){n.data=l,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,l]}}Ss.extendSubschemaData=CF;function OF(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(n.compositeRule=r),s!==void 0&&(n.createErrors=s),i!==void 0&&(n.allErrors=i),n.jtdDiscriminator=e,n.jtdMetadata=t}Ss.extendSubschemaMode=OF});var Iy=w((q8,NR)=>{"use strict";NR.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var RR=w((x8,PR)=>{"use strict";var ws=PR.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};_f(e,r,s,n,"",n)};ws.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ws.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ws.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ws.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 _f(n,e,t,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 ws.arrayKeywords)for(var f=0;f<d.length;f++)_f(n,e,t,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in ws.propsKeywords){if(d&&typeof d=="object")for(var m in d)_f(n,e,t,d[m],s+"/"+u+"/"+AF(m),i,s,u,r,m)}else(u in ws.keywords||n.allKeys&&!(u in ws.skipKeywords))&&_f(n,e,t,d,s+"/"+u,i,s,u,r)}t(r,s,i,o,a,c,l)}}function AF(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}});var hc=w(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.getSchemaRefs=cn.resolveUrl=cn.normalizeId=cn._getFullPath=cn.getFullPath=cn.inlineRef=void 0;var IF=he(),$F=Iy(),MF=RR(),LF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qF(n,e=!0){return typeof n=="boolean"?!0:e===!0?!$y(n):e?DR(n)<=e:!1}cn.inlineRef=qF;var xF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $y(n){for(let e in n){if(xF.has(e))return!0;let t=n[e];if(Array.isArray(t)&&t.some($y)||typeof t=="object"&&$y(t))return!0}return!1}function DR(n){let e=0;for(let t in n){if(t==="$ref")return 1/0;if(e++,!LF.has(t)&&(typeof n[t]=="object"&&(0,IF.eachItem)(n[t],r=>e+=DR(r)),e===1/0))return 1/0}return e}function CR(n,e="",t){t!==!1&&(e=Co(e));let r=n.parse(e);return OR(n,r)}cn.getFullPath=CR;function OR(n,e){return n.serialize(e).split("#")[0]+"#"}cn._getFullPath=OR;var jF=/#\/?$/;function Co(n){return n?n.replace(jF,""):""}cn.normalizeId=Co;function FF(n,e,t){return t=Co(t),n.resolve(e,t)}cn.resolveUrl=FF;var BF=/^[a-z_][-a-z0-9._]*$/i;function UF(n,e){if(typeof n=="boolean")return{};let{schemaId:t,uriResolver:r}=this.opts,s=Co(n[t]||e),i={"":s},o=CR(r,s,!1),a={},c=new Set;return MF(n,{allKeys:!0},(d,f,m,T)=>{if(T===void 0)return;let g=o+f,S=i[T];typeof d[t]=="string"&&(S=E.call(this,d[t])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),i[f]=S;function E(b){let R=this.opts.uriResolver.resolve;if(b=Co(S?R(S,b):b),c.has(b))throw u(b);c.add(b);let O=this.refs[b];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?l(d,O.schema,b):b!==Co(g)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=g),b}function v(b){if(typeof b=="string"){if(!BF.test(b))throw new Error(`invalid anchor "${b}"`);E.call(this,`#${b}`)}}}),a;function l(d,f,m){if(f!==void 0&&!$F(d,f))throw u(m)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}cn.getSchemaRefs=UF});var gc=w(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.getData=Es.KeywordCxt=Es.validateFunctionCode=void 0;var LR=dR(),AR=fc(),Ly=Ny(),Sf=fc(),VF=bR(),mc=wR(),My=kR(),K=ae(),te=Cn(),WF=hc(),$r=he(),pc=dc();function HF(n){if(jR(n)&&(FR(n),xR(n))){GF(n);return}qR(n,()=>(0,LR.topBoolOrEmptySchema)(n))}Es.validateFunctionCode=HF;function qR({gen:n,validateName:e,schema:t,schemaEnv:r,opts:s},i){s.code.es5?n.func(e,(0,K._)`${te.default.data}, ${te.default.valCxt}`,r.$async,()=>{n.code((0,K._)`"use strict"; ${IR(t,s)}`),zF(n,s),n.code(i)}):n.func(e,(0,K._)`${te.default.data}, ${KF(s)}`,r.$async,()=>n.code(IR(t,s)).code(i))}function KF(n){return(0,K._)`{${te.default.instancePath}="", ${te.default.parentData}, ${te.default.parentDataProperty}, ${te.default.rootData}=${te.default.data}${n.dynamicRef?(0,K._)`, ${te.default.dynamicAnchors}={}`:K.nil}}={}`}function zF(n,e){n.if(te.default.valCxt,()=>{n.var(te.default.instancePath,(0,K._)`${te.default.valCxt}.${te.default.instancePath}`),n.var(te.default.parentData,(0,K._)`${te.default.valCxt}.${te.default.parentData}`),n.var(te.default.parentDataProperty,(0,K._)`${te.default.valCxt}.${te.default.parentDataProperty}`),n.var(te.default.rootData,(0,K._)`${te.default.valCxt}.${te.default.rootData}`),e.dynamicRef&&n.var(te.default.dynamicAnchors,(0,K._)`${te.default.valCxt}.${te.default.dynamicAnchors}`)},()=>{n.var(te.default.instancePath,(0,K._)`""`),n.var(te.default.parentData,(0,K._)`undefined`),n.var(te.default.parentDataProperty,(0,K._)`undefined`),n.var(te.default.rootData,te.default.data),e.dynamicRef&&n.var(te.default.dynamicAnchors,(0,K._)`{}`)})}function GF(n){let{schema:e,opts:t,gen:r}=n;qR(n,()=>{t.$comment&&e.$comment&&UR(n),ZF(n),r.let(te.default.vErrors,null),r.let(te.default.errors,0),t.unevaluated&&YF(n),BR(n),nB(n)})}function YF(n){let{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,K._)`${t}.evaluated`),e.if((0,K._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,K._)`${n.evaluated}.props`,(0,K._)`undefined`)),e.if((0,K._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,K._)`${n.evaluated}.items`,(0,K._)`undefined`))}function IR(n,e){let t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,K._)`/*# sourceURL=${t} */`:K.nil}function JF(n,e){if(jR(n)&&(FR(n),xR(n))){XF(n,e);return}(0,LR.boolOrEmptySchema)(n,e)}function xR({schema:n,self:e}){if(typeof n=="boolean")return!n;for(let t in n)if(e.RULES.all[t])return!0;return!1}function jR(n){return typeof n.schema!="boolean"}function XF(n,e){let{schema:t,gen:r,opts:s}=n;s.$comment&&t.$comment&&UR(n),eB(n),tB(n);let i=r.const("_errs",te.default.errors);BR(n,i),r.var(e,(0,K._)`${i} === ${te.default.errors}`)}function FR(n){(0,$r.checkUnknownRules)(n),QF(n)}function BR(n,e){if(n.opts.jtd)return $R(n,[],!1,e);let t=(0,AR.getSchemaTypes)(n.schema),r=(0,AR.coerceAndCheckDataType)(n,t);$R(n,t,!r,e)}function QF(n){let{schema:e,errSchemaPath:t,opts:r,self:s}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,$r.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function ZF(n){let{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,$r.checkStrictMode)(n,"default is ignored in the schema root")}function eB(n){let e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,WF.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function tB(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function UR({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:s}){let i=t.$comment;if(s.$comment===!0)n.code((0,K._)`${te.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,K.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,K._)`${te.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function nB(n){let{gen:e,schemaEnv:t,validateName:r,ValidationError:s,opts:i}=n;t.$async?e.if((0,K._)`${te.default.errors} === 0`,()=>e.return(te.default.data),()=>e.throw((0,K._)`new ${s}(${te.default.vErrors})`)):(e.assign((0,K._)`${r}.errors`,te.default.vErrors),i.unevaluated&&rB(n),e.return((0,K._)`${te.default.errors} === 0`))}function rB({gen:n,evaluated:e,props:t,items:r}){t instanceof K.Name&&n.assign((0,K._)`${e}.props`,t),r instanceof K.Name&&n.assign((0,K._)`${e}.items`,r)}function $R(n,e,t,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=n,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,$r.schemaHasRulesButRef)(i,u))){s.block(()=>WR(n,"$ref",u.all.$ref.definition));return}c.jtd||sB(n,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Ly.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Sf.checkDataType)(f.type,o,c.strictNumbers)),MR(n,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Sf.reportTypeError)(n)),s.endIf()):MR(n,f),a||s.if((0,K._)`${te.default.errors} === ${r||0}`))}}function MR(n,e){let{gen:t,schema:r,opts:{useDefaults:s}}=n;s&&(0,VF.assignDefaults)(n,e.type),t.block(()=>{for(let i of e.rules)(0,Ly.shouldUseRule)(r,i)&&WR(n,i.keyword,i.definition,e.type)})}function sB(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(iB(n,e),n.opts.allowUnionTypes||oB(n,e),aB(n,n.dataTypes))}function iB(n,e){if(e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{VR(n.dataTypes,t)||qy(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),lB(n,e)}}function oB(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&qy(n,"use allowUnionTypes to allow union type keyword")}function aB(n,e){let t=n.self.RULES.all;for(let r in t){let s=t[r];if(typeof s=="object"&&(0,Ly.shouldUseRule)(n.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>cB(e,o))&&qy(n,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function cB(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function VR(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function lB(n,e){let t=[];for(let r of n.dataTypes)VR(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function qy(n,e){let t=n.schemaEnv.baseId+n.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,$r.checkStrictMode)(n,e,n.opts.strictTypes)}var wf=class{constructor(e,t,r){if((0,mc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,$r.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",HR(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,mc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",te.default.errors))}result(e,t,r){this.failResult((0,K.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,K.not)(e),void 0,t)}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:t}=this;this.fail((0,K._)`${t} !== undefined && (${(0,K.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?pc.reportExtraError:pc.reportError)(this,this.def.error,t)}$dataError(){(0,pc.reportError)(this,this.def.$dataError||pc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,pc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=K.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=K.nil,t=K.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,K.or)((0,K._)`${s} === undefined`,t)),e!==K.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==K.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:i}=this;return(0,K.or)(o(),a());function o(){if(r.length){if(!(t instanceof K.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,K._)`${(0,Sf.checkDataTypes)(c,t,i.opts.strictNumbers,Sf.DataType.Wrong)}`}return K.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,K._)`!${c}(${t})`}return K.nil}}subschema(e,t){let r=(0,My.getSubschema)(this.it,e);(0,My.extendSubschemaData)(r,this.it,e),(0,My.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return JF(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=$r.mergeEvaluated.props(s,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=$r.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,K.Name)),!0}};Es.KeywordCxt=wf;function WR(n,e,t,r){let s=new wf(n,t,e);"code"in t?t.code(s,r):s.$data&&t.validate?(0,mc.funcKeywordCode)(s,t):"macro"in t?(0,mc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,mc.funcKeywordCode)(s,t)}var uB=/^\/(?:[^~]|~0|~1)*$/,dB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function HR(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let s,i;if(n==="")return te.default.rootData;if(n[0]==="/"){if(!uB.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);s=n,i=te.default.rootData}else{let l=dB.exec(n);if(!l)throw new Error(`Invalid JSON-pointer: ${n}`);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=t[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,K._)`${i}${(0,K.getProperty)((0,$r.unescapeJsonPointer)(l))}`,o=(0,K._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Es.getData=HR});var Ef=w(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});var xy=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};jy.default=xy});var yc=w(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});var Fy=hc(),By=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Fy.resolveUrl)(e,t,r),this.missingSchema=(0,Fy.normalizeId)((0,Fy.getFullPath)(e,this.missingRef))}};Uy.default=By});var bc=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.resolveSchema=An.getCompilingSchema=An.resolveRef=An.compileSchema=An.SchemaEnv=void 0;var Jn=ae(),fB=Ef(),ii=Cn(),Xn=hc(),KR=he(),hB=gc(),Oo=class{constructor(e){var t;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=(t=e.baseId)!==null&&t!==void 0?t:(0,Xn.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};An.SchemaEnv=Oo;function Wy(n){let e=zR.call(this,n);if(e)return e;let t=(0,Xn.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Jn.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;n.$async&&(a=o.scopeValue("Error",{ref:fB.default,code:(0,Jn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");n.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ii.default.data,parentData:ii.default.parentData,parentDataProperty:ii.default.parentDataProperty,dataNames:[ii.default.data],dataPathArr:[Jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Jn.stringify)(n.schema)}:{ref:n.schema}),validateName:c,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Jn.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Jn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(n),(0,hB.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(ii.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,n));let m=new Function(`${ii.default.self}`,`${ii.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=n.schema,m.schemaEnv=n,n.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:T,items:g}=l;m.evaluated={props:T instanceof Jn.Name?void 0:T,items:g instanceof Jn.Name?void 0:g,dynamicProps:T instanceof Jn.Name,dynamicItems:g instanceof Jn.Name},m.source&&(m.source.evaluated=(0,Jn.stringify)(m.evaluated))}return n.validate=m,n}catch(d){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(n)}}An.compileSchema=Wy;function pB(n,e,t){var r;t=(0,Xn.resolveUrl)(this.opts.uriResolver,e,t);let s=n.refs[t];if(s)return s;let i=yB.call(this,n,t);if(i===void 0){let o=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;o&&(i=new Oo({schema:o,schemaId:a,root:n,baseId:e}))}if(i!==void 0)return n.refs[t]=mB.call(this,i)}An.resolveRef=pB;function mB(n){return(0,Xn.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Wy.call(this,n)}function zR(n){for(let e of this._compilations)if(gB(e,n))return e}An.getCompilingSchema=zR;function gB(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function yB(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||kf.call(this,n,e)}function kf(n,e){let t=this.opts.uriResolver.parse(e),r=(0,Xn._getFullPath)(this.opts.uriResolver,t),s=(0,Xn.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===s)return Vy.call(this,t,n);let i=(0,Xn.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=kf.call(this,n,o);return typeof a?.schema!="object"?void 0:Vy.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Wy.call(this,o),i===(0,Xn.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Xn.resolveUrl)(this.opts.uriResolver,s,l)),new Oo({schema:a,schemaId:c,root:n,baseId:s})}return Vy.call(this,t,o)}}An.resolveSchema=kf;var bB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Vy(n,{baseId:e,schema:t,root:r}){var s;if(((s=n.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,KR.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!bB.has(a)&&l&&(e=(0,Xn.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,KR.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Xn.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=kf.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new Oo({schema:t,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var GR=w((W8,vB)=>{vB.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 JR=w((H8,YR)=>{"use strict";var TB={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};YR.exports={HEX:TB}});var sD=w((K8,rD)=>{"use strict";var{HEX:_B}=JR(),SB=/^(?:(?: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 eD(n){if(nD(n,".")<3)return{host:n,isIPV4:!1};let e=n.match(SB)||[],[t]=e;return t?{host:EB(t,"."),isIPV4:!0}:{host:n,isIPV4:!1}}function Hy(n,e=!1){let t="",r=!0;for(let s of n){if(_B[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(t+=s)}return e&&t.length===0&&(t="0"),t}function wB(n){let e=0,t={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=Hy(s);if(l!==void 0)r.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<n.length;l++){let u=n[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,r.push(":"),e>7){t.error=!0;break}l-1>=0&&n[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?t.zone=s.join(""):a?r.push(s.join("")):r.push(Hy(s))),t.address=r.join(""),t}function tD(n){if(nD(n,":")<2)return{host:n,isIPV6:!1};let e=wB(n);if(e.error)return{host:n,isIPV6:!1};{let t=e.address,r=e.address;return e.zone&&(t+="%"+e.zone,r+="%25"+e.zone),{host:t,escapedHost:r,isIPV6:!0}}}function EB(n,e){let t="",r=!0,s=n.length;for(let i=0;i<s;i++){let o=n[i];o==="0"&&r?(i+1<=s&&n[i+1]===e||i+1===s)&&(t+=o,r=!1):(o===e?r=!0:r=!1,t+=o)}return t}function nD(n,e){let t=0;for(let r=0;r<n.length;r++)n[r]===e&&t++;return t}var XR=/^\.\.?\//u,QR=/^\/\.(?:\/|$)/u,ZR=/^\/\.\.(?:\/|$)/u,kB=/^\/?(?:.|\n)*?(?=\/|$)/u;function NB(n){let e=[];for(;n.length;)if(n.match(XR))n=n.replace(XR,"");else if(n.match(QR))n=n.replace(QR,"/");else if(n.match(ZR))n=n.replace(ZR,"/"),e.pop();else if(n==="."||n==="..")n="";else{let t=n.match(kB);if(t){let r=t[0];n=n.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function PB(n,e){let t=e!==!0?escape:unescape;return n.scheme!==void 0&&(n.scheme=t(n.scheme)),n.userinfo!==void 0&&(n.userinfo=t(n.userinfo)),n.host!==void 0&&(n.host=t(n.host)),n.path!==void 0&&(n.path=t(n.path)),n.query!==void 0&&(n.query=t(n.query)),n.fragment!==void 0&&(n.fragment=t(n.fragment)),n}function RB(n){let e=[];if(n.userinfo!==void 0&&(e.push(n.userinfo),e.push("@")),n.host!==void 0){let t=unescape(n.host),r=eD(t);if(r.isIPV4)t=r.host;else{let s=tD(r.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=n.host}e.push(t)}return(typeof n.port=="number"||typeof n.port=="string")&&(e.push(":"),e.push(String(n.port))),e.length?e.join(""):void 0}rD.exports={recomposeAuthority:RB,normalizeComponentEncoding:PB,removeDotSegments:NB,normalizeIPv4:eD,normalizeIPv6:tD,stringArrayToHexStripped:Hy}});var uD=w((z8,lD)=>{"use strict";var DB=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,CB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function iD(n){return typeof n.secure=="boolean"?n.secure:String(n.scheme).toLowerCase()==="wss"}function oD(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function aD(n){let e=String(n.scheme).toLowerCase()==="https";return(n.port===(e?443:80)||n.port==="")&&(n.port=void 0),n.path||(n.path="/"),n}function OB(n){return n.secure=iD(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function AB(n){if((n.port===(iD(n)?443:80)||n.port==="")&&(n.port=void 0),typeof n.secure=="boolean"&&(n.scheme=n.secure?"wss":"ws",n.secure=void 0),n.resourceName){let[e,t]=n.resourceName.split("?");n.path=e&&e!=="/"?e:void 0,n.query=t,n.resourceName=void 0}return n.fragment=void 0,n}function IB(n,e){if(!n.path)return n.error="URN can not be parsed",n;let t=n.path.match(CB);if(t){let r=e.scheme||n.scheme||"urn";n.nid=t[1].toLowerCase(),n.nss=t[2];let s=`${r}:${e.nid||n.nid}`,i=Ky[s];n.path=void 0,i&&(n=i.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n}function $B(n,e){let t=e.scheme||n.scheme||"urn",r=n.nid.toLowerCase(),s=`${t}:${e.nid||r}`,i=Ky[s];i&&(n=i.serialize(n,e));let o=n,a=n.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function MB(n,e){let t=n;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!DB.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function LB(n){let e=n;return e.nss=(n.uuid||"").toLowerCase(),e}var cD={scheme:"http",domainHost:!0,parse:oD,serialize:aD},qB={scheme:"https",domainHost:cD.domainHost,parse:oD,serialize:aD},Nf={scheme:"ws",domainHost:!0,parse:OB,serialize:AB},xB={scheme:"wss",domainHost:Nf.domainHost,parse:Nf.parse,serialize:Nf.serialize},jB={scheme:"urn",parse:IB,serialize:$B,skipNormalize:!0},FB={scheme:"urn:uuid",parse:MB,serialize:LB,skipNormalize:!0},Ky={http:cD,https:qB,ws:Nf,wss:xB,urn:jB,"urn:uuid":FB};lD.exports=Ky});var fD=w((G8,Rf)=>{"use strict";var{normalizeIPv6:BB,normalizeIPv4:UB,removeDotSegments:vc,recomposeAuthority:VB,normalizeComponentEncoding:Pf}=sD(),zy=uD();function WB(n,e){return typeof n=="string"?n=gr(Mr(n,e),e):typeof n=="object"&&(n=Mr(gr(n,e),e)),n}function HB(n,e,t){let r=Object.assign({scheme:"null"},t),s=dD(Mr(n,r),Mr(e,r),r,!0);return gr(s,{...r,skipEscape:!0})}function dD(n,e,t,r){let s={};return r||(n=Mr(gr(n,t),t),e=Mr(gr(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=vc(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=vc(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=vc(e.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?s.path="/"+e.path:n.path?s.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=vc(s.path)),s.query=e.query):(s.path=n.path,e.query!==void 0?s.query=e.query:s.query=n.query),s.userinfo=n.userinfo,s.host=n.host,s.port=n.port),s.scheme=n.scheme),s.fragment=e.fragment,s}function KB(n,e,t){return typeof n=="string"?(n=unescape(n),n=gr(Pf(Mr(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=gr(Pf(n,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=gr(Pf(Mr(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=gr(Pf(e,!0),{...t,skipEscape:!0})),n.toLowerCase()===e.toLowerCase()}function gr(n,e){let t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},r=Object.assign({},e),s=[],i=zy[(r.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,r),t.path!==void 0&&(r.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),r.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=VB(t);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=vc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var zB=Array.from({length:127},(n,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function GB(n){let e=0;for(let t=0,r=n.length;t<r;++t)if(e=n.charCodeAt(t),e>126||zB[e])return!0;return!1}var YB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Mr(n,e){let t=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=n.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);let o=n.match(YB);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=UB(r.host);if(c.isIPV4===!1){let l=BB(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",t.reference&&t.reference!=="suffix"&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");let a=zy[(t.scheme||r.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&GB(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,t)}else r.error=r.error||"URI can not be parsed.";return r}var Gy={SCHEMES:zy,normalize:WB,resolve:HB,resolveComponents:dD,equal:KB,serialize:gr,parse:Mr};Rf.exports=Gy;Rf.exports.default=Gy;Rf.exports.fastUri=Gy});var pD=w(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});var hD=fD();hD.code='require("ajv/dist/runtime/uri").default';Yy.default=hD});var SD=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.CodeGen=$t.Name=$t.nil=$t.stringify=$t.str=$t._=$t.KeywordCxt=void 0;var JB=gc();Object.defineProperty($t,"KeywordCxt",{enumerable:!0,get:function(){return JB.KeywordCxt}});var Ao=ae();Object.defineProperty($t,"_",{enumerable:!0,get:function(){return Ao._}});Object.defineProperty($t,"str",{enumerable:!0,get:function(){return Ao.str}});Object.defineProperty($t,"stringify",{enumerable:!0,get:function(){return Ao.stringify}});Object.defineProperty($t,"nil",{enumerable:!0,get:function(){return Ao.nil}});Object.defineProperty($t,"Name",{enumerable:!0,get:function(){return Ao.Name}});Object.defineProperty($t,"CodeGen",{enumerable:!0,get:function(){return Ao.CodeGen}});var XB=Ef(),vD=yc(),QB=ky(),Tc=bc(),ZB=ae(),_c=hc(),Df=fc(),Xy=he(),mD=GR(),eU=pD(),TD=(n,e)=>new RegExp(n,e);TD.code="new RegExp";var tU=["removeAdditional","useDefaults","coerceTypes"],nU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),rU={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."},sU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gD=200;function iU(n){var e,t,r,s,i,o,a,c,l,u,d,f,m,T,g,S,E,v,b,R,O,L,V,j,re;let Ae=n.strict,yt=(e=n.code)===null||e===void 0?void 0:e.optimize,de=yt===!0||yt===void 0?1:yt||0,yn=(r=(t=n.code)===null||t===void 0?void 0:t.regExp)!==null&&r!==void 0?r:TD,xr=(s=n.uriResolver)!==null&&s!==void 0?s:eU.default;return{strictSchema:(o=(i=n.strictSchema)!==null&&i!==void 0?i:Ae)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=n.strictNumbers)!==null&&a!==void 0?a:Ae)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=n.strictTypes)!==null&&l!==void 0?l:Ae)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=n.strictTuples)!==null&&d!==void 0?d:Ae)!==null&&f!==void 0?f:"log",strictRequired:(T=(m=n.strictRequired)!==null&&m!==void 0?m:Ae)!==null&&T!==void 0?T:!1,code:n.code?{...n.code,optimize:de,regExp:yn}:{optimize:de,regExp:yn},loopRequired:(g=n.loopRequired)!==null&&g!==void 0?g:gD,loopEnum:(S=n.loopEnum)!==null&&S!==void 0?S:gD,meta:(E=n.meta)!==null&&E!==void 0?E:!0,messages:(v=n.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=n.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(R=n.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(O=n.addUsedSchema)!==null&&O!==void 0?O:!0,validateSchema:(L=n.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(V=n.validateFormats)!==null&&V!==void 0?V:!0,unicodeRegExp:(j=n.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(re=n.int32range)!==null&&re!==void 0?re:!0,uriResolver:xr}}var Sc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...iU(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new ZB.ValueScope({scope:{},prefixes:nU,es5:t,lines:r}),this.logger=dU(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,QB.getRules)(),yD.call(this,rU,e,"NOT SUPPORTED"),yD.call(this,sU,e,"DEPRECATED","warn"),this._metaOpts=lU.call(this),e.formats&&aU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&cU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),oU.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=mD;r==="id"&&(s={...mD},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){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(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){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,t);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 vD.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,t)}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,t,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 t=(0,_c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){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&&t){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 t;for(;typeof(t=bD.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:r}=this.opts,s=new Tc.SchemaEnv({schema:{},schemaId:r});if(t=Tc.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=bD.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,_c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string")r=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if(typeof e=="object"&&t===void 0){if(t=e,r=t.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(hU.call(this,r,t),!t)return(0,Xy.eachItem)(r,i=>Jy.call(this,i)),this;mU.call(this,t);let s={...t,type:(0,Df.getJSONTypes)(t.type),schemaType:(0,Df.getJSONTypes)(t.schemaType)};return(0,Xy.eachItem)(r,s.type.length===0?i=>Jy.call(this,i,s):i=>s.type.forEach(o=>Jy.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){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]=_D(u))}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];(!t||t.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,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,_c.normalizeId)(o||r);let l=_c.getSchemaRefs.call(this,e,r);return c=new Tc.SchemaEnv({schema:e,schemaId:a,meta:t,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):Tc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Tc.compileSchema.call(this,e)}finally{this.opts=t}}};Sc.ValidationError=XB.default;Sc.MissingRefError=vD.default;$t.default=Sc;function yD(n,e,t,r="error"){for(let s in n){let i=s;i in e&&this.logger[r](`${t}: option ${s}. ${n[i]}`)}}function bD(n){return n=(0,_c.normalizeId)(n),this.schemas[n]||this.refs[n]}function oU(){let n=this.opts.schemas;if(n)if(Array.isArray(n))this.addSchema(n);else for(let e in n)this.addSchema(n[e],e)}function aU(){for(let n in this.opts.formats){let e=this.opts.formats[n];e&&this.addFormat(n,e)}}function cU(n){if(Array.isArray(n)){this.addVocabulary(n);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in n){let t=n[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function lU(){let n={...this.opts};for(let e of tU)delete n[e];return n}var uU={log(){},warn(){},error(){}};function dU(n){if(n===!1)return uU;if(n===void 0)return console;if(n.log&&n.warn&&n.error)return n;throw new Error("logger must implement log, warn and error methods")}var fU=/^[a-z_$][a-z0-9_$:-]*$/i;function hU(n,e){let{RULES:t}=this;if((0,Xy.eachItem)(n,r=>{if(t.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!fU.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 Jy(n,e,t){var r;let s=e?.post;if(t&&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===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[n]=!0,!e)return;let a={keyword:n,definition:{...e,type:(0,Df.getJSONTypes)(e.type),schemaType:(0,Df.getJSONTypes)(e.schemaType)}};e.before?pU.call(this,o,a,e.before):o.rules.push(a),i.all[n]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function pU(n,e,t){let r=n.rules.findIndex(s=>s.keyword===t);r>=0?n.rules.splice(r,0,e):(n.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function mU(n){let{metaSchema:e}=n;e!==void 0&&(n.$data&&this.opts.$data&&(e=_D(e)),n.validateSchema=this.compile(e,!0))}var gU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _D(n){return{anyOf:[n,gU]}}});var wD=w(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});var yU={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Qy.default=yU});var Af=w(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.callRef=oi.getValidate=void 0;var bU=yc(),ED=On(),ln=ae(),Io=Cn(),kD=bc(),Cf=he(),vU={keyword:"$ref",schemaType:"string",code(n){let{gen:e,schema:t,it:r}=n,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=kD.resolveRef.call(c,l,s,t);if(u===void 0)throw new bU.default(r.opts.uriResolver,s,t);if(u instanceof kD.SchemaEnv)return f(u);return m(u);function d(){if(i===l)return Of(n,o,i,i.$async);let T=e.scopeValue("root",{ref:l});return Of(n,(0,ln._)`${T}.validate`,l,l.$async)}function f(T){let g=ND(n,T);Of(n,g,T,T.$async)}function m(T){let g=e.scopeValue("schema",a.code.source===!0?{ref:T,code:(0,ln.stringify)(T)}:{ref:T}),S=e.name("valid"),E=n.subschema({schema:T,dataTypes:[],schemaPath:ln.nil,topSchemaRef:g,errSchemaPath:t},S);n.mergeEvaluated(E),n.ok(S)}}};function ND(n,e){let{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,ln._)`${t.scopeValue("wrapper",{ref:e})}.validate`}oi.getValidate=ND;function Of(n,e,t,r){let{gen:s,it:i}=n,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?Io.default.this:ln.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let T=s.let("valid");s.try(()=>{s.code((0,ln._)`await ${(0,ED.callValidateCode)(n,e,l)}`),m(e),o||s.assign(T,!0)},g=>{s.if((0,ln._)`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(T,!1)}),n.ok(T)}function d(){n.result((0,ED.callValidateCode)(n,e,l),()=>m(e),()=>f(e))}function f(T){let g=(0,ln._)`${T}.errors`;s.assign(Io.default.vErrors,(0,ln._)`${Io.default.vErrors} === null ? ${g} : ${Io.default.vErrors}.concat(${g})`),s.assign(Io.default.errors,(0,ln._)`${Io.default.vErrors}.length`)}function m(T){var g;if(!i.opts.unevaluated)return;let S=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(S&&!S.dynamicProps)S.props!==void 0&&(i.props=Cf.mergeEvaluated.props(s,S.props,i.props));else{let E=s.var("props",(0,ln._)`${T}.evaluated.props`);i.props=Cf.mergeEvaluated.props(s,E,i.props,ln.Name)}if(i.items!==!0)if(S&&!S.dynamicItems)S.items!==void 0&&(i.items=Cf.mergeEvaluated.items(s,S.items,i.items));else{let E=s.var("items",(0,ln._)`${T}.evaluated.items`);i.items=Cf.mergeEvaluated.items(s,E,i.items,ln.Name)}}}oi.callRef=Of;oi.default=vU});var PD=w(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0});var TU=wD(),_U=Af(),SU=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",TU.default,_U.default];Zy.default=SU});var RD=w(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var If=ae(),ks=If.operators,$f={maximum:{okStr:"<=",ok:ks.LTE,fail:ks.GT},minimum:{okStr:">=",ok:ks.GTE,fail:ks.LT},exclusiveMaximum:{okStr:"<",ok:ks.LT,fail:ks.GTE},exclusiveMinimum:{okStr:">",ok:ks.GT,fail:ks.LTE}},wU={message:({keyword:n,schemaCode:e})=>(0,If.str)`must be ${$f[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,If._)`{comparison: ${$f[n].okStr}, limit: ${e}}`},EU={keyword:Object.keys($f),type:"number",schemaType:"number",$data:!0,error:wU,code(n){let{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,If._)`${t} ${$f[e].fail} ${r} || isNaN(${t})`)}};eb.default=EU});var DD=w(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var wc=ae(),kU={message:({schemaCode:n})=>(0,wc.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,wc._)`{multipleOf: ${n}}`},NU={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kU,code(n){let{gen:e,data:t,schemaCode:r,it:s}=n,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,wc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,wc._)`${o} !== parseInt(${o})`;n.fail$data((0,wc._)`(${r} === 0 || (${o} = ${t}/${r}, ${a}))`)}};tb.default=NU});var OD=w(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});function CD(n){let e=n.length,t=0,r=0,s;for(;r<e;)t++,s=n.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=n.charCodeAt(r),(s&64512)===56320&&r++);return t}nb.default=CD;CD.code='require("ajv/dist/runtime/ucs2length").default'});var AD=w(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var ai=ae(),PU=he(),RU=OD(),DU={message({keyword:n,schemaCode:e}){let t=n==="maxLength"?"more":"fewer";return(0,ai.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:n})=>(0,ai._)`{limit: ${n}}`},CU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:DU,code(n){let{keyword:e,data:t,schemaCode:r,it:s}=n,i=e==="maxLength"?ai.operators.GT:ai.operators.LT,o=s.opts.unicode===!1?(0,ai._)`${t}.length`:(0,ai._)`${(0,PU.useFunc)(n.gen,RU.default)}(${t})`;n.fail$data((0,ai._)`${o} ${i} ${r}`)}};rb.default=CU});var ID=w(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var OU=On(),Mf=ae(),AU={message:({schemaCode:n})=>(0,Mf.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,Mf._)`{pattern: ${n}}`},IU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:AU,code(n){let{data:e,$data:t,schema:r,schemaCode:s,it:i}=n,o=i.opts.unicodeRegExp?"u":"",a=t?(0,Mf._)`(new RegExp(${s}, ${o}))`:(0,OU.usePattern)(n,r);n.fail$data((0,Mf._)`!${a}.test(${e})`)}};sb.default=IU});var $D=w(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var Ec=ae(),$U={message({keyword:n,schemaCode:e}){let t=n==="maxProperties"?"more":"fewer";return(0,Ec.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,Ec._)`{limit: ${n}}`},MU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:$U,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxProperties"?Ec.operators.GT:Ec.operators.LT;n.fail$data((0,Ec._)`Object.keys(${t}).length ${s} ${r}`)}};ib.default=MU});var MD=w(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var kc=On(),Nc=ae(),LU=he(),qU={message:({params:{missingProperty:n}})=>(0,Nc.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,Nc._)`{missingProperty: ${n}}`},xU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qU,code(n){let{gen:e,schema:t,schemaCode:r,data:s,$data:i,it:o}=n,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let m=n.parentSchema.properties,{definedProperties:T}=n.it;for(let g of t)if(m?.[g]===void 0&&!T.has(g)){let S=o.schemaEnv.baseId+o.errSchemaPath,E=`required property "${g}" is not defined at "${S}" (strictRequired)`;(0,LU.checkStrictMode)(o,E,o.opts.strictRequired)}}function l(){if(c||i)n.block$data(Nc.nil,d);else for(let m of t)(0,kc.checkReportMissingProp)(n,m)}function u(){let m=e.let("missing");if(c||i){let T=e.let("valid",!0);n.block$data(T,()=>f(m,T)),n.ok(T)}else e.if((0,kc.checkMissingProp)(n,t,m)),(0,kc.reportMissingProp)(n,m),e.else()}function d(){e.forOf("prop",r,m=>{n.setParams({missingProperty:m}),e.if((0,kc.noPropertyInData)(e,s,m,a.ownProperties),()=>n.error())})}function f(m,T){n.setParams({missingProperty:m}),e.forOf(m,r,()=>{e.assign(T,(0,kc.propertyInData)(e,s,m,a.ownProperties)),e.if((0,Nc.not)(T),()=>{n.error(),e.break()})},Nc.nil)}}};ob.default=xU});var LD=w(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var Pc=ae(),jU={message({keyword:n,schemaCode:e}){let t=n==="maxItems"?"more":"fewer";return(0,Pc.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,Pc._)`{limit: ${n}}`},FU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jU,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxItems"?Pc.operators.GT:Pc.operators.LT;n.fail$data((0,Pc._)`${t}.length ${s} ${r}`)}};ab.default=FU});var Lf=w(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var qD=Iy();qD.code='require("ajv/dist/runtime/equal").default';cb.default=qD});var xD=w(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var lb=fc(),Mt=ae(),BU=he(),UU=Lf(),VU={message:({params:{i:n,j:e}})=>(0,Mt.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,Mt._)`{i: ${n}, j: ${e}}`},WU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:VU,code(n){let{gen:e,data:t,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=n;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,lb.getSchemaTypes)(i.items):[];n.block$data(c,u,(0,Mt._)`${o} === false`),n.ok(c);function u(){let T=e.let("i",(0,Mt._)`${t}.length`),g=e.let("j");n.setParams({i:T,j:g}),e.assign(c,!0),e.if((0,Mt._)`${T} > 1`,()=>(d()?f:m)(T,g))}function d(){return l.length>0&&!l.some(T=>T==="object"||T==="array")}function f(T,g){let S=e.name("item"),E=(0,lb.checkDataTypes)(l,S,a.opts.strictNumbers,lb.DataType.Wrong),v=e.const("indices",(0,Mt._)`{}`);e.for((0,Mt._)`;${T}--;`,()=>{e.let(S,(0,Mt._)`${t}[${T}]`),e.if(E,(0,Mt._)`continue`),l.length>1&&e.if((0,Mt._)`typeof ${S} == "string"`,(0,Mt._)`${S} += "_"`),e.if((0,Mt._)`typeof ${v}[${S}] == "number"`,()=>{e.assign(g,(0,Mt._)`${v}[${S}]`),n.error(),e.assign(c,!1).break()}).code((0,Mt._)`${v}[${S}] = ${T}`)})}function m(T,g){let S=(0,BU.useFunc)(e,UU.default),E=e.name("outer");e.label(E).for((0,Mt._)`;${T}--;`,()=>e.for((0,Mt._)`${g} = ${T}; ${g}--;`,()=>e.if((0,Mt._)`${S}(${t}[${T}], ${t}[${g}])`,()=>{n.error(),e.assign(c,!1).break(E)})))}}};ub.default=WU});var jD=w(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var db=ae(),HU=he(),KU=Lf(),zU={message:"must be equal to constant",params:({schemaCode:n})=>(0,db._)`{allowedValue: ${n}}`},GU={keyword:"const",$data:!0,error:zU,code(n){let{gen:e,data:t,$data:r,schemaCode:s,schema:i}=n;r||i&&typeof i=="object"?n.fail$data((0,db._)`!${(0,HU.useFunc)(e,KU.default)}(${t}, ${s})`):n.fail((0,db._)`${i} !== ${t}`)}};fb.default=GU});var FD=w(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var Rc=ae(),YU=he(),JU=Lf(),XU={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,Rc._)`{allowedValues: ${n}}`},QU={keyword:"enum",schemaType:"array",$data:!0,error:XU,code(n){let{gen:e,data:t,$data:r,schema:s,schemaCode:i,it:o}=n;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,YU.useFunc)(e,JU.default)),u;if(a||r)u=e.let("valid"),n.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let m=e.const("vSchema",i);u=(0,Rc.or)(...s.map((T,g)=>f(m,g)))}n.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,m=>e.if((0,Rc._)`${l()}(${t}, ${m})`,()=>e.assign(u,!0).break()))}function f(m,T){let g=s[T];return typeof g=="object"&&g!==null?(0,Rc._)`${l()}(${t}, ${m}[${T}])`:(0,Rc._)`${t} === ${g}`}}};hb.default=QU});var BD=w(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var ZU=RD(),eV=DD(),tV=AD(),nV=ID(),rV=$D(),sV=MD(),iV=LD(),oV=xD(),aV=jD(),cV=FD(),lV=[ZU.default,eV.default,tV.default,nV.default,rV.default,sV.default,iV.default,oV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},aV.default,cV.default];pb.default=lV});var gb=w(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.validateAdditionalItems=void 0;var ci=ae(),mb=he(),uV={message:({params:{len:n}})=>(0,ci.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,ci._)`{limit: ${n}}`},dV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:uV,code(n){let{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,mb.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}UD(n,r)}};function UD(n,e){let{gen:t,schema:r,data:s,keyword:i,it:o}=n;o.items=!0;let a=t.const("len",(0,ci._)`${s}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,ci._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,mb.alwaysValidSchema)(o,r)){let l=t.var("valid",(0,ci._)`${a} <= ${e.length}`);t.if((0,ci.not)(l),()=>c(l)),n.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{n.subschema({keyword:i,dataProp:u,dataPropType:mb.Type.Num},l),o.allErrors||t.if((0,ci.not)(l),()=>t.break())})}}Dc.validateAdditionalItems=UD;Dc.default=dV});var yb=w(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.validateTuple=void 0;var VD=ae(),qf=he(),fV=On(),hV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){let{schema:e,it:t}=n;if(Array.isArray(e))return WD(n,"additionalItems",e);t.items=!0,!(0,qf.alwaysValidSchema)(t,e)&&n.ok((0,fV.validateArray)(n))}};function WD(n,e,t=n.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=n;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=qf.mergeEvaluated.items(r,t.length,a.items));let c=r.name("valid"),l=r.const("len",(0,VD._)`${i}.length`);t.forEach((d,f)=>{(0,qf.alwaysValidSchema)(a,d)||(r.if((0,VD._)`${l} > ${f}`,()=>n.subschema({keyword:o,schemaProp:f,dataProp:f},c)),n.ok(c))});function u(d){let{opts:f,errSchemaPath:m}=a,T=t.length,g=T===d.minItems&&(T===d.maxItems||d[e]===!1);if(f.strictTuples&&!g){let S=`"${o}" is ${T}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,qf.checkStrictMode)(a,S,f.strictTuples)}}}Cc.validateTuple=WD;Cc.default=hV});var HD=w(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var pV=yb(),mV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,pV.validateTuple)(n,"items")};bb.default=mV});var zD=w(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var KD=ae(),gV=he(),yV=On(),bV=gb(),vV={message:({params:{len:n}})=>(0,KD.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,KD._)`{limit: ${n}}`},TV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vV,code(n){let{schema:e,parentSchema:t,it:r}=n,{prefixItems:s}=t;r.items=!0,!(0,gV.alwaysValidSchema)(r,e)&&(s?(0,bV.validateAdditionalItems)(n,s):n.ok((0,yV.validateArray)(n)))}};vb.default=TV});var GD=w(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var In=ae(),xf=he(),_V={message:({params:{min:n,max:e}})=>e===void 0?(0,In.str)`must contain at least ${n} valid item(s)`:(0,In.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,In._)`{minContains: ${n}}`:(0,In._)`{minContains: ${n}, maxContains: ${e}}`},SV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:_V,code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n,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,In._)`${s}.length`);if(n.setParams({min:o,max:a}),a===void 0&&o===0){(0,xf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,xf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,xf.alwaysValidSchema)(i,t)){let g=(0,In._)`${u} >= ${o}`;a!==void 0&&(g=(0,In._)`${g} && ${u} <= ${a}`),n.pass(g);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?m(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,In._)`${s}.length > 0`,f)):(e.let(d,!1),f()),n.result(d,()=>n.reset());function f(){let g=e.name("_valid"),S=e.let("count",0);m(g,()=>e.if(g,()=>T(S)))}function m(g,S){e.forRange("i",0,u,E=>{n.subschema({keyword:"contains",dataProp:E,dataPropType:xf.Type.Num,compositeRule:!0},g),S()})}function T(g){e.code((0,In._)`${g}++`),a===void 0?e.if((0,In._)`${g} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,In._)`${g} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,In._)`${g} >= ${o}`,()=>e.assign(d,!0)))}}};Tb.default=SV});var jf=w(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.validateSchemaDeps=yr.validatePropertyDeps=yr.error=void 0;var _b=ae(),wV=he(),Oc=On();yr.error={message:({params:{property:n,depsCount:e,deps:t}})=>{let r=e===1?"property":"properties";return(0,_b.str)`must have ${r} ${t} when property ${n} is present`},params:({params:{property:n,depsCount:e,deps:t,missingProperty:r}})=>(0,_b._)`{property: ${n},
|
|
180
|
+
missingProperty: ${r},
|
|
181
|
+
depsCount: ${e},
|
|
182
|
+
deps: ${t}}`};var EV={keyword:"dependencies",type:"object",schemaType:"object",error:yr.error,code(n){let[e,t]=kV(n);YD(n,e),JD(n,t)}};function kV({schema:n}){let e={},t={};for(let r in n){if(r==="__proto__")continue;let s=Array.isArray(n[r])?e:t;s[r]=n[r]}return[e,t]}function YD(n,e=n.schema){let{gen:t,data:r,it:s}=n;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Oc.propertyInData)(t,r,o,s.opts.ownProperties);n.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Oc.checkReportMissingProp)(n,l)}):(t.if((0,_b._)`${c} && (${(0,Oc.checkMissingProp)(n,a,i)})`),(0,Oc.reportMissingProp)(n,i),t.else())}}yr.validatePropertyDeps=YD;function JD(n,e=n.schema){let{gen:t,data:r,keyword:s,it:i}=n,o=t.name("valid");for(let a in e)(0,wV.alwaysValidSchema)(i,e[a])||(t.if((0,Oc.propertyInData)(t,r,a,i.opts.ownProperties),()=>{let c=n.subschema({keyword:s,schemaProp:a},o);n.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),n.ok(o))}yr.validateSchemaDeps=JD;yr.default=EV});var QD=w(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var XD=ae(),NV=he(),PV={message:"property name must be valid",params:({params:n})=>(0,XD._)`{propertyName: ${n.propertyName}}`},RV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:PV,code(n){let{gen:e,schema:t,data:r,it:s}=n;if((0,NV.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",r,o=>{n.setParams({propertyName:o}),n.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,XD.not)(i),()=>{n.error(!0),s.allErrors||e.break()})}),n.ok(i)}};Sb.default=RV});var Eb=w(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var Ff=On(),Qn=ae(),DV=Cn(),Bf=he(),CV={message:"must NOT have additional properties",params:({params:n})=>(0,Qn._)`{additionalProperty: ${n.additionalProperty}}`},OV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:CV,code(n){let{gen:e,schema:t,parentSchema:r,data:s,errsCount:i,it:o}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Bf.alwaysValidSchema)(o,t))return;let l=(0,Ff.allSchemaProperties)(r.properties),u=(0,Ff.allSchemaProperties)(r.patternProperties);d(),n.ok((0,Qn._)`${i} === ${DV.default.errors}`);function d(){e.forIn("key",s,S=>{!l.length&&!u.length?T(S):e.if(f(S),()=>T(S))})}function f(S){let E;if(l.length>8){let v=(0,Bf.schemaRefOrVal)(o,r.properties,"properties");E=(0,Ff.isOwnProperty)(e,v,S)}else l.length?E=(0,Qn.or)(...l.map(v=>(0,Qn._)`${S} === ${v}`)):E=Qn.nil;return u.length&&(E=(0,Qn.or)(E,...u.map(v=>(0,Qn._)`${(0,Ff.usePattern)(n,v)}.test(${S})`))),(0,Qn.not)(E)}function m(S){e.code((0,Qn._)`delete ${s}[${S}]`)}function T(S){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){m(S);return}if(t===!1){n.setParams({additionalProperty:S}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,Bf.alwaysValidSchema)(o,t)){let E=e.name("valid");c.removeAdditional==="failing"?(g(S,E,!1),e.if((0,Qn.not)(E),()=>{n.reset(),m(S)})):(g(S,E),a||e.if((0,Qn.not)(E),()=>e.break()))}}function g(S,E,v){let b={keyword:"additionalProperties",dataProp:S,dataPropType:Bf.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(b,E)}}};wb.default=OV});var tC=w(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var AV=gc(),ZD=On(),kb=he(),eC=Eb(),IV={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&eC.default.code(new AV.KeywordCxt(i,eC.default,"additionalProperties"));let o=(0,ZD.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=kb.mergeEvaluated.props(e,(0,kb.toHash)(o),i.props));let a=o.filter(d=>!(0,kb.alwaysValidSchema)(i,t[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,ZD.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),n.it.definedProperties.add(d),n.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Nb.default=IV});var iC=w(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var nC=On(),Uf=ae(),rC=he(),sC=he(),$V={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,data:r,parentSchema:s,it:i}=n,{opts:o}=i,a=(0,nC.allSchemaProperties)(t),c=a.filter(g=>(0,rC.alwaysValidSchema)(i,t[g]));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 Uf.Name)&&(i.props=(0,sC.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let g of a)l&&m(g),i.allErrors?T(g):(e.var(u,!0),T(g),e.if(u))}function m(g){for(let S in l)new RegExp(g).test(S)&&(0,rC.checkStrictMode)(i,`property ${S} matches pattern ${g} (use allowMatchingProperties)`)}function T(g){e.forIn("key",r,S=>{e.if((0,Uf._)`${(0,nC.usePattern)(n,g)}.test(${S})`,()=>{let E=c.includes(g);E||n.subschema({keyword:"patternProperties",schemaProp:g,dataProp:S,dataPropType:sC.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,Uf._)`${d}[${S}]`,!0):!E&&!i.allErrors&&e.if((0,Uf.not)(u),()=>e.break())})})}}};Pb.default=$V});var oC=w(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var MV=he(),LV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:e,schema:t,it:r}=n;if((0,MV.alwaysValidSchema)(r,t)){n.fail();return}let s=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};Rb.default=LV});var aC=w(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var qV=On(),xV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:qV.validateUnion,error:{message:"must match a schema in anyOf"}};Db.default=xV});var cC=w(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Vf=ae(),jV=he(),FV={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,Vf._)`{passingSchemas: ${n.passing}}`},BV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:FV,code(n){let{gen:e,schema:t,parentSchema:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");n.setParams({passing:a}),e.block(l),n.result(o,()=>n.reset(),()=>n.error(!0));function l(){i.forEach((u,d)=>{let f;(0,jV.alwaysValidSchema)(s,u)?e.var(c,!0):f=n.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Vf._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Vf._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&n.mergeEvaluated(f,Vf.Name)})})}}};Cb.default=BV});var lC=w(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var UV=he(),VV={keyword:"allOf",schemaType:"array",code(n){let{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,UV.alwaysValidSchema)(r,i))return;let a=n.subschema({keyword:"allOf",schemaProp:o},s);n.ok(s),n.mergeEvaluated(a)})}};Ob.default=VV});var fC=w(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var Wf=ae(),dC=he(),WV={message:({params:n})=>(0,Wf.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Wf._)`{failingKeyword: ${n.ifClause}}`},HV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:WV,code(n){let{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,dC.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=uC(r,"then"),i=uC(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),n.reset(),s&&i){let u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,Wf.not)(a),l("else"));n.pass(o,()=>n.error(!0));function c(){let u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function l(u,d){return()=>{let f=n.subschema({keyword:u},a);e.assign(o,a),n.mergeValidEvaluated(f,o),d?e.assign(d,(0,Wf._)`${u}`):n.setParams({ifClause:u})}}}};function uC(n,e){let t=n.schema[e];return t!==void 0&&!(0,dC.alwaysValidSchema)(n,t)}Ab.default=HV});var hC=w(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var KV=he(),zV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,KV.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};Ib.default=zV});var pC=w($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var GV=gb(),YV=HD(),JV=yb(),XV=zD(),QV=GD(),ZV=jf(),e2=QD(),t2=Eb(),n2=tC(),r2=iC(),s2=oC(),i2=aC(),o2=cC(),a2=lC(),c2=fC(),l2=hC();function u2(n=!1){let e=[s2.default,i2.default,o2.default,a2.default,c2.default,l2.default,e2.default,t2.default,ZV.default,n2.default,r2.default];return n?e.push(YV.default,XV.default):e.push(GV.default,JV.default),e.push(QV.default),e}$b.default=u2});var mC=w(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var ot=ae(),d2={message:({schemaCode:n})=>(0,ot.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,ot._)`{format: ${n}}`},f2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:d2,code(n,e){let{gen:t,data:r,$data:s,schema:i,schemaCode:o,it:a}=n,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():m();function f(){let T=t.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=t.const("fDef",(0,ot._)`${T}[${o}]`),S=t.let("fType"),E=t.let("format");t.if((0,ot._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(S,(0,ot._)`${g}.type || "string"`).assign(E,(0,ot._)`${g}.validate`),()=>t.assign(S,(0,ot._)`"string"`).assign(E,g)),n.fail$data((0,ot.or)(v(),b()));function v(){return c.strictSchema===!1?ot.nil:(0,ot._)`${o} && !${E}`}function b(){let R=u.$async?(0,ot._)`(${g}.async ? await ${E}(${r}) : ${E}(${r}))`:(0,ot._)`${E}(${r})`,O=(0,ot._)`(typeof ${E} == "function" ? ${R} : ${E}.test(${r}))`;return(0,ot._)`${E} && ${E} !== true && ${S} === ${e} && !${O}`}}function m(){let T=d.formats[i];if(!T){v();return}if(T===!0)return;let[g,S,E]=b(T);g===e&&n.pass(R());function v(){if(c.strictSchema===!1){d.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function b(O){let L=O instanceof RegExp?(0,ot.regexpCode)(O):c.code.formats?(0,ot._)`${c.code.formats}${(0,ot.getProperty)(i)}`:void 0,V=t.scopeValue("formats",{key:i,ref:O,code:L});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,ot._)`${V}.validate`]:["string",O,V]}function R(){if(typeof T=="object"&&!(T instanceof RegExp)&&T.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ot._)`await ${E}(${r})`}return typeof S=="function"?(0,ot._)`${E}(${r})`:(0,ot._)`${E}.test(${r})`}}}};Mb.default=f2});var gC=w(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var h2=mC(),p2=[h2.default];Lb.default=p2});var yC=w($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.contentVocabulary=$o.metadataVocabulary=void 0;$o.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];$o.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var vC=w(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var m2=PD(),g2=BD(),y2=pC(),b2=gC(),bC=yC(),v2=[m2.default,g2.default,(0,y2.default)(),b2.default,bC.metadataVocabulary,bC.contentVocabulary];qb.default=v2});var jb=w(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.dynamicAnchor=void 0;var xb=ae(),T2=Cn(),TC=bc(),_2=Af(),S2={keyword:"$dynamicAnchor",schemaType:"string",code:n=>_C(n,n.schema)};function _C(n,e){let{gen:t,it:r}=n;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,xb._)`${T2.default.dynamicAnchors}${(0,xb.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:w2(n);t.if((0,xb._)`!${s}`,()=>t.assign(s,i))}Ac.dynamicAnchor=_C;function w2(n){let{schemaEnv:e,schema:t,self:r}=n.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new TC.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return TC.compileSchema.call(r,l),(0,_2.getValidate)(n,l)}Ac.default=S2});var Fb=w(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.dynamicRef=void 0;var SC=ae(),E2=Cn(),wC=Af(),k2={keyword:"$dynamicRef",schemaType:"string",code:n=>EC(n,n.schema)};function EC(n,e){let{gen:t,keyword:r,it:s}=n;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),n.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,SC._)`${E2.default.dynamicAnchors}${(0,SC.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,wC.callRef)(n,c),t.let(l,!0)}):()=>(0,wC.callRef)(n,c)}}Ic.dynamicRef=EC;Ic.default=k2});var kC=w(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var N2=jb(),P2=he(),R2={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,N2.dynamicAnchor)(n,""):(0,P2.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};Bb.default=R2});var NC=w(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var D2=Fb(),C2={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,D2.dynamicRef)(n,n.schema)};Ub.default=C2});var PC=w(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var O2=jb(),A2=Fb(),I2=kC(),$2=NC(),M2=[O2.default,A2.default,I2.default,$2.default];Vb.default=M2});var DC=w(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var RC=jf(),L2={keyword:"dependentRequired",type:"object",schemaType:"object",error:RC.error,code:n=>(0,RC.validatePropertyDeps)(n)};Wb.default=L2});var CC=w(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var q2=jf(),x2={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,q2.validateSchemaDeps)(n)};Hb.default=x2});var OC=w(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var j2=he(),F2={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:e,it:t}){e.contains===void 0&&(0,j2.checkStrictMode)(t,`"${n}" without "contains" is ignored`)}};Kb.default=F2});var AC=w(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var B2=DC(),U2=CC(),V2=OC(),W2=[B2.default,U2.default,V2.default];zb.default=W2});var $C=w(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var Ns=ae(),IC=he(),H2=Cn(),K2={message:"must NOT have unevaluated properties",params:({params:n})=>(0,Ns._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`},z2={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:K2,code(n){let{gen:e,schema:t,data:r,errsCount:s,it:i}=n;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Ns.Name?e.if((0,Ns._)`${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,n.ok((0,Ns._)`${s} === ${H2.default.errors}`);function c(d){if(t===!1){n.setParams({unevaluatedProperty:d}),n.error(),o||e.break();return}if(!(0,IC.alwaysValidSchema)(i,t)){let f=e.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:IC.Type.Str},f),o||e.if((0,Ns.not)(f),()=>e.break())}}function l(d,f){return(0,Ns._)`!${d} || !${d}[${f}]`}function u(d,f){let m=[];for(let T in d)d[T]===!0&&m.push((0,Ns._)`${f} !== ${T}`);return(0,Ns.and)(...m)}}};Gb.default=z2});var LC=w(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var li=ae(),MC=he(),G2={message:({params:{len:n}})=>(0,li.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,li._)`{limit: ${n}}`},Y2={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:G2,code(n){let{gen:e,schema:t,data:r,it:s}=n,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,li._)`${r}.length`);if(t===!1)n.setParams({len:i}),n.fail((0,li._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,MC.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,li._)`${o} <= ${i}`);e.if((0,li.not)(c),()=>a(c,i)),n.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{n.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:MC.Type.Num},c),s.allErrors||e.if((0,li.not)(c),()=>e.break())})}}};Yb.default=Y2});var qC=w(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var J2=$C(),X2=LC(),Q2=[J2.default,X2.default];Jb.default=Q2});var jC=w(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DiscrError=void 0;var xC;(function(n){n.Tag="tag",n.Mapping="mapping"})(xC||(Hf.DiscrError=xC={}))});var BC=w(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var Mo=ae(),Xb=jC(),FC=bc(),Z2=yc(),eW=he(),tW={message:({params:{discrError:n,tagName:e}})=>n===Xb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,Mo._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},nW={keyword:"discriminator",type:"object",schemaType:"object",error:tW,code(n){let{gen:e,data:t,schema:r,parentSchema:s,it:i}=n,{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,Mo._)`${t}${(0,Mo.getProperty)(a)}`);e.if((0,Mo._)`typeof ${l} == "string"`,()=>u(),()=>n.error(!1,{discrError:Xb.DiscrError.Tag,tag:l,tagName:a})),n.ok(c);function u(){let m=f();e.if(!1);for(let T in m)e.elseIf((0,Mo._)`${l} === ${T}`),e.assign(c,d(m[T]));e.else(),n.error(!1,{discrError:Xb.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(m){let T=e.name("valid"),g=n.subschema({keyword:"oneOf",schemaProp:m},T);return n.mergeEvaluated(g,Mo.Name),T}function f(){var m;let T={},g=E(s),S=!0;for(let R=0;R<o.length;R++){let O=o[R];if(O?.$ref&&!(0,eW.schemaHasRulesButRef)(O,i.self.RULES)){let V=O.$ref;if(O=FC.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,V),O instanceof FC.SchemaEnv&&(O=O.schema),O===void 0)throw new Z2.default(i.opts.uriResolver,i.baseId,V)}let L=(m=O?.properties)===null||m===void 0?void 0:m[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);S=S&&(g||E(O)),v(L,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return T;function E({required:R}){return Array.isArray(R)&&R.includes(a)}function v(R,O){if(R.const)b(R.const,O);else if(R.enum)for(let L of R.enum)b(L,O);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(R,O){if(typeof R!="string"||R in T)throw new Error(`discriminator: "${a}" values must be unique strings`);T[R]=O}}}};Qb.default=nW});var UC=w((GZ,rW)=>{rW.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 VC=w((YZ,sW)=>{sW.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 WC=w((JZ,iW)=>{iW.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 HC=w((XZ,oW)=>{oW.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 KC=w((QZ,aW)=>{aW.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 zC=w((ZZ,cW)=>{cW.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 GC=w((e5,lW)=>{lW.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 YC=w(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var uW=UC(),dW=VC(),fW=WC(),hW=HC(),pW=KC(),mW=zC(),gW=GC(),yW=["/properties"];function bW(n){return[uW,dW,fW,hW,e(this,pW),mW,e(this,gW)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,r){return n?t.$dataMetaSchema(r,yW):r}}Zb.default=bW});var JC=w((Ge,tv)=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.MissingRefError=Ge.ValidationError=Ge.CodeGen=Ge.Name=Ge.nil=Ge.stringify=Ge.str=Ge._=Ge.KeywordCxt=Ge.Ajv2019=void 0;var vW=SD(),TW=vC(),_W=PC(),SW=AC(),wW=qC(),EW=BC(),kW=YC(),ev="https://json-schema.org/draft/2019-09/schema",Lo=class extends vW.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(_W.default),TW.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(SW.default),this.addVocabulary(wW.default),this.opts.discriminator&&this.addKeyword(EW.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(kW.default.call(this,e),this.refs["http://json-schema.org/schema"]=ev)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ev)?ev:void 0)}};Ge.Ajv2019=Lo;tv.exports=Ge=Lo;tv.exports.Ajv2019=Lo;Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=Lo;var NW=gc();Object.defineProperty(Ge,"KeywordCxt",{enumerable:!0,get:function(){return NW.KeywordCxt}});var qo=ae();Object.defineProperty(Ge,"_",{enumerable:!0,get:function(){return qo._}});Object.defineProperty(Ge,"str",{enumerable:!0,get:function(){return qo.str}});Object.defineProperty(Ge,"stringify",{enumerable:!0,get:function(){return qo.stringify}});Object.defineProperty(Ge,"nil",{enumerable:!0,get:function(){return qo.nil}});Object.defineProperty(Ge,"Name",{enumerable:!0,get:function(){return qo.Name}});Object.defineProperty(Ge,"CodeGen",{enumerable:!0,get:function(){return qo.CodeGen}});var PW=Ef();Object.defineProperty(Ge,"ValidationError",{enumerable:!0,get:function(){return PW.default}});var RW=yc();Object.defineProperty(Ge,"MissingRefError",{enumerable:!0,get:function(){return RW.default}})});var Oe=G(Uw());var mu=class n{constructor(e,t,r,s){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(let r of e)if(n.isIncremental(r)){let s=Ww(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=Vw(r.text,!1,i);if(c-a===u.length)for(let f=0,m=u.length;f<m;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,m=l.length;f<m;f++)l[f]=l[f]+d}else if(n.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Vw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,s=t.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);t[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],s=e.line+1<t.length?t[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 t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},gu;(function(n){function e(s,i,o,a){return new mu(s,i,o,a)}n.create=e;function t(s,i,o){if(s instanceof mu)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(s,i){let o=s.getText(),a=Yp(i.map(WI),(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("")}n.applyEdits=r})(gu||(gu={}));function Yp(n,e){if(n.length<=1)return n;let t=n.length/2|0,r=n.slice(0,t),s=n.slice(t);Yp(r,e),Yp(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?n[a++]=r[i++]:n[a++]=s[o++];for(;i<r.length;)n[a++]=r[i++];for(;o<s.length;)n[a++]=s[o++];return n}function Vw(n,e,t=0){let r=e?[t]:[];for(let s=0;s<n.length;s++){let i=n.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<n.length&&n.charCodeAt(s+1)===10&&s++,r.push(t+s+1))}return r}function Ww(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function WI(n){let e=Ww(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var yu=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],bu=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Hw=G(X());var Jp=(n,e,t=!0,r=!0)=>({start:{line:n?.pos.line??0,character:t?n?.pos.col??0:(n?.pos.col??0)+(n?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}}),oe=n=>Jp(n.tokenIndexes.start,n.tokenIndexes.end),Kw=" ",zw=n=>{Kw=n},ji=()=>Kw,xs=n=>yu.findIndex(e=>e===n),js=n=>bu.findIndex(e=>e===n),hn=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),Gw=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),Yw=(n,e,t)=>{if(!n)return!1;let s=n.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var rr=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>hn(i,e,t));return r},A=(n,e,t=Hw.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a}),Jw=n=>[...n].sort((t,r)=>{if(t.sortKey===void 0||r.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==r.sortKey)return t.sortKey-r.sortKey;if(!t.tokenIndexes?.end||!r.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==r.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-r.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-r.tokenIndexes.end.pos.col});async function Ot(n,e,t,r){let s=n.textDocument.uri.replace("file://",""),i=await Fs(e,s,r);if(!i)return[];console.time("search");let a=(await i.context.getRuntime()).getDeepestAstNode(s,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===s?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function J(n,e){return{start:n,end:e??n}}var q=(n,e)=>n?.tokens.some(t=>t===e),Xe=n=>e=>e?.value&&n===e.value?"yes":HI(n)(e),Pe=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",HI=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Nr=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,pn=(n,e)=>!!n&&!!e&&Nr(n,e)&&n.pos.col+n.pos.len===e.pos.col,vu=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),Fs=async(n,e,t)=>(await vu(n)).sort(s=>s.context.name===t?-1:0).find(s=>s.files.some(i=>i===e)),Xw=async(n,e)=>(await vu(n)).filter(r=>r.files.some(s=>s===e));var Fi=G(X()),B=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=oe(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=oe(this);return[{location:Fi.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Fi.SymbolKind.File||t.kind===Fi.SymbolKind.Class||t.kind===Fi.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(xs(this.semanticTokenType),js(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Bi=G(X());var nE=G(X());var Qw=G(X()),lt=class extends B{constructor(t,r){super(r);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Qw.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var eE=G(X());var Zw=G(X());var sr=class extends B{toJson(){return-1}},ia=class extends sr{constructor(t,r){super();this.expression=t;this.join=r;this.addChild(t),r&&(this.addChild(r.operator),this.addChild(r.expression))}addExpression(t,r){this.addChild(t),this.addChild(r)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var wt=class extends sr{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:Zw.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}toJson(){return this.value}};var ut=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:eE.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(t=>t.value instanceof wt)){let t=new ArrayBuffer(8),r=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}};var tE=G(X()),Qr=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:tE.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}};var Fe=class extends B{constructor(t,r){super(r);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Qe=class extends B{constructor(t,r=[]){super();this.propertyName=t;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:nE.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof lt?t.value.value:t.value instanceof ut?t.value.values.map(r=>r.value instanceof wt?r.value.value:NaN):t.value instanceof Qr?t.value.values.map(r=>r.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var rE=G(X()),ir=class extends B{constructor(t,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:t,kind:rE.SymbolKind.Function}}};var En=class extends ir{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var He=class extends ir{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var Be=class n extends B{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Ht)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof En)}addNodeChild(e){this.addChild(e)}},Ht=class extends Be{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Bi.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Qe)}get deleteProperties(){return this.children.filter(e=>e instanceof He)}get nodes(){return this.children.filter(e=>e instanceof we)}get pathName(){return"/"}},Et=class extends Be{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Bi.SymbolKind.Class},t.forEach(r=>{super.addChild(r)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Bi.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof we)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Qe)}get deleteProperties(){return this.children.filter(t=>t instanceof He)}},we=class n extends Be{constructor(t=[],r){super();this.labels=t;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Bi.SymbolKind.Class},r&&this.addChild(r),t.forEach(s=>{this.addChild(s)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Bi.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Qe)}get deleteProperties(){return this.children.filter(t=>t instanceof He)}},Tu=class extends B{constructor(t,r){super(r);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address.toString(16)}},$e=class extends B{constructor(t,r,s){super(r);this.name=t;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(t){if(this._address)throw new Error("Address can only be set once");t&&(this.lastToken=void 0,this._address=t,t.forEach(r=>this.addChild(r)))}toString(){return this._address!==void 0?`${this.name}@${this._address.map(t=>t.toString()).join(",")}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(xs("type"),js("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{t(xs("decorator"),js("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var sE=G(X()),Ee=class extends B{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:sE.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var ar=G(X());var bt=n=>n instanceof ir?!0:n instanceof Be?!1:n.parentNode?bt(n.parentNode):!1;var Ui=n=>[...n.filter(t=>t instanceof we||t instanceof Et).map(t=>t instanceof we?t.name:t.labelReference)].filter(t=>!!t);var ft=G(X());var iE=G(X());var Pr=class extends B{constructor(){super();this._pathParts=[]}addPath(t,r){this._pathParts.push(t),r&&this.addChild(r),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},Fn=class extends B{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:iE.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}};var et=G(X());var _u=G(X());var oE=require("path"),Zr=class extends B{constructor(t,r){super();this.keyword=t;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:_u.SymbolKind.File},this.addChild(t),this.addChild(r)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:_u.SymbolKind.File},this._reolvedPath=t}},Vi=class extends B{constructor(t,r,s){super(s);this._path=t;this.relative=r;this.docSymbolsMeta={name:(0,oE.basename)(this.path),kind:_u.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var or=class extends B{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var KI=async(n,e,t)=>{let r=et.Position.create(n.pos.line,n.pos.col),s=t.find(i=>hn(i,e,r));if(s)return rr(s,e,r)},Xp=n=>{if(n)return n instanceof Be?n:Xp(n?.parentNode)},Hi=(n,e,t=0)=>!e||e.uri!==n?t:Hi(n,Xp(e.parentNode),t+1),zI=(n,e)=>async t=>{let r=await KI(t.firstToken,e,n);return!r||r===t||t.allDescendants.some(i=>i===r)?0:r instanceof Be?Hi(e,Xp(r)):void 0};async function aE(n,e){let t=[],r=n.textDocument.uri.replace("file://",""),s=(await e.getRuntime()).fileTopMostAst(r);return t.push(...(await Promise.all(s.flatMap(async i=>await cE(n,i,r,zI(s,r))))).flat()),t}var Bs=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return et.TextEdit.replace(et.Range.create(et.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),et.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
|
|
183
|
+
`))}},Wi=(n,e,t,r="")=>{if(n.pos.line===n.prevToken?.pos.line)return et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,n.pos.col),et.Position.create(n.pos.line,n.pos.col)),`
|
|
184
|
+
${r}${"".padStart(e*t.length,t)}`)},es=(n,e,t,r="")=>et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,0),et.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${r}`),dt=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let r=Bs(n.nextToken,0);if(!r)throw new Error("remove new LinesEdit must be defined");return[et.TextEdit.insert(et.Position.create(n.pos.line,n.pos.col+n.pos.len),"".padEnd(e," ")),r]}return n.nextToken.pos.col-(n.pos.col+n.pos.len)===e?[]:[et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,n.pos.col+n.pos.len),et.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},GI=async(n,e,t,r,s,i)=>{if(e.uri!==t)return[];let o=[],a=Wi(e.firstToken,r,s);if(a)o.push(a);else{o.push(es(e.firstToken,r,s));let l=Bs(e.firstToken);l&&o.push(l)}if(e instanceof we||e instanceof Et)if(o.push(...e.labels.flatMap(l=>dt(l.lastToken))),e instanceof we){let l=e.name&&e.openScope?dt(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?dt(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>cE(n,l,t,i,r+1)))).flat()),e.closeScope){let l=Wi(e.closeScope,r,s);if(l)o.push(l);else{o.push(es(e.closeScope,r,s));let u=Bs(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?dt(e.lastToken.prevToken,0):[];return o.push(...c),o},YI=(n,e,t,r)=>{let s=[];if(s.push(...dt(n.lastToken,r?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let i=Bs(n.firstToken);i&&s.push(i),s.push(es(n.firstToken,e+1,t))}return n.value,s},JI=(n,e,t,r)=>{let s=[];return n instanceof ut||n instanceof Qr?(n.openBracket&&s.push(...dt(n.openBracket,0)),s.push(...n.values.flatMap((i,o)=>YI(i,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&s.push(...dt(n.closeBracket,0))):n?.lastToken&&r&&s.push(...dt(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),s},XI=(n,e,t,r)=>{let s=[];return s.push(...n.startLabels.flatMap((i,o)=>o+1===n.startLabels.length?[]:dt(i.lastToken))),s.push(...JI(n.value,e,t,!r||n.endLabels.length>0)),s.push(...n.endLabels.flatMap((i,o)=>o+1===n.endLabels.length?[]:dt(i.lastToken))),s},QI=(n,e,t)=>{let r=[],s=i=>{if(i&&hn(n,n.uri,et.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return n.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)r.push(...dt(a,1));else if(c?.firstToken){let l=Bs(c?.firstToken);l&&r.push(l),r.push(es(c?.firstToken,e+1,t))}}}),[...r,...n.values.flatMap((i,o)=>i?XI(i,e,t,o+1===n.values.length):[])]},ZI=(n,e,t)=>{let r=[],s=Wi(n.firstToken,e,t);if(s)r.push(s);else{r.push(es(n.firstToken,e,t));let o=Bs(n.firstToken);o&&r.push(o)}if(r.push(...n.labels.flatMap(o=>dt(o.lastToken))),n.values){if(n.propertyName){r.push(...dt(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&r.push(...dt(a))}r.push(...QI(n.values,e,t))}let i=n.lastToken.value===";"&&n.lastToken.prevToken?dt(n.lastToken.prevToken,0):[];return r.push(...i),r},e$=(n,e,t)=>{let r=[],s=Wi(n.firstToken,e,t);s?r.push(s):r.push(es(n.firstToken,e,t));let i=dt(n.keyword.lastToken);r.push(...i);let o=n.lastToken.value===";"&&n.lastToken.prevToken?dt(n.lastToken.prevToken,0):[];return r.push(...o),r},t$=(n,e,t,r)=>{if(t===void 0)return[];if(n.uri!==e)return[];let s=[],i=Wi(n.firstToken,t,r);i?s.push(i):s.push(es(n.firstToken,t,r));let o=dt(n.keyword.lastToken);return s.push(...o),s},n$=(n,e,t)=>{let r=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&r.push(...dt(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return r.push(...dt(n.firstToken.prevToken)),r;if(e===void 0)return r;let s=n.firstToken.value.startsWith("*")?" ":"",i=Wi(n.firstToken,e,t,s);if(i)r.push(i);else{r.push(es(n.firstToken,e,t,s));let o=Bs(n.firstToken);o&&r.push(o)}return r},cE=async(n,e,t,r,s=0)=>{let i=n.options.tabSize,a=n.options.insertSpaces?"".padStart(i," "):" ";return zw(a),e instanceof Be?GI(n,e,t,s,a,r):e instanceof Qe?ZI(e,s,a):e instanceof ir?e$(e,s,a):e instanceof Zr?t$(e,t,await r(e),a):e instanceof or?n$(e,await r(e),a):[]};var Y=class{constructor(e,t,r="optional",s=void 0,i=[],o){this.name=e;this.type=t;this.def=s;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:ft.MarkupKind.Markdown,value:[...this.description?["### Description",this.description.join(`
|
|
178
185
|
|
|
179
186
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
180
187
|
|
|
181
188
|
`)]:[]].join(`
|
|
182
|
-
`)});typeof
|
|
183
|
-
${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r),a=[],c=(l,u,d)=>{if(d??=r.ast,!(l.some(g=>g==u)||l.some(g=>g==5)&&(u===3||u===5)||l.some(g=>g==4)&&(u===1||u===2))){let g=[];l.forEach(_=>{switch(_){case 0:g.push(1);break;case 3:g.push(2);break;case 5:g.push(3);break;case 1:g.push(5);break;case 2:g.push(6);break;case 4:g.push(7);break}}),g.length&&a.push(A(g,d,et.DiagnosticSeverity.Error,[],[],[r.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,r.ast.values??r.ast,et.DiagnosticSeverity.Error,[],[],[i,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(p=>p!==u)&&a.push(A(3,r.ast.values?.values[d]??r.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,r.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,r.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,r.ast.propertyName??r.ast,et.DiagnosticSeverity.Error,(r.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[r.name])):o.length===1&&c(this.type[0].types,o[0],r.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(r)??[]),this.values(r).length&&this.type[0].types.some(l=>l===3))){let l=r.ast.values?.values[0]?.value;this.values(r).some(u=>l.value===u)||a.push(A(9,r.ast.values?.values[0]?.value??r.ast,et.DiagnosticSeverity.Error,[],[],[this.values(r).map(u=>`'${u}'`).join(" or ")]))}return a}validate(e,t){if(typeof this.name=="string"){let s=t.getProperty(this.name);return this.validateProperty(e,t,this.name,s)}let i=t.properties.filter(s=>this.getNameMatch(s.name)),r=t.nodeType?.properties.filter(s=>s!==this)??[];return i.filter(s=>r.some(o=>o.getNameMatch(s.name)))?[]:i.flatMap(s=>this.validateProperty(e,t,s.name,s))}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:`"${i}"`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):t?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:`<${i}>`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},aP=n=>n.ast.values?n.ast.values.values.map(e=>cP(e)):[0],cP=n=>n?n.value instanceof Tt?3:n.value instanceof ze?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof pe||n.value instanceof on?1:6:7,mc=class{constructor(){this._properties=[]}getIssue(e,t){let i=[],r=t.getProperty("status"),s=r?.ast.values?.values.at(0)?.value;return s instanceof Tt&&s.value==="disabled"?([...t.definitions,...t.referencedBy].forEach(o=>i.push(A(22,o,et.DiagnosticSeverity.Hint,[...r?.ast.parentNode?[r?.ast.parentNode]:[]],[et.DiagnosticTag.Unnecessary]))),i):[...i,...this.properties.flatMap(o=>o.validate(e,t))]}get properties(){return this._properties}addProperty(e){Array.isArray(e)?e.forEach(t=>this._properties.push(t)):this._properties.push(e),this._properties.sort(t=>typeof t.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(e){e&&(e.bindingsPath=this.bindingsPath,this._childNodeType=e)}getOnPropertyHover(e){let t=this.properties.find(i=>i.getNameMatch(e));return t?.onHover.bind(t)()}};var an=class extends ${constructor(t,i,r){super();this.startLabels=t;this.value=i;this.endLabels=r;this.startLabels.forEach(s=>{this.addChild(s)}),this.addChild(i),this.endLabels.forEach(s=>{this.addChild(s)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}};var wt=n=>{if(!n?.values.some(e=>!(e?.value instanceof ze)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Re=(n,e,t)=>{let i=n.ast.values?.values.at(e)?.value;if(i instanceof ze){let r=i.values.at(t);if(r?.value instanceof vt)return r.value.value}},cn=(n,e,t=0)=>{if(n instanceof an){if(n?.value instanceof ze){let i=n.value.values.at(t);if(i?.value instanceof vt)return e.getPhandle(i.value.value);if(i?.value instanceof pe)return i.value.linksTo;if(i?.value instanceof on)return i.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof vt)return e.getPhandle(n.value);if(n instanceof pe)return n.linksTo;if(n instanceof on)return n.path?.pathParts.at(-1)?.linksTo}},TT=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof ze){let i=t.values.at(0)?.value;if(i instanceof vt)return{cellsProperty:e,node:n,value:i.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var vT=()=>{let n=new K("compatible",V(5));return n.desctiption=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var ld=z(Q()),ST=()=>{let n=new K("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"optional":"omitted",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Tt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name])]}return[]});return n.desctiption=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var kT=()=>{let n=new K("#interrupt-cells",V(1));return n.desctiption=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var ET=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.desctiption=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var wT=()=>{let n=new K("interrupt-parent",V(1));return n.desctiption=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var NT=z(Q()),_T=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupt-parent"),s=i.root;return(r?cn(r?.ast.values?.values.at(0),s):i.parent)?t:r?(t.push(A(18,r.ast.values?.values.at(0)?.value??r.ast)),t):(t.push(A(16,e.ast,NT.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.desctiption=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Ar=z(Q()),PT=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupts");r&&t.push(A(15,r.ast,Ar.DiagnosticSeverity.Warning,[e.ast],[],[r.name,"is ignored when 'interrupts-extended' is used"]));let s=i.getProperty("interrupt-parent");s&&t.push(A(15,s.ast,Ar.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.root,a=wt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=cn(a[c],o);if(!l)return t.push(A(18,a[c],Ar.DiagnosticSeverity.Error)),t;let u=TT(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Ar.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Ar.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.desctiption=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var DT=()=>{let n=new K("dma-noncoherent",V(0));return n.desctiption=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var RT=()=>{let n=new K("dma-coherent",V(0));return n.desctiption=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var CT=z(Q()),OT=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,CT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var AT=z(Q()),IT=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,AT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
189
|
+
`)});typeof r!="function"?this.required=()=>r:this.required=r,typeof i!="function"?this.values=()=>s&&i.indexOf(s)===-1?[s,...i]:i:this.values=i}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,r,s){let i=this.required(t);if(s){if(i==="omitted")return[A(11,s.ast,ft.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(i==="required"){let l=e.getOrderedNodeAst(t),u=Ui(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case 1:case 2:case 4:d=" = <>";break;case 3:case 5:d=' = ""';break;case 6:d=" = []";break}return[...l.map((f,m)=>{let T=f.openScope??u[m].lastToken;return A(0,u[m],ft.DiagnosticSeverity.Error,[],[],[r],ft.TextEdit.insert(ft.Position.create(T.pos.line,T.pos.col+1),`
|
|
190
|
+
${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=r$(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(m=>m==u)||l.some(m=>m==5)&&(u===3||u===5)||l.some(m=>m==4)&&(u===1||u===2))){let m=[];l.forEach(T=>{switch(T){case 0:m.push(1);break;case 3:m.push(2);break;case 5:m.push(3);break;case 1:m.push(5);break;case 2:m.push(6);break;case 4:m.push(7);break}}),m.length&&a.push(A(m,d,ft.DiagnosticSeverity.Error,[],[],[s.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,s.ast.values??s.ast,ft.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(A(3,s.ast.values?.values[d]??s.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,s.ast.propertyName??s.ast,ft.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(s)??[]),this.values(s).length&&this.type[0].types.some(l=>l===3))){let l=s.ast.values?.values[0]?.value;this.values(s).some(u=>l.value===u)||a.push(A(9,s.ast.values?.values[0]?.value??s.ast,ft.DiagnosticSeverity.Error,[],[],[this.values(s).map(u=>`'${u}'`).join(" or ")]))}return a}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(r=>r===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(r=>({label:`"${r}"`,kind:ft.CompletionItemKind.Variable,sortText:r===this.def?`A${r}`:`Z${r}`})):t?.types.some(r=>r===1||r===2)?this.values(e).map(r=>({label:`<${r}>`,kind:ft.CompletionItemKind.Variable,sortText:r===this.def?`A${r}`:`Z${r}`})):[]}},r$=n=>n.ast.values?n.ast.values.values.map(e=>s$(e)):[0],s$=n=>n?n.value instanceof lt?3:n.value instanceof ut?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof Ee||n.value instanceof Fn?1:6:7,oa=class{},Ki=class extends oa{constructor(){super(...arguments);this._properties=[]}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof lt&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(A(22,c,ft.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[ft.DiagnosticTag.Unnecessary]))),s;let a=this.properties.flatMap(c=>{if(typeof c.name=="string"){let d=r.getProperty(c.name);return c.validateProperty(t,r,c.name,d)}let l=r.property.filter(d=>c.getNameMatch(d.name)),u=this.properties.filter(d=>d!==c)??[];return l.filter(d=>u.some(f=>f.getNameMatch(d.name)))?[]:l.flatMap(d=>c.validateProperty(t,r,d.name,d))});return[...s,...a]}get properties(){return this._properties}addProperty(t){Array.isArray(t)?t.forEach(r=>this._properties.push(r)):this._properties.push(t),this._properties.sort(r=>typeof r.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(t){t&&(t.bindingsPath=this.bindingsPath,this._childNodeType=t)}getOnPropertyHover(t){let r=this.properties.find(s=>s.getNameMatch(t));return r?.onHover.bind(r)()}getPropertyListCompletionItems(t){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(t)!=="omitted"&&typeof r.name=="string").map(r=>{let s=t&&r.required(t),i=!!t.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:ft.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var Bn=class extends B{constructor(t,r,s,i){super();this.startLabels=t;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(t=>t.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Kt=n=>{if(!n?.values.some(e=>!(e?.value instanceof ut)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Ue=(n,e,t)=>{let r=n.ast.values?.values.at(e)?.value;if(r instanceof ut){let s=r.values.at(t);if(s?.value instanceof wt)return s.value.value}},Un=(n,e,t=0)=>{if(n instanceof Bn){if(n?.value instanceof ut){let r=n.value.values.at(t);if(r?.value instanceof wt)return e.getPhandle(r.value.value);if(r?.value instanceof Ee)return r.value.linksTo;if(r?.value instanceof Fn)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof wt)return e.getPhandle(n.value);if(n instanceof Ee)return n.linksTo;if(n instanceof Fn)return n.path?.pathParts.at(-1)?.linksTo}},lE=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof ut){let r=t.values.at(0)?.value;if(r instanceof wt)return{cellsProperty:e,node:n,value:r.value}}return{cellsProperty:e,node:n}},H=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var uE=()=>{let n=new Y("compatible",H(5));return n.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."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var zi=G(X()),dE=()=>{let n=new Y("device_type",H(3),void 0,void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof lt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,zi.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,zi.DiagnosticSeverity.Error,[],[],[e.name])]}return[A(14,e.ast,zi.DiagnosticSeverity.Hint,[],[zi.DiagnosticTag.Deprecated],[e.name])]});return n.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."],n};var fE=()=>{let n=new Y("#interrupt-cells",H(1));return n.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var hE=()=>{let n=new Y("interrupt-controller",H(0),"optional");return n.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var pE=()=>{let n=new Y("interrupt-parent",H(1));return n.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."],n};var mE=G(X()),gE=()=>{let n=new Y("interrupts",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupt-parent"),i=r.root;return(s?Un(s?.ast.values?.values.at(0),i):r.parent)?t:s?(t.push(A(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(A(16,e.ast,mE.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.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."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Gi=G(X()),yE=()=>{let n=new Y("interrupts-extended",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupts");s&&t.push(A(15,s.ast,Gi.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=r.getProperty("interrupt-parent");i&&t.push(A(15,i.ast,Gi.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=r.root,a=Kt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=Un(a[c],o);if(!l)return t.push(A(18,a[c],Gi.DiagnosticSeverity.Error)),t;let u=lE(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Gi.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Gi.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.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."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var bE=()=>{let n=new Y("dma-noncoherent",H(0));return n.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."],n};var vE=()=>{let n=new Y("dma-coherent",H(0));return n.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."],n};var TE=G(X()),_E=()=>{let n=new Y("dma-ranges",H([0,4]),"optional",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ue(s,0,0)??1:1,c=i?Ue(i,0,0)??2:2,l=o?Ue(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(A(20,r.at(r.length-r.length%(c+l+a))??e.ast,TE.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.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)."],n};var SE=G(X()),wE=()=>{let n=new Y("ranges",H([0,4]),"optional",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ue(s,0,0)??1:1,c=i?Ue(i,0,0)??2:2,l=o?Ue(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(A(20,r.at(r.length-r.length%(c+l+a))??e.ast,SE.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.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."],n.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
184
191
|
compatible = "simple-bus";
|
|
185
192
|
#address-cells = <1>;
|
|
186
193
|
#size-cells = <1>;
|
|
@@ -195,7 +202,7 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
|
|
|
195
202
|
};
|
|
196
203
|
};`,"```"].join(`
|
|
197
204
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
198
|
-
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var
|
|
205
|
+
`),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var EE=()=>{let n=new Y("virtual-reg",H(1));return n.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."],n};var Su=G(X()),kE=()=>{let n=new Y("reg",H(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r)return[];let s=e.parent.parent?.getProperty("#size-cells"),i=e.parent.parent?.getProperty("#address-cells"),o=s?Ue(s,0,0)??1:1,a=i?Ue(i,0,0)??2:2;if(r.length===0||r.length%(o+a)!==0)return t.push(A(20,r.at(r.length-r.length%(o+a))??e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<r.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);r.slice(0,a).map((d,f)=>Ue(e,0,f)??0).forEach((d,f)=>{u.setUint32(f*4,d)}),e.parent.address&&e.parent.address?.length>1?e.parent.address?.forEach((d,f)=>{u.getUint32(f*4)!==d&&t.push(A(10,e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name]))}):e.parent.address?.length===1&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address[0])||a===1&&u.getUint32(0)!==e.parent.address[0])&&t.push(A(10,e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var NE=()=>new Y("#size-cells",H(1),"optional",1);var PE=()=>{let n=new Y("#address-cells",H(1),"optional",2);return n.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."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
|
|
199
206
|
#address-cells = <1>;
|
|
200
207
|
#size-cells = <1>;
|
|
201
208
|
serial@4600 {
|
|
@@ -206,8 +213,8 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
|
|
|
206
213
|
interrupt-parent = <&ipic>;
|
|
207
214
|
};
|
|
208
215
|
};`,"```"].join(`
|
|
209
|
-
`),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var
|
|
210
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var
|
|
216
|
+
`),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var RE=()=>{let n=new Y("status",H(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.description=[`The status property indicates the operational status of a device.
|
|
217
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var DE=G(X()),CE=()=>{let n=new Y("phandle",H(1),"optional",void 0,[],e=>{let t=Ue(e,0,0);if(t){let r=e.parent.root.getAllPhandle(t);if(r.length>1&&r.at(-1)===e.parent)return[A(19,e.ast.values?.values.at(0)??e.ast,DE.DiagnosticSeverity.Error,r.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[e.name])]}return[]});return n.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."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
|
|
211
218
|
phandle = <1>;
|
|
212
219
|
interrupt-controller;
|
|
213
220
|
reg = <0x10000000 0x100>;
|
|
@@ -215,18 +222,29 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
|
|
|
215
222
|
`),"A phandle value of 1 is defined. Another device node could reference the pic node with a phandle value of 1:",["```devicetree",`another-device-node {
|
|
216
223
|
interrupt-parent = <1>;
|
|
217
224
|
};`,"```"].join(`
|
|
218
|
-
`)],n};var UT=()=>{let n=new K("model",V(3));return n.desctiption=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var gc=z(Q()),$T=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[A(14,e.ast,gc.DiagnosticSeverity.Warning,[],[gc.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var ui=z(Q());var WT=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=e.parent.root,s=wt(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#address-cells"),a=i.getProperty("#interrupt-cells");if(o||t.push(A(16,e.ast,ui.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),a||t.push(A(16,e.ast,ui.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)return t;let c=0;for(;c<s.length;){let l=Re(o,0,0),u=Re(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,s.length<c+1){let R=l+u+1;t.push(A(21,s[s.length-1],ui.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}let p=cn(s[c],r);if(!p){t.push(A(18,s[c],ui.DiagnosticSeverity.Error));break}let g=p.getProperty("#address-cells"),_=p.getProperty("#interrupt-cells");if(g||t.push(A(16,s[c],ui.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),_||t.push(A(16,s[c],ui.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)break;c++;let y=Re(g,0,0),w=Re(_,0,0);if(y==null||w==null)break;if(c+=y+w,s.length<c){let R=l+u+1+y+w;t.push(A(21,s[s.length-1],ui.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:y},()=>"ParentUnitAddress"),...Array.from({length:w},()=>"ParentInterruptSpecifier")].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Re(o,0,0),p=Re(a,0,0);if(d==null||p==null||!(u.value instanceof ze))return t}return t});return n.desctiption=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var VT=()=>{let n=new K("interrupt-map-mask",V(4));return n.desctiption=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Ir=z(Q()),HT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],i=[],r=e.parent,s=e.parent.root,o=r.getProperty(`#${t}-cells`);if(!o)return i.push(A(16,e.ast,Ir.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;let a=Re(o,0,0);if(a==null)return i;let c=wt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let _=a+1;i.push(A(21,c[c.length-1],Ir.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}let d=cn(c[l],s);if(!d){i.push(A(18,c[l],Ir.DiagnosticSeverity.Error));break}let p=d.getProperty(`#${t}-cells`);if(!p)return i.push(A(16,c[l],Ir.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;l++;let g=Re(p,0,0);if(g==null)break;if(l+=g,c.length<l){let _=a+1+g;i.push(A(21,c[c.length-1],Ir.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentSpecifier")].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}u=l}return i});return n.desctiption=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var YT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.desctiption=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var KT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.desctiption=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var zT=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.desctiption=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function fi(){let n=new mc;return n.addProperty([vT(),UT(),jT(),FT(),qT(),MT(),xT(),LT(),IT(),OT(),RT(),DT(),$T(),ST(),_T(),wT(),PT(),kT(),ET(),WT(),VT(),HT(),YT(),KT(),zT()]),n}var be=class{constructor(e,t,i,r=null){this.bindingLoader=e;this.name=t;this.address=i;this.parent=r;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[fi()];r?.addNode(this)}get nodeTypes(){let e=this.parent?.nodeTypes.at(0)?.childNodeType;return e?[e]:this._nodeTypes??[fi()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return dc([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let i=[...this.definitions,...this.referencedBy].find(r=>qt(r,e,t));if(i){let r=this.deletes.map(c=>({item:this,ast:Tn(c,e,t)})).find(c=>qt(c.ast,e,t));if(r)return r;let s=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>c.ast.lastToken.value===";"?qt(c.ast,e,t):rT(c.ast,e,t));if(s)return s.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Tn(i,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof he).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.properties.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.properties.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.properties.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof he),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:En.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[t instanceof he?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get properties(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(i=>i.name===e&&i.address===t)}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,i){let r=this._nodes.findIndex(s=>s.name===e&&i===s.address);r!==-1&&(this._deletedNodes.push({node:this._nodes[r],by:t}),this._nodes.splice(r,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof ze){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]}return this._nodes.flatMap(i=>i.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof ze){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return this}return this._nodes.flatMap(i=>i.getPhandle(e)).find(i=>!!i)}getNode(e,t,i=!0){let r=i||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!r||o.address===t));if(s!==-1)return this._nodes[s]}deleteProperty(e,t){let i=this._properties.findIndex(r=>r.name===e);i!==-1&&(this._deletedProperties.push({property:this._properties[i],by:t}),this._properties.splice(i,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(i=>i.name===e.name);if(t===-1)this._properties.push(e);else{let i=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=i,i.replacedBy=e}e.name==="compatible"&&(this._nodeTypes=this.bindingLoader?.getNodeTypes(this)??[fi()])}getChild(e,t=!0){let i=[...e];i.splice(0,1);let r=i[0].split("@"),s=r[0],o=r[1]!==void 0?Number.parseInt(r[1],16):void 0,a=this.getNode(s,o,t);return i.length===1||!a?a:a.getChild(i)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let i=[...e];return i.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!t(s.by)).map(s=>s.node)].find(s=>s.fullName===i[0])?.getChildFromScope(i,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.properties.length?`
|
|
219
|
-
`:""}${this.
|
|
225
|
+
`)],n};var OE=()=>{let n=new Y("model",H(3));return n.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.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var wu=G(X()),AE=()=>{let n=new Y("name",H(3),"optional",void 0,[],e=>[A(14,e.ast,wu.DiagnosticSeverity.Warning,[],[wu.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var Yi=G(X());var IE=()=>{let n=new Y("interrupt-map",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=e.parent.root,i=Kt(e.ast.values);if(!i?.length)return[];let o=r.getProperty("#address-cells"),a=r.getProperty("#interrupt-cells");if(!a)return t.push(A(16,e.ast,Yi.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`])),t;let c=0;for(;c<i.length;){let l=o?Ue(o,0,0):2,u=Ue(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,i.length<c+1){let E=l+u+1;t.push(A(21,i[i.length-1],Yi.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((i.length-d)%E===0?E:(i.length-d)%E).join(" ")}`]));break}let f=Un(i[c],s);if(!f){t.push(A(18,i[c],Yi.DiagnosticSeverity.Error));break}let m=f.getProperty("#address-cells"),T=f.getProperty("#interrupt-cells");if(!T){t.push(A(16,i[c],Yi.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`]));break}c++;let g=m?Ue(m,0,0):2,S=Ue(T,0,0);if(g==null||S==null)break;if(c+=g+S,i.length<c){let E=l+u+1+g+S;t.push(A(21,i[i.length-1],Yi.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentUnitAddress"),...Array.from({length:S},()=>"ParentInterruptSpecifier")].slice((i.length-d)%E===0?E:(i.length-d)%E).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Ue(o,0,0),f=Ue(a,0,0);if(d==null||f==null||!(u.value instanceof ut))return t}return t});return n.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."],n};var $E=()=>{let n=new Y("interrupt-map-mask",H(4));return n.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."],n};var Ji=G(X()),ME=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),H(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],r=[],s=e.parent,i=e.parent.root,o=s.getProperty(`#${t}-cells`);if(!o)return r.push(A(16,e.ast,Ji.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;let a=Ue(o,0,0);if(a==null)return r;let c=Kt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let T=a+1;r.push(A(21,c[c.length-1],Ji.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%T===0?T:(c.length-u)%T).join(" ")}`]));break}let d=Un(c[l],i);if(!d){r.push(A(18,c[l],Ji.DiagnosticSeverity.Error));break}let f=d.getProperty(`#${t}-cells`);if(!f)return r.push(A(16,c[l],Ji.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;l++;let m=Ue(f,0,0);if(m==null)break;if(l+=m,c.length<l){let T=a+1+m;r.push(A(21,c[c.length-1],Ji.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:m},()=>"ParentSpecifier")].slice((c.length-u)%T===0?T:(c.length-u)%T).join(" ")}`]));break}u=l}return r});return n.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."],n.list=!0,n};var LE=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),H(4));return n.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."],n};var qE=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),H(4));return n.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."],n};var xE=()=>{let n=new Y(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),H(1));return n.list=!0,n.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function ts(){let n=new Ki;return n.addProperty([uE(),OE(),CE(),RE(),PE(),NE(),kE(),EE(),wE(),_E(),vE(),bE(),AE(),dE(),gE(),pE(),yE(),fE(),hE(),IE(),$E(),ME(),LE(),qE(),xE()]),n}var ke=class n{constructor(e,t,r,s=null){this.bindingLoader=e;this.name=t;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[ts()];s?.addNode(this)}static toJson(e){let t={};return e.property.forEach(r=>t[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>t[r.fullName]=n.toJson(r)),t}get nodeTypes(){let e=this.parent?.nodeType?.childNodeType;return e?[e]:this._nodeTypes??[ts()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return Ui([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let r=[...this.definitions,...this.referencedBy].find(s=>hn(s,e,t));if(r){let s=this.deletes.map(c=>({item:this,ast:rr(c,e,t)})).find(c=>hn(c.ast,e,t));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=>c.ast.lastToken.value===";"?hn(c.ast,e,t):Gw(c.ast,e,t));if(i)return i.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=rr(r,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof we).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(){return[...this.property.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:ar.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[ar.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:ar.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[ar.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof we),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:ar.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[ar.DiagnosticTag.Deprecated],templateStrings:[t instanceof we?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}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,t){return this._nodes.some(r=>r.name===e&&(r.address===t||r.address?.every((s,i)=>t?.at(i)===s)))}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,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:t}),this._nodes.splice(s,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof ut){let r=t.values[0].value;if(r instanceof wt&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof ut){let r=t.values[0].value;if(r instanceof wt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,t,r=!0){let s=r||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===t||o.address?.every((a,c)=>t?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,t){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:t}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(r=>r.name===e.name);if(t===-1)this._properties.push(e);else{let r=this._properties.splice(t,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=[ts()])}getChild(e,t=!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,t);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,t){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=>!t(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.property.length?`
|
|
226
|
+
`:""}${this.property.map(e=>e.toString()).join(`
|
|
220
227
|
`)}${this.nodes.length?`
|
|
221
228
|
${this.nodes.map(e=>`${e.fullName}{ /* ... */ };`).join(`
|
|
222
229
|
`)}`:""}
|
|
223
|
-
};`}toMarkupContent(){return{kind:
|
|
224
|
-
`)}}};var
|
|
230
|
+
};`}toMarkupContent(){return{kind:ar.MarkupKind.Markdown,value:["### Current State","```devicetree",this.toString(),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
|
|
231
|
+
`)}}};var ku=G(X());var Qp=G(X());var ns=class extends B{constructor(t,r){super(r);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:Qp.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},ht=class extends B{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value,kind:Qp.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let r=this.parentNode;if(!(r instanceof Ee&&r.linksTo)){super.buildSemanticTokens(t);return}t(xs("type"),js("declaration"),{start:this.firstToken,end:this.lastToken})}};var pt=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){return{item:this,ast:rr(this.ast,e,t)}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof ns)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[{issues:[0],severity:ku.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[ku.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var FE=G(X());var Pu=require("fs");var Nu=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
225
232
|
`,`
|
|
226
|
-
`).split(/\n/).map(
|
|
233
|
+
`).split(/\n/).map(r=>`${r}
|
|
227
234
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
228
|
-
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let i=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,i===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let i=this._tokens.at(-1);return t&&!i?.tokens.some(r=>r===21)&&i&&i.pos.len<e.length?this.process(e.slice(i.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},i=this._tokens.at(-1);t.prevToken=i,i&&(i.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let i=this.lineNumber,r=this.columnNumber,s=this.getString(t[0]);return this.pushToken({tokens:[21],value:s,pos:{col:r-1,line:i,len:s.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var GT,dd=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(i=>({...i}));return t.forEach((i,r)=>{i.prevToken=t[r-1],i.nextToken=t[r+1]}),t}renewLexer(e,t){if(!e||!(0,vc.existsSync)(e))return[];try{t??=(0,vc.readFileSync)(e).toString();let i=new Tc(t,e);return this.fileMap.set(e,i),n.clone(i.tokens)}catch{}return[]}requestTokens(e,t){let i=this.fileMap.get(e)?.tokens;return!i&&t?[...this.renewLexer(e)]:n.clone(i??[])}};function hi(){return GT??=new dd,GT}var Sc=class n{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new be(this.context.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(i=>n.getFileTopMostAst(i,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let r=this.fileTopMostAst(e).find(s=>qt(s,e,t)||sT(hi().requestTokens(e,!1),s,t));if(r instanceof rt){let o=this.rootNode.getReferenceBy(r)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Tn(r,e,t)}}else if(r instanceof Ft&&r.path){let s=this.rootNode.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r instanceof he&&r.path){let s=n.getNodeFromPath(r.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r)return{runtime:this,item:null,ast:Tn(r,e,t)}}static getNodeFromPath(e,t){if(e.length===0)return t;let i=e[0].split("@"),r=i[0],s=i.at(1),o=s?Number.parseInt(s,16):void 0,a=e.slice(1),c=t.getNode(r,o);return c?n.getNodeFromPath(a,c):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let i=this.labelsUsedCache.get(e[0].slice(1));return i||(t??=this.rootNode.allDescendantsLabels,t.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof De)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(i=>{t.has(i.label.label.value)?t.get(i.label.label.value)?.push(i):t.set(i.label.label.value,[i])}),Array.from(t).forEach(i=>{let r=i[1];if(r.length>1){let s=r.find(a=>a.owner instanceof be);if(!r.every(a=>a&&a.owner===s?.owner)||!s){let a=r.filter(c=>!(c&&c.owner===s?.owner));e.push(A(4,r.at(0).label,XT.DiagnosticSeverity.Error,r.slice(1).map(c=>c.label),[],[r.at(0).label.label.value]))}}}),e}get typesIssues(){if(this.typeIssueCache)return this.typeIssueCache;let e=t=>[...t.nodeTypes.at(0)?.getIssue(this,t)??[],...t.nodes.flatMap(i=>e(i))];return this.typeIssueCache=e(this.rootNode),this.typeIssueCache}getOrderedNodeAst(e){return oT([...e.definitions,...e.referencedBy])}};var st=class extends ${constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var QT=z(Q()),kc=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:QT.SymbolKind.String},this.values.forEach(i=>this.addChild(i))}};var JT=z(Q()),Ec=class extends ${constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:JT.SymbolKind.Function}}};var wn=class extends ${constructor(t,i){super();this.value=t;this.labels=i;this.labels.forEach(r=>{this.addChild(r)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var hd=z(Q());var wc=class extends vn{constructor(t,i,r){super(i);this.value=t;this.docSymbolsMeta={name:`param${r+1}`,kind:hd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Nc=class extends vn{constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:hd.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var ZT=z(Q());var Lr=class extends vn{constructor(t,i){super(i);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:ZT.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var _c=class extends ${constructor(t,i){super(i);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var pi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{if(this.currentToken?.pos.line!==e)return;let i=this.currentToken,r=i;for(;this.currentToken?.pos.line===e;)r=this.moveToNextToken;if(t){let s=new $(G(i,r));this._issues.push(A(22,s))}return r};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this._issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this._issues.length&&this._issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(i=>{let r=this.currentToken,s=i(r),o=!1;return s!=="no"&&r&&(t.push(r),this.moveToNextToken,o=Bn(r,this.currentToken)),s==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],i,r=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&r);)t.push(this.currentToken),i=this.currentToken,this.moveToNextToken,r=Bn(i,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let i=[],r=(s,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;i.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(r)}),i.sort((s,o)=>s.line===o.line?s.char-o.char:s.line-o.line).forEach(s=>e.push(s.line,s.char,s.length,s.tokenType,s.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(Se));if(!e.length){this.popStack();return}let t=e.map(r=>r.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Lr(t,G(e[0],e.at(-1)));return this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,i;if(M(e,40)?(i="&",M(this.currentToken,40)&&(i="&&",t=this.moveToNextToken)):M(e,10)?(i="!",M(this.currentToken,0)&&(i="==",t=this.moveToNextToken)):M(e,8)?(i="|",M(this.currentToken,8)&&(i="||",t=this.moveToNextToken)):M(e,9)?i="^":M(e,4)?(i=">",M(this.currentToken,4)?(i="<<",t=this.moveToNextToken):M(this.currentToken,0)&&(i=">=",t=this.moveToNextToken)):M(e,5)?(i=">",M(this.currentToken,5)?(i=">>",t=this.moveToNextToken):M(this.currentToken,0)&&(i="<=",t=this.moveToNextToken)):M(e,15)?i="+":M(e,16)?i="-":M(e,17)?i="*":M(e,13)?i="/":M(e,18)?i="%":M(e,46)&&M(this.currentToken,46)&&(i="##",t=this.moveToNextToken),i){let r=new _c(i,G(e,t));return this.mergeStack(),r}this.popStack()}parseScopedBlock(e,t,i){this.enqueueToStack();let r=this.moveToNextToken;if(!r||!e(r)){this.popStack();return}let s=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(i?.(l)&&(o[o.length]=[]),l&&(s.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,i);u&&(s.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:r,items:s,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var pd=require("fs"),xr=require("path");var Dc=class n extends pi{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let i=0;i<this.tokens.length;i++){let r=n.processBlockComments(this.tokens,i)||n.processLineComments(this.tokens,i);r&&(i=r.index,t.push(...r.tokenUsed),this.comments.push(...r.comments))}t.reverse().forEach(i=>this.tokens.splice(i,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=hi().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,i){let r=[],s=()=>(r.push(i++),t[i]),o=()=>t[i],a=()=>t[i-1],c=o(),l=c;if(!c||!M(c,13)||(l=s(),!M(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!M(a(),17)||!M(o(),13)||!Bn(a(),o())),d=l.pos.line,p=c,g=[];l=s();do{if(o()?.pos.line!==d){let y=new kn(G(p,a()));g.push(y),d=o().pos.line??0,p=o()}l=s()}while(i<t.length&&!u());let _=new kn(G(p,o()));return g.push(_),s(),{comments:g,tokenUsed:r,index:i-1}}static processLineComments(t,i){let r=[];if(!M(t[i],13)||t.length===i+1||!M(t[i+1],13)||!Bn(t[i],t[i+1]))return;let s=[];for(;t[i].pos.line===t.at(i+1)?.pos.line;)r.push(i++);r.push(i++);let o=t[r.at(-1)],a=new kn(G(t[r[0]],t[r.at(-1)]));return s.push(a),{comments:s,tokenUsed:r,index:i-1}}};var Rc=class extends ${constructor(t,i){super(t);this.content=i}toString(){let t=this.content.filter(i=>!M(i,14));return t.map((i,r)=>{let s=i.value;return i.pos.line===t.at(r+1)?.pos.line?s=s.padEnd(t[r+1].pos.col-i.pos.col," "):t.at(r+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Cc=class extends ${constructor(t,i,r){super();this.keyword=t;this.identifier=i;this.content=r;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Lr?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var ev=z(Q());var Oc=class extends st{toString(){return"..."}},Ac=class extends ${constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:ev.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Cs=class extends ${constructor(e){super(e)}},Ic=class extends ${constructor(t,i){super();this.keyword=t;this.content=i;this.addChild(t)}},Os=class extends Ic{constructor(t,i,r){super(t,r);this.identifier=i;this.addChild(i),this.addChild(r)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Lc=class extends Os{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},xc=class extends Ic{};var Mc=class extends ${constructor(t,i,r){super();this.ifDef=t;this.endIf=i;this.elseOption=r;this.addChild(t),r&&this.addChild(r),this.addChild(i)}getInValidTokenRange(t,i){let r=[],s=a=>i.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];r.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&r.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(r.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&r.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&r.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),r}};var tv=z(Q()),qc=class n extends pi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.macros=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(r).forEach(([s,o])=>this.macroSnapShot.set(s,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,i])=>this.macros.set(t,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(i=>{t.then(()=>{this.reset(),this.parse().then(i)})}),this.parsing}async parse(){let t=new Dc(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),this.prevToken&&this.prevToken.pos.line===this.currentToken?.pos.line){this.moveEndOfLine(this.prevToken.pos.line,!1),this.mergeStack();return}let t=this.currentToken?.pos.line,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();t!==void 0&&this.moveEndOfLine(t,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken;if(!i||!M(i,25))return this.popStack(),!1;let r=new st(G(i)),s=this.isFunctionDefinition()||this.processCIdentifier();if(!s)return this._issues.push(A(30,r)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Rc(G(o[0],o.at(-1)),o));let c=new Cc(r,s,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],i=this.prevToken;for(;Fn(i,this.currentToken)||i&&M(i,14)&&i.pos.line+1===this.currentToken?.pos.line;)i=this.moveToNextToken,i&&t.push(i);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.moveToNextToken;if(!M(i,42)){this.popStack();return}let r=[],s=this.processCIdentifier()||this.processVariadic();for(;s;)r.push(s),!M(this.currentToken,24)&&!M(this.currentToken,43)?this._issues.push(A(28,s)):M(this.currentToken,43)||(i=this.moveToNextToken),s=this.processCIdentifier()||this.processVariadic();let o=new Ac(t,r);return M(this.currentToken,43)?(i=this.moveToNextToken,o.lastToken=i):(o.lastToken=this.prevToken,this._issues.push(A(26,r.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Se(45),Se(45),Se(45)]);if(t.length!==3){this.popStack();return}let i=new Oc(G(t[0],t.at(-1)));return this.mergeStack(),i}processIfDefBlocks(){let t=this.peekIndex(),i=this.parseScopedBlock(r=>{let s=this.getTokenIndex(r)-1;return!!r&&[33,34].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[37].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[36].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)});if(i&&(M(i.startToken,33)||M(i.startToken,34))){let r;M(i.startToken,33)?r=this.processIfDefBlock(i,(o,a,c)=>new Os(o,a??null,c)):r=this.processIfDefBlock(i,(o,a,c)=>new Lc(o,a??null,c)),this.nodes.push(r),r.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,i){this.enqueueToStack();let r=new st(G(t.startToken)),s=new st(G(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this._issues.push(A(31,r));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new Cs(G(this.currentToken,this.tokens[a])),l=i(r,o??null,c),u;if(t.splitTokens.length>1){let p=this.getTokenIndex(t.splitTokens[1][0]),g=new st(G(this.tokens[p])),_=new Cs(G(this.tokens[p+1],t.splitTokens[1].at(-1)));u=new xc(g,_)}let d=new Mc(l,s,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,xr.resolve)((0,xr.dirname)(t.uri),t.path.path),...this.incudes.map(i=>(0,xr.resolve)(i,t.path.path))].find(i=>(0,pd.existsSync)(i)):this.incudes.map(i=>(0,xr.resolve)(i,t.path.path)).find(i=>(0,pd.existsSync)(i))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),i=this.currentToken;if(!i)return this.popStack(),!1;let r=i,s=i;if(M(i,26))this.moveToNextToken;else{let y=this.checkConcurrentTokens([Se(13),Ve("include"),Se(13)]);if(y.length!==3)return this.popStack(),!1;r=y[0],s=y.at(-1)}let o=r?.pos.line,a=new st(G(r,s));i=this.moveToNextToken;let c=i,l=!!M(i,21);if(!c||!l&&!M(i,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=i?.value??"";else for(;this.currentToken?.pos.line===o&&!M(this.currentToken,4);)u+=this.currentToken?.value??"",i=this.moveToNextToken;let d=new Cr(u,l,G(c,i)),p=new ci(a,d);this.dtsIncludes.push(p),l||(this.currentToken?.pos.line!==o||!M(this.currentToken,4)?this._issues.push(A(12,p)):(i=this.moveToNextToken,d.lastToken=i)),this.mergeStack();let g=this.peekIndex(),_=this.resolveInclude(p);if(p.reolvedPath=_,_||this._issues.push(A(36,p.path,tv.DiagnosticSeverity.Warning)),_&&!_.endsWith(".h")){hi().requestTokens(_,!0);let y=new n(_,this.incudes,this.macros);await y.stable,this.tokens.splice(t,g-t,...y.tokens),this.nodes.push(...y.nodes),this.dtsIncludes.push(...y.dtsIncludes)}else this.tokens.splice(t,g-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var As=class extends pi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.tokens=[];this.others=[];this.rootDocument=new De;this.unhandledStatements=new Ft;this.cPreprocessorParser=new qc(this.uri,this.incudes,r)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new De,this._issues=[],this.unhandledStatements=new Ft}async reparse(){let t=performance.now(),i=this.stable;return this.parsing=new Promise(r=>{i.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),r()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let i=async()=>{if(!(this.isDtsDocumentVersion()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let r=this.moveToNextToken;if(r){let s=new $(G(r));this._issues.push(A(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await i();if(this.unhandledStatements.properties.forEach(r=>{this._issues.push(A(32,r))}),this.unhandledStatements.deleteProperties.forEach(r=>{this._issues.push(A(33,r))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let i=this.moveToNextToken,r=i,s=13;if(!i||!M(i,s))return this.popStack(),!1;if(r=this.moveToNextToken,s=2,!r||!M(r,s))return this.popStack(),!1;let o=new Ft;o.openScope=r,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??r;return o.firstToken=i,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let i=this.currentToken;if(M(i,3))this.moveToNextToken;else{let r=this.prevToken;if(r){let s=new $(G(r));this._issues.push(A(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return M(this.currentToken,3)||M(this.currentToken,1)}endStatement(t=!0){let i=this.currentToken;if(!M(i,1)){let r=this.prevToken;if(r&&t){let s=new $(G(this.prevToken));return this._issues.push(A(1,s)),r}}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;M(this.currentToken,1);){let t=this.moveToNextToken;if(t){let i=new $(G(t));this._issues.push(A(23,i))}}}processNode(t,i){if(this.done)return!1;let r=!1,s=!1;do{if(s=this.isChildNode(t,i)||this.isProperty(t)||this.isDeleteNode(t,i)||this.isDeleteProperty(t),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new $(G(o));this._issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;r=r||s}while(!this.isNodeEnd());return r}processOptionalLabelAssign(t=!1){let i=[],r=this.isLabelAssign(t);for(;r;)i.push(r),r=this.isLabelAssign(t);return i}isChildNode(t,i){this.enqueueToStack();let r;i==="Name"&&(r=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=i==="Ref"?new rt(s):new he(s,r);if(i==="Ref"?a=this.isLabelRef():i==="Name"&&(o=this.isNodeName()),!a&&!o){if(!M(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(A(i==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof rt?(c.labelReference=a,l=!0):o&&c instanceof he&&(l=o.address!==void 0,c.name=o),M(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Se));if(!t.length){this.popStack();return}let i=t.map(o=>o.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=this.checkConcurrentTokens([Se(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(Se)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new ke(i,G(t[0],o.at(-1)??t.at(-1)),a);if(!Bn(t.at(-1),r[0])){let l=new $(G(t.at(-1),r[0]));this._issues.push(A(29,l))}if(Number.isNaN(a)&&this._issues.push(A(8,c)),!Number.isNaN(a)&&!Bn(r.at(-1),o[0])){let l=new $(G(r[0],o.at(0)));this._issues.push(A(29,l))}return this.mergeStack(),c}let s=new ke(i,G(t[0],t.at(-1)));return this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Se));if(!t.length){this.popStack();return}let i=new Pe(t.map(r=>r.value).join(""),G(t[0],t.at(-1)));return this.mergeStack(),i}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Se));if(!t.length){this.popStack();return}let i=t.map(s=>s.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=new Xe(i,G(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(Se));if(!i.length){this.popStack();return}let r=i.map(c=>c.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&M(s,50),a=new di(new Xe(r,G(i[0],i.at(-1))),G(i[0],o?s:i.at(-1)));if(o){let c=i.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.col+c.pos.len)&&this._issues.push(A(29,new $(G(c,s)))),this.moveToNextToken}else if(t)this._issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(),r=this.isPropertyName();if(!r)return this.popStack(),!1;if(M(this.currentToken,2)||M(this.currentToken,49))return this.popStack(),!1;let s=new Me(r,i),o;M(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this._issues.push(A(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,t.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Se(13),Ve("d"),Ve("ts"),Se(16),Ve("v"),Ve("1")]);if(!t.length)return this.popStack(),!1;let i=t[0],r=i;if(t.length===1&&!M(this.currentToken,2))return this.popStack(),!1;if(t.length!==6)return this.popStack(),!1;let s=new st;s.firstToken=i;let o=new Ec(s);if(this.others.push(o),M(this.currentToken,13))r=this.moveToNextToken;else return s.lastToken=t.at(-1),this._issues.push(A(21,o)),this.mergeStack(),!0;return s.lastToken=r,o.lastToken=this.endStatement(),this.mergeStack(),!0}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Se(13),Ve("omit"),Se(16),Ve("if"),Se(16),Ve("no"),Se(16),Ve("ref"),Se(13)]);if(t.length!==9){this.popStack();return}let i=new st(G(t[0],t.at(-1)));return this.mergeStack(),i}isDeleteNode(t,i){this.enqueueToStack();let r=this.checkConcurrentTokens([Se(13),Ve("d"),Ve("e"),Ve("lete"),Se(16),Ve("node")]);if(!r.length)return this.popStack(),!1;let s=r[0],o=s,a=new st;if(a.firstToken=s,r.length===1&&!M(this.currentToken,2)){this._issues.push(A(25,a)),a.lastToken=r.at(-1);let d=new zt(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=r.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=r.at(-1),c!=="/delete-node"?this._issues.push(A(c.startsWith("/delete-n")?34:25,a)):M(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(A(21,a));let l=new zt(a);if(Fn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&i==="Name"&&this._issues.push(A(7,d));let p=d?void 0:this.isLabelRef();p&&i==="Name"&&this._issues.push(A(7,p));let g=d||p?void 0:this.isNodeName();g&&i==="Ref"&&this._issues.push(A(10,g)),!d&&!g&&!p&&this._issues.push(A([7,10],l)),l.nodeNameOrRef=d??p??g??null}else i==="Name"?this._issues.push(A(7,a)):i==="Ref"&&this._issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let i=this.checkConcurrentTokens([Se(13),Ve("d"),Ve("e"),Ve("lete"),Se(16),Ve("property")]);if(!i.length)return this.popStack(),!1;let r=i[0],s=r,o=new st;if(o.firstToken=r,i.length===1&&!M(this.currentToken,2)){this._issues.push(A(25,o)),o.lastToken=i.at(-1);let u=new Ae(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=i.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=i.at(-1),a!=="/delete-property"?this._issues.push(A(a.startsWith("/delete-p")?35:25,o)):M(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(A(21,o));let c=new Ae(o);if(Fn(o.tokenIndexes?.end,r)){let u=this.isPropertyName();u||this._issues.push(A(6,c)),c.propertyName=u??null}else this._issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.processNodePathRef();if(!i){this.popStack();return}let r=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&r.push(...this.processOptionalLabelAssign(!0));let s=new an(t,i,r);return this.mergeStack(),s}processValue(t){this.enqueueToStack();let r=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!M(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=M(this.currentToken,24);d&&this.moveToNextToken;let p=o();if(u&&p===null&&d){let g=new $(G(u,this.currentToken));this._issues.push(A(0,g))}if(!d&&p===null)break;if(l&&!d&&p){let g=new $(G(l));this._issues.push(A(28,g))}c.push(p)}return c})();if(r.length===0){this.popStack();return}return this.mergeStack(),new kc(r)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken;if(!M(i,21)){this.popStack();return}if(!i?.value)throw new Error("Token must have value");let r=i.value;r.match(/["']$/)&&(r=r.slice(1,-1));let s=new Tt(r,G(i));i.value.match(/["']$/)||this._issues.push(A(i.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new an(t,s,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.currentToken;if(M(r,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues(t)??null;s.openBracket=r;let o=this.processOptionalLabelAssign(!0)??[],a=new an(i,s,o);M(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(A(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=r,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken,r=i;if(!M(r,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(A(15,u))});let a=new ai(s??[]);a.openBracket=r,a.values.length===0&&(a.firstToken=i,this._issues.push(A(14,a)));let c=new an(t,a,o);M(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let i=t(),r=[];if(!i)return this.popStack(),[];for(;i;)r=[...r,i],i=t();if(r){let s=t();s&&(r=[...r,s])}return this.mergeStack(),r}processArrayValues(t){this.enqueueToStack();let i=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new ze(i);return i.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processHex();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ve("0"),Ve("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(Se));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(o=>o.value).join(""),16),s=new vt(r,G(t[0],i.at(-1)));return this.mergeStack(),s}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.checkConcurrentTokens([20,20].map(Se));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(a=>a.value).join(""),16),s=new vt(r,G(i[0],i.at(-1))),o=new wn(s,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processDec();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(Se));if(!t.length){this.popStack();return}let i=Number.parseInt(t.map(s=>s.value).join(""),10),r=new vt(i,G(t[0],t.at(-1)));return this.mergeStack(),r}processLabeledExpression(t=!0,i=t){this.enqueueToStack();let r=[];t&&(r=this.processOptionalLabelAssign(i));let s=this.processExpression();if(!s){this.popStack();return}let o=new wn(s,r);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.processMacroCallParams();if(!i){this.popStack();return}let r=new Nc(t,i);return this.mergeStack(),r}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.processExpression();if(!i){this.popStack();return}let r=this.processOptionalLabelAssign(!0),s=new an(t,i,r);return this.mergeStack(),s}processExpression(){this.enqueueToStack();let t=!1,i,r;M(this.currentToken,42)&&(t=!0,i=this.moveToNextToken,r=i);let s=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!s){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?s instanceof Ds?s.addExpression(o,a):s=new Ds(s,{operator:o,expression:a}):this._issues.push(A(27,o)),o=this.isOperator()}M(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(A(26,o??s))}return this.mergeStack(),s}processMacroCallParams(){return M(this.currentToken,42)?this.parseScopedBlock(r=>!!M(r,42),r=>!!M(r,43),r=>!!M(r,24))?.splitTokens.map((r,s)=>{if(r.length===0||M(r[0],24)&&r.length===1)return null;let o=s?r.slice(1):r;return new wc(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),G(o[0],o.at(-1)),s)}):void 0}isLabelRef(t){this.enqueueToStack();let i=this.currentToken;if(M(i,40))this.moveToNextToken;else{this.popStack();return}let r=this.isLabelName();if(!r){let o=new pe(null);return this._issues.push(A(18,t??o)),o.firstToken=i,this.mergeStack(),o}i&&(r.firstToken.pos.line!==i.pos.line||r.firstToken.pos.col!==i.pos.col+i.pos.len)&&this._issues.push(A(29,new $(G(i,r.firstToken))));let s=new pe(r);return s.firstToken=i,this.mergeStack(),s}isLabelRefValue(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.isLabelRef(t);if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new an(i,r,s);return this.mergeStack(),o}processRefValue(t,i){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.currentToken;if(!M(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new wn(o,r);return this.mergeStack(),l}let a=this.isLabelRef(i);if(a===void 0){this._issues.push(A([18,9],i));let l=new wn(null,r);return l.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),l}let c=new wn(a,r);return c.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(t=!0,i=new jn){this.enqueueToStack();let r;if(M(this.currentToken,13))r=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(A(19,new $(G(this.prevToken))))}let s=this.isNodeName();return s||this._issues.push(A(7,new $(G(r??this.prevToken)))),i.addPath(s??null,r?new $(G(r)):void 0),this.processNodePath(!1,i),this.mergeStack(),i}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,i=t;if(!M(i,40)){this.popStack();return}let r=this.moveToNextToken;if(i=r,!M(i,2)){this.popStack();return}let s=this.processNodePath(),o=new on(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&l.lastToken.pos.col+l.lastToken.pos.len!==c.pos.col){this._issues.push(A(29,new $(G(l.lastToken,c))));return}if(u===0&&r&&r.pos.col+r.pos.len!==l?.firstToken.pos.col){this._issues.push(A(29,new $(G(r,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&l.lastToken.pos.col+l.lastToken.pos.len!==d?.firstToken.pos.col&&this._issues.push(A(29,new $(G(l.lastToken,d?.firstToken))))}),M(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(A(3,new $(G(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof ci)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Mr=z(Q());var nv=require("fs"),iv=require("path");var qr=class{constructor(e,t,i,r=[],s){this.includePaths=t;this.bindingLoader=i;this._issues=[];this.overlays=[];this.overlays=Array.isArray(r)?r:[r],this.overlays.filter(nv.existsSync),this.parser=new As(e,t),this.name=s??(0,iv.basename)(e),this.overlayParsers=this.overlays?.map(o=>new As(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let r=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>s.ast.uri===e&&(!t||qt(s.ast,e,t))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof Tt&&l.compatible===o.value.value);return c?{range:ne(o.value),target:`file://${c.bindingsPath}`}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>s.uri===e&&(!t||qt(s,e,t))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:ne(s.path),target:`file://${o}`}}).filter(s=>s)??[],...r]}linkPropertiesLabelsAndNodePaths(e){let t=s=>[...s.properties,...s.nodes.flatMap(t)],i=t(e.rootNode),r=e.rootNode.allDescendantsLabels;i.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof pe){let a=e.resolvePath([`&${o.label?.value}`],r);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,Mr.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof jn){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let p=a?.getNode(d.name,d.address,!1);d.linksTo=p,!u&&!p&&(u=!0,this._issues.push(A(8,d,Mr.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(g=>g?.linksTo).map(g=>g?.toString()).join("/")}`]))),p?.linkedNodeNamePaths.push(d),a=p}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new Sc(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let i=0;i<this.overlayParsers.length;i++)this.processRoot(this.overlayParsers[i].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(i=>i instanceof kn),(await this.getAllParsers()).flatMap(i=>i.tokens).forEach((i,r)=>i.sortKey=r),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let i=0;i<e.children.length;i++){let r=e.children[i];this.processChild(r,t.rootNode,t)}}processChild(e,t,i){e instanceof De?this.processDtcBaseNode(e,t,i):e instanceof Me?this.processDtcProperty(e,t,i):e instanceof zt?this.processDeleteNode(e,t,i):e instanceof Ae&&this.processDeleteProperty(e,t,i)}checkNodeUniqueNames(e,t){let i=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address===a.address)),r=t.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof he&&o.name)i(s,o.name)&&this._issues.push(A(2,o.name)),s.push(o.name);else if(o instanceof zt&&o.nodeNameOrRef instanceof ke){let a=o.nodeNameOrRef;i(r,a)&&(s=s.filter(c=>i(s,c)))}})}processDtcBaseNode(e,t,i){e instanceof Ft?this.processDtcRootNode(e,i):e instanceof he?this.processDtcChildNode(e,t,i):e instanceof rt&&this.processDtcRefNode(e,i)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((i,r)=>i instanceof Me&&r instanceof Ae||r instanceof Me&&i instanceof Ae?0:r instanceof Me?1:0).forEach(i=>this.processChild(i,t.rootNode,t))}processDtcChildNode(e,t,i){if(e.name?.name){let r=e.path?i.resolvePath(e.path):void 0,o=(r?i.rootNode.getChild(r):void 0)??new be(this.bindingLoader,e.name.name,e.name.address,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,t,i))}processDtcRefNode(e,t){let i;if(e.labelReference){let r=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);r?(e.resolveNodePath??=[...r],i=t.rootNode.getChild(r),e.labelReference.linksTo=i,e.labels.forEach(s=>s.lastLinkedTo=i),i?.linkedRefLabels.push(e.labelReference),i?.referencedBy.push(e),e.labels.forEach(s=>{t.labelsUsedCache.set(s.label.value,r)}),i?(t.references.push(e),this.checkNodeUniqueNames(e,i)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,Mr.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,i??new be(this.bindingLoader,""),t))}processDtcProperty(e,t,i){e.propertyName?.name&&t.addProperty(new Qe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof ke&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let r=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address);e.nodeNameOrRef.linksTo=r,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address),r?.labels.forEach(s=>{i.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof pe&&e.nodeNameOrRef.value){let r=i.resolvePath([`&${e.nodeNameOrRef.value}`]),s;r?(s=i.rootNode.getChild(r),t.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{i.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)):(i.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,Mr.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof on&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(r=>!r)){let r=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=i.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let p=s?.getNode(d.name,d.address,!1);d.linksTo=p,p?.linkedNodeNamePaths.push(d),s=p}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(i.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,Mr.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{i.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)}else i.unlinkedDeletes.push(e);e.children.forEach(r=>this.processChild(r,t,i))}processDeleteProperty(e,t,i){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(r=>this.processChild(r,t,i))}};var ot=z(Q());var rv=require("fs"),Fr=require("path");function lP(n){if(!n||!(n.ast instanceof Cr))return[];let e=i=>i.flatMap(r=>(0,rv.readdirSync)(r,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,Fr.join)((0,Fr.relative)(r,s.parentPath),s.name)}`,kind:ot.CompletionItemKind.File})));if(n.ast.relative)return e([(0,Fr.dirname)(n.ast.uri)]);let t=n.runtime.context.includePaths;return e(t)}var Fc=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>Fc(t.node,e)),...n.nodes.flatMap(t=>Fc(t,e))],md=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>md(t.node,e)),...n.nodes.flatMap(t=>md(t,e))];function uP(n,e){if(!n||!(n.item instanceof Qe)||!(n.ast instanceof pe))return[];let t=i=>md(i,e);return Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Method}))}function fP(n,e){if(!n||n.item!==null||!(n.ast instanceof pe)||!(n.ast.parentNode instanceof rt))return[];let t=i=>Fc(i,e).filter(r=>e(r));return[...Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:i,insertText:`${i} {
|
|
235
|
+
`)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return t&&!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 t={...e,uri:this.uri},r=this._tokens.at(-1);t.prevToken=r,r&&(r.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,s=this.columnNumber,i=this.getString(t[0]);return this.pushToken({tokens:[21],value:i,pos:{col:s-1,line:r,len:i.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var jE,Zp=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(r=>({...r}));return t.forEach((r,s)=>{r.prevToken=t[s-1],r.nextToken=t[s+1]}),t}renewLexer(e,t){if(!e||!(0,Pu.existsSync)(e))return[];try{t??=(0,Pu.readFileSync)(e).toString();let r=new Nu(t,e);return this.fileMap.set(e,r),n.clone(r.tokens)}catch{}return[]}requestTokens(e,t){let r=this.fileMap.get(e)?.tokens;return!r&&t?[...this.renewLexer(e)]:n.clone(r??[])}};function rs(){return jE??=new Zp,jE}var Ru=class n{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}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(r=>n.getFileTopMostAst(r,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let s=this.fileTopMostAst(e).find(i=>hn(i,e,t)||Yw(rs().requestTokens(e,!1),i,t));if(s instanceof Et){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:rr(s,e,t)}}else if(s instanceof Ht&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof we&&s.path){let i=n.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:rr(s,e,t)}}static getNodeFromPath(e,t,r=!0){if(e.length===0)return t;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=t.getNode(i,a,r);return l?n.getNodeFromPath(c,l,r):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof Be)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{t.has(r.label.label.value)?t.get(r.label.label.value)?.push(r):t.set(r.label.label.value,[r])}),Array.from(t).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof ke);if(!s.every(a=>a&&a.owner===i?.owner)||!i){let a=s.filter(c=>!(c&&c.owner===i?.owner));e.push(A(4,s.at(0).label,FE.DiagnosticSeverity.Error,s.slice(1).map(c=>c.label),[],[s.at(0).label.label.value]))}}}),e}get typesIssues(){let e=t=>[...t.nodeType?.getIssue(this,t)??[],...t.nodes.flatMap(r=>e(r))];return e(this.rootNode)}getOrderedNodeAst(e){return Jw([...e.definitions,...e.referencedBy])}};var mt=class extends B{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var BE=G(X()),Du=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:BE.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(t=>t?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(t=>t?.toJson())}};var UE=G(X()),Cu=class extends B{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:UE.SymbolKind.Function}}};var cr=class extends B{constructor(t,r){super();this.value=t;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var em=G(X());var Ou=class extends sr{constructor(t,r,s){super(r);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:em.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Au=class extends sr{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:em.SymbolKind.Function,range:oe(this),selectionRange:oe(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var VE=G(X());var Xi=class extends sr{constructor(t,r){super(r);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:VE.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Iu=class extends B{constructor(t,r){super(r);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var ss=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||this.currentToken?.uri!==e.uri)return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(t){let o=new B(J(s,i));this._issues.push(A(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;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this._issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this._issues.length&&this._issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=pn(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=pn(r,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let r=[],s=(i,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;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(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!e.length){this.popStack();return}let t=e.map(s=>s.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let r=new Xi(t,J(e[0],e.at(-1)));return this.mergeStack(),r}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,r;if(q(e,40)?(r="&",q(this.currentToken,40)&&(r="&&",t=this.moveToNextToken)):q(e,10)?(r="!",q(this.currentToken,0)&&(r="==",t=this.moveToNextToken)):q(e,8)?(r="|",q(this.currentToken,8)&&(r="||",t=this.moveToNextToken)):q(e,9)?r="^":q(e,4)?(r=">",q(this.currentToken,4)?(r="<<",t=this.moveToNextToken):q(this.currentToken,0)&&(r=">=",t=this.moveToNextToken)):q(e,5)?(r=">",q(this.currentToken,5)?(r=">>",t=this.moveToNextToken):q(this.currentToken,0)&&(r="<=",t=this.moveToNextToken)):q(e,15)?r="+":q(e,16)?r="-":q(e,17)?r="*":q(e,13)?r="/":q(e,18)?r="%":q(e,46)&&q(this.currentToken,46)&&(r="##",t=this.moveToNextToken),r){let s=new Iu(r,J(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(r?.(l)&&(o[o.length]=[]),l&&(i.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,r);u&&(i.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:s,items:i,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var tm=require("fs"),Qi=require("path");var Mu=class n extends ss{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let r=0;r<this.tokens.length;r++){let s=n.processBlockComments(this.tokens,r)||n.processLineComments(this.tokens,r);s&&(r=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.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=rs().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,r){let s=[],i=()=>(s.push(r++),t[r]),o=()=>t[r],a=()=>t[r-1],c=o(),l=c;if(!c||!q(c,13)||(l=i(),!q(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!q(a(),17)||!q(o(),13)||!pn(a(),o())),d=l.pos.line,f=c,m=[];l=i();do{if(o()?.pos.line!==d){let g=new or(J(f,a()));m.push(g),d=o().pos.line??0,f=o()}l=i()}while(r<t.length&&!u());let T=new or(J(f,o()));return m.push(T),i(),{comments:m,tokenUsed:s,index:r-1}}static processLineComments(t,r){let s=[];if(!q(t[r],13)||t.length===r+1||!q(t[r+1],13)||!pn(t[r],t[r+1]))return;let i=[];for(;t[r].pos.line===t.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=t[s.at(-1)],a=new or(J(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var Lu=class extends B{constructor(t,r){super(t);this.content=r}toString(){let t=this.content.filter(r=>!q(r,14));return t.map((r,s)=>{let i=r.value;return r.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-r.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},qu=class extends B{constructor(t,r,s){super();this.keyword=t;this.identifier=r;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Xi?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var WE=G(X());var xu=class extends mt{toString(){return"..."}},ju=class extends B{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:WE.SymbolKind.Function,range:oe(this),selectionRange:oe(this),children:this.params.flatMap(r=>r.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var ca=class extends B{constructor(e){super(e)}},Fu=class extends B{constructor(t,r){super();this.keyword=t;this.content=r;this.addChild(t)}},la=class extends Fu{constructor(t,r,s){super(t,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Bu=class extends la{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Uu=class extends Fu{};var Vu=class extends B{constructor(t,r,s){super();this.ifDef=t;this.endIf=r;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)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(t);return!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}};var HE=G(X()),Wu=class n extends ss{constructor(t,r,s=new Map){super();this.uri=t;this.incudes=r;this.macros=s;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,r])=>this.macros.set(t,r)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(r=>{t.then(()=>{this.reset(),this.parse().then(r)})}),this.parsing}async parse(){let t=new Mu(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),!(!this.prevToken||this.prevToken.pos.line!==this.currentToken?.pos.line||this.prevToken.uri!==this.currentToken?.uri)){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,s=this.currentToken?.uri,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!q(r,25))return this.popStack(),!1;let s=new mt(J(r)),i=this.isFunctionDefinition()||this.processCIdentifier();if(!i)return this._issues.push(A(30,s)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Lu(J(o[0],o.at(-1)),o));let c=new qu(s,i,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],r=this.prevToken;for(;Nr(r,this.currentToken)||r&&q(r,14)&&r.pos.line+1===this.currentToken?.pos.line;)r=this.moveToNextToken,r&&t.push(r);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let r=this.moveToNextToken;if(!q(r,42)){this.popStack();return}let s=[],i=this.processCIdentifier()||this.processVariadic();for(;i;)s.push(i),!q(this.currentToken,24)&&!q(this.currentToken,43)?this._issues.push(A(28,i)):q(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier()||this.processVariadic();let o=new ju(t,s);return q(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(A(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(45),Pe(45),Pe(45)]);if(t.length!==3){this.popStack();return}let r=new xu(J(t[0],t.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let t=this.peekIndex(),r=this.parseScopedBlock(s=>{let i=this.getTokenIndex(s)-1;return!!s&&[33,34].some(o=>q(s,o))&&!Nr(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[37].some(o=>q(s,o))&&!Nr(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[36].some(o=>q(s,o))&&!Nr(this.tokens.at(i),s)});if(r&&(q(r.startToken,33)||q(r.startToken,34))){let s;q(r.startToken,33)?s=this.processIfDefBlock(r,(o,a,c)=>new la(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>new Bu(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)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,r){this.enqueueToStack();let s=new mt(J(t.startToken)),i=new mt(J(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this._issues.push(A(31,s));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new ca(J(this.currentToken,this.tokens[a])),l=r(s,o??null,c),u;if(t.splitTokens.length>1){let f=this.getTokenIndex(t.splitTokens[1][0]),m=new mt(J(this.tokens[f])),T=new ca(J(this.tokens[f+1],t.splitTokens[1].at(-1)));u=new Uu(m,T)}let d=new Vu(l,i,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,Qi.resolve)((0,Qi.dirname)(t.uri),t.path.path),...this.incudes.map(r=>(0,Qi.resolve)(r,t.path.path))].find(r=>(0,tm.existsSync)(r)):this.incudes.map(r=>(0,Qi.resolve)(r,t.path.path)).find(r=>(0,tm.existsSync)(r))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if(q(r,26))this.moveToNextToken;else{let g=this.checkConcurrentTokens([Pe(13),Xe("include"),Pe(13)]);if(g.length!==3)return this.popStack(),!1;s=g[0],i=g.at(-1)}let o=s,a=new mt(J(s,i));r=this.moveToNextToken;let c=r,l=!!q(r,21);if(!c||!l&&!q(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&&!q(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Vi(u,l,J(c,r)),f=new Zr(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!q(this.currentToken,4)?this._issues.push(A(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let m=this.peekIndex(),T=this.resolveInclude(f);if(f.reolvedPath=T,T||this._issues.push(A(36,f.path,HE.DiagnosticSeverity.Warning)),T&&!T.endsWith(".h")){rs().requestTokens(T,!0);let g=new n(T,this.incudes,this.macros);await g.stable,this.tokens.splice(t,m-t,...g.tokens),this.nodes.push(...g.nodes),this.dtsIncludes.push(...g.dtsIncludes)}else this.tokens.splice(t,m-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var KE=G(X()),Hu=class extends B{constructor(t,r,s){super();this.keyword=t;this.startAddress=r;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:KE.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var zE=G(X()),Ku=class extends B{constructor(t,r){super();this.keyword=t;this.bitsSize=r;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:zE.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var GE=G(X()),ua=class extends ss{constructor(t,r,s=new Map){super();this.uri=t;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new Be;this.unhandledStatements=new Ht;this.cPreprocessorParser=new Wu(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new Be,this._issues=[],this.unhandledStatements=new Ht}async reparse(){let t=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()-t),s()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let 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 B(J(s));this._issues.push(A(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(A(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(A(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!q(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!q(s,i))return this.popStack(),!1;let o=new Ht;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let r=this.currentToken;if(q(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new B(J(s));this._issues.push(A(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return q(this.currentToken,3)||q(this.currentToken,1)}endStatement(t=!0){let r=this.currentToken;if(!q(r,1)){let s=this.prevToken;if(s&&t){let i=new B(J(this.prevToken));return this._issues.push(A(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;q(this.currentToken,1);){let t=this.moveToNextToken;if(t){let r=new B(J(t));this._issues.push(A(23,r))}}}processNode(t,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,r)||this.isProperty(t)||this.isDeleteNode(t,r)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new B(J(o));this._issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let r=[],s=this.isLabelAssign(t);for(;s;)r.push(s),s=this.isLabelAssign(t);return r}isChildNode(t,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new Et(i):new we(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!q(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(A(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof Et?(c.labelReference=a,l=!0):o&&c instanceof we&&(l=o.address!==void 0,c.name=o),q(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let t=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(Pe)),s=r.length?Number.parseInt(r.map(o=>o.value).join(""),16):NaN;if(t){if(Number.isNaN(s)){let o=new B(J(t));this._issues.push(A(8,o))}else if(!Number.isNaN(s)&&!pn(t,r[0])){let o=new B(J(t,r.at(0)));this._issues.push(A(29,o))}}return new Tu(s,J(r[0]??this.prevToken,r.at(-1)))}processNodeAddresse(t){this.enqueueToStack();let r=this.checkConcurrentTokens([Pe(49)]);if(r.length){if(!pn(t.lastToken,r[0])){let o=new B(J(t.lastToken,r[0]));this._issues.push(A(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),q(this.currentToken,24)){if(this.prevToken&&!pn(this.prevToken,this.currentToken)){let o=new B(J(this.prevToken,this.currentToken));this._issues.push(A(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Pe));if(!t.length){this.popStack();return}let r=t.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new $e(r,J(t[0],t.at(-1))),i=this.processNodeAddresse(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Pe));if(!t.length){this.popStack();return}let r=new Fe(t.map(s=>s.value).join(""),J(t[0],t.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!t.length){this.popStack();return}let r=t.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new ht(r,J(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));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&&q(i,50),a=new ns(new ht(s,J(r[0],r.at(-1))),J(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.col+c.pos.len)&&this._issues.push(A(29,new B(J(c,i)))),this.moveToNextToken}else if(t)this._issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(q(this.currentToken,2)||q(this.currentToken,49))return this.popStack(),!1;let i=new Qe(s,r),o;q(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(A(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,t.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("ts"),Pe(16),Xe("v"),Xe("1")]);if(t.length!==6)return this.popStack(),!1;let r=t[0],s=r,i=new mt;i.firstToken=r;let o=new Cu(i);if(this.others.push(o),q(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(A(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("memreserve")]);if(t.length!==2)return this.popStack(),!1;let r=new mt;r.firstToken=t[0];let i=t[0];q(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(A(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new Hu(r,o,a);return this.others.push(c),o||this._issues.push(A(37,r)),a||this._issues.push(A(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("b"),Xe("its")]);if(t.length!==3){this.popStack();return}let r=new mt;r.firstToken=t[0];let i=t[0];q(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(A(21,r)));let o=this.processDec(),a=new Ku(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(A(40,o)):this._issues.push(A(39,r)),this._issues.push(A(41,a,GE.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("omit"),Pe(16),Xe("if"),Pe(16),Xe("no"),Pe(16),Xe("ref"),Pe(13)]);if(t.length!==9){this.popStack();return}let r=new mt(J(t[0],t.at(-1)));return this.mergeStack(),r}isDeleteNode(t,r){this.enqueueToStack();let s=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("e"),Xe("lete"),Pe(16),Xe("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new mt;if(a.firstToken=i,s.length===1&&!q(this.currentToken,2)){this._issues.push(A(25,a)),a.lastToken=s.at(-1);let d=new En(a);return t.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(A(c.startsWith("/delete-n")?34:25,a)):q(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(A(21,a));let l=new En(a);if(Nr(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(A(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(A(7,f));let m=d||f?void 0:this.isNodeName();m&&r==="Ref"&&this._issues.push(A(10,m)),!d&&!m&&!f&&this._issues.push(A([7,10],l)),l.nodeNameOrRef=d??f??m??null}else r==="Name"?this._issues.push(A(7,a)):r==="Ref"&&this._issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let r=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("e"),Xe("lete"),Pe(16),Xe("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new mt;if(o.firstToken=s,r.length===1&&!q(this.currentToken,2)){this._issues.push(A(25,o)),o.lastToken=r.at(-1);let u=new He(o);return t.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(A(a.startsWith("/delete-p")?35:25,o)):q(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(A(21,o));let c=new He(o);if(Nr(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(A(6,c)),c.propertyName=u??null}else this._issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),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 Bn(t,r,s);return this.mergeStack(),i}processValue(t){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!q(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=q(this.currentToken,24);d&&this.moveToNextToken;let f=o();if(u&&f===null&&d){let m=new B(J(u,this.currentToken));this._issues.push(A(0,m))}if(!d&&f===null)break;if(l&&!d&&f){let m=new B(J(l));this._issues.push(A(28,m))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new Du(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!q(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 lt(s,J(r));r.value.match(/["']$/)||this._issues.push(A(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 Bn(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(q(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new Bn(r,o,a,s);q(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(A(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 t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!q(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(A(15,u))});let a=new Qr(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(A(14,a)));let c=new Bn(t,a,o);q(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let r=t(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new ut(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new cr(s,r);return this.mergeStack(),i}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Xe("0"),Xe("x")]);if(t.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(Pe));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(o=>o.value).join(""),16),i=new wt(s,J(t[0],r.at(-1)));return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Pe));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new wt(s,J(r[0],r.at(-1))),o=new cr(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new cr(s,r);return this.mergeStack(),i}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(Pe));if(!t.length){this.popStack();return}let r=Number.parseInt(t.map(i=>i.value).join(""),10),s=new wt(r,J(t[0],t.at(-1)));return this.mergeStack(),s}processLabeledExpression(t=!0,r=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression();if(!i){this.popStack();return}let o=new cr(i,s);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}let s=new Au(t,r);return this.mergeStack(),s}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.processExpression();if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new Bn(t,r,s);return this.mergeStack(),i}processExpression(){this.enqueueToStack();let t=!1,r,s;q(this.currentToken,42)&&(t=!0,r=this.moveToNextToken,s=r);let i=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!i){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?i instanceof ia?i.addExpression(o,a):i=new ia(i,{operator:o,expression:a}):this._issues.push(A(27,o)),o=this.isOperator()}q(this.currentToken,43)?s=this.moveToNextToken:this._issues.push(A(26,o??i))}return this.mergeStack(),i}processMacroCallParams(){return q(this.currentToken,42)?this.parseScopedBlock(s=>!!q(s,42),s=>!!q(s,43),s=>!!q(s,24))?.splitTokens.map((s,i)=>{if(s.length===0||q(s[0],24)&&s.length===1)return null;let o=i?s.slice(1):s;return new Ou(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),J(o[0],o.at(-1)),i)}):void 0}isLabelRef(t){this.enqueueToStack();let r=this.currentToken;if(q(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new Ee(null);return this._issues.push(A(18,t??o)),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.col+r.pos.len)&&this._issues.push(A(29,new B(J(r,s.firstToken))));let i=new Ee(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(t);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 Bn(r,s,i);return this.mergeStack(),o}processRefValue(t,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!q(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new cr(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(A([18,9],r));let l=new cr(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new cr(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,r=new Pr){this.enqueueToStack();let s;if(q(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(A(19,new B(J(this.prevToken))))}let i=this.isNodeName();return i||this._issues.push(A(7,new B(J(s??this.prevToken)))),r.addPath(i??null,s?new B(J(s)):void 0),this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,r=t;if(!q(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!q(r,2)){this.popStack();return}let i=this.processNodePath(),o=new Fn(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!pn(l.lastToken,c)){this._issues.push(A(29,new B(J(l.lastToken,c))));return}if(u===0&&s&&!pn(s,l?.firstToken)){this._issues.push(A(29,new B(J(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!pn(l.lastToken,d.firstToken)&&this._issues.push(A(29,new B(J(l.lastToken,d?.firstToken))))}),q(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(A(3,new B(J(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof Zr)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Zi=G(X());var YE=require("fs"),JE=require("path");var eo=class{constructor(e,t,r,s=[],i){this.includePaths=t;this.bindingLoader=r;this._issues=[];this.overlays=[];this.overlays=Array.isArray(s)?s:[s],this.overlays.filter(YE.existsSync),this.parser=new ua(e,t),this.name=i??(0,JE.basename)(e),this.overlayParsers=this.overlays?.map(o=>new ua(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>i.ast.uri===e&&(!t||hn(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof lt&&l.compatible===o.value.value);return c?{range:oe(o.value),target:`file://${c.bindingsPath}`}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>i.uri===e&&(!t||hn(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:oe(i.path),target:`file://${o}`}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],r=t(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof Ee){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(A(3,o,Zi.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof Pr){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.address?.map(m=>m.address),!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(A(8,d,Zi.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(m=>m?.linksTo).map(m=>m?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new Ru(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof or),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>r.sortKey=s),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,t.rootNode,t)}}processChild(e,t,r){e instanceof Be?this.processDtcBaseNode(e,t,r):e instanceof Qe?this.processDtcProperty(e,t,r):e instanceof En?this.processDeleteNode(e,t,r):e instanceof He&&this.processDeleteProperty(e,t,r)}checkNodeUniqueNames(e,t){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address.every((l,u)=>a.address?.at(u)?.address===l))),s=t.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof we&&o.name)r(i.map(a=>({name:a.name,address:a.address?.map(c=>c.address)})),o.name)&&this._issues.push(A(2,o.name)),i.push(o.name);else if(o instanceof En&&o.nodeNameOrRef instanceof $e){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.address?.map(u=>u.address)})),c)))}})}processDtcBaseNode(e,t,r){e instanceof Ht?this.processDtcRootNode(e,r):e instanceof we?this.processDtcChildNode(e,t,r):e instanceof Et&&this.processDtcRefNode(e,r)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((r,s)=>r instanceof Qe&&s instanceof He||s instanceof Qe&&r instanceof He?0:s instanceof Qe?1:0).forEach(r=>this.processChild(r,t.rootNode,t))}processDtcChildNode(e,t,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new ke(this.bindingLoader,e.name.name,e.name.address?.map(a=>a.address),t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,t,r))}processDtcRefNode(e,t){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=t.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=>{t.labelsUsedCache.set(i.label.value,s)}),r?(t.references.push(e),this.checkNodeUniqueNames(e,r)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,Zi.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,r??new ke(this.bindingLoader,""),t))}processDtcProperty(e,t,r){e.propertyName?.name&&t.addProperty(new pt(e,t)),e.children.forEach(s=>this.processChild(s,t,r))}processDeleteNode(e,t,r){if(e.nodeNameOrRef instanceof $e&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(s=>s.address)))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let s=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(i=>i.address));e.nodeNameOrRef.linksTo=s,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address?.map(i=>i.address)),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof Ee&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),t.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 Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,Zi.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Fn&&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.address?.map(m=>m.address),!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(A(8,c,Zi.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,r))}processDeleteProperty(e,t,r){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,t,r))}};var kt=G(X());var XE=require("fs"),to=require("path");function i$(n){if(!n||!(n.ast instanceof Vi))return[];let e=r=>r.flatMap(s=>(0,XE.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,to.join)((0,to.relative)(s,i.parentPath),i.name)}`,kind:kt.CompletionItemKind.File})));if(n.ast.relative)return e([(0,to.dirname)(n.ast.uri)]);let t=n.runtime.context.includePaths;return e(t)}var zu=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>zu(t.node,e)),...n.nodes.flatMap(t=>zu(t,e))],nm=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>nm(t.node,e)),...n.nodes.flatMap(t=>nm(t,e))];function o$(n,e){if(!n||!(n.item instanceof pt)||!(n.ast instanceof Ee))return[];let t=r=>nm(r,e);return Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:kt.CompletionItemKind.Method}))}function a$(n,e){if(!n||n.item!==null||!(n.ast instanceof Ee)||!(n.ast.parentNode instanceof Et))return[];let t=r=>zu(r,e).filter(s=>e(s));return[...Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
|
|
229
236
|
$1
|
|
230
|
-
};`,kind:ot.CompletionItemKind.Value,insertTextFormat:ot.InsertTextFormat.Snippet}))]}function dP(n,e){let t=r=>r?r.parentNode instanceof rt||r.parentNode instanceof Ft||r.parentNode instanceof he?!1:t(r.parentNode):!0;if(!n||n.item!==null||!Ze(n.ast)||!t(n.ast))return[];let i=r=>Fc(r,e).filter(s=>e(s));return n.ast instanceof st?i(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(i(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:ot.CompletionItemKind.Variable}))}function hP(n,e){if(!n||!(n.item instanceof be)||n.item===null)return[];let t=i=>[...i.nodes,...i.deletedNodes.filter(r=>!e(r.by)).map(r=>r.node)].flatMap(r=>r.definitions.filter(s=>s instanceof he)).filter(r=>e(r));return n.ast instanceof ke||n.ast instanceof zt?Array.from(new Set(t(n.item).map(i=>i.name?.toString()))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:[]}function pP(n,e){if(!n||!(n.item instanceof be))return[];let t=i=>[...i.properties,...i.deletedProperties.filter(r=>!e(r.by)).map(r=>r.property)].flatMap(r=>[r,...r.allReplaced]).filter(r=>e(r.ast));return n.ast instanceof Pe||n.ast instanceof Ae?Array.from(new Set(t(n.item).map(i=>i.name))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:ot.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:ot.InsertTextFormat.Snippet}]:[]}function mP(n,e){let t=n?.ast instanceof jn?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof jn))return[];let i=t.pathParts.slice(0,-1);if(i.some(o=>!o))return[];let r=i.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...r],e);return[...o?.nodes.filter(a=>!Ze(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...r,o].join("/")}`,kind:ot.CompletionItemKind.Variable}))}async function sv(n,e,t){return dt(n,e,(i,r)=>[...pP(i,r),...hP(i,r),...dP(i,r),...mP(i,r),...fP(i,r),...uP(i,r),...lP(i)],t)}var Wi=z(Q());function gP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if(r instanceof Me)return Wi.Location.create(`file://${r.uri}`,ne(r.propertyName??r));if(r instanceof Ae)return Wi.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Qe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function yP(n){if(!n||!(n.ast instanceof ke)&&!(n.ast instanceof Xe))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he)return Wi.Location.create(`file://${i.uri}`,ne(i.name??i));if(i instanceof ke)return Wi.Location.create(`file://${i.uri}`,ne(i));if(i instanceof pe)return Wi.Location.create(`file://${i.uri}`,ne(i.label??i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),Wi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function ov(n,e,t){return dt(n,e,i=>[...yP(i),...gP(i)],t)}var mi=z(Q());function av(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if((r instanceof Me||r instanceof Ae)&&r.propertyName)return mi.Location.create(`file://${r.uri}`,ne(r.propertyName))}).filter(r=>r);if(n.item instanceof Qe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function cv(n,e){if(!e||!(e.ast instanceof Xe))return[];"newName"in n&&(e.ast.parentNode instanceof pe&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof di&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,i=r=>[...r.definitions.filter(s=>s instanceof he).flatMap(s=>s.labels.map(o=>o.label)),...r.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===t).map(s=>{if(s)return mi.Location.create(`file://${s.uri}`,ne(s))}).filter(s=>s);return e.item instanceof be&&!Ze(e.ast)?i(e.item):e.ast instanceof Xe&&e.ast.parentNode instanceof pe&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function lv(n){if(!n||!(n.ast instanceof ke))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he&&i.name)return mi.Location.create(`file://${i.uri}`,ne(i.name));if(i instanceof ke)return mi.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof ke&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),mi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function uv(n,e,t){let i={};return(await dt(n,e,s=>[...lv(s),...cv(n,s),...av(s)],t)).forEach(s=>{i[s.uri]??=[],i[s.uri].push(mi.TextEdit.replace(s.range,n.newName))}),{changes:i}}async function fv(n,e,t,i){let r=await dt(n,e,s=>[...lv(s),...cv(n,s),...av(s)],i);if(r.some(s=>t.some(o=>s.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var Bc=z(Q());function bP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast)].map(r=>{if(r instanceof Me)return Bc.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Qe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function TP(n){if(!n||!(n.ast instanceof ke)&&!(n.ast instanceof Xe))return[];let e=t=>[...t.definitions,...t.referencedBy].map(i=>{if(i instanceof he)return Bc.Location.create(`file://${i.uri}`,ne(i));if(i instanceof rt)return Bc.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&n.ast.linksTo?e(n.ast.linksTo):[]}async function dv(n,e,t){return dt(n,e,i=>[...TP(i),...bP(i)],t)}var gd=z(Q());function vP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return;let e=i=>i.replaces?e(i.replaces):i,t=i=>gd.Location.create(`file://${i.ast.uri}`,ne(i.ast.propertyName??i.ast));if(n.item instanceof Qe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(e(i))}}function SP(n){if(!n||!(n.ast instanceof ke)&&!(n.ast instanceof Xe))return;let e=t=>{let i=t.definitions.at(0);return i?gd.Location.create(`file://${i.uri}`,ne(i)):void 0};if(n.item instanceof be&&!Ze(n.ast))return e(n.item);if(n.ast instanceof Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof ke&&n.ast.linksTo)return e(n.ast.linksTo)}async function hv(n,e,t){return(await dt(n,e,i=>[SP(i)||vP(i)],t)).at(0)}var J=z(Q());var kP=(n,e,t,i,r)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(J.Range.create(J.Position.create(i.range.start.line,n.pos.col+n.pos.len),J.Position.create(i.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.del(i.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),">")]}}}];default:return}},EP=(n,e,t,i,r,s)=>{if(!s)return[];switch(t){case 0:return[{title:`Add Property "${s.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[s]}}}];default:return}};function pv(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>kP(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>EP(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit))}}).filter(a=>!!a),t=e.filter(a=>a.kind===J.CodeActionKind.SourceFixAll),i=e.filter(a=>a.title.startsWith("Add Property")),r=e.filter(a=>a.kind!==J.CodeActionKind.SourceFixAll),s=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return i.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...r,...t.map(a=>({...a,kind:J.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var mv=z(Q());function wP(n){return!n||!(n.item instanceof Qe)||!(n.ast instanceof Me&&(n.ast.values||n.ast.values===null))?[]:n.item.parent.nodeType?.properties.find(e=>e.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]}function NP(n){if(!n||!(n.item instanceof Qe&&n.ast instanceof Pe&&n.item.ast.values===null||n.item instanceof be)||Ze(n.ast))return[];let e=t=>t.nodeType?.properties.filter(i=>!i.hideAutoComplete&&i.required(t)!=="omitted"&&typeof i.name=="string").map(i=>{let r=t&&i.required(t),s=!!t.properties.some(a=>i.getNameMatch(a.name)),o="a";return r?o=s?"Y":"A":o=s?"Z":"B",{label:`${i.name}`,kind:mv.CompletionItemKind.Property,sortText:`${o}${i.name}`}})??[];return n.item instanceof Qe?e(n.item.parent):e(n.item)}async function gv(n,e,t){return dt(n,e,i=>[...wP(i),...NP(i)],t)}function _P(n){if(n?.item instanceof be)return{contents:n.item.toMarkupContent(),range:ne(n.ast)};if(n?.ast instanceof ke){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}if(n?.ast.parentNode instanceof pe){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}}function PP(n){if(n?.item instanceof Qe&&n.ast instanceof Pe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:ne(n.ast)}}}function yv(n,e,t){return dt(n,e,i=>[_P(i)||PP(i)],t)}var cw=z(sE());var _E=z(bE(),1);var uo=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var s0={"[: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]},fo=n=>n.replace(/[[\]\\-]/g,"\\$&"),o0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),TE=n=>n.join(""),vE=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;s<n.length;){let y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){l=!0,s++;continue}if(y==="]"&&o&&!c){u=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[w,[R,v,T]]of Object.entries(s0))if(n.startsWith(w,s)){if(d)return["$.",!1,n.length-t,!0];s+=w.length,T?r.push(R):i.push(R),a=a||v;continue e}}if(c=!1,d){y>d?i.push(fo(d)+"-"+fo(y)):y===d&&i.push(fo(y)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(fo(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=y,s+=2;continue}i.push(fo(y)),s++}if(u<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,n.length-t,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let y=i[0].length===2?i[0].slice(-1):i[0];return[o0(y),!1,u-t,!1]}let p="["+(l?"^":"")+TE(i)+"]",g="["+(l?"":"^")+TE(r)+"]";return[i.length&&r.length?"("+p+"|"+g+")":i.length?p:g,a,u-t,!0]};var fn=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var a0=new Set(["!","?","+","*","@"]),SE=n=>a0.has(n),c0="(?!(?:^|/)\\.\\.?(?:$|/))",ql="(?!\\.)",l0=new Set(["[","."]),u0=new Set(["..","."]),f0=new Set("().*{}+?[]^$\\!"),d0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Zh="[^/]",kE=Zh+"*?",EE=Zh+"+?",Gr=class n{type;#e;#t;#s=!1;#i=[];#o;#v;#l;#f=!1;#a;#c;#r=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,i=t.#o;for(;i;){for(let r=t.#v+1;!i.type&&r<i.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[r])}t=i,i=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let t=0;t<this.#v;t++){let i=e.#i[t];if(!(i instanceof n&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#y(e,t,i,r){let s=!1,o=!1,a=-1,c=!1;if(t.type===null){let g=i,_="";for(;g<e.length;){let y=e.charAt(g++);if(s||y==="\\"){s=!s,_+=y;continue}if(o){g===a+1?(y==="^"||y==="!")&&(c=!0):y==="]"&&!(g===a+2&&c)&&(o=!1),_+=y;continue}else if(y==="["){o=!0,a=g,c=!1,_+=y;continue}if(!r.noext&&SE(y)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(y,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=y}return t.push(_),g}let l=i+1,u=new n(null,t),d=[],p="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,p+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(l===a+2&&c)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=l,c=!1,p+=g;continue}if(SE(g)&&e.charAt(l)==="("){u.push(p),p="";let _=new n(g,u);u.push(_),l=n.#y(e,_,l,r);continue}if(g==="|"){u.push(p),p="",d.push(u),u=new n(null,t);continue}if(g===")")return p===""&&t.#i.length===0&&(t.#r=!0),u.push(p),p="",t.push(...d,u),l;p+=g}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],l}static fromGlob(e,t={}){let i=new n(null,void 0,t);return n.#y(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,r,s]=this.toRegExpSource();if(!(r||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#i.map(g=>{let[_,y,w,R]=typeof g=="string"?n.#d(g,this.#t,c):g.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||R,_}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&u0.has(this.#i[0]))){let _=l0,y=t&&_.has(l.charAt(0))||l.startsWith("\\.")&&_.has(l.charAt(2))||l.startsWith("\\.\\.")&&_.has(l.charAt(4)),w=!t&&!e&&_.has(l.charAt(0));u=y?c0:w?ql:""}let d="";return this.isEnd()&&this.#e.#f&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,fn(l),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,fn(this.toString()),!1,!1]}let o=!i||e||t||!ql?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!t?ql:"")+EE;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ql:"")+kE+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+c}return[a,fn(s),this.#t=!!this.#t,this.#s]}#h(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,r,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#d(e,t,i=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(r){r=!1,s+=(f0.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(c==="["){let[l,u,d,p]=vE(e,a);if(d){s+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){i&&e==="*"?s+=EE:s+=kE,t=!0;continue}if(c==="?"){s+=Zh,t=!0;continue}s+=d0(c)}return[s,fn(e),!!t,o]}};var Xr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var Nt=(n,e,t={})=>(uo(e),!t.nocomment&&e.charAt(0)==="#"?!1:new jt(e,t).match(n)),h0=/^\*+([^+@!?\*\[\(]*)$/,p0=n=>e=>!e.startsWith(".")&&e.endsWith(n),m0=n=>e=>e.endsWith(n),g0=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),y0=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),b0=/^\*+\.\*+$/,T0=n=>!n.startsWith(".")&&n.includes("."),v0=n=>n!=="."&&n!==".."&&n.includes("."),S0=/^\.\*+$/,k0=n=>n!=="."&&n!==".."&&n.startsWith("."),E0=/^\*+$/,w0=n=>n.length!==0&&!n.startsWith("."),N0=n=>n.length!==0&&n!=="."&&n!=="..",_0=/^\?+([^+@!?\*\[\(]*)?$/,P0=([n,e=""])=>{let t=PE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},D0=([n,e=""])=>{let t=DE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},R0=([n,e=""])=>{let t=DE([n]);return e?i=>t(i)&&i.endsWith(e):t},C0=([n,e=""])=>{let t=PE([n]);return e?i=>t(i)&&i.endsWith(e):t},PE=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},DE=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},RE=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wE={win32:{sep:"\\"},posix:{sep:"/"}},O0=RE==="win32"?wE.win32.sep:wE.posix.sep;Nt.sep=O0;var pt=Symbol("globstar **");Nt.GLOBSTAR=pt;var A0="[^/]",I0=A0+"*?",L0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",x0="(?:(?!(?:\\/|^)\\.).)*?",M0=(n,e={})=>t=>Nt(t,n,e);Nt.filter=M0;var Xt=(n,e={})=>Object.assign({},n,e),q0=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Nt;let e=Nt;return Object.assign((i,r,s={})=>e(i,r,Xt(n,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Xt(n,s))}static defaults(r){return e.defaults(Xt(n,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Xt(n,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Xt(n,s))}},unescape:(i,r={})=>e.unescape(i,Xt(n,r)),escape:(i,r={})=>e.escape(i,Xt(n,r)),filter:(i,r={})=>e.filter(i,Xt(n,r)),defaults:i=>e.defaults(Xt(n,i)),makeRe:(i,r={})=>e.makeRe(i,Xt(n,r)),braceExpand:(i,r={})=>e.braceExpand(i,Xt(n,r)),match:(i,r,s={})=>e.match(i,r,Xt(n,s)),sep:e.sep,GLOBSTAR:pt})};Nt.defaults=q0;var CE=(n,e={})=>(uo(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,_E.default)(n));Nt.braceExpand=CE;var F0=(n,e={})=>new jt(n,e).makeRe();Nt.makeRe=F0;var B0=(n,e,t={})=>{let i=new jt(e,t);return n=n.filter(r=>i.match(r)),i.options.nonull&&!n.length&&n.push(e),n};Nt.match=B0;var NE=/[?*]|[+@!]\(.*?\)|\[|\]/,j0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){uo(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||RE,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!NE.test(s[2]))&&!NE.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let r=0;r<e[i].length;r++)e[i][r]==="**"&&(e[i][r]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let r=i;for(;t[r+1]==="**";)r++;r!==i&&t.splice(i,r-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let r=e[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let o=r;for(;i[o+1]==="**";)o++;o>r&&i.splice(r+1,o-r);let a=i[r+1],c=i[r+2],l=i[r+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,i.splice(r,1);let u=i.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(t=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let o=i[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let r=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(r){e[t]=[],e[i]=r;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<t.length;)if(e[r]===t[s])o.push(a==="b"?t[s]:e[r]),r++,s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])o.push(e[r]),r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])o.push(t[s]),s++;else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),r++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let r=this.options;if(this.isWindows){let y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),R=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!R&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:y?0:void 0,N=v?3:R?0:void 0;if(typeof T=="number"&&typeof N=="number"){let[L,q]=[e[T],t[N]];L.toLowerCase()===q.toLowerCase()&&(t[N]=L,N>T?t=t.slice(N):T>N&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===pt){this.debug("GLOBSTAR",[t,u,d]);var p=o,g=a+1;if(g===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var _=e[p];if(this.debug(`
|
|
231
|
-
globstar while`,e,
|
|
232
|
-
>>> no match, partial?`,e,p,t,g),p===c))}let y;if(typeof u=="string"?(y=d===u,this.debug("string match",u,d,y)):(y=u.test(d),this.debug("pattern match",u,d,y)),!y)return!1}if(o===c&&a===l)return!0;if(o===c)return i;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return CE(this.pattern,this.options)}parse(e){uo(e);let t=this.options;if(e==="**")return pt;if(e==="")return"";let i,r=null;(i=e.match(E0))?r=t.dot?N0:w0:(i=e.match(h0))?r=(t.nocase?t.dot?y0:g0:t.dot?m0:p0)(i[1]):(i=e.match(_0))?r=(t.nocase?t.dot?D0:P0:t.dot?R0:C0)(i):(i=e.match(b0))?r=t.dot?v0:T0:(i=e.match(S0))&&(r=k0);let s=Gr.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?I0:t.dot?L0:x0,r=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))r.add(d);return typeof u=="string"?j0(u):u===pt?pt:u._src});return l.forEach((u,d)=>{let p=l[d+1],g=l[d-1];u!==pt||g===pt||(g===void 0?p!==void 0&&p!==pt?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=g+"(?:\\/|"+i+")?":p!==pt&&(l[d-1]=g+"(?:\\/|\\/"+i+"\\/)"+p,l[d+1]=pt))}),l.filter(u=>u!==pt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let c=s[a],l=r;if(i.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Nt.defaults(e).Minimatch}};Nt.AST=Gr;Nt.Minimatch=jt;Nt.escape=Xr;Nt.unescape=fn;var ew=require("node:url");var Qr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,AE=new Set,ep=typeof process=="object"&&process?process:{},IE=(n,e,t,i)=>{typeof ep.emitWarning=="function"?ep.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},Fl=globalThis.AbortController,OE=globalThis.AbortSignal;if(typeof Fl>"u"){OE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},Fl=class{constructor(){e()}signal=new OE;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=ep.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,IE("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 U0=n=>!AE.has(n),dW=Symbol("type"),Ni=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),LE=n=>Ni(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Jr:null:null,Jr=class extends Array{constructor(e){super(e),this.fill(0)}},tp=class n{heap;length;static#e=!1;static create(e){let t=LE(e);if(!t)return[];n.#e=!0;let i=new n(e,t);return n.#e=!1,i}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ho=class n{#e;#t;#s;#i;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#c;#r;#g;#y;#h;#d;#E;#m;#w;#N;#T;#S;#k;#p;static unsafeExposeInternals(e){return{starts:e.#N,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#r,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#d},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,i,r,s)=>e.#F(t,i,r,s),moveToTail:t=>e.#j(t),indexes:t=>e.#P(t),rindexes:t=>e.#D(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:y,fetchMethod:w,memoMethod:R,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:L,ignoreFetchAbort:q}=e;if(t!==0&&!Ni(t))throw new TypeError("max option must be a nonnegative integer");let H=t?LE(t):Array;if(!H)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=R,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#k=!!w,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#r=new Array(t).fill(void 0),this.#g=new H(t),this.#y=new H(t),this.#h=0,this.#d=0,this.#E=tp.create(t),this.#l=0,this.#f=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#S=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#t!==0&&!Ni(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ni(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ni(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!Ni(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";U0(j)&&(AE.add(j),IE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new Jr(this.#e),t=new Jr(this.#e);this.#T=e,this.#N=t,this.#A=(s,o,a=Qr.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#O(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#_=s=>{t[s]=e[s]!==0?Qr.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=Qr.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#b=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#_=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Jr(this.#e);this.#f=0,this.#w=e,this.#I=t=>{this.#f-=e[t],e[t]=0},this.#x=(t,i,r,s)=>{if(this.#u(i))return 0;if(!Ni(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!Ni(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,i,r)=>{if(e[t]=i,this.#t){let s=this.#t-e[t];for(;this.#f>s;)this.#q(!0)}this.#f+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#f)}}#I=e=>{};#L=(e,t,i)=>{};#x=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#d;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#d));)t=this.#g[t]}#M(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*rentries(){for(let e of this.#D())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#D())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#c[i],this))return this.get(this.#c[i],t)}}forEach(e,t=this){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#r[t],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#T&&this.#N){let o=this.#T[t],a=this.#N[t];if(o&&a){let c=o-(Qr.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#c[t],r=this.#r[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#T&&this.#N){o.ttl=this.#T[t];let a=Qr.now()-this.#N[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=Qr.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#x(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#d:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#r[d]=t,this.#a.set(e,d),this.#g[this.#d]=d,this.#y[d]=this.#d,this.#d=d,this.#l++,this.#L(d,u,c),c&&(c.set="add"),l=!1;else{this.#j(d);let p=this.#r[d];if(t!==p){if(this.#k&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=p;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#m?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]));if(this.#I(d),this.#L(d,u,c),this.#r[d]=t,c){c.set="replace";let g=p&&this.#u(p)?p.__staleWhileFetching:p;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(r!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#A(d,r,s),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let p=this.#m,g;for(;g=p?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#r[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#q(e){let t=this.#h,i=this.#c[t],r=this.#r[t];return this.#k&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(r,i,"evict"),this.#p&&this.#m?.push([r,i,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#r[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#d=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(i),this.#l--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#a.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))r&&(r.has="stale",this.#n(r,s));else return i&&this.#_(s),r&&(r.has="hit",this.#n(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!i&&this.#b(r))return;let s=this.#r[r];return this.#u(s)?s.__staleWhileFetching:s}#F(e,t,i,r){let s=t===void 0?void 0:this.#r[t];if(this.#u(s))return s;let o=new Fl,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(y,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&y!==void 0;if(i.status&&(R&&!w?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),R&&!v&&!w)return d(o.signal.reason);let T=g;return this.#r[t]===g&&(y===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,y,c.options))),y},u=y=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=y),d(y)),d=y=>{let{aborted:w}=o.signal,R=w&&i.allowStaleOnFetchAbort,v=R||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,N=g;if(this.#r[t]===g&&(!T||N.__staleWhileFetching===void 0?this.#O(e,"fetch"):R||(this.#r[t]=N.__staleWhileFetching)),v)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw y},p=(y,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>y(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(y(void 0),i.allowStaleOnFetchAbort&&(y=v=>l(v,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(p).then(l,u),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...c.options,status:void 0}),t=this.#a.get(e)):this.#r[t]=_,_}#u(e){if(!this.#k)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Fl}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:y,forceRefresh:w=!1,status:R,signal:v}=t;if(!this.#k)return R&&(R.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:R});let T={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:R,signal:v},N=this.#a.get(e);if(N===void 0){R&&(R.fetch="miss");let L=this.#F(e,N,T,y);return L.__returned=L}else{let L=this.#r[N];if(this.#u(L)){let Be=i&&L.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",Be&&(R.returnedStale=!0)),Be?L.__staleWhileFetching:L.__returned=L}let q=this.#b(N);if(!w&&!q)return R&&(R.fetch="hit"),this.#j(N),r&&this.#_(N),R&&this.#n(R,N),L;let H=this.#F(e,N,T,y),re=H.__staleWhileFetching!==void 0&&i;return R&&(R.fetch=q?"stale":"refresh",re&&q&&(R.returnedStale=!0)),re?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#r[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#j(a),r&&this.#_(a),c))}else o&&(o.get="miss")}#B(e,t){this.#y[t]=e,this.#g[e]=t}#j(e){e!==this.#d&&(e===this.#h?this.#h=this.#g[e]:this.#B(this.#y[e],this.#g[e]),this.#B(this.#d,e),this.#d=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let i=!1;if(this.#l!==0){let r=this.#a.get(e);if(r!==void 0)if(i=!0,this.#l===1)this.#U(t);else{this.#I(r);let s=this.#r[r];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,t),this.#p&&this.#m?.push([s,e,t])),this.#a.delete(e),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#d)this.#d=this.#y[r];else if(r===this.#h)this.#h=this.#g[r];else{let o=this.#y[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#y[a]=this.#y[r]}this.#l--,this.#E.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,s;for(;s=r?.shift();)this.#i?.(...s)}return i}clear(){return this.#U("delete")}#U(e){for(let t of this.#D({allowStale:!0})){let i=this.#r[t];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#c[t];this.#S&&this.#s?.(i,r,e),this.#p&&this.#m?.push([i,r,e])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#T&&this.#N&&(this.#T.fill(0),this.#N.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#d=0,this.#E.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};var ts=require("node:path"),VE=require("node:url"),Rn=require("fs"),Q0=z(require("node:fs"),1),Di=require("node:fs/promises");var Hl=require("node:events"),cp=z(require("node:stream"),1),BE=require("node:string_decoder"),xE=typeof process=="object"&&process?process:{stdout:null,stderr:null},$0=n=>!!n&&typeof n=="object"&&(n instanceof Pi||n instanceof cp.default||W0(n)||V0(n)),W0=n=>!!n&&typeof n=="object"&&n instanceof Hl.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==cp.default.Writable.prototype.pipe,V0=n=>!!n&&typeof n=="object"&&n instanceof Hl.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Wn=Symbol("EOF"),Vn=Symbol("maybeEmitEnd"),_i=Symbol("emittedEnd"),Bl=Symbol("emittingEnd"),po=Symbol("emittedError"),jl=Symbol("closed"),ME=Symbol("read"),Ul=Symbol("flush"),qE=Symbol("flushChunk"),dn=Symbol("encoding"),Zr=Symbol("decoder"),at=Symbol("flowing"),mo=Symbol("paused"),es=Symbol("resume"),ct=Symbol("buffer"),_t=Symbol("pipes"),lt=Symbol("bufferLength"),np=Symbol("bufferPush"),$l=Symbol("bufferShift"),St=Symbol("objectMode"),He=Symbol("destroyed"),ip=Symbol("error"),rp=Symbol("emitData"),FE=Symbol("emitEnd"),sp=Symbol("emitEnd2"),Pn=Symbol("async"),op=Symbol("abort"),Wl=Symbol("aborted"),go=Symbol("signal"),Qi=Symbol("dataListeners"),Ut=Symbol("discarded"),yo=n=>Promise.resolve().then(n),H0=n=>n(),Y0=n=>n==="end"||n==="finish"||n==="prefinish",K0=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,z0=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Vl=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[es](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ap=class extends Vl{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>t.emit("error",r),e.on("error",this.proxyErrors)}},G0=n=>!!n.objectMode,X0=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",Pi=class extends Hl.EventEmitter{[at]=!1;[mo]=!1;[_t]=[];[ct]=[];[St];[dn];[Pn];[Zr];[Wn]=!1;[_i]=!1;[Bl]=!1;[jl]=!1;[po]=null;[lt]=0;[He]=!1;[go];[Wl]=!1;[Qi]=0;[Ut]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");G0(t)?(this[St]=!0,this[dn]=null):X0(t)?(this[dn]=t.encoding,this[St]=!1):(this[St]=!1,this[dn]=null),this[Pn]=!!t.async,this[Zr]=this[dn]?new BE.StringDecoder(this[dn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ct]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_t]});let{signal:i}=t;i&&(this[go]=i,i.aborted?this[op]():i.addEventListener("abort",()=>this[op]()))}get bufferLength(){return this[lt]}get encoding(){return this[dn]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[St]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Pn]}set async(e){this[Pn]=this[Pn]||!!e}[op](){this[Wl]=!0,this.emit("abort",this[go]?.reason),this.destroy(this[go]?.reason)}get aborted(){return this[Wl]}set aborted(e){}write(e,t,i){if(this[Wl])return!1;if(this[Wn])throw new Error("write after end");if(this[He])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[Pn]?yo:H0;if(!this[St]&&!Buffer.isBuffer(e)){if(z0(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(K0(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[St]?(this[at]&&this[lt]!==0&&this[Ul](!0),this[at]?this.emit("data",e):this[np](e),this[lt]!==0&&this.emit("readable"),i&&r(i),this[at]):e.length?(typeof e=="string"&&!(t===this[dn]&&!this[Zr]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[dn]&&(e=this[Zr].write(e)),this[at]&&this[lt]!==0&&this[Ul](!0),this[at]?this.emit("data",e):this[np](e),this[lt]!==0&&this.emit("readable"),i&&r(i),this[at]):(this[lt]!==0&&this.emit("readable"),i&&r(i),this[at])}read(e){if(this[He])return null;if(this[Ut]=!1,this[lt]===0||e===0||e&&e>this[lt])return this[Vn](),null;this[St]&&(e=null),this[ct].length>1&&!this[St]&&(this[ct]=[this[dn]?this[ct].join(""):Buffer.concat(this[ct],this[lt])]);let t=this[ME](e||null,this[ct][0]);return this[Vn](),t}[ME](e,t){if(this[St])this[$l]();else{let i=t;e===i.length||e===null?this[$l]():typeof i=="string"?(this[ct][0]=i.slice(e),t=i.slice(0,e),this[lt]-=e):(this[ct][0]=i.subarray(e),t=i.subarray(0,e),this[lt]-=e)}return this.emit("data",t),!this[ct].length&&!this[Wn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Wn]=!0,this.writable=!1,(this[at]||!this[mo])&&this[Vn](),this}[es](){this[He]||(!this[Qi]&&!this[_t].length&&(this[Ut]=!0),this[mo]=!1,this[at]=!0,this.emit("resume"),this[ct].length?this[Ul]():this[Wn]?this[Vn]():this.emit("drain"))}resume(){return this[es]()}pause(){this[at]=!1,this[mo]=!0,this[Ut]=!1}get destroyed(){return this[He]}get flowing(){return this[at]}get paused(){return this[mo]}[np](e){this[St]?this[lt]+=1:this[lt]+=e.length,this[ct].push(e)}[$l](){return this[St]?this[lt]-=1:this[lt]-=this[ct][0].length,this[ct].shift()}[Ul](e=!1){do;while(this[qE](this[$l]())&&this[ct].length);!e&&!this[ct].length&&!this[Wn]&&this.emit("drain")}[qE](e){return this.emit("data",e),this[at]}pipe(e,t){if(this[He])return e;this[Ut]=!1;let i=this[_i];return t=t||{},e===xE.stdout||e===xE.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[_t].push(t.proxyErrors?new ap(this,e,t):new Vl(this,e,t)),this[Pn]?yo(()=>this[es]()):this[es]()),e}unpipe(e){let t=this[_t].find(i=>i.dest===e);t&&(this[_t].length===1?(this[at]&&this[Qi]===0&&(this[at]=!1),this[_t]=[]):this[_t].splice(this[_t].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[Ut]=!1,this[Qi]++,!this[_t].length&&!this[at]&&this[es]();else if(e==="readable"&&this[lt]!==0)super.emit("readable");else if(Y0(e)&&this[_i])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[po]){let r=t;this[Pn]?yo(()=>r.call(this,this[po])):r.call(this,this[po])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Qi]=this.listeners("data").length,this[Qi]===0&&!this[Ut]&&!this[_t].length&&(this[at]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Qi]=0,!this[Ut]&&!this[_t].length&&(this[at]=!1)),t}get emittedEnd(){return this[_i]}[Vn](){!this[Bl]&&!this[_i]&&!this[He]&&this[ct].length===0&&this[Wn]&&(this[Bl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[jl]&&this.emit("close"),this[Bl]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==He&&this[He])return!1;if(e==="data")return!this[St]&&!i?!1:this[Pn]?(yo(()=>this[rp](i)),!0):this[rp](i);if(e==="end")return this[FE]();if(e==="close"){if(this[jl]=!0,!this[_i]&&!this[He])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[po]=i,super.emit(ip,i);let s=!this[go]||this.listeners("error").length?super.emit("error",i):!1;return this[Vn](),s}else if(e==="resume"){let s=super.emit("resume");return this[Vn](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let r=super.emit(e,...t);return this[Vn](),r}[rp](e){for(let i of this[_t])i.dest.write(e)===!1&&this.pause();let t=this[Ut]?!1:super.emit("data",e);return this[Vn](),t}[FE](){return this[_i]?!1:(this[_i]=!0,this.readable=!1,this[Pn]?(yo(()=>this[sp]()),!0):this[sp]())}[sp](){if(this[Zr]){let t=this[Zr].end();if(t){for(let i of this[_t])i.dest.write(t);this[Ut]||super.emit("data",t)}}for(let t of this[_t])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[St]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[St]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[St])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[dn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(He,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ut]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Wn])return t();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(He,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(He,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(He,u),t(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,s=d,this.once(He,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ut]=!1;let e=!1,t=()=>(this.pause(),this.off(ip,t),this.off(He,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(ip,t),this.once(He,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[He])return e?this.emit("error",e):this.emit(He),this;this[He]=!0,this[Ut]=!0,this[ct].length=0,this[lt]=0;let t=this;return typeof t.close=="function"&&!this[jl]&&t.close(),e?this.emit("error",e):this.emit(He),this}static get isStream(){return $0}};var J0=Rn.realpathSync.native,To={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:J0,promises:{lstat:Di.lstat,readdir:Di.readdir,readlink:Di.readlink,realpath:Di.realpath}},HE=n=>!n||n===To||n===Q0?To:{...To,...n,promises:{...To.promises,...n.promises||{}}},YE=/^\\\\\?\\([a-z]:)\\?$/i,Z0=n=>n.replace(/\//g,"\\").replace(YE,"$1\\"),eA=/[\\\/]/,Jt=0,KE=1,zE=2,Dn=4,GE=6,XE=8,Ji=10,QE=12,Qt=15,bo=~Qt,lp=16,jE=32,vo=64,hn=128,Yl=256,zl=512,UE=vo|hn|zl,tA=1023,up=n=>n.isFile()?XE:n.isDirectory()?Dn:n.isSymbolicLink()?Ji:n.isCharacterDevice()?zE:n.isBlockDevice()?GE:n.isSocket()?QE:n.isFIFO()?KE:Jt,$E=new Map,So=n=>{let e=$E.get(n);if(e)return e;let t=n.normalize("NFKD");return $E.set(n,t),t},WE=new Map,Kl=n=>{let e=WE.get(n);if(e)return e;let t=So(n.toLowerCase());return WE.set(n,t),t},Gl=class extends ho{constructor(){super({max:256})}},fp=class extends ho{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},JE=Symbol("PathScurry setAsCwd"),kt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#d;get birthtimeMs(){return this.#d}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#N;get birthtime(){return this.#N}#T;#S;#k;#p;#R;#_;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Jt,i,r,s,o,a){this.name=e,this.#T=s?Kl(e):So(e),this.#n=t&tA,this.nocase=s,this.roots=r,this.root=i||this,this.#A=o,this.#k=a.fullpath,this.#R=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=HE(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),r=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(r):this.#I(r)}#I(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~lp,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),r=this.nocase?Kl(e):So(e);for(let c of i)if(c.#T===r)return c;let s=this.parent?this.sep:"",o=this.#k?this.#k+s+e:void 0,a=this.newChild(e,Jt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=hn),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#k!==void 0)return this.#k;let e=this.name,t=this.parent;if(!t)return this.#k=this.name;let r=t.fullpath()+(t.parent?this.sep:"")+e;return this.#k=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Qt)===Jt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Qt)===XE}isDirectory(){return(this.#n&Qt)===Dn}isCharacterDevice(){return(this.#n&Qt)===zE}isBlockDevice(){return(this.#n&Qt)===GE}isFIFO(){return(this.#n&Qt)===KE}isSocket(){return(this.#n&Qt)===QE}isSymbolicLink(){return(this.#n&Ji)===Ji}lstatCached(){return this.#n&jE?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Qt;return!(e!==Jt&&e!==Ji||this.#n&Yl||this.#n&hn)}calledReaddir(){return!!(this.#n&lp)}isENOENT(){return!!(this.#n&hn)}isNamed(e){return this.nocase?this.#T===Kl(e):this.#T===So(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}#L(e){this.#n|=lp;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#x()}}#x(){this.#n&hn||(this.#n=(this.#n|hn)&bo,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#D(){this.#n|=zl,this.#M()}#M(){if(this.#n&vo)return;let e=this.#n;(e&Qt)===Dn&&(e&=bo),this.#n=e|vo,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#x():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=Yl,e==="ENOENT"&&(t|=hn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=bo),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#B(e,t){return this.#O(e,t)||this.#j(e,t)}#j(e,t){let i=up(e),r=this.newChild(e.name,i,{parent:this}),s=r.#n&Qt;return s!==Dn&&s!==Ji&&s!==Jt&&(r.#n|=vo),t.unshift(r),t.provisional++,r}#O(e,t){for(let i=t.provisional;i<t.length;i++){let r=t[i];if((this.nocase?Kl(e.name):So(e.name))===r.#T)return this.#U(e,r,i,t)}}#U(e,t,i,r){let s=t.name;return t.#n=t.#n&bo|up(e),s!==e.name&&(t.name=e.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(t)),r.provisional++,t}async lstat(){if(!(this.#n&hn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if(!(this.#n&hn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:t,atimeMs:i,birthtime:r,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:g,mtime:_,mtimeMs:y,nlink:w,rdev:R,size:v,uid:T}=e;this.#E=t,this.#g=i,this.#N=r,this.#d=s,this.#f=o,this.#r=a,this.#w=c,this.#h=l,this.#t=u,this.#v=d,this.#a=p,this.#s=g,this.#m=_,this.#y=y,this.#i=w,this.#l=R,this.#c=v,this.#o=T;let N=up(e);this.#n=this.#n&bo|N|jE,N!==Jt&&N!==Dn&&N!==Ji&&(this.#n|=vo)}#W=[];#V=!1;#Y(e){this.#V=!1;let t=this.#W.slice();this.#W.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#V)return;this.#V=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),i.provisional=0;else{for(let a of o)this.#B(a,i);this.#L(i)}this.#Y(i.slice(0,i.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#$)await this.#$;else{let i=()=>{};this.#$=new Promise(r=>i=r);try{for(let r of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(r,e);this.#L(e)}catch(r){this.#q(r.code),e.provisional=0}this.#$=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(i,e);this.#L(e)}catch(i){this.#q(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&UE)return!1;let e=Qt&this.#n;return e===Jt||e===Dn||e===Ji}shouldWalk(e,t){return(this.#n&Dn)===Dn&&!(this.#n&UE)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((zl|Yl|hn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#C)return this.#C;if(!((zl|Yl|hn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}[JE](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],r=this;for(;r&&r.parent;)t.add(r),r.#R=i.join(this.sep),r.#_=i.join("/"),r=r.parent,i.push("..");for(r=e;r&&r.parent&&!t.has(r);)r.#R=void 0,r.#_=void 0,r=r.parent}},Xl=class n extends kt{sep="\\";splitSep=eA;constructor(e,t=Jt,i,r,s,o,a){super(e,t,i,r,s,o,a)}newChild(e,t=Jt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return ts.win32.parse(e).root}getRoot(e){if(e=Z0(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new ns(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YE,"$1\\"),e===t}},Ql=class n extends kt{splitSep="/";sep="/";constructor(e,t=Jt,i,r,s,o,a){super(e,t,i,r,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Jt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Jl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:r,childrenCacheSize:s=16*1024,fs:o=To}={}){this.#i=HE(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,VE.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Gl,this.#t=new Gl,this.#s=new fp(s);let c=a.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,g=!1;for(let _ of c){let y=u--;l=l.child(_,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).fill("..").join("/"),fullpath:p+=(g?"":d)+_}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#e.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#t.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let r=await e.readdir();return i?r:r.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(r=>r.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((g,_)=>{if(g)return p(g);let y=_.length;if(!y)return p();let w=()=>{--y===0&&p()};for(let R of _)(!s||s(R))&&a.push(i?R:R.fullpath()),r&&R.isSymbolicLink()?R.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,w):w()):R.shouldWalk(c,o)?l(R,w):w()},!0)},u=e;return new Promise((d,p)=>{l(u,g=>{if(g)return p(g);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(i?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(r&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield i?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(r&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new Pi({objectMode:!0});(!s||s(e))&&a.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=(w,R,v=!1)=>{if(w)return a.emit("error",w);if(r&&!v){let T=[];for(let N of R)N.isSymbolicLink()&&T.push(N.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,R,!0));return}}for(let T of R)T&&(!s||s(T))&&(a.write(i?T:T.fullpath())||(p=!0));u--;for(let T of R){let N=T.realpathCached()||T;N.shouldWalk(c,o)&&l.push(N)}p&&!a.flowing?a.once("drain",d):y||d()},y=!0;g.readdirCB(_,!0),y=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new Pi({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=g.readdirSync();for(let y of _)(!s||s(y))&&(a.write(i?y:y.fullpath())||(p=!0));u--;for(let y of _){let w=y;if(y.isSymbolicLink()){if(!(r&&(w=y.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(c,o)&&l.push(w)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[JE](t)}},ns=class extends Jl{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,ts.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(e){return ts.win32.parse(e).root.toUpperCase()}newRoot(e){return new Xl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},is=class extends Jl{sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,ts.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Ql(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ko=class extends is{constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}},yW=process.platform==="win32"?Xl:Ql,ZE=process.platform==="win32"?ns:process.platform==="darwin"?ko:is;var nA=n=>n.length>=1,iA=n=>n.length>=1,rs=class n{#e;#t;#s;length;#i;#o;#v;#l;#f;#a;#c=!0;constructor(e,t,i,r){if(!nA(e))throw new TypeError("empty pattern list");if(!iA(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=i,this.#i=r,this.#s===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,p,g,..._]=this.#t;l[0]===""&&(l.shift(),_.shift());let y=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[y,...l],this.#t=[w,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=s+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===pt}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var rA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:r,noglobstar:s,platform:o=rA}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:r,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new jt(e,this.mmopts);for(let i=0;i<t.set.length;i++){let r=t.set[i],s=t.globParts[i];if(!r||!s)throw new Error("invalid pattern object");for(;r[0]==="."&&s[0]===".";)r.shift(),s.shift();let o=new rs(r,s,0,this.platform),a=new jt(o.globString(),this.mmopts),c=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),i=`${t}/`,r=e.relative()||".",s=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(t))return!0;return!1}};var dp=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),r=this.store.get(i);r?r.add(t.globString()):this.store.set(i,new Set([t.globString()]))}},hp=class{store=new Map;add(e,t,i){let r=(t?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?r:r&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},pp=class{store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(r=>r.globString()===t.globString())||i.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Eo=class n{hasWalkedCache;matches=new hp;subwalks=new pp;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new dp}processPatterns(e,t){this.patterns=t;let i=t.map(r=>[e,r]);for(let[r,s]of i){this.hasWalkedCache.storeWalked(r,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)r=r.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(r,s))continue;this.hasWalkedCache.storeWalked(r,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,d);continue}else if(c===pt){(!r.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(r,s);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(r,a,d===""||d===".");else if(d===".."){let g=r.parent||r;p?this.hasWalkedCache.hasWalked(g,p)||this.subwalks.add(g,p):this.matches.add(g,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),r=this.child();for(let s of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===pt?r.testGlobstar(s,o,l,a):c instanceof RegExp?r.testRegExp(s,c,l,a):r.testString(s,c,l,a)}return r}testGlobstar(e,t,i,r){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),r);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),r)}}testRegExp(e,t,i,r){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}testString(e,t,i,r){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}};var sA=(n,e)=>typeof n=="string"?new ss([n],e):Array.isArray(n)?new ss(n,e):n,Zl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=sA(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+r)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+r:"."+r)}}async match(e,t,i){let r=await this.matchCheck(e,i);r&&this.matchFinish(r,t)}matchSync(e,t,i){let r=this.matchCheckSync(e,i);r&&this.matchFinish(r,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new Eo(this.opts),i)}walkCB2(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,i,o):a.readdirCB((l,u)=>this.walkCB3(a,u,i,o),!0)}o()}walkCB3(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of i.subwalks.entries())s++,this.walkCB2(a,c,i.child(),o);o()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new Eo(this.opts),i)}walkCB2Sync(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,i,o)}o()}walkCB3Sync(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of i.subwalks.entries())s++,this.walkCB2Sync(a,c,i.child(),o);o()}},wo=class extends Zl{matches=new Set;constructor(e,t,i){super(e,t,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},No=class extends Zl{results;constructor(e,t,i){super(e,t,i),this.results=new Pi({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 oA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",pn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ew.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||oA,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?ns:t.platform==="darwin"?ko:t.platform?is:ZE;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new jt(c,r)),[o,a]=s.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new rs(c,u,0,this.platform)})}async walk(){return[...await new wo(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 wo(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 No(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 No(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 mp=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new jt(t,e).hasMagic())return!0;return!1};function tu(n,e={}){return new pn(n,e).streamSync()}function nw(n,e={}){return new pn(n,e).stream()}function iw(n,e={}){return new pn(n,e).walkSync()}async function tw(n,e={}){return new pn(n,e).walk()}function nu(n,e={}){return new pn(n,e).iterateSync()}function rw(n,e={}){return new pn(n,e).iterate()}var aA=tu,cA=Object.assign(nw,{sync:tu}),lA=nu,uA=Object.assign(rw,{sync:nu}),fA=Object.assign(iw,{stream:tu,iterate:nu}),eu=Object.assign(tw,{glob:tw,globSync:iw,sync:fA,globStream:nw,stream:cA,globStreamSync:tu,streamSync:aA,globIterate:rw,iterate:uA,globIterateSync:nu,iterateSync:lA,Glob:pn,hasMagic:mp,escape:Xr,unescape:fn});eu.glob=eu;var _o=require("path"),lw=require("fs");var Cn=z(Q()),dA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},sw=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},iu=(n,e)=>{if(e=e.include.reduce((t,i)=>{let r=n.find(s=>(0,_o.basename)(s.filePath)===i.name);if(r){let s=i["property-blocklist"];return t.include=t.include.filter(o=>o!==i),hA(n,r,t,s)??t}return console.warn(`Unable to find ${i}`),t},e),e["child-binding"]&&(e["child-binding"].include=uw(e["child-binding"].include),e["child-binding"]=iu(n,e["child-binding"])),!e.include.length)return e},hA=(n,e,t,i=[])=>{let r=iu(n,e),s=iu(n,t);if(!r||!s)return;let o=new Set;Object.keys(r?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let p=i?.some(_=>_===d)?{}:r.properties?.[d]??{},g=s.properties?.[d]??{};a={...a,[d]:{...p,...g}}}),s.properties=a;let c=new Set;return Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let p=r[d]??[],g=s[d]??[];s[d]=Array.from([...p,...g])}),s},uw=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],gp=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values;if(!i?.values.some(r=>!(r?.value instanceof Tt)))return i?.values.map(r=>(r?.value).value)}getNodeTypes(e,t){let i=n.getNodeCompatible(t);if(!i)return[fi()];let r=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(r.length)return r;this.loadTypeAndCache(e);let s=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return s.length?s:[fi()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let r=eu.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,_o.resolve)(t,o);try{let a=cw.default.parse((0,lw.readFileSync)(o,"utf-8"));return{...a,include:uw(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=r.map(o=>iu(r,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...pA(s))})}},ow,fw=()=>(ow??=new gp,ow),pA=n=>n.map(dw),dw=n=>{let e=fi();e.compatible=n.compatible??(n.filePath?(0,_o.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let i=Object.keys(n).filter(r=>r.endsWith("-cells")).map(r=>({specifier:r.replace(/-cells$/,""),values:n[r]}));return n.properties&&Object.keys(n.properties).forEach(r=>{let s=n.properties[r];mA(e,r,s),e.cellsValues=i}),n["child-binding"]&&(e.childNodeType=dw(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},mA=(n,e,t)=>{let i=n.properties.find(r=>typeof r.name=="string"&&r.getNameMatch(e));if(i){i.required=()=>t.required?"required":"optional",i.values=()=>t.enum??[],i.constValue=sw(t.type,t.const);let r=i.additionalTypeCheck;i.additionalTypeCheck=s=>[...aw(t,e)(s),...r?.(s)??[]]}else{let r=new K(e,dA(t.type),t.required?"required":"optional",void 0,t.enum,aw(t,e));r.desctiption=t.description?[t.description]:void 0,r.constValue=sw(t.type,t.const),n.addProperty(r)}},aw=(n,e)=>{let t=n;return i=>{let r=i.parent.root,s=[];if(t.const){let o=i.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||s.push(A(25,i.ast.values??i.ast,Cn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&s.push(A(14,i.ast,Cn.DiagnosticSeverity.Warning,[],[Cn.DiagnosticTag.Deprecated],[i.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&wt(i.ast.values)?.forEach(a=>{cn(a,r)||s.push(A(23,a,Cn.DiagnosticSeverity.Error))}),t.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Tt){let o=i.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=r.getNode(c);return l?a.push(c):s.push(A(24,o,Cn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=wt(i.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=cn(c,r);if(!l){s.push(A(23,c??i.ast,Cn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){s.push(A(16,i.ast,Cn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[i.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let p=d?Re(d,0,0)??0:0;if(1+p>o.length-a){let g=l.nodeType?.cellsValues?.find(_=>_.specifier===u)?.values;s.push(A(20,c??i.ast,Cn.DiagnosticSeverity.Error,[],[],[i.name,`<${["phandel",...g??[],...Array.from({length:p-(g?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+p}}return s}};var ru=(n,e)=>({getNodeTypes:t=>{switch(e){case"Zephyr":return fw().getNodeTypes(n,t)}}});var hw=z(Q()),yp=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(yp):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:hw.FoldingRangeKind.Region},...n.nodes.flatMap(yp)];function pw(n){return n.rootDocument.nodes.flatMap(yp)}var Zi=z(Q());function gA(n){if(!n||!(n.ast instanceof ke)&&!(n.ast instanceof Xe))return[];let e=t=>t.nodeType?.bindingsPath?[Zi.Location.create(`file://${t.nodeType.bindingsPath}`,Zi.Range.create(Zi.Position.create(0,0),Zi.Position.create(0,0)))]:[];return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&n.ast.linksTo?e(n.ast.linksTo):[]}async function mw(n,e,t){return dt(n,e,i=>[...gA(i)],t)}var os=require("path"),ve=[],Ri,bp,Po=new WeakMap,yA=n=>{let e=Po.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},ut=async()=>{await kw,await Promise.all(ve.map(yA))},Tp=n=>{let e=gw(n);return ve.filter(t=>!e.some(i=>i===t))},gw=n=>ve.filter(e=>{let t=n.contexts?.find(i=>i.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(i=>e.overlays.some(r=>r===i))}),bA=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes),i=(await e.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes);return t.length?t.every(r=>i.some(s=>s.reolvedPath===r.reolvedPath&&s.firstToken.pos.col===r.firstToken.pos.col&&s.firstToken.pos.len===r.firstToken.pos.len&&s.firstToken.pos.line===r.firstToken.pos.line&&s.lastToken.pos.col===r.lastToken.pos.col&&s.lastToken.pos.len===r.lastToken.pos.len&&s.lastToken.pos.line===r.lastToken.pos.line)):e.getContextFiles().some(r=>r===n.parser.uri)},yw=async n=>{let e=Tp(ie),t=await gw(ie),i=await fc(e);if(ve.indexOf(n)===-1)return;let r=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(ve.indexOf(n)===-1)return;let s=await Promise.all(i.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await bA(a.context,c)})))),o=i.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&r.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{kp(a),Po.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),ve=ve.filter(a=>o.indexOf(a)===-1))},ue=(0,ge.createConnection)(ge.ProposedFeatures.all),Hn=new ge.TextDocuments(cc),Sp=!0,vp=!1,bw=!1;ue.onInitialize(n=>{let e=n.capabilities;Sp=!!(e.workspace&&e.workspace.configuration),vp=!!(e.workspace&&e.workspace.workspaceFolders),bw=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:ge.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[ge.CodeActionKind.QuickFix,ge.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:lc,tokenModifiers:uc},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return vp&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});ue.onInitialized(()=>{Sp&&ue.client.register(ge.DidChangeConfigurationNotification.type,{}),vp&&ue.workspace.onDidChangeWorkspaceFolders(n=>{ue.console.log("Workspace folder change event received")})});var Tw={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},ie=Tw,vw=new Map,Sw=!1,kw=new Promise(n=>{let e=setInterval(()=>{Sw&&(n(),clearInterval(e))},100)});ue.onDidChangeConfiguration(n=>{if(Sw=!0,!n.settings)return;console.log("Configuration changed",n),Sp&&vw.clear();let e=ie;ie={...Tw,...n.settings?.devicetree},ie.contexts?.forEach((r,s)=>{if(r.cwd||ie.cwd){let o=r.cwd??ie.cwd;r.includePaths??=ie.defaultIncludePaths,r.zephyrBindings??=ie.defaultIncludePaths,r.bindingType??=ie.defaultBindingType,o&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(a=>(0,os.resolve)(o,a)),r.includePaths=r.includePaths?.map(a=>(0,os.resolve)(o,a)),r.dtsFile=(0,os.resolve)(o,r.dtsFile)}});let t=Tp(e);ve=[],Po=new WeakMap,ie.contexts?.forEach((r,s)=>{let o=r.bindingType,a=new qr(r.dtsFile,r.includePaths??[],o?ru(r.zephyrBindings??[],o):void 0,r.overlays,r.ctxName);ve.push(a),console.log(`New context with ID ${a.name} for ${r.dtsFile}`)});let i=Ew();ve=[...ve,...t.map(r=>{let s=ie.defaultBindingType,o=new qr(r.parser.uri,i.defaultIncludePaths,s?ru(i.defaultZephyrBindings,s):void 0);return console.log(`New context with ID ${o.name} for ${r.parser.uri}`),o})],t=Tp(ie),t.forEach(yw),bp&&Do(bp,!0),bw&&ue.languages.diagnostics.refresh()});var Ew=()=>{let n=(ie.defaultIncludePaths??[]).map(t=>ie.cwd?(0,os.resolve)(ie.cwd,t):t);ie.cwd&&ie.defaultBindingType==="Zephyr"&&!ie.defaultZephyrBindings&&(ie.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(ie.defaultZephyrBindings??[]).map(t=>ie.cwd?(0,os.resolve)(ie.cwd,t):t);return{defaultIncludePaths:n,defaultZephyrBindings:e}};Hn.onDidClose(n=>{ue.sendDiagnostics({uri:n.document.uri,version:Hn.get(n.document.uri)?.version,diagnostics:[]}),vw.delete(n.document.uri)});Hn.onDidOpen(async n=>{ue.sendDiagnostics({uri:n.document.uri,version:Hn.get(n.document.uri)?.version,diagnostics:(await TA(n.document.uri)).items??[]})});var TA=async n=>{n=n.replace("file://",""),await ut();let e=await Ri;return{kind:ge.DocumentDiagnosticReportKind.Full,items:e?await Nw(e,n):[{severity:ge.DiagnosticSeverity.Warning,range:ge.Range.create(ge.Position.create(0,0),ge.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}},vA=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include"}},SA=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),kA=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},EA=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),wA=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};Hn.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");hi().renewLexer(e,n.document.getText()),await kw;let t=await aT(ve,e);if(t.length)t.forEach(i=>{Po.get(i.context)?.abort.abort();let r=new AbortController,s=new Promise(o=>{setTimeout(async()=>{if(r.signal.aborted){o();return}let a=performance.now();su.delete(i.context);let c=ww(i.context);await i.context.reevaluate(e),kp(i.context,c),Ep(i.context).then(l=>{l.items.map(u=>({uri:u.uri,version:u.version??void 0,diagnostics:u.items})).forEach(u=>{ue.sendDiagnostics(u)})}),o(),console.log("reevaluate",performance.now()-a)},50)});Po.set(i.context,{abort:r,promise:s})});else{if(ie.allowAdhocContexts===!1)return;let i=ie.defaultBindingType,r=Ew(),s=new qr(e,r.defaultIncludePaths,i?ru(r.defaultZephyrBindings,i):void 0);console.log(`New ad hoc context with ID ${s.name} for ${e}`),ve.push(s),Do(e),await s.parser.stable,yw(s)}});var ww=n=>n.getContextFiles().map(e=>({uri:`file://${e}`,version:Hn.get(`file://${e}`)?.version,diagnostics:[]})),kp=(n,e=ww(n))=>{e.forEach(t=>{ue.sendDiagnostics({uri:`file://${t}`,version:Hn.get(`file://${t}`)?.version,diagnostics:[]})})},Ep=async n=>({items:[...await Promise.all(n.getContextFiles().map(async t=>{let i=await Nw(n,t);return{uri:`file://${t}`,kind:ge.DocumentDiagnosticReportKind.Full,items:i,version:Hn.get(`file://${t}`)?.version??null}}))]});ue.languages.diagnostics.onWorkspace(async()=>{await ut();let n=await Ri;return n?Ep(n):{items:[]}});var su=new WeakMap;async function Nw(n,e){let t=performance.now(),i=su.get(n);if(i){let r=i.get(e);if(r)return r}else su.set(n,new Map);try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:a.issues?a.issues.map(vA).join(" or "):"",source:"devicetree",data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:a.issues,edit:a.edit}}};r.push(c)}),(await n.getContextIssues()??[]).filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:SA(a),source:"devicetree",tags:a.tags,relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(kA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))]};r.push(c)}),(await n.getRuntime())?.typesIssues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:EA(a),relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(wA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))],source:"devicetree",tags:a.tags,data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:a.issues,edit:a.edit}}};r.push(c)}),console.log("diagnostics",e,performance.now()-t),su.get(n)?.set(e,r),r):[{severity:ge.DiagnosticSeverity.Warning,range:ge.Range.create(ge.Position.create(0,0),ge.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}ue.onDidChangeWatchedFiles(n=>{ue.console.log("We received a file change event")});ue.onCompletion(async n=>(await ut(),ve?[...await sv(n,ve,ie.preferredContext),...await gv(n,ve,ie.preferredContext)]:[]));ue.onCompletionResolve(n=>n);Hn.listen(ue);ue.listen();var Do=async(n,e=!1)=>{if(!e&&ie.autoChangeContext===!1)return;bp=n,await ut();let t=await Ri;Ri=Ui(ve,n,ie.preferredContext).then(r=>r?.context);let i=await Ri;t!==i&&(t&&kp(t),i&&Ep(i).then(r=>{r.items.map(s=>({uri:s.uri,version:s.version??void 0,diagnostics:s.items})).forEach(s=>{ue.sendDiagnostics(s)})}),console.log(`(ID: ${i?.name??-1}) activeContext:`,i?.parser.uri),ve.forEach((r,s)=>{console.log(`Context with ID ${r.name} for ${r.parser.uri}`)}))};ue.onDocumentSymbol(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let i=await(await Ri)?.parser;return i?i.getDocumentSymbols(e):[]});ue.onWorkspaceSymbol(async()=>{await ut();let n=await Ri;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ue.languages.semanticTokens.on(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let t=new ge.SemanticTokensBuilder,i=await Ui(ve,e,ie.preferredContext),r=i?.context.isInContext(e);return!i||!r?{data:[]}:(i.context.parser.buildSemanticTokens(t,e),t.build())});ue.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await ut(),(await Ui(ve,e,ie.preferredContext))?.context.getDocumentLinks(e)});ue.onPrepareRename(async n=>(await ut(),fv(n,ve,ie.lockRenameEdits??[],ie.preferredContext)));ue.onRenameRequest(async n=>(await ut(),uv(n,ve,ie.preferredContext)));ue.onReferences(async n=>(await ut(),ov(n,ve,ie.preferredContext)));ue.onDefinition(async n=>{let e=n.textDocument.uri.replace("file://","");await ut();let i=(await(await Ui(ve,e,ie.preferredContext))?.context.getDocumentLinks(e,n.position))?.filter(r=>r.target).map(r=>ge.Location.create(r.target,r.range))??[];return i.length?i:dv(n,ve,ie.preferredContext)});ue.onDeclaration(async n=>(await ut(),hv(n,ve,ie.preferredContext)));ue.onCodeAction(async n=>pv(n));ue.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await ut();let t=await Ui(ve,e,ie.preferredContext);return t?yT(n,t.context):[]});ue.onHover(async n=>(await ut(),(await yv(n,ve,ie.preferredContext)).at(0)));ue.onRequest("devicetree/contexts",async()=>(await ut(),ve.map(n=>n.parser.uri)));ue.onFoldingRanges(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let t=await Ri,i=t?.isInContext(e);return!t||!i?[]:pw(t.parser)});ue.onTypeDefinition(async n=>(await ut(),mw(n,ve)));
|
|
237
|
+
};`,kind:kt.CompletionItemKind.Value,insertTextFormat:kt.InsertTextFormat.Snippet}))]}function c$(n,e){let t=s=>s?s.parentNode instanceof Et||s.parentNode instanceof Ht||s.parentNode instanceof we?!1:t(s.parentNode):!0;if(!n||n.item!==null||!bt(n.ast)||!t(n.ast))return[];let r=s=>zu(s,e).filter(i=>e(i));return n.ast instanceof mt?r(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:kt.CompletionItemKind.Keyword,insertTextFormat:kt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:kt.CompletionItemKind.Keyword,insertTextFormat:kt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(n.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:`${s}`,kind:kt.CompletionItemKind.Variable}))}function l$(n,e){if(!n||!(n.item instanceof ke)||n.item===null)return[];let t=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof we)).filter(s=>e(s));return n.ast instanceof $e||n.ast instanceof En?Array.from(new Set(t(n.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:kt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:kt.CompletionItemKind.Keyword,insertTextFormat:kt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function u$(n,e){if(!n||!(n.item instanceof ke))return[];let t=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 n.ast instanceof Fe||n.ast instanceof He?Array.from(new Set(t(n.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:kt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:kt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:kt.InsertTextFormat.Snippet}]:[]}function d$(n,e){let t=n?.ast instanceof Pr?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof Pr))return[];let r=t.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!bt(n.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:kt.CompletionItemKind.Variable}))}async function QE(n,e,t){return Ot(n,e,(r,s)=>[...u$(r,s),...l$(r,s),...c$(r,s),...d$(r,s),...a$(r,s),...o$(r,s),...i$(r)],t)}var Us=G(X());function f$(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof Qe)return Us.Location.create(`file://${s.uri}`,oe(s.propertyName??s));if(s instanceof He)return Us.Location.create(`file://${s.uri}`,oe(s.propertyName??s))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof ke&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function h$(n){if(!n||!(n.ast instanceof $e)&&!(n.ast instanceof ht))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(r=>{if(r instanceof we)return Us.Location.create(`file://${r.uri}`,oe(r.name??r));if(r instanceof $e)return Us.Location.create(`file://${r.uri}`,oe(r));if(r instanceof Ee)return Us.Location.create(`file://${r.uri}`,oe(r.label??r))}).filter(r=>r);return n.item instanceof ke&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof Ee&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof $e&&n.ast.linksTo?bt(n.ast)?[...e(n.ast.linksTo),Us.Location.create(`file://${n.ast.uri}`,oe(n.ast))]:e(n.ast.linksTo):[]}async function ZE(n,e,t){return Ot(n,e,r=>[...h$(r),...f$(r)],t)}var is=G(X());function ek(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof Qe||s instanceof He)&&s.propertyName)return is.Location.create(`file://${s.uri}`,oe(s.propertyName))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof ke&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function tk(n,e){if(!e||!(e.ast instanceof ht))return[];"newName"in n&&(e.ast.parentNode instanceof Ee&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof ns&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof we).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return is.Location.create(`file://${i.uri}`,oe(i))}).filter(i=>i);return e.item instanceof ke&&!bt(e.ast)?r(e.item):e.ast instanceof ht&&e.ast.parentNode instanceof Ee&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function nk(n){if(!n||!(n.ast instanceof $e))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(r=>{if(r instanceof we&&r.name)return is.Location.create(`file://${r.uri}`,oe(r.name));if(r instanceof $e)return is.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof ke&&!bt(n.ast)?e(n.item):n.ast instanceof $e&&n.ast.linksTo?bt(n.ast)?[...e(n.ast.linksTo),is.Location.create(`file://${n.ast.uri}`,oe(n.ast))]:e(n.ast.linksTo):[]}async function rk(n,e,t){let r={};return(await Ot(n,e,i=>[...nk(i),...tk(n,i),...ek(i)],t)).forEach(i=>{r[i.uri]??=[],r[i.uri].push(is.TextEdit.replace(i.range,n.newName))}),{changes:r}}async function sk(n,e,t,r){let s=await Ot(n,e,i=>[...nk(i),...tk(n,i),...ek(i)],r);if(s.some(i=>t.some(o=>i.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!s.length}}var Gu=G(X());function p$(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof Qe)return Gu.Location.create(`file://${s.uri}`,oe(s.propertyName??s))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof ke&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function m$(n){if(!n||!(n.ast instanceof $e)&&!(n.ast instanceof ht))return[];let e=t=>[...t.definitions,...t.referencedBy].map(r=>{if(r instanceof we)return Gu.Location.create(`file://${r.uri}`,oe(r));if(r instanceof Et)return Gu.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof ke&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof Ee&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof $e&&n.ast.linksTo?e(n.ast.linksTo):[]}async function ik(n,e,t){return Ot(n,e,r=>[...m$(r),...p$(r)],t)}var rm=G(X());function g$(n){if(!n||n.item===null||!(n.ast instanceof Fe))return;let e=r=>r.replaces?e(r.replaces):r,t=r=>rm.Location.create(`file://${r.ast.uri}`,oe(r.ast.propertyName??r.ast));if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof ke&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(e(r))}}function y$(n){if(!n||!(n.ast instanceof $e)&&!(n.ast instanceof ht))return;let e=t=>{let r=t.definitions.at(0);return r?rm.Location.create(`file://${r.uri}`,oe(r)):void 0};if(n.item instanceof ke&&!bt(n.ast))return e(n.item);if(n.ast instanceof ht&&n.ast.parentNode instanceof Ee&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof $e&&n.ast.linksTo)return e(n.ast.linksTo)}async function ok(n,e,t){return(await Ot(n,e,r=>[y$(r)||g$(r)],t)).at(0)}var ee=G(X());var b$=(n,e,t,r,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(ee.Range.create(ee.Position.create(r.range.start.line,n.pos.col+n.pos.len),ee.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},v$=(n,e,t,r,s,i,o)=>{if(!i)return[];switch(t){case 0:return[{title:o??`Add Property "${i.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 26:return i?[{title:o??"TODO",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}]:[];default:return}};function ak(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>b$(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>v$(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===ee.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==ee.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return r.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...s,...t.map(a=>({...a,kind:ee.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}function T$(n){if(!n||!(n.item instanceof pt)||!(n.ast instanceof Qe&&(n.ast.values||n.ast.values===null)))return[];let e=n.item.parent.nodeType;return e instanceof Ki?e.properties.find(t=>t.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]:[]}function _$(n){if(!n||!(n.item instanceof pt&&n.ast instanceof Fe&&n.item.ast.values==null||n.item instanceof ke)||bt(n.ast))return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return n.item instanceof pt?e(n.item.parent):e(n.item)}async function ck(n,e,t){return Ot(n,e,r=>[...T$(r),..._$(r)],t)}function S$(n){if(n?.item instanceof ke)return{contents:n.item.toMarkupContent(),range:oe(n.ast)};if(n?.ast instanceof $e){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}if(n?.ast.parentNode instanceof Ee){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}}function w$(n){if(n?.item instanceof pt&&n.ast instanceof Fe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:oe(n.ast)}}}function lk(n,e,t){return Ot(n,e,r=>[S$(r)||w$(r)],t)}var rv=G(xg());var y0=G(l0(),1);var Ua=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var tx={"[: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]},Va=n=>n.replace(/[[\]\\-]/g,"\\$&"),nx=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),u0=n=>n.join(""),d0=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<n.length;){let g=n.charAt(i);if((g==="!"||g==="^")&&i===t+1){l=!0,i++;continue}if(g==="]"&&o&&!c){u=i+1;break}if(o=!0,g==="\\"&&!c){c=!0,i++;continue}if(g==="["&&!c){for(let[S,[E,v,b]]of Object.entries(tx))if(n.startsWith(S,i)){if(d)return["$.",!1,n.length-t,!0];i+=S.length,b?s.push(E):r.push(E),a=a||v;continue e}}if(c=!1,d){g>d?r.push(Va(d)+"-"+Va(g)):g===d&&r.push(Va(g)),d="",i++;continue}if(n.startsWith("-]",i+1)){r.push(Va(g+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=g,i+=2;continue}r.push(Va(g)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,n.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[nx(g),!1,u-t,!1]}let f="["+(l?"^":"")+u0(r)+"]",m="["+(l?"":"^")+u0(s)+"]";return[r.length&&s.length?"("+f+"|"+m+")":r.length?f:m,a,u-t,!0]};var Hn=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var rx=new Set(["!","?","+","*","@"]),f0=n=>rx.has(n),sx="(?!(?:^|/)\\.\\.?(?:$|/))",Kd="(?!\\.)",ix=new Set(["[","."]),ox=new Set(["..","."]),ax=new Set("().*{}+?[]^$\\!"),cx=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bg="[^/]",h0=Bg+"*?",p0=Bg+"+?",ho=class n{type;#e;#t;#i=!1;#r=[];#o;#T;#l;#d=!1;#a;#c;#s=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#o=t,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.#T=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#c=this.#r.map(e=>String(e)).join("")}#g(){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 t=e,r=t.#o;for(;r;){for(let s=t.#T+1;!r.type&&s<r.#r.length;s++)for(let i of e.#r){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#r[s])}t=r,r=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.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.#T===0)return!0;let e=this.#o;for(let t=0;t<this.#T;t++){let r=e.#r[t];if(!(r instanceof n&&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.#r.length:0;return this.#T===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#y(e,t,r,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let m=r,T="";for(;m<e.length;){let g=e.charAt(m++);if(i||g==="\\"){i=!i,T+=g;continue}if(o){m===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(m===a+2&&c)&&(o=!1),T+=g;continue}else if(g==="["){o=!0,a=m,c=!1,T+=g;continue}if(!s.noext&&f0(g)&&e.charAt(m)==="("){t.push(T),T="";let S=new n(g,t);m=n.#y(e,S,m,s),t.push(S);continue}T+=g}return t.push(T),m}let l=r+1,u=new n(null,t),d=[],f="";for(;l<e.length;){let m=e.charAt(l++);if(i||m==="\\"){i=!i,f+=m;continue}if(o){l===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(l===a+2&&c)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=l,c=!1,f+=m;continue}if(f0(m)&&e.charAt(l)==="("){u.push(f),f="";let T=new n(m,u);u.push(T),l=n.#y(e,T,l,s);continue}if(m==="|"){u.push(f),f="",d.push(u),u=new n(null,t);continue}if(m===")")return f===""&&t.#r.length===0&&(t.#s=!0),u.push(f),f="",t.push(...d,u),l;f+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new n(null,void 0,t);return n.#y(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,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(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[T,g,S,E]=typeof m=="string"?n.#f(m,this.#t,c):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,T}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&ox.has(this.#r[0]))){let T=ix,g=t&&T.has(l.charAt(0))||l.startsWith("\\.")&&T.has(l.charAt(2))||l.startsWith("\\.\\.")&&T.has(l.charAt(4)),S=!t&&!e&&T.has(l.charAt(0));u=g?sx:S?Kd:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Hn(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#h(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,Hn(this.toString()),!1,!1]}let o=!r||e||t||!Kd?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!t?Kd:"")+p0;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Kd:"")+h0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,Hn(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,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+=(ax.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=d0(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){r&&e==="*"?i+=p0:i+=h0,t=!0;continue}if(c==="?"){i+=Bg,t=!0;continue}i+=cx(c)}return[i,Hn(e),!!t,o]}};var po=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var zt=(n,e,t={})=>(Ua(e),!t.nocomment&&e.charAt(0)==="#"?!1:new mn(e,t).match(n)),lx=/^\*+([^+@!?\*\[\(]*)$/,ux=n=>e=>!e.startsWith(".")&&e.endsWith(n),dx=n=>e=>e.endsWith(n),fx=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),hx=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),px=/^\*+\.\*+$/,mx=n=>!n.startsWith(".")&&n.includes("."),gx=n=>n!=="."&&n!==".."&&n.includes("."),yx=/^\.\*+$/,bx=n=>n!=="."&&n!==".."&&n.startsWith("."),vx=/^\*+$/,Tx=n=>n.length!==0&&!n.startsWith("."),_x=n=>n.length!==0&&n!=="."&&n!=="..",Sx=/^\?+([^+@!?\*\[\(]*)?$/,wx=([n,e=""])=>{let t=b0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Ex=([n,e=""])=>{let t=v0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},kx=([n,e=""])=>{let t=v0([n]);return e?r=>t(r)&&r.endsWith(e):t},Nx=([n,e=""])=>{let t=b0([n]);return e?r=>t(r)&&r.endsWith(e):t},b0=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},v0=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},T0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",m0={win32:{sep:"\\"},posix:{sep:"/"}},Px=T0==="win32"?m0.win32.sep:m0.posix.sep;zt.sep=Px;var It=Symbol("globstar **");zt.GLOBSTAR=It;var Rx="[^/]",Dx=Rx+"*?",Cx="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ox="(?:(?!(?:\\/|^)\\.).)*?",Ax=(n,e={})=>t=>zt(t,n,e);zt.filter=Ax;var Nn=(n,e={})=>Object.assign({},n,e),Ix=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return zt;let e=zt;return Object.assign((r,s,i={})=>e(r,s,Nn(n,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Nn(n,i))}static defaults(s){return e.defaults(Nn(n,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Nn(n,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Nn(n,i))}},unescape:(r,s={})=>e.unescape(r,Nn(n,s)),escape:(r,s={})=>e.escape(r,Nn(n,s)),filter:(r,s={})=>e.filter(r,Nn(n,s)),defaults:r=>e.defaults(Nn(n,r)),makeRe:(r,s={})=>e.makeRe(r,Nn(n,s)),braceExpand:(r,s={})=>e.braceExpand(r,Nn(n,s)),match:(r,s,i={})=>e.match(r,s,Nn(n,i)),sep:e.sep,GLOBSTAR:It})};zt.defaults=Ix;var _0=(n,e={})=>(Ua(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,y0.default)(n));zt.braceExpand=_0;var $x=(n,e={})=>new mn(n,e).makeRe();zt.makeRe=$x;var Mx=(n,e,t={})=>{let r=new mn(e,t);return n=n.filter(s=>r.match(s)),r.options.nonull&&!n.length&&n.push(e),n};zt.match=Mx;var g0=/[?*]|[+@!]\(.*?\)|\[|\]/,Lx=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Ua(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||T0,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...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]==="?"||!g0.test(i[2]))&&!g0.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:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.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)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!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;t=!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==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<t.length;)if(e[s]===t[i])o.push(a==="b"?t[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(r&&t[i]==="**"&&e[s]===t[i+1])o.push(t[i]),i++;else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[i]),s++,i++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,R=v?3:E?0:void 0;if(typeof b=="number"&&typeof R=="number"){let[O,L]=[e[b],t[R]];O.toLowerCase()===L.toLowerCase()&&(t[R]=O,R>b?t=t.slice(R):b>R&&(e=e.slice(b)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===It){this.debug("GLOBSTAR",[t,u,d]);var f=o,m=a+1;if(m===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 T=e[f];if(this.debug(`
|
|
238
|
+
globstar while`,e,f,t,m,T),this.matchOne(e.slice(f),t.slice(m),r))return this.debug("globstar found match!",f,c,T),!0;if(T==="."||T===".."||!s.dot&&T.charAt(0)==="."){this.debug("dot detected!",e,f,t,m);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
|
|
239
|
+
>>> no match, partial?`,e,f,t,m),f===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)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 _0(this.pattern,this.options)}parse(e){Ua(e);let t=this.options;if(e==="**")return It;if(e==="")return"";let r,s=null;(r=e.match(vx))?s=t.dot?_x:Tx:(r=e.match(lx))?s=(t.nocase?t.dot?hx:fx:t.dot?dx:ux)(r[1]):(r=e.match(Sx))?s=(t.nocase?t.dot?Ex:wx:t.dot?kx:Nx)(r):(r=e.match(px))?s=t.dot?gx:mx:(r=e.match(yx))&&(s=bx);let i=ho.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 t=this.options,r=t.noglobstar?Dx:t.dot?Cx:Ox,s=new Set(t.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"?Lx(u):u===It?It:u._src});return l.forEach((u,d)=>{let f=l[d+1],m=l[d-1];u!==It||m===It||(m===void 0?f!==void 0&&f!==It?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=m+"(?:\\/|"+r+")?":f!==It&&(l[d-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=It))}),l.filter(u=>u!==It).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,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let 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,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return zt.defaults(e).Minimatch}};zt.AST=ho;zt.Minimatch=mn;zt.escape=po;zt.unescape=Hn;var H0=require("node:url");var mo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,w0=new Set,Ug=typeof process=="object"&&process?process:{},E0=(n,e,t,r)=>{typeof Ug.emitWarning=="function"?Ug.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},zd=globalThis.AbortController,S0=globalThis.AbortSignal;if(typeof zd>"u"){S0=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},zd=class{constructor(){e()}signal=new S0;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 n=Ug.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,E0("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 qx=n=>!w0.has(n),WQ=Symbol("type"),ms=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),k0=n=>ms(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?go:null:null,go=class extends Array{constructor(e){super(e),this.fill(0)}},Vg=class n{heap;length;static#e=!1;static create(e){let t=k0(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Wa=class n{#e;#t;#i;#r;#o;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#g;#y;#h;#f;#w;#m;#E;#k;#v;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#v,sizes:e.#E,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#f},free:e.#w,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,r,s,i)=>e.#x(t,r,s,i),moveToTail:t=>e.#F(t),indexes:t=>e.#P(t),rindexes:t=>e.#R(t),isStale:t=>e.#b(t)}}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.#T}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:T=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:O,ignoreFetchAbort:L}=e;if(t!==0&&!ms(t))throw new TypeError("max option must be a nonnegative integer");let V=t?k0(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=T||this.#t,this.sizeCalculation=g,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.#T=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=S,this.#S=!!S,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#s=new Array(t).fill(void 0),this.#g=new V(t),this.#y=new V(t),this.#h=0,this.#f=0,this.#w=Vg.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#r=u,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#_=!!this.#i,this.#p=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!ms(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ms(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ms(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!ms(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";qx(j)&&(w0.add(j),E0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#D(){let e=new go(this.#e),t=new go(this.#e);this.#v=e,this.#k=t,this.#A=(i,o,a=mo.now())=>{if(t[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(i)&&this.#O(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{t[i]=e[i]!==0?mo.now():0},this.#n=(i,o)=>{if(e[o]){let a=e[o],c=t[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=mo.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=t[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#b=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new go(this.#e);this.#d=0,this.#E=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#M=(t,r,s,i)=>{if(this.#u(r))return 0;if(!ms(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,t),!ms(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.#$=(t,r,s)=>{if(e[t]=r,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#q(!0)}this.#d+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#$=(e,t,r)=>{};#M=(e,t,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 t=this.#f;!(!this.#L(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#L(t)||((e||!this.#b(t))&&(yield t),t===this.#f));)t=this.#g[t]}#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 t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*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,t={}){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#R()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#R({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let r=this.#s[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#v&&this.#k){let o=this.#v[t],a=this.#k[t];if(o&&a){let c=o-(mo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#E&&(i.size=this.#E[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#c[t],s=this.#s[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#v&&this.#k){o.ttl=this.#v[t];let a=mo.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=mo.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===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,t,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#f:this.#w.length!==0?this.#w.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#s[d]=t,this.#a.set(e,d),this.#g[this.#f]=d,this.#y[d]=this.#f,this.#f=d,this.#l++,this.#$(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(t!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=f;m!==void 0&&!o&&(this.#_&&this.#i?.(m,e,"set"),this.#p&&this.#m?.push([m,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]));if(this.#I(d),this.#$(d,u,c),this.#s[d]=t,c){c.set="replace";let m=f&&this.#u(f)?f.__staleWhileFetching:f;m!==void 0&&(c.oldValue=m)}}else c&&(c.set="update")}if(s!==0&&!this.#v&&this.#D(),this.#v&&(l||this.#A(d,s,i),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let f=this.#m,m;for(;m=f?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#q(e){let t=this.#h,r=this.#c[t],s=this.#s[t];return this.#S&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(s,r,"evict"),this.#p&&this.#m?.push([s,r,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#s[t]=void 0,this.#w.push(t)),this.#l===1?(this.#h=this.#f=0,this.#w.length=0):this.#h=this.#g[t],this.#a.delete(r),this.#l--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,i=this.#a.get(e);if(i!==void 0){let o=this.#s[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(i))s&&(s.has="stale",this.#n(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#n(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!r&&this.#b(s))return;let i=this.#s[s];return this.#u(i)?i.__staleWhileFetching:i}#x(e,t,r,s){let i=t===void 0?void 0:this.#s[t];if(this.#u(i))return i;let o=new zd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(g,S=!1)=>{let{aborted:E}=o.signal,v=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!v&&!S)return d(o.signal.reason);let b=m;return this.#s[t]===m&&(g===void 0?b.__staleWhileFetching?this.#s[t]=b.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),d(g)),d=g=>{let{aborted:S}=o.signal,E=S&&r.allowStaleOnFetchAbort,v=E||r.allowStaleOnFetchRejection,b=v||r.noDeleteOnFetchRejection,R=m;if(this.#s[t]===m&&(!b||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):E||(this.#s[t]=R.__staleWhileFetching)),v)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},f=(g,S)=>{let E=this.#o?.(e,i,c);E&&E instanceof Promise&&E.then(v=>g(v===void 0?void 0:v),S),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=v=>l(v,!0)))})};r.status&&(r.status.fetchDispatched=!0);let m=new Promise(f).then(l,u),T=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,T,{...c.options,status:void 0}),t=this.#a.get(e)):this.#s[t]=T,T}#u(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof zd}async fetch(e,t={}){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:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:v}=t;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:T,ignoreFetchAbort:m,status:E,signal:v},R=this.#a.get(e);if(R===void 0){E&&(E.fetch="miss");let O=this.#x(e,R,b,g);return O.__returned=O}else{let O=this.#s[R];if(this.#u(O)){let Ae=r&&O.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",Ae&&(E.returnedStale=!0)),Ae?O.__staleWhileFetching:O.__returned=O}let L=this.#b(R);if(!S&&!L)return E&&(E.fetch="hit"),this.#F(R),s&&this.#N(R),E&&this.#n(E,R),O;let V=this.#x(e,R,b,g),re=V.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=L?"stale":"refresh",re&&L&&(E.returnedStale=!0)),re?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#T;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=t,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,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#O(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,t){this.#y[t]=e,this.#g[e]=t}#F(e){e!==this.#f&&(e===this.#h?this.#h=this.#g[e]:this.#j(this.#y[e],this.#g[e]),this.#j(this.#f,e),this.#f=e)}delete(e){return this.#O(e,"delete")}#O(e,t){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(t);else{this.#I(s);let i=this.#s[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(i,e,t),this.#p&&this.#m?.push([i,e,t])),this.#a.delete(e),this.#c[s]=void 0,this.#s[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#h)this.#h=this.#g[s];else{let o=this.#y[s];this.#g[o]=this.#g[s];let a=this.#g[s];this.#y[a]=this.#y[s]}this.#l--,this.#w.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#r?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let r=this.#s[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#_&&this.#i?.(r,s,e),this.#p&&this.#m?.push([r,s,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#v&&this.#k&&(this.#v.fill(0),this.#k.fill(0)),this.#E&&this.#E.fill(0),this.#h=0,this.#f=0,this.#w.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};var vo=require("node:path"),M0=require("node:url"),hr=require("fs"),zx=G(require("node:fs"),1),bs=require("node:fs/promises");var ef=require("node:events"),Jg=G(require("node:stream"),1),C0=require("node:string_decoder"),N0=typeof process=="object"&&process?process:{stdout:null,stderr:null},xx=n=>!!n&&typeof n=="object"&&(n instanceof ys||n instanceof Jg.default||jx(n)||Fx(n)),jx=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==Jg.default.Writable.prototype.pipe,Fx=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Cr=Symbol("EOF"),Or=Symbol("maybeEmitEnd"),gs=Symbol("emittedEnd"),Gd=Symbol("emittingEnd"),Ha=Symbol("emittedError"),Yd=Symbol("closed"),P0=Symbol("read"),Jd=Symbol("flush"),R0=Symbol("flushChunk"),Kn=Symbol("encoding"),yo=Symbol("decoder"),Nt=Symbol("flowing"),Ka=Symbol("paused"),bo=Symbol("resume"),Pt=Symbol("buffer"),Gt=Symbol("pipes"),Rt=Symbol("bufferLength"),Wg=Symbol("bufferPush"),Xd=Symbol("bufferShift"),Ft=Symbol("objectMode"),it=Symbol("destroyed"),Hg=Symbol("error"),Kg=Symbol("emitData"),D0=Symbol("emitEnd"),zg=Symbol("emitEnd2"),dr=Symbol("async"),Gg=Symbol("abort"),Qd=Symbol("aborted"),za=Symbol("signal"),Js=Symbol("dataListeners"),gn=Symbol("discarded"),Ga=n=>Promise.resolve().then(n),Bx=n=>n(),Ux=n=>n==="end"||n==="finish"||n==="prefinish",Vx=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,Wx=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Zd=class{src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[bo](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Yg=class extends Zd{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},Hx=n=>!!n.objectMode,Kx=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",ys=class extends ef.EventEmitter{[Nt]=!1;[Ka]=!1;[Gt]=[];[Pt]=[];[Ft];[Kn];[dr];[yo];[Cr]=!1;[gs]=!1;[Gd]=!1;[Yd]=!1;[Ha]=null;[Rt]=0;[it]=!1;[za];[Qd]=!1;[Js]=0;[gn]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Hx(t)?(this[Ft]=!0,this[Kn]=null):Kx(t)?(this[Kn]=t.encoding,this[Ft]=!1):(this[Ft]=!1,this[Kn]=null),this[dr]=!!t.async,this[yo]=this[Kn]?new C0.StringDecoder(this[Kn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Pt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Gt]});let{signal:r}=t;r&&(this[za]=r,r.aborted?this[Gg]():r.addEventListener("abort",()=>this[Gg]()))}get bufferLength(){return this[Rt]}get encoding(){return this[Kn]}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[Ft]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[dr]}set async(e){this[dr]=this[dr]||!!e}[Gg](){this[Qd]=!0,this.emit("abort",this[za]?.reason),this.destroy(this[za]?.reason)}get aborted(){return this[Qd]}set aborted(e){}write(e,t,r){if(this[Qd])return!1;if(this[Cr])throw new Error("write after end");if(this[it])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[dr]?Ga:Bx;if(!this[Ft]&&!Buffer.isBuffer(e)){if(Wx(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Vx(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ft]?(this[Nt]&&this[Rt]!==0&&this[Jd](!0),this[Nt]?this.emit("data",e):this[Wg](e),this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt]):e.length?(typeof e=="string"&&!(t===this[Kn]&&!this[yo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Kn]&&(e=this[yo].write(e)),this[Nt]&&this[Rt]!==0&&this[Jd](!0),this[Nt]?this.emit("data",e):this[Wg](e),this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt]):(this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt])}read(e){if(this[it])return null;if(this[gn]=!1,this[Rt]===0||e===0||e&&e>this[Rt])return this[Or](),null;this[Ft]&&(e=null),this[Pt].length>1&&!this[Ft]&&(this[Pt]=[this[Kn]?this[Pt].join(""):Buffer.concat(this[Pt],this[Rt])]);let t=this[P0](e||null,this[Pt][0]);return this[Or](),t}[P0](e,t){if(this[Ft])this[Xd]();else{let r=t;e===r.length||e===null?this[Xd]():typeof r=="string"?(this[Pt][0]=r.slice(e),t=r.slice(0,e),this[Rt]-=e):(this[Pt][0]=r.subarray(e),t=r.subarray(0,e),this[Rt]-=e)}return this.emit("data",t),!this[Pt].length&&!this[Cr]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Cr]=!0,this.writable=!1,(this[Nt]||!this[Ka])&&this[Or](),this}[bo](){this[it]||(!this[Js]&&!this[Gt].length&&(this[gn]=!0),this[Ka]=!1,this[Nt]=!0,this.emit("resume"),this[Pt].length?this[Jd]():this[Cr]?this[Or]():this.emit("drain"))}resume(){return this[bo]()}pause(){this[Nt]=!1,this[Ka]=!0,this[gn]=!1}get destroyed(){return this[it]}get flowing(){return this[Nt]}get paused(){return this[Ka]}[Wg](e){this[Ft]?this[Rt]+=1:this[Rt]+=e.length,this[Pt].push(e)}[Xd](){return this[Ft]?this[Rt]-=1:this[Rt]-=this[Pt][0].length,this[Pt].shift()}[Jd](e=!1){do;while(this[R0](this[Xd]())&&this[Pt].length);!e&&!this[Pt].length&&!this[Cr]&&this.emit("drain")}[R0](e){return this.emit("data",e),this[Nt]}pipe(e,t){if(this[it])return e;this[gn]=!1;let r=this[gs];return t=t||{},e===N0.stdout||e===N0.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[Gt].push(t.proxyErrors?new Yg(this,e,t):new Zd(this,e,t)),this[dr]?Ga(()=>this[bo]()):this[bo]()),e}unpipe(e){let t=this[Gt].find(r=>r.dest===e);t&&(this[Gt].length===1?(this[Nt]&&this[Js]===0&&(this[Nt]=!1),this[Gt]=[]):this[Gt].splice(this[Gt].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[gn]=!1,this[Js]++,!this[Gt].length&&!this[Nt]&&this[bo]();else if(e==="readable"&&this[Rt]!==0)super.emit("readable");else if(Ux(e)&&this[gs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ha]){let s=t;this[dr]?Ga(()=>s.call(this,this[Ha])):s.call(this,this[Ha])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Js]=this.listeners("data").length,this[Js]===0&&!this[gn]&&!this[Gt].length&&(this[Nt]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Js]=0,!this[gn]&&!this[Gt].length&&(this[Nt]=!1)),t}get emittedEnd(){return this[gs]}[Or](){!this[Gd]&&!this[gs]&&!this[it]&&this[Pt].length===0&&this[Cr]&&(this[Gd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yd]&&this.emit("close"),this[Gd]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==it&&this[it])return!1;if(e==="data")return!this[Ft]&&!r?!1:this[dr]?(Ga(()=>this[Kg](r)),!0):this[Kg](r);if(e==="end")return this[D0]();if(e==="close"){if(this[Yd]=!0,!this[gs]&&!this[it])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[Ha]=r,super.emit(Hg,r);let i=!this[za]||this.listeners("error").length?super.emit("error",r):!1;return this[Or](),i}else if(e==="resume"){let i=super.emit("resume");return this[Or](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...t);return this[Or](),s}[Kg](e){for(let r of this[Gt])r.dest.write(e)===!1&&this.pause();let t=this[gn]?!1:super.emit("data",e);return this[Or](),t}[D0](){return this[gs]?!1:(this[gs]=!0,this.readable=!1,this[dr]?(Ga(()=>this[zg]()),!0):this[zg]())}[zg](){if(this[yo]){let t=this[yo].end();if(t){for(let r of this[Gt])r.dest.write(t);this[gn]||super.emit("data",t)}}for(let t of this[Gt])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ft]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Ft]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Ft])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Kn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(it,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[gn]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Cr])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(it,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(it,u),this.pause(),i({value:d,done:!!this[Cr]})},l=()=>{this.off("error",a),this.off("data",c),this.off(it,u),t(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(it,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[gn]=!1;let e=!1,t=()=>(this.pause(),this.off(Hg,t),this.off(it,t),this.off("end",t),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(Hg,t),this.once(it,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[it])return e?this.emit("error",e):this.emit(it),this;this[it]=!0,this[gn]=!0,this[Pt].length=0,this[Rt]=0;let t=this;return typeof t.close=="function"&&!this[Yd]&&t.close(),e?this.emit("error",e):this.emit(it),this}static get isStream(){return xx}};var Gx=hr.realpathSync.native,Ja={lstatSync:hr.lstatSync,readdir:hr.readdir,readdirSync:hr.readdirSync,readlinkSync:hr.readlinkSync,realpathSync:Gx,promises:{lstat:bs.lstat,readdir:bs.readdir,readlink:bs.readlink,realpath:bs.realpath}},L0=n=>!n||n===Ja||n===zx?Ja:{...Ja,...n,promises:{...Ja.promises,...n.promises||{}}},q0=/^\\\\\?\\([a-z]:)\\?$/i,Yx=n=>n.replace(/\//g,"\\").replace(q0,"$1\\"),Jx=/[\\\/]/,Rn=0,x0=1,j0=2,fr=4,F0=6,B0=8,Xs=10,U0=12,Pn=15,Ya=~Pn,Xg=16,O0=32,Xa=64,zn=128,tf=256,rf=512,A0=Xa|zn|rf,Xx=1023,Qg=n=>n.isFile()?B0:n.isDirectory()?fr:n.isSymbolicLink()?Xs:n.isCharacterDevice()?j0:n.isBlockDevice()?F0:n.isSocket()?U0:n.isFIFO()?x0:Rn,I0=new Map,Qa=n=>{let e=I0.get(n);if(e)return e;let t=n.normalize("NFKD");return I0.set(n,t),t},$0=new Map,nf=n=>{let e=$0.get(n);if(e)return e;let t=Qa(n.toLowerCase());return $0.set(n,t),t},sf=class extends Wa{constructor(){super({max:256})}},Zg=class extends Wa{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},V0=Symbol("PathScurry setAsCwd"),Bt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#T;get gid(){return this.#T}#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}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#f;get birthtimeMs(){return this.#f}#w;get atime(){return this.#w}#m;get mtime(){return this.#m}#E;get ctime(){return this.#E}#k;get birthtime(){return this.#k}#v;#_;#S;#p;#D;#N;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Rn,r,s,i,o,a){this.name=e,this.#v=i?nf(e):Qa(e),this.#n=t&Xx,this.nocase=i,this.roots=s,this.root=r||this,this.#A=o,this.#S=a.fullpath,this.#D=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=L0(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(s):this.#I(s)}#I(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~Xg,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?nf(e):Qa(e);for(let c of r)if(c.#v===s)return c;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,Rn,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=zn),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,t=this.parent;if(!t)return this.#D=this.name;let r=t.relative();return r+(!r||!t.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,t=this.parent;if(!t)return this.#N=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&Pn)===Rn}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Pn)===B0}isDirectory(){return(this.#n&Pn)===fr}isCharacterDevice(){return(this.#n&Pn)===j0}isBlockDevice(){return(this.#n&Pn)===F0}isFIFO(){return(this.#n&Pn)===x0}isSocket(){return(this.#n&Pn)===U0}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&O0?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Pn;return!(e!==Rn&&e!==Xs||this.#n&tf||this.#n&zn)}calledReaddir(){return!!(this.#n&Xg)}isENOENT(){return!!(this.#n&zn)}isNamed(e){return this.nocase?this.#v===nf(e):this.#v===Qa(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#b=r}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#b=r}catch(t){this.#u(t.code);return}}#$(e){this.#n|=Xg;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#M()}}#M(){this.#n&zn||(this.#n=(this.#n|zn)&Ya,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#M()}#R(){this.#n|=rf,this.#L()}#L(){if(this.#n&Xa)return;let e=this.#n;(e&Pn)===fr&&(e&=Ya),this.#n=e|Xa,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#M():this.children().provisional=0}#x(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#M()}#u(e=""){let t=this.#n;t|=tf,e==="ENOENT"&&(t|=zn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ya),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,t){return this.#O(e,t)||this.#F(e,t)}#F(e,t){let r=Qg(e),s=this.newChild(e.name,r,{parent:this}),i=s.#n&Pn;return i!==fr&&i!==Xs&&i!==Rn&&(s.#n|=Xa),t.unshift(s),t.provisional++,s}#O(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?nf(e.name):Qa(e.name))===s.#v)return this.#B(e,s,r,t)}}#B(e,t,r,s){let i=t.name;return t.#n=t.#n&Ya|Qg(e),i!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if(!(this.#n&zn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#x(e.code)}}lstatSync(){if(!(this.#n&zn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#x(e.code)}}#H(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:m,mtime:T,mtimeMs:g,nlink:S,rdev:E,size:v,uid:b}=e;this.#w=t,this.#g=r,this.#k=s,this.#f=i,this.#d=o,this.#s=a,this.#E=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=m,this.#m=T,this.#y=g,this.#r=S,this.#l=E,this.#c=v,this.#o=b;let R=Qg(e);this.#n=this.#n&Ya|R|O0,R!==Rn&&R!==fr&&R!==Xs&&(this.#n|=Xa)}#V=[];#W=!1;#K(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);t?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#W)return;this.#W=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#q(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#$(r)}this.#K(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 t=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(t,{withFileTypes:!0}))this.#j(s,e);this.#$(e)}catch(s){this.#q(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 t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(r,e);this.#$(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&A0)return!1;let e=Pn&this.#n;return e===Rn||e===fr||e===Xs}shouldWalk(e,t){return(this.#n&fr)===fr&&!(this.#n&A0)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((rf|tf|zn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#C)return this.#C;if(!((rf|tf|zn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[V0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#D=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#D=void 0,s.#N=void 0,s=s.parent}},of=class n extends Bt{sep="\\";splitSep=Jx;constructor(e,t=Rn,r,s,i,o,a){super(e,t,r,s,i,o,a)}newChild(e,t=Rn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return vo.win32.parse(e).root}getRoot(e){if(e=Yx(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new To(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(q0,"$1\\"),e===t}},af=class n extends Bt{splitSep="/";sep="/";constructor(e,t=Rn,r,s,i,o,a){super(e,t,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Rn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},cf=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=Ja}={}){this.#r=L0(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,M0.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new sf,this.#t=new sf,this.#i=new Zg(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.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,m=!1;for(let T of c){let g=u--;l=l.child(T,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:f+=(m?"":d)+T}),m=!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 t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,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,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;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:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((m,T)=>{if(m)return f(m);let g=T.length;if(!g)return f();let S=()=>{--g===0&&f()};for(let E of T)(!i||i(E))&&a.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,S):S()):E.shouldWalk(c,o)?l(E,S):S()},!0)},u=e;return new Promise((d,f)=>{l(u,m=>{if(m)return f(m);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,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,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!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,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new ys({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 m=l.shift();if(!m){u===0&&a.end();return}u++,c.add(m);let T=(S,E,v=!1)=>{if(S)return a.emit("error",S);if(s&&!v){let b=[];for(let R of E)R.isSymbolicLink()&&b.push(R.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>T(null,E,!0));return}}for(let b of E)b&&(!i||i(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of E){let R=b.realpathCached()||b;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):g||d()},g=!0;m.readdirCB(T,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new ys({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 m=l.shift();if(!m){u===0&&a.end();return}u++,c.add(m);let T=m.readdirSync();for(let g of T)(!i||i(g))&&(a.write(r?g:g.fullpath())||(f=!0));u--;for(let g of T){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(c,o)&&l.push(S)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[V0](t)}},To=class extends cf{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,vo.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return vo.win32.parse(e).root.toUpperCase()}newRoot(e){return new of(this.rootPath,fr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},_o=class extends cf{sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,vo.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new af(this.rootPath,fr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Za=class extends _o{constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},YQ=process.platform==="win32"?of:af,W0=process.platform==="win32"?To:process.platform==="darwin"?Za:_o;var Qx=n=>n.length>=1,Zx=n=>n.length>=1,So=class n{#e;#t;#i;length;#r;#o;#T;#l;#d;#a;#c=!0;constructor(e,t,r,s){if(!Qx(e))throw new TypeError("empty pattern list");if(!Zx(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,m,...T]=this.#t;l[0]===""&&(l.shift(),T.shift());let g=[i,o,a,c,""].join("/"),S=[u,d,f,m,""].join("/");this.#e=[g,...l],this.#t=[S,...T],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.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===It}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#T=this.#T||(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 n(this.#e,this.#t,this.#i+1,this.#r),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.#r==="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.#r==="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 ej=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",wo=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:i,platform:o=ej}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,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 t=new mn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],i=t.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new So(s,i,0,this.platform),a=new mn(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 t=e.fullpath(),r=`${t}/`,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(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=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(t))return!0;return!1}};var ey=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},ty=class{store=new Map;add(e,t,r){let s=(t?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,t])=>[e,!!(t&2),!!(t&1)])}},ny=class{store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ec=class n{hasWalkedCache;matches=new ty;subwalks=new ny;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new ey}processPatterns(e,t){this.patterns=t;let r=t.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===It){(!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 m=s.parent||s;f?this.hasWalkedCache.hasWalked(m,f)||this.subwalks.add(m,f):this.matches.add(m,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===It?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,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),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,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var tj=(n,e)=>typeof n=="string"?new wo([n],e):Array.isArray(n)?new wo(n,e):n,lf=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=tj(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}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&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,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&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,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";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.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new ec(this.opts),r)}walkCB2(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(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,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(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,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new ec(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(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,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},tc=class extends lf{matches=new Set;constructor(e,t,r){super(e,t,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,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},nc=class extends lf{results;constructor(e,t,r){super(e,t,r),this.results=new ys({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 nj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Gn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,H0.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||nj,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?To:t.platform==="darwin"?Za:t.platform?_o:W0;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,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 mn(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 So(c,u,0,this.platform)})}async walk(){return[...await new tc(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 tc(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 nc(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 nc(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 ry=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new mn(t,e).hasMagic())return!0;return!1};function uf(n,e={}){return new Gn(n,e).streamSync()}function z0(n,e={}){return new Gn(n,e).stream()}function G0(n,e={}){return new Gn(n,e).walkSync()}async function K0(n,e={}){return new Gn(n,e).walk()}function df(n,e={}){return new Gn(n,e).iterateSync()}function Y0(n,e={}){return new Gn(n,e).iterate()}var rj=uf,sj=Object.assign(z0,{sync:uf}),ij=df,oj=Object.assign(Y0,{sync:df}),aj=Object.assign(G0,{stream:uf,iterate:df}),Qs=Object.assign(K0,{glob:K0,globSync:G0,sync:aj,globStream:z0,stream:sj,globStreamSync:uf,streamSync:rj,globIterate:Y0,iterate:oj,globIterateSync:df,iterateSync:ij,Glob:Gn,hasMagic:ry,escape:po,unescape:Hn});Qs.glob=Qs;var sv=require("path"),iv=require("fs");var ZC=G(JC());var nv={};PO(nv,{$id:()=>CW,$schema:()=>DW,default:()=>MW,definitions:()=>AW,properties:()=>$W,title:()=>OW,type:()=>IW});var DW="http://json-schema.org/draft-07/schema#",CW="http://json-schema.org/draft-07/schema#",OW="Core schema meta-schema",AW={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:[]}},IW=["object","boolean"],$W={$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:"#"}},MW={$schema:DW,$id:CW,title:OW,definitions:AW,type:IW,properties:$W,default:!0};var Tt=G(X());var Kf=class extends oa{constructor(t,r){super();this.ajv=t;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof lt&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(A(22,c,Tt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[Tt.DiagnosticTag.Unnecessary]))),s;let a=ke.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...LW(t,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.path.join("/")}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.path.join("/")}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let r=(this.validate?.schema).properties?.[t];if(r&&"description"in r)return{kind:Tt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
240
|
+
|
|
241
|
+
`):r.description]:[]].join(`
|
|
242
|
+
`)}}getPropertyListCompletionItems(t){let r=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return r.map(i=>{let o=t&&s.some(l=>l===i),a=!!t.property.some(l=>i===l.name),c="a";return o?c=a?"Y":"A":c=a?"Z":"B",{label:`${i}`,kind:Tt.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},LW=(n,e,t,r)=>{let s=qW(t,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],Tt.TextEdit.del(Jp(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=i.getProperty(e.instancePath.split("/")[1]);return o?[A(26,o.ast,Tt.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=n.getOrderedNodeAst(i),c=Ui(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return A(0,c[u],Tt.DiagnosticSeverity.Error,[],[],[o],Tt.TextEdit.insert(Tt.Position.create(d.pos.line,d.pos.col+1),`
|
|
243
|
+
${"".padEnd(Hi(c[u].uri,l)*ji().length,ji())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
|
|
244
|
+
${e.params.allowedValues.join(`
|
|
245
|
+
`)}
|
|
246
|
+
${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[A(26,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
247
|
+
${JSON.stringify(e)}
|
|
248
|
+
${r}`])]:[A(26,s.node.definitions[0]instanceof Ht?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
249
|
+
${JSON.stringify(e)}
|
|
250
|
+
${r}`])]},qW=(n,e)=>XC(n,e.split("/").filter(t=>t)),XC=(n,e)=>{if(e.length===0)return{node:n,remainingInstancePath:""};let t=e[0].split("@"),r=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=n.getNode(r,s);return i?XC(i,e.slice(1)):{node:n,property:n.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var ov=class n{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 lt)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){Qs.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,sv.resolve)(e,s);try{let i=rv.default.parse((0,iv.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){Qs.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,sv.resolve)(e,s);try{let i=rv.default.parse((0,iv.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,r){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new ZC.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(nv),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),n.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Kf(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)??[]}},QC,eO=()=>(QC??=new ov,QC);var sO=G(xg());var $c=require("path"),iO=require("fs");var br=G(X()),xW=n=>{switch(n){case"string":return H(3);case"int":return H(1);case"boolean":return H(0);case"array":return H(4);case"uint8-array":return H(6);case"string-array":return H(5);case"phandle":return H(1);case"phandles":return H(4);case"phandle-array":return H(4);case"path":return H([3,1]);case"compound":return H(8)}},tO=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},zf=(n,e)=>{if(e=e.include.reduce((t,r)=>{let s=n.find(i=>(0,$c.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return t.include=t.include.filter(o=>o!==r),jW(n,s,t,i)??t}return console.warn(`Unable to find ${r}`),t},e),e["child-binding"]&&(e["child-binding"].include=oO(e["child-binding"].include),e["child-binding"]=zf(n,e["child-binding"])),!e.include.length)return e},jW=(n,e,t,r=[])=>{let s=zf(n,e),i=zf(n,t);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(T=>T===d)?{}:s.properties?.[d]??{},m=i.properties?.[d]??{};a={...a,[d]:{...f,...m}}}),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]??[],m=i[d]??[];i[d]=Array.from([...f,...m])}),i},oO=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],av=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof lt)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let r=n.getNodeCompatible(t);if(!r)return[ts()];let s=this.typeCache.filter(o=>e.some(a=>r.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(s.length)return s;this.loadTypeAndCache(e);let i=this.typeCache.filter(o=>e.some(a=>r.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return i.length?i:[ts()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=Qs.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,$c.resolve)(t,o);try{let a=sO.default.parse((0,iO.readFileSync)(o,"utf-8"));return{...a,include:oO(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>zf(s,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...FW(i))})}},nO,aO=()=>(nO??=new av,nO),FW=n=>n.map(cO),cO=n=>{let e=ts();e.compatible=n.compatible??(n.filePath?(0,$c.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let r=Object.keys(n).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:n[s]}));return n.properties&&Object.keys(n.properties).forEach(s=>{let i=n.properties[s];BW(e,s,i),e.cellsValues=r}),n["child-binding"]&&(e.childNodeType=cO(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},BW=(n,e,t)=>{let r=n.properties.find(s=>typeof s.name=="string"&&s.getNameMatch(e));if(r){r.required=()=>t.required?"required":"optional",r.values=()=>t.enum??[],r.constValue=tO(t.type,t.const);let s=r.additionalTypeCheck;r.additionalTypeCheck=i=>[...rO(t,e)(i),...s?.(i)??[]]}else{let s=new Y(e,xW(t.type),t.required?"required":"optional",void 0,t.enum,rO(t,e));s.description=t.description?[t.description]:void 0,s.constValue=tO(t.type,t.const),n.addProperty(s)}},rO=(n,e)=>{let t=n;return r=>{let s=r.parent.root,i=[];if(t.const){let o=r.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||i.push(A(25,r.ast.values??r.ast,br.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&i.push(A(14,r.ast,br.DiagnosticSeverity.Warning,[],[br.DiagnosticTag.Deprecated],[r.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&Kt(r.ast.values)?.forEach(a=>{Un(a,s)||i.push(A(23,a,br.DiagnosticSeverity.Error))}),t.type==="path"&&r.ast.values?.values.at(0)?.value instanceof lt){let o=r.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=s.getNode(c);return l?a.push(c):i.push(A(24,o,br.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=Kt(r.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=Un(c,s);if(!l){i.push(A(23,c??r.ast,br.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){i.push(A(16,r.ast,br.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[r.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let f=d?Ue(d,0,0)??0:0;if(1+f>o.length-a){let m=l.nodeType?.cellsValues?.find(T=>T.specifier===u)?.values;i.push(A(20,c??r.ast,br.DiagnosticSeverity.Error,[],[],[r.name,`<${["phandel",...m??[],...Array.from({length:f-(m?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+f}}return i}};var Gf=(n,e)=>({getNodeTypes:async t=>{switch(e){case"Zephyr":return aO().getNodeTypes(n.zephyrBindings,t);case"DevicetreeOrg":return eO().getNodeTypes(n.deviceOrgBindingsMetaSchema,n.deviceOrgTreeBindings,t)}}});var lO=G(X()),cv=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(cv):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:lO.FoldingRangeKind.Region},...n.nodes.flatMap(cv)];function uO(n){return n.rootDocument.nodes.flatMap(cv)}var di=G(X());function UW(n){if(!n||!(n.ast instanceof $e)&&!(n.ast instanceof ht))return[];let e=t=>t.nodeType?.bindingsPath?[di.Location.create(`file://${t.nodeType.bindingsPath}`,di.Range.create(di.Position.create(0,0),di.Position.create(0,0)))]:[];return n.item instanceof ke&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof Ee&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof $e&&n.ast.linksTo?e(n.ast.linksTo):[]}async function dO(n,e,t){return Ot(n,e,r=>[...UW(r)],t)}var vr=require("path"),Ce=[],Lr,lv,Mc=new WeakMap,VW=n=>{let e=Mc.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},Dt=async()=>{await bO,await Promise.all(Ce.map(VW))},uv=n=>{let e=fO(n);return Ce.filter(t=>!e.some(r=>r===t))},fO=n=>Ce.filter(e=>{let t=n.contexts?.find(r=>r.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(r=>e.overlays.some(s=>s===r))}),WW=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes);return t.length?t.every(s=>r.some(i=>i.reolvedPath===s.reolvedPath&&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=>s===n.parser.uri)},hO=async n=>{let e=uv(Z),t=await fO(Z),r=await vu(e);if(Ce.indexOf(n)===-1)return;let s=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(Ce.indexOf(n)===-1)return;let i=await Promise.all(r.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await WW(a.context,c)})))),o=r.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{hv(a),Mc.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),Ce=Ce.filter(a=>o.indexOf(a)===-1))},ve=(0,Oe.createConnection)(Oe.ProposedFeatures.all),qr=new Oe.TextDocuments(gu),fv=!0,dv=!1,pO=!1;ve.onInitialize(n=>{let e=n.capabilities;fv=!!(e.workspace&&e.workspace.configuration),dv=!!(e.workspace&&e.workspace.workspaceFolders),pO=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Oe.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Oe.CodeActionKind.QuickFix,Oe.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:yu,tokenModifiers:bu},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return dv&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});ve.onInitialized(()=>{fv&&ve.client.register(Oe.DidChangeConfigurationNotification.type,{}),dv&&ve.workspace.onDidChangeWorkspaceFolders(n=>{ve.console.log("Workspace folder change event received")})});var mO={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},Z=mO,gO=new Map,yO=!1,bO=new Promise(n=>{let e=setInterval(()=>{yO&&(n(),clearInterval(e))},100)});ve.onDidChangeConfiguration(n=>{if(yO=!0,!n.settings)return;console.log("Configuration changed",n),fv&&gO.clear();let e=Z;Z={...mO,...n.settings?.devicetree},Z.contexts?.forEach((s,i)=>{if(s.cwd||Z.cwd){let o=s.cwd??Z.cwd;s.includePaths??=Z.defaultIncludePaths,s.zephyrBindings??=Z.defaultIncludePaths,s.bindingType??=Z.defaultBindingType,s.deviceOrgTreeBindings??=Z.defaultDeviceOrgTreeBindings,s.deviceOrgBindingsMetaSchema??=Z.defaultDeviceOrgBindingsMetaSchema,o&&s.bindingType==="Zephyr"&&(!s.zephyrBindings||s.zephyrBindings.length===0)&&(s.zephyrBindings=["./zephyr/dts/bindings"]),s.zephyrBindings=s.zephyrBindings?.map(a=>(0,vr.resolve)(o,a)),s.deviceOrgTreeBindings=s.deviceOrgTreeBindings?.map(a=>(0,vr.resolve)(o,a)),s.deviceOrgBindingsMetaSchema=s.deviceOrgBindingsMetaSchema?.map(a=>(0,vr.resolve)(o,a)),s.includePaths=s.includePaths?.map(a=>(0,vr.resolve)(o,a)),s.dtsFile=(0,vr.resolve)(o,s.dtsFile)}});let t=uv(e);Ce=[],Mc=new WeakMap,Z.contexts?.forEach((s,i)=>{let o=s.bindingType,a=new eo(s.dtsFile,s.includePaths??[],o?Gf({zephyrBindings:s.zephyrBindings??[],deviceOrgBindingsMetaSchema:s.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:s.deviceOrgTreeBindings??[]},o):void 0,s.overlays,s.ctxName);Ce.push(a),console.log(`New context with ID ${a.name} for ${s.dtsFile}`)});let r=vO();Ce=[...Ce,...t.map(s=>{let i=Z.defaultBindingType,o=new eo(s.parser.uri,r.defaultIncludePaths,i?Gf({zephyrBindings:r.defaultZephyrBindings,deviceOrgBindingsMetaSchema:r.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:r.defaultDeviceOrgTreeBindings},i):void 0);return console.log(`New context with ID ${o.name} for ${s.parser.uri}`),o})],t=uv(Z),t.forEach(hO),lv&&Lc(lv,!0),pO&&ve.languages.diagnostics.refresh()});var vO=()=>{let n=(Z.defaultIncludePaths??[]).map(s=>Z.cwd?(0,vr.resolve)(Z.cwd,s):s);Z.cwd&&Z.defaultBindingType==="Zephyr"&&!Z.defaultZephyrBindings&&(Z.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(Z.defaultZephyrBindings??[]).map(s=>Z.cwd?(0,vr.resolve)(Z.cwd,s):s),t=(Z.defaultDeviceOrgBindingsMetaSchema??[]).map(s=>Z.cwd?(0,vr.resolve)(Z.cwd,s):s),r=(Z.defaultDeviceOrgTreeBindings??[]).map(s=>Z.cwd?(0,vr.resolve)(Z.cwd,s):s);return{defaultIncludePaths:n,defaultZephyrBindings:e,defaultDeviceOrgBindingsMetaSchema:t,defaultDeviceOrgTreeBindings:r}};qr.onDidClose(async n=>{let e=n.document.uri.replace("file://",""),t=await Lr;t&&t.getContextFiles().some(s=>s===e)||ve.sendDiagnostics({uri:n.document.uri,version:qr.get(n.document.uri)?.version,diagnostics:[]}),gO.delete(n.document.uri)});qr.onDidOpen(async n=>{await Dt(),await Lr||ve.sendDiagnostics({uri:n.document.uri,version:qr.get(n.document.uri)?.version,diagnostics:[{severity:Oe.DiagnosticSeverity.Warning,range:Oe.Range.create(Oe.Position.create(0,0),Oe.Position.create(0,0)),message:"File has no context",source:"devicetree"}]})});var HW=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"Expedted start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},KW=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),zW=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},GW=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0];case 26:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),YW=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};qr.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");rs().renewLexer(e,n.document.getText()),await bO;let t=await Xw(Ce,e);if(t.length)t.forEach(r=>{Mc.get(r.context)?.abort.abort();let s=new AbortController,i=new Promise(o=>{setTimeout(async()=>{if(s.signal.aborted){o();return}let a=performance.now(),c=TO(r.context);await r.context.reevaluate(e),hv(r.context,c),pv(r.context).then(l=>{l.items.map(u=>({uri:u.uri,version:u.version??void 0,diagnostics:u.items})).forEach(u=>{ve.sendDiagnostics(u)})}),o(),console.log("reevaluate",performance.now()-a)},50)});Mc.set(r.context,{abort:s,promise:i})});else{if(Z.allowAdhocContexts===!1)return;let r=Z.defaultBindingType,s=vO(),i=new eo(e,s.defaultIncludePaths,r?Gf({zephyrBindings:s.defaultZephyrBindings,deviceOrgBindingsMetaSchema:s.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:s.defaultDeviceOrgTreeBindings},r):void 0);console.log(`New ad hoc context with ID ${i.name} for ${e}`),Ce.push(i),Lc(e),await i.parser.stable,hO(i)}});var TO=n=>n.getContextFiles().map(e=>({uri:`file://${e}`,version:qr.get(`file://${e}`)?.version,diagnostics:[]})),hv=(n,e=TO(n))=>{e.forEach(t=>{ve.sendDiagnostics({uri:t.uri,version:qr.get(t.uri)?.version,diagnostics:[]})})},pv=async n=>(await n.stable(),{items:[...await Promise.all(n.getContextFiles().map(async t=>{let r=await JW(n,t);return{uri:`file://${t}`,kind:Oe.DocumentDiagnosticReportKind.Full,items:r,version:qr.get(`file://${t}`)?.version??null}}))]});ve.languages.diagnostics.onWorkspace(async()=>{await Dt();let n=await Lr;return n?pv(n):{items:[]}});async function JW(n,e){let t=performance.now();try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:o.issues?o.issues.map(HW).join(" or "):"",source:"devicetree",data:{firstToken:{pos:o.astElement.firstToken.pos,tokens:o.astElement.firstToken.tokens,value:o.astElement.firstToken.value},lastToken:{pos:o.astElement.lastToken.pos,tokens:o.astElement.lastToken.tokens,value:o.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:o.issues,edit:o.edit,codeActionTitle:o.codeActionTitle}}};r.push(a)}),(await n.getContextIssues()??[]).filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:KW(o),source:"devicetree",tags:o.tags,relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(zW).join(" or "),location:{uri:`file://${c.uri}`,range:oe(c)}}))]};r.push(a)}),(await n.getRuntime())?.typesIssues.filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:GW(o),relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(YW).join(" or "),location:{uri:`file://${c.uri}`,range:oe(c)}}))],source:"devicetree",tags:o.tags,data:{firstToken:{pos:o.astElement.firstToken.pos,tokens:o.astElement.firstToken.tokens,value:o.astElement.firstToken.value},lastToken:{pos:o.astElement.lastToken.pos,tokens:o.astElement.lastToken.tokens,value:o.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:o.issues,edit:o.edit,codeActionTitle:o.codeActionTitle}}};r.push(a)}),console.log("diagnostics",e,performance.now()-t),r):[{severity:Oe.DiagnosticSeverity.Warning,range:Oe.Range.create(Oe.Position.create(0,0),Oe.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}ve.onDidChangeWatchedFiles(n=>{ve.console.log("We received a file change event")});ve.onCompletion(async n=>(await Dt(),Ce?[...await QE(n,Ce,Z.preferredContext),...await ck(n,Ce,Z.preferredContext)]:[]));ve.onCompletionResolve(n=>n);qr.listen(ve);ve.listen();var Lc=async(n,e=!1)=>{if(!e&&Z.autoChangeContext===!1)return;lv=n,await Dt();let t=await Lr;Lr=Fs(Ce,n,Z.preferredContext).then(s=>s?.context);let r=await Lr;t!==r&&(t&&hv(t),r&&pv(r).then(s=>{s.items.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(i=>{ve.sendDiagnostics(i)})}),console.log(`(ID: ${r?.name??-1}) activeContext:`,r?.parser.uri),Ce.forEach((s,i)=>{console.log(`Context with ID ${s.name} for ${s.parser.uri}`)}))};ve.onDocumentSymbol(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let r=await(await Lr)?.parser;return r?r.getDocumentSymbols(e):[]});ve.onWorkspaceSymbol(async()=>{await Dt();let n=await Lr;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ve.languages.semanticTokens.on(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=new Oe.SemanticTokensBuilder,r=await Fs(Ce,e,Z.preferredContext),s=r?.context.isInContext(e);return!r||!s?{data:[]}:(r.context.parser.buildSemanticTokens(t,e),t.build())});ve.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await Dt(),(await Fs(Ce,e,Z.preferredContext))?.context.getDocumentLinks(e)});ve.onPrepareRename(async n=>(await Dt(),sk(n,Ce,Z.lockRenameEdits??[],Z.preferredContext)));ve.onRenameRequest(async n=>(await Dt(),rk(n,Ce,Z.preferredContext)));ve.onReferences(async n=>(await Dt(),ZE(n,Ce,Z.preferredContext)));ve.onDefinition(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let r=(await(await Fs(Ce,e,Z.preferredContext))?.context.getDocumentLinks(e,n.position))?.filter(s=>s.target).map(s=>Oe.Location.create(s.target,s.range))??[];return r.length?r:ik(n,Ce,Z.preferredContext)});ve.onDeclaration(async n=>(await Dt(),ok(n,Ce,Z.preferredContext)));ve.onCodeAction(async n=>ak(n));ve.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let t=await Fs(Ce,e,Z.preferredContext);return t?aE(n,t.context):[]});ve.onHover(async n=>(await Dt(),(await lk(n,Ce,Z.preferredContext)).at(0)));ve.onRequest("devicetree/contexts",async()=>(await Dt(),Ce.map(n=>n.parser.uri)));ve.onFoldingRanges(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=await Lr,r=t?.isInContext(e);return!t||!r?[]:uO(t.parser)});ve.onTypeDefinition(async n=>(await Dt(),dO(n,Ce)));
|