devicetree-language-server 0.1.1 → 0.2.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 +3 -7
- package/dist/server.js +170 -146
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,193 +1,193 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var OO=Object.create;var th=Object.defineProperty;var AO=Object.getOwnPropertyDescriptor;var IO=Object.getOwnPropertyNames;var MO=Object.getPrototypeOf,$O=Object.prototype.hasOwnProperty;var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),LO=(n,e)=>{for(var t in e)th(n,t,{get:e[t],enumerable:!0})},xO=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of IO(e))!$O.call(n,s)&&s!==t&&th(n,s,{get:()=>e[s],enumerable:!(r=AO(e,s))||r.enumerable});return n};var G=(n,e,t)=>(t=n!=null?OO(MO(n)):{},xO(e||!n||!n.__esModule?th(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 qO(n){return n===!0||n===!1}at.boolean=qO;function Nv(n){return typeof n=="string"||n instanceof String}at.string=Nv;function jO(n){return typeof n=="number"||n instanceof Number}at.number=jO;function FO(n){return n instanceof Error}at.error=FO;function Pv(n){return typeof n=="function"}at.func=Pv;function Rv(n){return Array.isArray(n)}at.array=Rv;function BO(n){return Rv(n)&&n.every(e=>Nv(e))}at.stringArray=BO;function UO(n,e){return Array.isArray(n)&&n.every(e)}at.typedArray=UO;function VO(n){return n&&Pv(n.then)}at.thenable=VO});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 WO(n){return n===!0||n===!1}Lt.boolean=WO;function Dv(n){return typeof n=="string"||n instanceof String}Lt.string=Dv;function HO(n){return typeof n=="number"||n instanceof Number}Lt.number=HO;function KO(n){return n instanceof Error}Lt.error=KO;function zO(n){return typeof n=="function"}Lt.func=zO;function Cv(n){return Array.isArray(n)}Lt.array=Cv;function GO(n){return Cv(n)&&n.every(e=>Dv(e))}Lt.stringArray=GO});var Nh=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(),nh;(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})(nh||(z.ErrorCodes=nh={}));var rh=class n extends Error{constructor(e,t,r){super(t),this.code=Cs.number(e)?e:nh.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=rh;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 sh=class extends We{constructor(e){super(e,0)}};z.RequestType0=sh;var ih=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType=ih;var oh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType1=oh;var ah=class extends We{constructor(e){super(e,2)}};z.RequestType2=ah;var ch=class extends We{constructor(e){super(e,3)}};z.RequestType3=ch;var lh=class extends We{constructor(e){super(e,4)}};z.RequestType4=lh;var uh=class extends We{constructor(e){super(e,5)}};z.RequestType5=uh;var dh=class extends We{constructor(e){super(e,6)}};z.RequestType6=dh;var fh=class extends We{constructor(e){super(e,7)}};z.RequestType7=fh;var hh=class extends We{constructor(e){super(e,8)}};z.RequestType8=hh;var ph=class extends We{constructor(e){super(e,9)}};z.RequestType9=ph;var mh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType=mh;var gh=class extends We{constructor(e){super(e,0)}};z.NotificationType0=gh;var yh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType1=yh;var bh=class extends We{constructor(e){super(e,2)}};z.NotificationType2=bh;var vh=class extends We{constructor(e){super(e,3)}};z.NotificationType3=vh;var Th=class extends We{constructor(e){super(e,4)}};z.NotificationType4=Th;var _h=class extends We{constructor(e){super(e,5)}};z.NotificationType5=_h;var Sh=class extends We{constructor(e){super(e,6)}};z.NotificationType6=Sh;var wh=class extends We{constructor(e){super(e,7)}};z.NotificationType7=wh;var kh=class extends We{constructor(e){super(e,8)}};z.NotificationType8=kh;var Eh=class extends We{constructor(e){super(e,9)}};z.NotificationType9=Eh;var Ov;(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})(Ov||(z.Message=Ov={}))});var Rh=w(Br=>{"use strict";var Av;Object.defineProperty(Br,"__esModule",{value:!0});Br.LRUCache=Br.LinkedMap=Br.Touch=void 0;var xt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(xt||(Br.Touch=xt={}));var el=class{constructor(){this[Av]="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=xt.None){let r=this._map.get(e);if(r)return t!==xt.None&&this.touch(r,t),r.value}set(e,t,r=xt.None){let s=this._map.get(e);if(s)s.value=t,r!==xt.None&&this.touch(s,r);else{switch(s={key:e,value:t,next:void 0,previous:void 0},r){case xt.None:this.addItemLast(s);break;case xt.First:this.addItemFirst(s);break;case xt.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}[(Av=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!==xt.First&&t!==xt.Last)){if(t===xt.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===xt.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)}};Br.LinkedMap=el;var Ph=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=xt.AsNew){return super.get(e,t)}peek(e){return super.get(e,xt.None)}set(e,t){return super.set(e,t,xt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Br.LRUCache=Ph});var Mv=w(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.Disposable=void 0;var Iv;(function(n){function e(t){return{dispose:t}}n.create=e})(Iv||(tl.Disposable=Iv={}))});var Ur=w(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Dh;function Ch(){if(Dh===void 0)throw new Error("No runtime abstraction layer installed");return Dh}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Dh=t}n.install=e})(Ch||(Ch={}));Oh.default=Ch});var vi=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Emitter=bi.Event=void 0;var YO=Ur(),$v;(function(n){let e={dispose(){}};n.None=function(){return e}})($v||(bi.Event=$v={}));var Ah=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,YO.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 Ah),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 JO=Ur(),XO=yi(),Ih=vi(),rl;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ih.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ih.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||XO.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(rl||(Ti.CancellationToken=rl={}));var QO=Object.freeze(function(n,e){let t=(0,JO.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?QO:(this._emitter||(this._emitter=new Ih.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Mh=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=Mh});var Lv=w(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.SharedArrayReceiverStrategy=_i.SharedArraySenderStrategy=void 0;var ZO=il(),Wo;(function(n){n.Continue=0,n.Cancelled=1})(Wo||(Wo={}));var $h=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=$h;var Lh=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")}},xh=class{constructor(e){this.token=new Lh(e)}cancel(){}dispose(){}},qh=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new ZO.CancellationTokenSource:new xh(t)}};_i.SharedArrayReceiverStrategy=qh});var Fh=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.Semaphore=void 0;var eA=Ur(),jh=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,eA.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=jh});var qv=w(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ReadableStreamMessageReader=Vr.AbstractMessageReader=Vr.MessageReader=void 0;var Uh=Ur(),Si=yi(),Bh=vi(),tA=Fh(),xv;(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})(xv||(Vr.MessageReader=xv={}));var al=class{constructor(){this.errorEmitter=new Bh.Emitter,this.closeEmitter=new Bh.Emitter,this.partialMessageEmitter=new Bh.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"}`)}};Vr.AbstractMessageReader=al;var Vh;(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,Uh.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Vh||(Vh={}));var Wh=class extends al{constructor(e,t){super(),this.readable=e,this.options=Vh.fromOptions(t),this.buffer=(0,Uh.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new tA.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(
|
|
4
|
-
`,
|
|
5
|
-
`,
|
|
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),
|
|
7
|
-
${JSON.stringify(
|
|
8
|
-
${JSON.stringify(
|
|
2
|
+
"use strict";var sA=Object.create;var fh=Object.defineProperty;var iA=Object.getOwnPropertyDescriptor;var oA=Object.getOwnPropertyNames;var aA=Object.getPrototypeOf,cA=Object.prototype.hasOwnProperty;var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),lA=(r,e)=>{for(var t in e)fh(r,t,{get:e[t],enumerable:!0})},uA=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of oA(e))!cA.call(r,s)&&s!==t&&fh(r,s,{get:()=>e[s],enumerable:!(n=iA(e,s))||n.enumerable});return r};var K=(r,e,t)=>(t=r!=null?sA(aA(r)):{},uA(e||!r||!r.__esModule?fh(t,"default",{value:r,enumerable:!0}):t,r));var ul=E(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.thenable=ft.typedArray=ft.stringArray=ft.array=ft.func=ft.error=ft.number=ft.string=ft.boolean=void 0;function dA(r){return r===!0||r===!1}ft.boolean=dA;function Fv(r){return typeof r=="string"||r instanceof String}ft.string=Fv;function fA(r){return typeof r=="number"||r instanceof Number}ft.number=fA;function hA(r){return r instanceof Error}ft.error=hA;function Bv(r){return typeof r=="function"}ft.func=Bv;function Uv(r){return Array.isArray(r)}ft.array=Uv;function pA(r){return Uv(r)&&r.every(e=>Fv(e))}ft.stringArray=pA;function mA(r,e){return Array.isArray(r)&&r.every(e)}ft.typedArray=mA;function gA(r){return r&&Bv(r.then)}ft.thenable=gA});var Si=E(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.stringArray=qt.array=qt.func=qt.error=qt.number=qt.string=qt.boolean=void 0;function yA(r){return r===!0||r===!1}qt.boolean=yA;function Vv(r){return typeof r=="string"||r instanceof String}qt.string=Vv;function bA(r){return typeof r=="number"||r instanceof Number}qt.number=bA;function vA(r){return r instanceof Error}qt.error=vA;function TA(r){return typeof r=="function"}qt.func=TA;function Wv(r){return Array.isArray(r)}qt.array=Wv;function _A(r){return Wv(r)&&r.every(e=>Vv(e))}qt.stringArray=_A});var xh=E(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.Message=J.NotificationType9=J.NotificationType8=J.NotificationType7=J.NotificationType6=J.NotificationType5=J.NotificationType4=J.NotificationType3=J.NotificationType2=J.NotificationType1=J.NotificationType0=J.NotificationType=J.RequestType9=J.RequestType8=J.RequestType7=J.RequestType6=J.RequestType5=J.RequestType4=J.RequestType3=J.RequestType2=J.RequestType1=J.RequestType=J.RequestType0=J.AbstractMessageSignature=J.ParameterStructures=J.ResponseError=J.ErrorCodes=void 0;var Ms=Si(),hh;(function(r){r.ParseError=-32700,r.InvalidRequest=-32600,r.MethodNotFound=-32601,r.InvalidParams=-32602,r.InternalError=-32603,r.jsonrpcReservedErrorRangeStart=-32099,r.serverErrorStart=-32099,r.MessageWriteError=-32099,r.MessageReadError=-32098,r.PendingResponseRejected=-32097,r.ConnectionInactive=-32096,r.ServerNotInitialized=-32002,r.UnknownErrorCode=-32001,r.jsonrpcReservedErrorRangeEnd=-32e3,r.serverErrorEnd=-32e3})(hh||(J.ErrorCodes=hh={}));var ph=class r extends Error{constructor(e,t,n){super(t),this.code=Ms.number(e)?e:hh.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,r.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};J.ResponseError=ph;var er=class r{constructor(e){this.kind=e}static is(e){return e===r.auto||e===r.byName||e===r.byPosition}toString(){return this.kind}};J.ParameterStructures=er;er.auto=new er("auto");er.byPosition=new er("byPosition");er.byName=new er("byName");var Ge=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return er.auto}};J.AbstractMessageSignature=Ge;var mh=class extends Ge{constructor(e){super(e,0)}};J.RequestType0=mh;var gh=class extends Ge{constructor(e,t=er.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};J.RequestType=gh;var yh=class extends Ge{constructor(e,t=er.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};J.RequestType1=yh;var bh=class extends Ge{constructor(e){super(e,2)}};J.RequestType2=bh;var vh=class extends Ge{constructor(e){super(e,3)}};J.RequestType3=vh;var Th=class extends Ge{constructor(e){super(e,4)}};J.RequestType4=Th;var _h=class extends Ge{constructor(e){super(e,5)}};J.RequestType5=_h;var Sh=class extends Ge{constructor(e){super(e,6)}};J.RequestType6=Sh;var Eh=class extends Ge{constructor(e){super(e,7)}};J.RequestType7=Eh;var wh=class extends Ge{constructor(e){super(e,8)}};J.RequestType8=wh;var kh=class extends Ge{constructor(e){super(e,9)}};J.RequestType9=kh;var Nh=class extends Ge{constructor(e,t=er.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};J.NotificationType=Nh;var Ph=class extends Ge{constructor(e){super(e,0)}};J.NotificationType0=Ph;var Rh=class extends Ge{constructor(e,t=er.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};J.NotificationType1=Rh;var Dh=class extends Ge{constructor(e){super(e,2)}};J.NotificationType2=Dh;var Ch=class extends Ge{constructor(e){super(e,3)}};J.NotificationType3=Ch;var Oh=class extends Ge{constructor(e){super(e,4)}};J.NotificationType4=Oh;var Ah=class extends Ge{constructor(e){super(e,5)}};J.NotificationType5=Ah;var Ih=class extends Ge{constructor(e){super(e,6)}};J.NotificationType6=Ih;var Mh=class extends Ge{constructor(e){super(e,7)}};J.NotificationType7=Mh;var $h=class extends Ge{constructor(e){super(e,8)}};J.NotificationType8=$h;var Lh=class extends Ge{constructor(e){super(e,9)}};J.NotificationType9=Lh;var Hv;(function(r){function e(s){let i=s;return i&&Ms.string(i.method)&&(Ms.string(i.id)||Ms.number(i.id))}r.isRequest=e;function t(s){let i=s;return i&&Ms.string(i.method)&&s.id===void 0}r.isNotification=t;function n(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(Ms.string(i.id)||Ms.number(i.id)||i.id===null)}r.isResponse=n})(Hv||(J.Message=Hv={}))});var jh=E(zn=>{"use strict";var zv;Object.defineProperty(zn,"__esModule",{value:!0});zn.LRUCache=zn.LinkedMap=zn.Touch=void 0;var jt;(function(r){r.None=0,r.First=1,r.AsOld=r.First,r.Last=2,r.AsNew=r.Last})(jt||(zn.Touch=jt={}));var dl=class{constructor(){this[zv]="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=jt.None){let n=this._map.get(e);if(n)return t!==jt.None&&this.touch(n,t),n.value}set(e,t,n=jt.None){let s=this._map.get(e);if(s)s.value=t,n!==jt.None&&this.touch(s,n);else{switch(s={key:e,value:t,next:void 0,previous:void 0},n){case jt.None:this.addItemLast(s);break;case jt.First:this.addItemFirst(s);break;case jt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let 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 n=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!==n)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,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 n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,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 n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,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 n}[(zv=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,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,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.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!==jt.First&&t!==jt.Last)){if(t===jt.First){if(e===this._head)return;let n=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(n.previous=s,s.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===jt.Last){if(e===this._tail)return;let n=e.next,s=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=s,s.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};zn.LinkedMap=dl;var qh=class extends dl{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=jt.AsNew){return super.get(e,t)}peek(e){return super.get(e,jt.None)}set(e,t){return super.set(e,t,jt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};zn.LRUCache=qh});var Gv=E(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.Disposable=void 0;var Kv;(function(r){function e(t){return{dispose:t}}r.create=e})(Kv||(fl.Disposable=Kv={}))});var Kn=E(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var Fh;function Bh(){if(Fh===void 0)throw new Error("No runtime abstraction layer installed");return Fh}(function(r){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Fh=t}r.install=e})(Bh||(Bh={}));Uh.default=Bh});var wi=E(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Emitter=Ei.Event=void 0;var SA=Kn(),Yv;(function(r){let e={dispose(){}};r.None=function(){return e}})(Yv||(Ei.Event=Yv={}));var Vh=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!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 n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],n=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=n.length;i<o;i++)try{t.push(n[i].apply(s[i],e))}catch(a){(0,SA.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},hl=class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new Vh),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=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.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)}};Ei.Emitter=hl;hl._noop=function(){}});var gl=E(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.CancellationTokenSource=ki.CancellationToken=void 0;var EA=Kn(),wA=Si(),Wh=wi(),pl;(function(r){r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wh.Event.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Wh.Event.None});function e(t){let n=t;return n&&(n===r.None||n===r.Cancelled||wA.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}r.is=e})(pl||(ki.CancellationToken=pl={}));var kA=Object.freeze(function(r,e){let t=(0,EA.default)().timer.setTimeout(r.bind(e),0);return{dispose(){t.dispose()}}}),ml=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?kA:(this._emitter||(this._emitter=new Wh.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Hh=class{get token(){return this._token||(this._token=new ml),this._token}cancel(){this._token?this._token.cancel():this._token=pl.Cancelled}dispose(){this._token?this._token instanceof ml&&this._token.dispose():this._token=pl.None}};ki.CancellationTokenSource=Hh});var Jv=E(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.SharedArrayReceiverStrategy=Ni.SharedArraySenderStrategy=void 0;var NA=gl(),Qo;(function(r){r.Continue=0,r.Cancelled=1})(Qo||(Qo={}));var zh=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),n=new Int32Array(t,0,1);n[0]=Qo.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let n=this.buffers.get(t);if(n===void 0)return;let s=new Int32Array(n,0,1);Atomics.store(s,0,Qo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ni.SharedArraySenderStrategy=zh;var Kh=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Qo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Gh=class{constructor(e){this.token=new Kh(e)}cancel(){}dispose(){}},Yh=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new NA.CancellationTokenSource:new Gh(t)}};Ni.SharedArrayReceiverStrategy=Yh});var Xh=E(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.Semaphore=void 0;var PA=Kn(),Jh=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,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,PA.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(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};yl.Semaphore=Jh});var Qv=E(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ReadableStreamMessageReader=Gn.AbstractMessageReader=Gn.MessageReader=void 0;var Zh=Kn(),Pi=Si(),Qh=wi(),RA=Xh(),Xv;(function(r){function e(t){let n=t;return n&&Pi.func(n.listen)&&Pi.func(n.dispose)&&Pi.func(n.onError)&&Pi.func(n.onClose)&&Pi.func(n.onPartialMessage)}r.is=e})(Xv||(Gn.MessageReader=Xv={}));var bl=class{constructor(){this.errorEmitter=new Qh.Emitter,this.closeEmitter=new Qh.Emitter,this.partialMessageEmitter=new Qh.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: ${Pi.string(e.message)?e.message:"unknown"}`)}};Gn.AbstractMessageReader=bl;var ep;(function(r){function e(t){let n,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")n=t??"utf-8";else{if(n=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,Zh.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}r.fromOptions=e})(ep||(ep={}));var tp=class extends bl{constructor(e,t){super(),this.readable=e,this.options=ep.fromOptions(t),this.buffer=(0,Zh.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new RA.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(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let s=n.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(n))}`));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 n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(s)}).catch(n=>{this.fireError(n)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Zh.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))}};Gn.ReadableStreamMessageReader=tp});var nT=E(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.WriteableStreamMessageWriter=Yn.AbstractMessageWriter=Yn.MessageWriter=void 0;var Zv=Kn(),Zo=Si(),DA=Xh(),eT=wi(),CA="Content-Length: ",tT=`\r
|
|
4
|
+
`,rT;(function(r){function e(t){let n=t;return n&&Zo.func(n.dispose)&&Zo.func(n.onClose)&&Zo.func(n.onError)&&Zo.func(n.write)}r.is=e})(rT||(Yn.MessageWriter=rT={}));var vl=class{constructor(){this.errorEmitter=new eT.Emitter,this.closeEmitter=new eT.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Zo.string(e.message)?e.message:"unknown"}`)}};Yn.AbstractMessageWriter=vl;var rp;(function(r){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Zv.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Zv.default)().applicationJson.encoder}}r.fromOptions=e})(rp||(rp={}));var np=class extends vl{constructor(e,t){super(),this.writable=e,this.options=rp.fromOptions(t),this.errorCount=0,this.writeSemaphore=new DA.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let s=[];return s.push(CA,n.byteLength.toString(),tT),s.push(tT),this.doWrite(e,s,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}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()}};Yn.WriteableStreamMessageWriter=np});var sT=E(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.AbstractMessageBuffer=void 0;var OA=13,AA=10,IA=`\r
|
|
5
|
+
`,sp=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,n=0,s=0,i=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(s=0;s<l.length;){switch(l[s]){case OA:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case AA: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,n++}if(t!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(IA);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),n=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);t.set(o,n),n+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else t.set(i,n),n+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return t}};Tl.AbstractMessageBuffer=sp});var lT=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.createMessageConnection=oe.ConnectionOptions=oe.MessageStrategy=oe.CancellationStrategy=oe.CancellationSenderStrategy=oe.CancellationReceiverStrategy=oe.RequestCancellationReceiverStrategy=oe.IdCancellationReceiverStrategy=oe.ConnectionStrategy=oe.ConnectionError=oe.ConnectionErrors=oe.LogTraceNotification=oe.SetTraceNotification=oe.TraceFormat=oe.TraceValues=oe.Trace=oe.NullLogger=oe.ProgressType=oe.ProgressToken=void 0;var iT=Kn(),tt=Si(),Z=xh(),oT=jh(),ea=wi(),ip=gl(),na;(function(r){r.type=new Z.NotificationType("$/cancelRequest")})(na||(na={}));var op;(function(r){function e(t){return typeof t=="string"||typeof t=="number"}r.is=e})(op||(oe.ProgressToken=op={}));var ta;(function(r){r.type=new Z.NotificationType("$/progress")})(ta||(ta={}));var ap=class{constructor(){}};oe.ProgressType=ap;var cp;(function(r){function e(t){return tt.func(t)}r.is=e})(cp||(cp={}));oe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ke;(function(r){r[r.Off=0]="Off",r[r.Messages=1]="Messages",r[r.Compact=2]="Compact",r[r.Verbose=3]="Verbose"})(ke||(oe.Trace=ke={}));var aT;(function(r){r.Off="off",r.Messages="messages",r.Compact="compact",r.Verbose="verbose"})(aT||(oe.TraceValues=aT={}));(function(r){function e(n){if(!tt.string(n))return r.Off;switch(n=n.toLowerCase(),n){case"off":return r.Off;case"messages":return r.Messages;case"compact":return r.Compact;case"verbose":return r.Verbose;default:return r.Off}}r.fromString=e;function t(n){switch(n){case r.Off:return"off";case r.Messages:return"messages";case r.Compact:return"compact";case r.Verbose:return"verbose";default:return"off"}}r.toString=t})(ke||(oe.Trace=ke={}));var hr;(function(r){r.Text="text",r.JSON="json"})(hr||(oe.TraceFormat=hr={}));(function(r){function e(t){return tt.string(t)?(t=t.toLowerCase(),t==="json"?r.JSON:r.Text):r.Text}r.fromString=e})(hr||(oe.TraceFormat=hr={}));var lp;(function(r){r.type=new Z.NotificationType("$/setTrace")})(lp||(oe.SetTraceNotification=lp={}));var _l;(function(r){r.type=new Z.NotificationType("$/logTrace")})(_l||(oe.LogTraceNotification=_l={}));var ra;(function(r){r[r.Closed=1]="Closed",r[r.Disposed=2]="Disposed",r[r.AlreadyListening=3]="AlreadyListening"})(ra||(oe.ConnectionErrors=ra={}));var Ri=class r extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,r.prototype)}};oe.ConnectionError=Ri;var up;(function(r){function e(t){let n=t;return n&&tt.func(n.cancelUndispatched)}r.is=e})(up||(oe.ConnectionStrategy=up={}));var Sl;(function(r){function e(t){let n=t;return n&&(n.kind===void 0||n.kind==="id")&&tt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||tt.func(n.dispose))}r.is=e})(Sl||(oe.IdCancellationReceiverStrategy=Sl={}));var dp;(function(r){function e(t){let n=t;return n&&n.kind==="request"&&tt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||tt.func(n.dispose))}r.is=e})(dp||(oe.RequestCancellationReceiverStrategy=dp={}));var El;(function(r){r.Message=Object.freeze({createCancellationTokenSource(t){return new ip.CancellationTokenSource}});function e(t){return Sl.is(t)||dp.is(t)}r.is=e})(El||(oe.CancellationReceiverStrategy=El={}));var wl;(function(r){r.Message=Object.freeze({sendCancellation(t,n){return t.sendNotification(na.type,{id:n})},cleanup(t){}});function e(t){let n=t;return n&&tt.func(n.sendCancellation)&&tt.func(n.cleanup)}r.is=e})(wl||(oe.CancellationSenderStrategy=wl={}));var kl;(function(r){r.Message=Object.freeze({receiver:El.Message,sender:wl.Message});function e(t){let n=t;return n&&El.is(n.receiver)&&wl.is(n.sender)}r.is=e})(kl||(oe.CancellationStrategy=kl={}));var Nl;(function(r){function e(t){let n=t;return n&&tt.func(n.handleMessage)}r.is=e})(Nl||(oe.MessageStrategy=Nl={}));var cT;(function(r){function e(t){let n=t;return n&&(kl.is(n.cancellationStrategy)||up.is(n.connectionStrategy)||Nl.is(n.messageStrategy))}r.is=e})(cT||(oe.ConnectionOptions=cT={}));var Br;(function(r){r[r.New=1]="New",r[r.Listening=2]="Listening",r[r.Closed=3]="Closed",r[r.Disposed=4]="Disposed"})(Br||(Br={}));function MA(r,e,t,n){let s=t!==void 0?t:oe.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,m=new Map,T,g=new oT.LinkedMap,S=new Map,w=new Set,v=new Map,b=ke.Off,R=hr.Text,A,L=Br.New,W=new ea.Emitter,j=new ea.Emitter,se=new ea.Emitter,Me=new ea.Emitter,yt=new ea.Emitter,de=n&&n.cancellationStrategy?n.cancellationStrategy:kl.Message;function vr(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 Wn(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function Gc(){return"not-"+(++o).toString()}function dh(k,M){Z.Message.isRequest(M)?k.set(vr(M.id),M):Z.Message.isResponse(M)?k.set(Wn(M.id),M):k.set(Gc(),M)}function Yc(k){}function zo(){return L===Br.Listening}function Os(){return L===Br.Closed}function Rn(){return L===Br.Disposed}function yi(){(L===Br.New||L===Br.Listening)&&(L=Br.Closed,j.fire(void 0))}function As(k){W.fire([k,void 0,void 0])}function Jc(k){W.fire(k)}r.onClose(yi),r.onError(As),e.onClose(yi),e.onError(Jc);function Ko(){T||g.size===0||(T=(0,iT.default)().timer.setImmediate(()=>{T=void 0,Xc()}))}function Go(k){Z.Message.isRequest(k)?Zc(k):Z.Message.isNotification(k)?tl(k):Z.Message.isResponse(k)?el(k):bi(k)}function Xc(){if(g.size===0)return;let k=g.shift();try{let M=n?.messageStrategy;Nl.is(M)?M.handleMessage(k,Go):Go(k)}finally{Ko()}}let Qc=k=>{try{if(Z.Message.isNotification(k)&&k.method===na.type.method){let M=k.params.id,F=vr(M),z=g.get(F);if(Z.Message.isRequest(z)){let De=n?.connectionStrategy,Ke=De&&De.cancelUndispatched?De.cancelUndispatched(z,Yc):void 0;if(Ke&&(Ke.error!==void 0||Ke.result!==void 0)){g.delete(F),v.delete(M),Ke.id=z.id,Is(Ke,k.method,Date.now()),e.write(Ke).catch(()=>s.error("Sending response for canceled message failed."));return}}let $e=v.get(M);if($e!==void 0){$e.cancel(),vi(k);return}else w.add(M)}dh(g,k)}finally{Ko()}};function Zc(k){if(Rn())return;function M(fe,qe,Se){let nt={jsonrpc:c,id:k.id};fe instanceof Z.ResponseError?nt.error=fe.toJson():nt.result=fe===void 0?null:fe,Is(nt,qe,Se),e.write(nt).catch(()=>s.error("Sending response failed."))}function F(fe,qe,Se){let nt={jsonrpc:c,id:k.id,error:fe.toJson()};Is(nt,qe,Se),e.write(nt).catch(()=>s.error("Sending response failed."))}function z(fe,qe,Se){fe===void 0&&(fe=null);let nt={jsonrpc:c,id:k.id,result:fe};Is(nt,qe,Se),e.write(nt).catch(()=>s.error("Sending response failed."))}sl(k);let $e=u.get(k.method),De,Ke;$e&&(De=$e.type,Ke=$e.handler);let Xe=Date.now();if(Ke||l){let fe=k.id??String(Date.now()),qe=Sl.is(de.receiver)?de.receiver.createCancellationTokenSource(fe):de.receiver.createCancellationTokenSource(k);k.id!==null&&w.has(k.id)&&qe.cancel(),k.id!==null&&v.set(fe,qe);try{let Se;if(Ke)if(k.params===void 0){if(De!==void 0&&De.numberOfParams!==0){F(new Z.ResponseError(Z.ErrorCodes.InvalidParams,`Request ${k.method} defines ${De.numberOfParams} params but received none.`),k.method,Xe);return}Se=Ke(qe.token)}else if(Array.isArray(k.params)){if(De!==void 0&&De.parameterStructures===Z.ParameterStructures.byName){F(new Z.ResponseError(Z.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,Xe);return}Se=Ke(...k.params,qe.token)}else{if(De!==void 0&&De.parameterStructures===Z.ParameterStructures.byPosition){F(new Z.ResponseError(Z.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,Xe);return}Se=Ke(k.params,qe.token)}else l&&(Se=l(k.method,k.params,qe.token));let nt=Se;Se?nt.then?nt.then(St=>{v.delete(fe),M(St,k.method,Xe)},St=>{v.delete(fe),St instanceof Z.ResponseError?F(St,k.method,Xe):St&&tt.string(St.message)?F(new Z.ResponseError(Z.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${St.message}`),k.method,Xe):F(new Z.ResponseError(Z.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Xe)}):(v.delete(fe),M(Se,k.method,Xe)):(v.delete(fe),z(Se,k.method,Xe))}catch(Se){v.delete(fe),Se instanceof Z.ResponseError?M(Se,k.method,Xe):Se&&tt.string(Se.message)?F(new Z.ResponseError(Z.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Se.message}`),k.method,Xe):F(new Z.ResponseError(Z.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Xe)}}else F(new Z.ResponseError(Z.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,Xe)}function el(k){if(!Rn())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 M=k.id,F=S.get(M);if(il(k,F),F!==void 0){S.delete(M);try{if(k.error){let z=k.error;F.reject(new Z.ResponseError(z.code,z.message,z.data))}else if(k.result!==void 0)F.resolve(k.result);else throw new Error("Should never happen.")}catch(z){z.message?s.error(`Response handler '${F.method}' failed with message: ${z.message}`):s.error(`Response handler '${F.method}' failed unexpectedly.`)}}}}function tl(k){if(Rn())return;let M,F;if(k.method===na.type.method){let z=k.params.id;w.delete(z),vi(k);return}else{let z=f.get(k.method);z&&(F=z.handler,M=z.type)}if(F||d)try{if(vi(k),F)if(k.params===void 0)M!==void 0&&M.numberOfParams!==0&&M.parameterStructures!==Z.ParameterStructures.byName&&s.error(`Notification ${k.method} defines ${M.numberOfParams} params but received none.`),F();else if(Array.isArray(k.params)){let z=k.params;k.method===ta.type.method&&z.length===2&&op.is(z[0])?F({token:z[0],value:z[1]}):(M!==void 0&&(M.parameterStructures===Z.ParameterStructures.byName&&s.error(`Notification ${k.method} defines parameters by name but received parameters by position`),M.numberOfParams!==k.params.length&&s.error(`Notification ${k.method} defines ${M.numberOfParams} params but received ${z.length} arguments`)),F(...z))}else M!==void 0&&M.parameterStructures===Z.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(z){z.message?s.error(`Notification handler '${k.method}' failed with message: ${z.message}`):s.error(`Notification handler '${k.method}' failed unexpectedly.`)}else se.fire(k)}function bi(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 M=k;if(tt.string(M.id)||tt.number(M.id)){let F=M.id,z=S.get(F);z&&z.reject(new Error("The received response has neither a result nor an error property."))}}function qr(k){if(k!=null)switch(b){case ke.Verbose:return JSON.stringify(k,null,4);case ke.Compact:return JSON.stringify(k);default:return}}function rl(k){if(!(b===ke.Off||!A))if(R===hr.Text){let M;(b===ke.Verbose||b===ke.Compact)&&k.params&&(M=`Params: ${qr(k.params)}
|
|
9
9
|
|
|
10
|
-
`),
|
|
10
|
+
`),A.log(`Sending request '${k.method} - (${k.id})'.`,M)}else Dn("send-request",k)}function nl(k){if(!(b===ke.Off||!A))if(R===hr.Text){let M;(b===ke.Verbose||b===ke.Compact)&&(k.params?M=`Params: ${qr(k.params)}
|
|
11
11
|
|
|
12
12
|
`:M=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),
|
|
14
|
+
`),A.log(`Sending notification '${k.method}'.`,M)}else Dn("send-notification",k)}function Is(k,M,F){if(!(b===ke.Off||!A))if(R===hr.Text){let z;(b===ke.Verbose||b===ke.Compact)&&(k.error&&k.error.data?z=`Error data: ${qr(k.error.data)}
|
|
15
15
|
|
|
16
|
-
`:
|
|
16
|
+
`:k.result?z=`Result: ${qr(k.result)}
|
|
17
17
|
|
|
18
|
-
`:
|
|
18
|
+
`:k.error===void 0&&(z=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),
|
|
20
|
+
`)),A.log(`Sending response '${M} - (${k.id})'. Processing request took ${Date.now()-F}ms`,z)}else Dn("send-response",k)}function sl(k){if(!(b===ke.Off||!A))if(R===hr.Text){let M;(b===ke.Verbose||b===ke.Compact)&&k.params&&(M=`Params: ${qr(k.params)}
|
|
21
21
|
|
|
22
|
-
`),
|
|
22
|
+
`),A.log(`Received request '${k.method} - (${k.id})'.`,M)}else Dn("receive-request",k)}function vi(k){if(!(b===ke.Off||!A||k.method===_l.type.method))if(R===hr.Text){let M;(b===ke.Verbose||b===ke.Compact)&&(k.params?M=`Params: ${qr(k.params)}
|
|
23
23
|
|
|
24
24
|
`:M=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),
|
|
26
|
+
`),A.log(`Received notification '${k.method}'.`,M)}else Dn("receive-notification",k)}function il(k,M){if(!(b===ke.Off||!A))if(R===hr.Text){let F;if((b===ke.Verbose||b===ke.Compact)&&(k.error&&k.error.data?F=`Error data: ${qr(k.error.data)}
|
|
27
27
|
|
|
28
|
-
`:
|
|
28
|
+
`:k.result?F=`Result: ${qr(k.result)}
|
|
29
29
|
|
|
30
|
-
`:
|
|
30
|
+
`:k.error===void 0&&(F=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),M){let W=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";O.log(`Received response '${M.method} - (${E.id})' in ${Date.now()-M.timerStart}ms.${W}`,F)}else O.log(`Received response ${E.id} without active response promise.`,F)}else Er("receive-response",E)}function Er(E,M){if(!O||b===Ne.Off)return;let F={isLSPMessage:!0,type:E,message:M,timestamp:Date.now()};O.log(F)}function Fr(){if(Ps())throw new wi(Go.Closed,"Connection is closed.");if(kr())throw new wi(Go.Disposed,"Connection is disposed.")}function Yc(){if(qo())throw new wi(Go.AlreadyListening,"Connection is already listening")}function Jc(){if(!qo())throw new Error("Call listen() first.")}function er(E){return E===void 0?null:E}function Bo(E){if(E!==null)return E}function Uo(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function mi(E,M){switch(E){case Q.ParameterStructures.auto:return Uo(M)?Bo(M):[er(M)];case Q.ParameterStructures.byName:if(!Uo(M))throw new Error("Received parameters by name but param is not an object literal.");return Bo(M);case Q.ParameterStructures.byPosition:return[er(M)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Vo(E,M){let F,W=E.numberOfParams;switch(W){case 0:F=void 0;break;case 1:F=mi(E.parameterStructures,M[0]);break;default:F=[];for(let Ae=0;Ae<M.length&&Ae<W;Ae++)F.push(er(M[Ae]));if(M.length<W)for(let Ae=M.length;Ae<W;Ae++)F.push(null);break}return F}let Nr={sendNotification:(E,...M)=>{Fr();let F,W;if(Ze.string(E)){F=E;let Re=M[0],Ve=0,Ye=Q.ParameterStructures.auto;Q.ParameterStructures.is(Re)&&(Ve=1,Ye=Re);let fe=M.length,$e=fe-Ve;switch($e){case 0:W=void 0;break;case 1:W=mi(Ye,M[Ve]);break;default:if(Ye===Q.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);W=M.slice(Ve,fe).map(_e=>er(_e));break}}else{let Re=M;F=E.method,W=Vo(E,Re)}let Ae={jsonrpc:c,method:F,params:W};return Kc(Ae),e.write(Ae).catch(Re=>{throw s.error("Sending notification failed."),Re})},onNotification:(E,M)=>{Fr();let F;return Ze.func(E)?d=E:M&&(Ze.string(E)?(F=E,f.set(E,{type:void 0,handler:M})):(F=E.method,f.set(E.method,{type:E,handler:M}))),{dispose:()=>{F!==void 0?f.delete(F):d=void 0}}},onProgress:(E,M,F)=>{if(m.has(M))throw new Error(`Progress handler for token ${M} already registered`);return m.set(M,F),{dispose:()=>{m.delete(M)}}},sendProgress:(E,M,F)=>Nr.sendNotification(zo.type,{token:M,value:F}),onUnhandledProgress:Oe.event,sendRequest:(E,...M)=>{Fr(),Jc();let F,W,Ae;if(Ze.string(E)){F=E;let fe=M[0],$e=M[M.length-1],_e=0,tt=Q.ParameterStructures.auto;Q.ParameterStructures.is(fe)&&(_e=1,tt=fe);let _t=M.length;Gh.CancellationToken.is($e)&&(_t=_t-1,Ae=$e);let un=_t-_e;switch(un){case 0:W=void 0;break;case 1:W=mi(tt,M[_e]);break;default:if(tt===Q.ParameterStructures.byName)throw new Error(`Received ${un} parameters for 'by Name' request parameter structure.`);W=M.slice(_e,_t).map(Xc=>er(Xc));break}}else{let fe=M;F=E.method,W=Vo(E,fe);let $e=E.numberOfParams;Ae=Gh.CancellationToken.is(fe[$e])?fe[$e]:void 0}let Re=i++,Ve;Ae&&(Ve=Ae.onCancellationRequested(()=>{let fe=de.sender.sendCancellation(Nr,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,$e)=>{let _e=un=>{fe(un),de.sender.cleanup(Re),Ve?.dispose()},tt=un=>{$e(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:(E,M)=>{Fr();let F=null;return Xh.is(E)?(F=void 0,l=E):Ze.string(E)?(F=null,M!==void 0&&(F=E,u.set(E,{handler:M,type:void 0}))):M!==void 0&&(F=E.method,u.set(E.method,{type:E,handler:M})),{dispose:()=>{F!==null&&(F!==void 0?u.delete(F):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(E,M,F)=>{let W=!1,Ae=dn.Text;F!==void 0&&(Ze.boolean(F)?W=F:(W=F.sendNotification||!1,Ae=F.traceFormat||dn.Text)),b=E,R=Ae,b===Ne.Off?O=void 0:O=M,W&&!Ps()&&!kr()&&await Nr.sendNotification(Qh.type,{value:Ne.toString(E)})},onError:V.event,onClose:j.event,onUnhandledNotification:re.event,onDispose:yt.event,end:()=>{e.end()},dispose:()=>{if(kr())return;L=xn.Disposed,yt.fire(void 0);let E=new Q.ResponseError(Q.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of S.values())M.reject(E);S=new Map,v=new Map,k=new Set,g=new Kv.LinkedMap,Ze.func(e.dispose)&&e.dispose(),Ze.func(n.dispose)&&n.dispose()},listen:()=>{Fr(),Yc(),L=xn.Listening,n.listen(Bc)},inspect:()=>{(0,Hv.default)().console.log("inspect")}};return Nr.onNotification(ul.type,E=>{if(b===Ne.Off||!O)return;let M=b===Ne.Verbose||b===Ne.Compact;O.log(E.message,M?E.verbose:void 0)}),Nr.onNotification(zo.type,E=>{let M=m.get(E.token);M?M(E.value):Oe.fire(E)}),Nr}ie.createMessageConnection=aA});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=Nh();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 tp=Rh();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return tp.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return tp.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return tp.Touch}});var cA=Mv();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return cA.Disposable}});var Jv=vi();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return Jv.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return Jv.Emitter}});var Xv=il();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return Xv.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return Xv.CancellationToken}});var Qv=Lv();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Qv.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Qv.SharedArrayReceiverStrategy}});var np=qv();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return np.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return np.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return np.ReadableStreamMessageReader}});var rp=Vv();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return rp.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return rp.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return rp.WriteableStreamMessageWriter}});var lA=Wv();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return lA.AbstractMessageBuffer}});var Ct=Yv();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 uA=Ur();I.RAL=uA.default});var tT=w(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var Zv=require("util"),Rr=gl(),yl=class n extends Rr.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 sp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Rr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Rr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Rr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Rr.Disposable.create(()=>this.stream.off("data",e))}},ip=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Rr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Rr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Rr.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()}},eT=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 sp(n),asWritableStream:n=>new ip(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 op(){return eT}(function(n){function e(){Rr.RAL.install(eT)}n.install=e})(op||(op={}));ap.default=op});var Is=w(me=>{"use strict";var dA=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]}),fA=me&&me.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dA(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 ki=tT();ki.default.install();var nT=require("path"),hA=require("os"),pA=require("crypto"),Tl=require("net"),fn=gl();fA(gl(),me);var cp=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=cp;var lp=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=lp;var up=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=up;var dp=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=dp;var Os=class extends fn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,ki.default)().stream.asReadableStream(e),t)}};me.SocketMessageReader=Os;var As=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,ki.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,ki.default)().stream.asReadableStream(e),t)}};me.StreamMessageReader=bl;var vl=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,ki.default)().stream.asWritableStream(e),t)}};me.StreamMessageWriter=vl;var rT=process.env.XDG_RUNTIME_DIR,mA=new Map([["linux",107],["darwin",103]]);function gA(){let n=(0,pA.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;rT?e=nT.join(rT,`vscode-ipc-${n}.sock`):e=nT.join(hA.tmpdir(),`vscode-${n}.sock`);let t=mA.get(process.platform);return t!==void 0&&e.length>t&&(0,ki.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}me.generateRandomPipeName=gA;function yA(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=yA;function bA(n,e="utf-8"){let t=(0,Tl.createConnection)(n);return[new Os(t,e),new As(t,e)]}me.createServerPipeTransport=bA;function vA(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=vA;function TA(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=TA;function _A(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function SA(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function wA(n,e,t,r){t||(t=fn.NullLogger);let s=_A(n)?new bl(n):n,i=SA(e)?new vl(e):e;return fn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,fn.createMessageConnection)(s,i,t,r)}me.createMessageConnection=wA});var fp=w((EH,sT)=>{"use strict";sT.exports=Is()});var Sl=w((iT,_l)=>{(function(n){if(typeof _l=="object"&&typeof _l.exports=="object"){var e=n(require,iT);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,$){if(C.uinteger(y)&&C.uinteger(h)&&C.uinteger(D)&&C.uinteger($))return{start:o.create(y,h),end:o.create(D,$)};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($,"]"))}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,$){return{targetUri:y,targetRange:h,targetSelectionRange:D,originSelectionRange:$}}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,$){return{red:y,green:h,blue:D,alpha:$}}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,$,se,nt){var qe={startLine:y,endLine:h};return C.defined(D)&&(qe.startCharacter=D),C.defined($)&&(qe.endCharacter=$),C.defined(se)&&(qe.kind=se),C.defined(nt)&&(qe.collapsedText=nt),qe}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 k;(function(p){p.Unnecessary=1,p.Deprecated=2})(k||(e.DiagnosticTag=k={}));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,$,se,nt){var qe={range:y,message:h};return C.defined(D)&&(qe.severity=D),C.defined($)&&(qe.code=$),C.defined(se)&&(qe.source=se),C.defined(nt)&&(qe.relatedInformation=nt),qe}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=[],$=2;$<arguments.length;$++)D[$-2]=arguments[$];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,$){return{range:D,newText:$}}p.replace=N;function P(D,$){return{range:{start:D,end:D},newText:$}}p.insert=P;function y(D){return{range:D,newText:""}}p.del=y;function h(D){var $=D;return C.objectLiteral($)&&C.string($.newText)&&a.is($.range)}p.is=h})(O||(e.TextEdit=O={}));var L;(function(p){function N(y,h,D){var $={label:y};return h!==void 0&&($.needsConfirmation=h),D!==void 0&&($.description=D),$}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,$,se){return{range:D,newText:$,annotationId:se}}p.replace=N;function P(D,$,se){return{range:{start:D,end:D},newText:$,annotationId:se}}p.insert=P;function y(D,$){return{range:D,newText:"",annotationId:$}}p.del=y;function h(D){var $=D;return O.is($)&&(L.is($.annotationId)||V.is($.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 Oe;(function(p){function N(y,h,D){var $={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&($.options=h),D!==void 0&&($.annotationId=D),$}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})(Oe||(e.CreateFile=Oe={}));var yt;(function(p){function N(y,h,D,$){var se={kind:"rename",oldUri:y,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(se.options=D),$!==void 0&&(se.annotationId=$),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 $={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&($.options=h),D!==void 0&&($.annotationId=D),$}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)?Oe.is(h)||yt.is(h)||de.is(h):re.is(h)}))}p.is=N})(yn||(e.WorkspaceEdit=yn={}));var jr=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}(),xc=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}(),eh=function(){function p(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new xc(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(re.is(y)){var h=new jr(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new jr(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 jr(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 jr(h),this._textEditChanges[N]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new xc,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,$;if(h===void 0?D=Oe.create(N,y):($=V.is(h)?h:this._changeAnnotations.manage(h),D=Oe.create(N,y,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},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 $,se;if(D===void 0?$=yt.create(N,P,h):(se=V.is(D)?D:this._changeAnnotations.manage(D),$=yt.create(N,P,h,se)),this._workspaceEdit.documentChanges.push($),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,$;if(h===void 0?D=de.create(N,y):($=V.is(h)?h:this._changeAnnotations.manage(h),D=de.create(N,y,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p}();e.WorkspaceChange=eh;var qc;(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})(qc||(e.TextDocumentIdentifier=qc={}));var qo;(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})(qo||(e.VersionedTextDocumentIdentifier=qo={}));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 kr;(function(p){function N(y,h,D,$){return{uri:y,languageId:h,version:D,text:$}}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})(kr||(e.TextDocumentItem=kr={}));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 Mn;(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})(Mn||(e.Hover=Mn={}));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 $={label:P};return C.defined(y)&&($.documentation=y),C.defined(h)?$.parameters=h:$.parameters=[],$}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 Er;(function(p){function N(P,y,h,D,$){var se={name:P,kind:y,location:{uri:D,range:h}};return $&&(se.containerName=$),se}p.create=N})(Er||(e.SymbolInformation=Er={}));var Fr;(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})(Fr||(e.WorkspaceSymbol=Fr={}));var Yc;(function(p){function N(y,h,D,$,se,nt){var qe={name:y,detail:h,kind:D,range:$,selectionRange:se};return nt!==void 0&&(qe.children=nt),qe}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 er;(function(p){p.Invoked=1,p.Automatic=2})(er||(e.CodeActionTriggerKind=er={}));var Bo;(function(p){function N(y,h,D){var $={diagnostics:y};return h!=null&&($.only=h),D!=null&&($.triggerKind=D),$}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===er.Invoked||h.triggerKind===er.Automatic)}p.is=P})(Bo||(e.CodeActionContext=Bo={}));var Uo;(function(p){function N(y,h,D){var $={title:y},se=!0;return typeof h=="string"?(se=!1,$.kind=h):R.is(h)?$.command=h:$.edit=h,se&&D!==void 0&&($.kind=D),$}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 Nr;(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})(Nr||(e.DocumentLink=Nr={}));var E;(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})(E||(e.SelectionRange=E={}));var M;(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"})(M||(e.SemanticTokenTypes=M={}));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 Ae;(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})(Ae||(e.InlineValueText=Ae={}));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 $e;(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})($e||(e.InlayHintLabelPart=$e={}));var _e;(function(p){function N(y,h,D){var $={position:y,label:h};return D!==void 0&&($.kind=D),$}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,$e.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 _v;(function(p){function N(P,y){return{range:P,text:y}}p.create=N})(_v||(e.SelectedCompletionInfo=_v={}));var Sv;(function(p){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}p.create=N})(Sv||(e.InlineCompletionContext=Sv={}));var wv;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&r.is(y.uri)&&C.string(y.name)}p.is=N})(wv||(e.WorkspaceFolder=wv={})),e.EOL=[`
|
|
32
|
+
`)),M){let z=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";A.log(`Received response '${M.method} - (${k.id})' in ${Date.now()-M.timerStart}ms.${z}`,F)}else A.log(`Received response ${k.id} without active response promise.`,F)}else Dn("receive-response",k)}function Dn(k,M){if(!A||b===ke.Off)return;let F={isLSPMessage:!0,type:k,message:M,timestamp:Date.now()};A.log(F)}function Hn(){if(Os())throw new Ri(ra.Closed,"Connection is closed.");if(Rn())throw new Ri(ra.Disposed,"Connection is disposed.")}function ol(){if(zo())throw new Ri(ra.AlreadyListening,"Connection is already listening")}function al(){if(!zo())throw new Error("Call listen() first.")}function sn(k){return k===void 0?null:k}function Yo(k){if(k!==null)return k}function Jo(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function Ti(k,M){switch(k){case Z.ParameterStructures.auto:return Jo(M)?Yo(M):[sn(M)];case Z.ParameterStructures.byName:if(!Jo(M))throw new Error("Received parameters by name but param is not an object literal.");return Yo(M);case Z.ParameterStructures.byPosition:return[sn(M)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function Xo(k,M){let F,z=k.numberOfParams;switch(z){case 0:F=void 0;break;case 1:F=Ti(k.parameterStructures,M[0]);break;default:F=[];for(let $e=0;$e<M.length&&$e<z;$e++)F.push(sn(M[$e]));if(M.length<z)for(let $e=M.length;$e<z;$e++)F.push(null);break}return F}let Cn={sendNotification:(k,...M)=>{Hn();let F,z;if(tt.string(k)){F=k;let De=M[0],Ke=0,Xe=Z.ParameterStructures.auto;Z.ParameterStructures.is(De)&&(Ke=1,Xe=De);let fe=M.length,qe=fe-Ke;switch(qe){case 0:z=void 0;break;case 1:z=Ti(Xe,M[Ke]);break;default:if(Xe===Z.ParameterStructures.byName)throw new Error(`Received ${qe} parameters for 'by Name' notification parameter structure.`);z=M.slice(Ke,fe).map(Se=>sn(Se));break}}else{let De=M;F=k.method,z=Xo(k,De)}let $e={jsonrpc:c,method:F,params:z};return nl($e),e.write($e).catch(De=>{throw s.error("Sending notification failed."),De})},onNotification:(k,M)=>{Hn();let F;return tt.func(k)?d=k:M&&(tt.string(k)?(F=k,f.set(k,{type:void 0,handler:M})):(F=k.method,f.set(k.method,{type:k,handler:M}))),{dispose:()=>{F!==void 0?f.delete(F):d=void 0}}},onProgress:(k,M,F)=>{if(m.has(M))throw new Error(`Progress handler for token ${M} already registered`);return m.set(M,F),{dispose:()=>{m.delete(M)}}},sendProgress:(k,M,F)=>Cn.sendNotification(ta.type,{token:M,value:F}),onUnhandledProgress:Me.event,sendRequest:(k,...M)=>{Hn(),al();let F,z,$e;if(tt.string(k)){F=k;let fe=M[0],qe=M[M.length-1],Se=0,nt=Z.ParameterStructures.auto;Z.ParameterStructures.is(fe)&&(Se=1,nt=fe);let St=M.length;ip.CancellationToken.is(qe)&&(St=St-1,$e=qe);let fr=St-Se;switch(fr){case 0:z=void 0;break;case 1:z=Ti(nt,M[Se]);break;default:if(nt===Z.ParameterStructures.byName)throw new Error(`Received ${fr} parameters for 'by Name' request parameter structure.`);z=M.slice(Se,St).map(cl=>sn(cl));break}}else{let fe=M;F=k.method,z=Xo(k,fe);let qe=k.numberOfParams;$e=ip.CancellationToken.is(fe[qe])?fe[qe]:void 0}let De=i++,Ke;$e&&(Ke=$e.onCancellationRequested(()=>{let fe=de.sender.sendCancellation(Cn,De);return fe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${De}`),Promise.resolve()):fe.catch(()=>{s.log(`Sending cancellation messages for id ${De} failed`)})}));let Xe={jsonrpc:c,id:De,method:F,params:z};return rl(Xe),typeof de.sender.enableCancellation=="function"&&de.sender.enableCancellation(Xe),new Promise(async(fe,qe)=>{let Se=fr=>{fe(fr),de.sender.cleanup(De),Ke?.dispose()},nt=fr=>{qe(fr),de.sender.cleanup(De),Ke?.dispose()},St={method:F,timerStart:Date.now(),resolve:Se,reject:nt};try{await e.write(Xe),S.set(De,St)}catch(fr){throw s.error("Sending request failed."),St.reject(new Z.ResponseError(Z.ErrorCodes.MessageWriteError,fr.message?fr.message:"Unknown reason")),fr}})},onRequest:(k,M)=>{Hn();let F=null;return cp.is(k)?(F=void 0,l=k):tt.string(k)?(F=null,M!==void 0&&(F=k,u.set(k,{handler:M,type:void 0}))):M!==void 0&&(F=k.method,u.set(k.method,{type:k,handler:M})),{dispose:()=>{F!==null&&(F!==void 0?u.delete(F):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(k,M,F)=>{let z=!1,$e=hr.Text;F!==void 0&&(tt.boolean(F)?z=F:(z=F.sendNotification||!1,$e=F.traceFormat||hr.Text)),b=k,R=$e,b===ke.Off?A=void 0:A=M,z&&!Os()&&!Rn()&&await Cn.sendNotification(lp.type,{value:ke.toString(k)})},onError:W.event,onClose:j.event,onUnhandledNotification:se.event,onDispose:yt.event,end:()=>{e.end()},dispose:()=>{if(Rn())return;L=Br.Disposed,yt.fire(void 0);let k=new Z.ResponseError(Z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of S.values())M.reject(k);S=new Map,v=new Map,w=new Set,g=new oT.LinkedMap,tt.func(e.dispose)&&e.dispose(),tt.func(r.dispose)&&r.dispose()},listen:()=>{Hn(),ol(),L=Br.Listening,r.listen(Qc)},inspect:()=>{(0,iT.default)().console.log("inspect")}};return Cn.onNotification(_l.type,k=>{if(b===ke.Off||!A)return;let M=b===ke.Verbose||b===ke.Compact;A.log(k.message,M?k.verbose:void 0)}),Cn.onNotification(ta.type,k=>{let M=m.get(k.token);M?M(k.value):Me.fire(k)}),Cn}oe.createMessageConnection=MA});var Pl=E(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 We=xh();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return We.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return We.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return We.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return We.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return We.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return We.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return We.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return We.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return We.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return We.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return We.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return We.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return We.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return We.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return We.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return We.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return We.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return We.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return We.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return We.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return We.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return We.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return We.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return We.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return We.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return We.ParameterStructures}});var fp=jh();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return fp.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return fp.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return fp.Touch}});var $A=Gv();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return $A.Disposable}});var uT=wi();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return uT.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return uT.Emitter}});var dT=gl();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return dT.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return dT.CancellationToken}});var fT=Jv();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return fT.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return fT.SharedArrayReceiverStrategy}});var hp=Qv();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return hp.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return hp.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return hp.ReadableStreamMessageReader}});var pp=nT();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return pp.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return pp.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return pp.WriteableStreamMessageWriter}});var LA=sT();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return LA.AbstractMessageBuffer}});var Ot=lT();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Ot.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Ot.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Ot.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Ot.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Ot.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Ot.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Ot.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Ot.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Ot.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Ot.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Ot.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Ot.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Ot.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ot.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ot.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Ot.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Ot.MessageStrategy}});var xA=Kn();I.RAL=xA.default});var mT=E(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});var hT=require("util"),An=Pl(),Rl=class r extends An.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return r.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new hT.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)}};Rl.emptyBuffer=Buffer.allocUnsafe(0);var mp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),An.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),An.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),An.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),An.Disposable.create(()=>this.stream.off("data",e))}},gp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),An.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),An.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),An.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((n,s)=>{let i=o=>{o==null?n():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},pT=Object.freeze({messageBuffer:Object.freeze({create:r=>new Rl(r)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(r,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(r,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(r,e)=>{try{return r instanceof Buffer?Promise.resolve(JSON.parse(r.toString(e.charset))):Promise.resolve(JSON.parse(new hT.TextDecoder(e.charset).decode(r)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:r=>new mp(r),asWritableStream:r=>new gp(r)}),console,timer:Object.freeze({setTimeout(r,e,...t){let n=setTimeout(r,e,...t);return{dispose:()=>clearTimeout(n)}},setImmediate(r,...e){let t=setImmediate(r,...e);return{dispose:()=>clearImmediate(t)}},setInterval(r,e,...t){let n=setInterval(r,e,...t);return{dispose:()=>clearInterval(n)}}})});function yp(){return pT}(function(r){function e(){An.RAL.install(pT)}r.install=e})(yp||(yp={}));bp.default=yp});var xs=E(me=>{"use strict";var qA=me&&me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=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(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),jA=me&&me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qA(e,r,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 Di=mT();Di.default.install();var gT=require("path"),FA=require("os"),BA=require("crypto"),Ol=require("net"),pr=Pl();jA(Pl(),me);var vp=class extends pr.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),pr.Disposable.create(()=>this.process.off("message",e))}};me.IPCMessageReader=vp;var Tp=class extends pr.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",n=>this.fireError(n)),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=Tp;var _p=class extends pr.AbstractMessageReader{constructor(e){super(),this.onData=new pr.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=_p;var Sp=class extends pr.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=Sp;var $s=class extends pr.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,Di.default)().stream.asReadableStream(e),t)}};me.SocketMessageReader=$s;var Ls=class extends pr.WriteableStreamMessageWriter{constructor(e,t){super((0,Di.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};me.SocketMessageWriter=Ls;var Dl=class extends pr.ReadableStreamMessageReader{constructor(e,t){super((0,Di.default)().stream.asReadableStream(e),t)}};me.StreamMessageReader=Dl;var Cl=class extends pr.WriteableStreamMessageWriter{constructor(e,t){super((0,Di.default)().stream.asWritableStream(e),t)}};me.StreamMessageWriter=Cl;var yT=process.env.XDG_RUNTIME_DIR,UA=new Map([["linux",107],["darwin",103]]);function VA(){let r=(0,BA.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${r}-sock`;let e;yT?e=gT.join(yT,`vscode-ipc-${r}.sock`):e=gT.join(FA.tmpdir(),`vscode-${r}.sock`);let t=UA.get(process.platform);return t!==void 0&&e.length>t&&(0,Di.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}me.generateRandomPipeName=VA;function WA(r,e="utf-8"){let t,n=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Ol.createServer)(a=>{o.close(),t([new $s(a,e),new Ls(a,e)])});o.on("error",i),o.listen(r,()=>{o.removeListener("error",i),s({onConnected:()=>n})})})}me.createClientPipeTransport=WA;function HA(r,e="utf-8"){let t=(0,Ol.createConnection)(r);return[new $s(t,e),new Ls(t,e)]}me.createServerPipeTransport=HA;function zA(r,e="utf-8"){let t,n=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Ol.createServer)(a=>{o.close(),t([new $s(a,e),new Ls(a,e)])});o.on("error",i),o.listen(r,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>n})})})}me.createClientSocketTransport=zA;function KA(r,e="utf-8"){let t=(0,Ol.createConnection)(r,"127.0.0.1");return[new $s(t,e),new Ls(t,e)]}me.createServerSocketTransport=KA;function GA(r){let e=r;return e.read!==void 0&&e.addListener!==void 0}function YA(r){let e=r;return e.write!==void 0&&e.addListener!==void 0}function JA(r,e,t,n){t||(t=pr.NullLogger);let s=GA(r)?new Dl(r):r,i=YA(e)?new Cl(e):e;return pr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,pr.createMessageConnection)(s,i,t,n)}me.createMessageConnection=JA});var Ep=E((sz,bT)=>{"use strict";bT.exports=xs()});var Il=E((vT,Al)=>{(function(r){if(typeof Al=="object"&&typeof Al.exports=="object"){var e=r(require,vT);e!==void 0&&(Al.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],r)})(function(r,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 n;(function(p){function N(P){return typeof P=="string"}p.is=N})(n||(e.URI=n={}));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 O.objectLiteral(h)&&O.uinteger(h.line)&&O.uinteger(h.character)}p.is=P})(o||(e.Position=o={}));var a;(function(p){function N(y,h,C,$){if(O.uinteger(y)&&O.uinteger(h)&&O.uinteger(C)&&O.uinteger($))return{start:o.create(y,h),end:o.create(C,$)};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(C,", ").concat($,"]"))}p.create=N;function P(y){var h=y;return O.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 O.objectLiteral(h)&&a.is(h.range)&&(O.string(h.uri)||O.undefined(h.uri))}p.is=P})(c||(e.Location=c={}));var l;(function(p){function N(y,h,C,$){return{targetUri:y,targetRange:h,targetSelectionRange:C,originSelectionRange:$}}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.targetRange)&&O.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||O.undefined(h.originSelectionRange))}p.is=P})(l||(e.LocationLink=l={}));var u;(function(p){function N(y,h,C,$){return{red:y,green:h,blue:C,alpha:$}}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.numberRange(h.red,0,1)&&O.numberRange(h.green,0,1)&&O.numberRange(h.blue,0,1)&&O.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 O.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,C){return{label:y,textEdit:h,additionalTextEdits:C}}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.undefined(h.textEdit)||A.is(h))&&(O.undefined(h.additionalTextEdits)||O.typedArray(h.additionalTextEdits,A.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,C,$,ie,st){var Ve={startLine:y,endLine:h};return O.defined(C)&&(Ve.startCharacter=C),O.defined($)&&(Ve.endCharacter=$),O.defined(ie)&&(Ve.kind=ie),O.defined(st)&&(Ve.collapsedText=st),Ve}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.uinteger(h.startLine)&&O.uinteger(h.startLine)&&(O.undefined(h.startCharacter)||O.uinteger(h.startCharacter))&&(O.undefined(h.endCharacter)||O.uinteger(h.endCharacter))&&(O.undefined(h.kind)||O.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 O.defined(h)&&c.is(h.location)&&O.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 w;(function(p){p.Unnecessary=1,p.Deprecated=2})(w||(e.DiagnosticTag=w={}));var v;(function(p){function N(P){var y=P;return O.objectLiteral(y)&&O.string(y.href)}p.is=N})(v||(e.CodeDescription=v={}));var b;(function(p){function N(y,h,C,$,ie,st){var Ve={range:y,message:h};return O.defined(C)&&(Ve.severity=C),O.defined($)&&(Ve.code=$),O.defined(ie)&&(Ve.source=ie),O.defined(st)&&(Ve.relatedInformation=st),Ve}p.create=N;function P(y){var h,C=y;return O.defined(C)&&a.is(C.range)&&O.string(C.message)&&(O.number(C.severity)||O.undefined(C.severity))&&(O.integer(C.code)||O.string(C.code)||O.undefined(C.code))&&(O.undefined(C.codeDescription)||O.string((h=C.codeDescription)===null||h===void 0?void 0:h.href))&&(O.string(C.source)||O.undefined(C.source))&&(O.undefined(C.relatedInformation)||O.typedArray(C.relatedInformation,g.is))}p.is=P})(b||(e.Diagnostic=b={}));var R;(function(p){function N(y,h){for(var C=[],$=2;$<arguments.length;$++)C[$-2]=arguments[$];var ie={title:y,command:h};return O.defined(C)&&C.length>0&&(ie.arguments=C),ie}p.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.title)&&O.string(h.command)}p.is=P})(R||(e.Command=R={}));var A;(function(p){function N(C,$){return{range:C,newText:$}}p.replace=N;function P(C,$){return{range:{start:C,end:C},newText:$}}p.insert=P;function y(C){return{range:C,newText:""}}p.del=y;function h(C){var $=C;return O.objectLiteral($)&&O.string($.newText)&&a.is($.range)}p.is=h})(A||(e.TextEdit=A={}));var L;(function(p){function N(y,h,C){var $={label:y};return h!==void 0&&($.needsConfirmation=h),C!==void 0&&($.description=C),$}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&O.string(h.label)&&(O.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(O.string(h.description)||h.description===void 0)}p.is=P})(L||(e.ChangeAnnotation=L={}));var W;(function(p){function N(P){var y=P;return O.string(y)}p.is=N})(W||(e.ChangeAnnotationIdentifier=W={}));var j;(function(p){function N(C,$,ie){return{range:C,newText:$,annotationId:ie}}p.replace=N;function P(C,$,ie){return{range:{start:C,end:C},newText:$,annotationId:ie}}p.insert=P;function y(C,$){return{range:C,newText:"",annotationId:$}}p.del=y;function h(C){var $=C;return A.is($)&&(L.is($.annotationId)||W.is($.annotationId))}p.is=h})(j||(e.AnnotatedTextEdit=j={}));var se;(function(p){function N(y,h){return{textDocument:y,edits:h}}p.create=N;function P(y){var h=y;return O.defined(h)&&Os.is(h.textDocument)&&Array.isArray(h.edits)}p.is=P})(se||(e.TextDocumentEdit=se={}));var Me;(function(p){function N(y,h,C){var $={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&($.options=h),C!==void 0&&($.annotationId=C),$}p.create=N;function P(y){var h=y;return h&&h.kind==="create"&&O.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}p.is=P})(Me||(e.CreateFile=Me={}));var yt;(function(p){function N(y,h,C,$){var ie={kind:"rename",oldUri:y,newUri:h};return C!==void 0&&(C.overwrite!==void 0||C.ignoreIfExists!==void 0)&&(ie.options=C),$!==void 0&&(ie.annotationId=$),ie}p.create=N;function P(y){var h=y;return h&&h.kind==="rename"&&O.string(h.oldUri)&&O.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||O.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||O.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}p.is=P})(yt||(e.RenameFile=yt={}));var de;(function(p){function N(y,h,C){var $={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&($.options=h),C!==void 0&&($.annotationId=C),$}p.create=N;function P(y){var h=y;return h&&h.kind==="delete"&&O.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||O.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||O.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||W.is(h.annotationId))}p.is=P})(de||(e.DeleteFile=de={}));var vr;(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 O.string(h.kind)?Me.is(h)||yt.is(h)||de.is(h):se.is(h)}))}p.is=N})(vr||(e.WorkspaceEdit=vr={}));var Wn=function(){function p(N,P){this.edits=N,this.changeAnnotations=P}return p.prototype.insert=function(N,P,y){var h,C;if(y===void 0?h=A.insert(N,P):W.is(y)?(C=y,h=j.insert(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(y),h=j.insert(N,P,C)),this.edits.push(h),C!==void 0)return C},p.prototype.replace=function(N,P,y){var h,C;if(y===void 0?h=A.replace(N,P):W.is(y)?(C=y,h=j.replace(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(y),h=j.replace(N,P,C)),this.edits.push(h),C!==void 0)return C},p.prototype.delete=function(N,P){var y,h;if(P===void 0?y=A.del(N):W.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}(),Gc=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(W.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}(),dh=function(){function p(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new Gc(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(se.is(y)){var h=new Wn(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new Wn(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(Os.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=[],C={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(C),y=new Wn(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 Wn(h),this._textEditChanges[N]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Gc,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)||W.is(P)?h=P:y=P;var C,$;if(h===void 0?C=Me.create(N,y):($=W.is(h)?h:this._changeAnnotations.manage(h),C=Me.create(N,y,$)),this._workspaceEdit.documentChanges.push(C),$!==void 0)return $},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 C;L.is(y)||W.is(y)?C=y:h=y;var $,ie;if(C===void 0?$=yt.create(N,P,h):(ie=W.is(C)?C:this._changeAnnotations.manage(C),$=yt.create(N,P,h,ie)),this._workspaceEdit.documentChanges.push($),ie!==void 0)return ie},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)||W.is(P)?h=P:y=P;var C,$;if(h===void 0?C=de.create(N,y):($=W.is(h)?h:this._changeAnnotations.manage(h),C=de.create(N,y,$)),this._workspaceEdit.documentChanges.push(C),$!==void 0)return $},p}();e.WorkspaceChange=dh;var Yc;(function(p){function N(y){return{uri:y}}p.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)}p.is=P})(Yc||(e.TextDocumentIdentifier=Yc={}));var zo;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.integer(h.version)}p.is=P})(zo||(e.VersionedTextDocumentIdentifier=zo={}));var Os;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&(h.version===null||O.integer(h.version))}p.is=P})(Os||(e.OptionalVersionedTextDocumentIdentifier=Os={}));var Rn;(function(p){function N(y,h,C,$){return{uri:y,languageId:h,version:C,text:$}}p.create=N;function P(y){var h=y;return O.defined(h)&&O.string(h.uri)&&O.string(h.languageId)&&O.integer(h.version)&&O.string(h.text)}p.is=P})(Rn||(e.TextDocumentItem=Rn={}));var yi;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function N(P){var y=P;return y===p.PlainText||y===p.Markdown}p.is=N})(yi||(e.MarkupKind=yi={}));var As;(function(p){function N(P){var y=P;return O.objectLiteral(P)&&yi.is(y.kind)&&O.string(y.value)}p.is=N})(As||(e.MarkupContent=As={}));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 Ko;(function(p){p.PlainText=1,p.Snippet=2})(Ko||(e.InsertTextFormat=Ko={}));var Go;(function(p){p.Deprecated=1})(Go||(e.CompletionItemTag=Go={}));var Xc;(function(p){function N(y,h,C){return{newText:y,insert:h,replace:C}}p.create=N;function P(y){var h=y;return h&&O.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}p.is=P})(Xc||(e.InsertReplaceEdit=Xc={}));var Qc;(function(p){p.asIs=1,p.adjustIndentation=2})(Qc||(e.InsertTextMode=Qc={}));var Zc;(function(p){function N(P){var y=P;return y&&(O.string(y.detail)||y.detail===void 0)&&(O.string(y.description)||y.description===void 0)}p.is=N})(Zc||(e.CompletionItemLabelDetails=Zc={}));var el;(function(p){function N(P){return{label:P}}p.create=N})(el||(e.CompletionItem=el={}));var tl;(function(p){function N(P,y){return{items:P||[],isIncomplete:!!y}}p.create=N})(tl||(e.CompletionList=tl={}));var bi;(function(p){function N(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=N;function P(y){var h=y;return O.string(h)||O.objectLiteral(h)&&O.string(h.language)&&O.string(h.value)}p.is=P})(bi||(e.MarkedString=bi={}));var qr;(function(p){function N(P){var y=P;return!!y&&O.objectLiteral(y)&&(As.is(y.contents)||bi.is(y.contents)||O.typedArray(y.contents,bi.is))&&(P.range===void 0||a.is(P.range))}p.is=N})(qr||(e.Hover=qr={}));var rl;(function(p){function N(P,y){return y?{label:P,documentation:y}:{label:P}}p.create=N})(rl||(e.ParameterInformation=rl={}));var nl;(function(p){function N(P,y){for(var h=[],C=2;C<arguments.length;C++)h[C-2]=arguments[C];var $={label:P};return O.defined(y)&&($.documentation=y),O.defined(h)?$.parameters=h:$.parameters=[],$}p.create=N})(nl||(e.SignatureInformation=nl={}));var Is;(function(p){p.Text=1,p.Read=2,p.Write=3})(Is||(e.DocumentHighlightKind=Is={}));var sl;(function(p){function N(P,y){var h={range:P};return O.number(y)&&(h.kind=y),h}p.create=N})(sl||(e.DocumentHighlight=sl={}));var vi;(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})(vi||(e.SymbolKind=vi={}));var il;(function(p){p.Deprecated=1})(il||(e.SymbolTag=il={}));var Dn;(function(p){function N(P,y,h,C,$){var ie={name:P,kind:y,location:{uri:C,range:h}};return $&&(ie.containerName=$),ie}p.create=N})(Dn||(e.SymbolInformation=Dn={}));var Hn;(function(p){function N(P,y,h,C){return C!==void 0?{name:P,kind:y,location:{uri:h,range:C}}:{name:P,kind:y,location:{uri:h}}}p.create=N})(Hn||(e.WorkspaceSymbol=Hn={}));var ol;(function(p){function N(y,h,C,$,ie,st){var Ve={name:y,detail:h,kind:C,range:$,selectionRange:ie};return st!==void 0&&(Ve.children=st),Ve}p.create=N;function P(y){var h=y;return h&&O.string(h.name)&&O.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||O.string(h.detail))&&(h.deprecated===void 0||O.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}p.is=P})(ol||(e.DocumentSymbol=ol={}));var al;(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"})(al||(e.CodeActionKind=al={}));var sn;(function(p){p.Invoked=1,p.Automatic=2})(sn||(e.CodeActionTriggerKind=sn={}));var Yo;(function(p){function N(y,h,C){var $={diagnostics:y};return h!=null&&($.only=h),C!=null&&($.triggerKind=C),$}p.create=N;function P(y){var h=y;return O.defined(h)&&O.typedArray(h.diagnostics,b.is)&&(h.only===void 0||O.typedArray(h.only,O.string))&&(h.triggerKind===void 0||h.triggerKind===sn.Invoked||h.triggerKind===sn.Automatic)}p.is=P})(Yo||(e.CodeActionContext=Yo={}));var Jo;(function(p){function N(y,h,C){var $={title:y},ie=!0;return typeof h=="string"?(ie=!1,$.kind=h):R.is(h)?$.command=h:$.edit=h,ie&&C!==void 0&&($.kind=C),$}p.create=N;function P(y){var h=y;return h&&O.string(h.title)&&(h.diagnostics===void 0||O.typedArray(h.diagnostics,b.is))&&(h.kind===void 0||O.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||O.boolean(h.isPreferred))&&(h.edit===void 0||vr.is(h.edit))}p.is=P})(Jo||(e.CodeAction=Jo={}));var Ti;(function(p){function N(y,h){var C={range:y};return O.defined(h)&&(C.data=h),C}p.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.command)||R.is(h.command))}p.is=P})(Ti||(e.CodeLens=Ti={}));var Xo;(function(p){function N(y,h){return{tabSize:y,insertSpaces:h}}p.create=N;function P(y){var h=y;return O.defined(h)&&O.uinteger(h.tabSize)&&O.boolean(h.insertSpaces)}p.is=P})(Xo||(e.FormattingOptions=Xo={}));var Cn;(function(p){function N(y,h,C){return{range:y,target:h,data:C}}p.create=N;function P(y){var h=y;return O.defined(h)&&a.is(h.range)&&(O.undefined(h.target)||O.string(h.target))}p.is=P})(Cn||(e.DocumentLink=Cn={}));var k;(function(p){function N(y,h){return{range:y,parent:h}}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||p.is(h.parent))}p.is=P})(k||(e.SelectionRange=k={}));var M;(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"})(M||(e.SemanticTokenTypes=M={}));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 z;(function(p){function N(P){var y=P;return O.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})(z||(e.SemanticTokens=z={}));var $e;(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)&&O.string(h.text)}p.is=P})($e||(e.InlineValueText=$e={}));var De;(function(p){function N(y,h,C){return{range:y,variableName:h,caseSensitiveLookup:C}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&O.boolean(h.caseSensitiveLookup)&&(O.string(h.variableName)||h.variableName===void 0)}p.is=P})(De||(e.InlineValueVariableLookup=De={}));var Ke;(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)&&(O.string(h.expression)||h.expression===void 0)}p.is=P})(Ke||(e.InlineValueEvaluatableExpression=Ke={}));var Xe;(function(p){function N(y,h){return{frameId:y,stoppedLocation:h}}p.create=N;function P(y){var h=y;return O.defined(h)&&a.is(y.stoppedLocation)}p.is=P})(Xe||(e.InlineValueContext=Xe={}));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 qe;(function(p){function N(y){return{value:y}}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&(h.tooltip===void 0||O.string(h.tooltip)||As.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}p.is=P})(qe||(e.InlayHintLabelPart=qe={}));var Se;(function(p){function N(y,h,C){var $={position:y,label:h};return C!==void 0&&($.kind=C),$}p.create=N;function P(y){var h=y;return O.objectLiteral(h)&&o.is(h.position)&&(O.string(h.label)||O.typedArray(h.label,qe.is))&&(h.kind===void 0||fe.is(h.kind))&&h.textEdits===void 0||O.typedArray(h.textEdits,A.is)&&(h.tooltip===void 0||O.string(h.tooltip)||As.is(h.tooltip))&&(h.paddingLeft===void 0||O.boolean(h.paddingLeft))&&(h.paddingRight===void 0||O.boolean(h.paddingRight))}p.is=P})(Se||(e.InlayHint=Se={}));var nt;(function(p){function N(P){return{kind:"snippet",value:P}}p.createSnippet=N})(nt||(e.StringValue=nt={}));var St;(function(p){function N(P,y,h,C){return{insertText:P,filterText:y,range:h,command:C}}p.create=N})(St||(e.InlineCompletionItem=St={}));var fr;(function(p){function N(P){return{items:P}}p.create=N})(fr||(e.InlineCompletionList=fr={}));var cl;(function(p){p.Invoked=0,p.Automatic=1})(cl||(e.InlineCompletionTriggerKind=cl={}));var $v;(function(p){function N(P,y){return{range:P,text:y}}p.create=N})($v||(e.SelectedCompletionInfo=$v={}));var Lv;(function(p){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}p.create=N})(Lv||(e.InlineCompletionContext=Lv={}));var xv;(function(p){function N(P){var y=P;return O.objectLiteral(y)&&n.is(y.uri)&&O.string(y.name)}p.is=N})(xv||(e.WorkspaceFolder=xv={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
35
|
-
`,
|
|
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 $=y-1;return o.create($,N-P[$])},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 $(pe){return N.call(pe)==="[object Number]"}p.number=$;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 qe(pe){return N.call(pe)==="[object Number]"&&0<=pe&&pe<=2147483647}p.uinteger=qe;function $n(pe){return N.call(pe)==="[object Function]"}p.func=$n;function Ln(pe){return pe!==null&&typeof pe=="object"}p.objectLiteral=Ln;function Pr(pe,gi){return Array.isArray(pe)&&pe.every(gi)}p.typedArray=Pr})(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 Ei=Is(),oT;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(oT||(Qt.MessageDirection=oT={}));var hp=class{constructor(e){this.method=e}};Qt.RegistrationType=hp;var pp=class extends Ei.RequestType0{constructor(e){super(e)}};Qt.ProtocolRequestType0=pp;var mp=class extends Ei.RequestType{constructor(e){super(e,Ei.ParameterStructures.byName)}};Qt.ProtocolRequestType=mp;var gp=class extends Ei.NotificationType0{constructor(e){super(e)}};Qt.ProtocolNotificationType0=gp;var yp=class extends Ei.NotificationType{constructor(e){super(e,Ei.ParameterStructures.byName)}};Qt.ProtocolNotificationType=yp});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 kA(n){return n===!0||n===!1}ct.boolean=kA;function aT(n){return typeof n=="string"||n instanceof String}ct.string=aT;function EA(n){return typeof n=="number"||n instanceof Number}ct.number=EA;function NA(n){return n instanceof Error}ct.error=NA;function PA(n){return typeof n=="function"}ct.func=PA;function cT(n){return Array.isArray(n)}ct.array=cT;function RA(n){return cT(n)&&n.every(e=>aT(e))}ct.stringArray=RA;function DA(n,e){return Array.isArray(n)&&n.every(e)}ct.typedArray=DA;function CA(n){return n!==null&&typeof n=="object"}ct.objectLiteral=CA});var dT=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.ImplementationRequest=void 0;var lT=Je(),uT;(function(n){n.method="textDocument/implementation",n.messageDirection=lT.MessageDirection.clientToServer,n.type=new lT.ProtocolRequestType(n.method)})(uT||(kl.ImplementationRequest=uT={}))});var pT=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.TypeDefinitionRequest=void 0;var fT=Je(),hT;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=fT.MessageDirection.clientToServer,n.type=new fT.ProtocolRequestType(n.method)})(hT||(El.TypeDefinitionRequest=hT={}))});var yT=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.DidChangeWorkspaceFoldersNotification=Ni.WorkspaceFoldersRequest=void 0;var Nl=Je(),mT;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Nl.MessageDirection.serverToClient,n.type=new Nl.ProtocolRequestType0(n.method)})(mT||(Ni.WorkspaceFoldersRequest=mT={}));var gT;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Nl.MessageDirection.clientToServer,n.type=new Nl.ProtocolNotificationType(n.method)})(gT||(Ni.DidChangeWorkspaceFoldersNotification=gT={}))});var TT=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.ConfigurationRequest=void 0;var bT=Je(),vT;(function(n){n.method="workspace/configuration",n.messageDirection=bT.MessageDirection.serverToClient,n.type=new bT.ProtocolRequestType(n.method)})(vT||(Pl.ConfigurationRequest=vT={}))});var wT=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ColorPresentationRequest=Pi.DocumentColorRequest=void 0;var Rl=Je(),_T;(function(n){n.method="textDocument/documentColor",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(_T||(Pi.DocumentColorRequest=_T={}));var ST;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(ST||(Pi.ColorPresentationRequest=ST={}))});var NT=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.FoldingRangeRefreshRequest=Ri.FoldingRangeRequest=void 0;var Dl=Je(),kT;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Dl.MessageDirection.clientToServer,n.type=new Dl.ProtocolRequestType(n.method)})(kT||(Ri.FoldingRangeRequest=kT={}));var ET;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Dl.MessageDirection.serverToClient,n.type=new Dl.ProtocolRequestType0(n.method)})(ET||(Ri.FoldingRangeRefreshRequest=ET={}))});var DT=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.DeclarationRequest=void 0;var PT=Je(),RT;(function(n){n.method="textDocument/declaration",n.messageDirection=PT.MessageDirection.clientToServer,n.type=new PT.ProtocolRequestType(n.method)})(RT||(Cl.DeclarationRequest=RT={}))});var AT=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.SelectionRangeRequest=void 0;var CT=Je(),OT;(function(n){n.method="textDocument/selectionRange",n.messageDirection=CT.MessageDirection.clientToServer,n.type=new CT.ProtocolRequestType(n.method)})(OT||(Ol.SelectionRangeRequest=OT={}))});var LT=w(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.WorkDoneProgressCancelNotification=Hr.WorkDoneProgressCreateRequest=Hr.WorkDoneProgress=void 0;var OA=Is(),Al=Je(),IT;(function(n){n.type=new OA.ProgressType;function e(t){return t===n.type}n.is=e})(IT||(Hr.WorkDoneProgress=IT={}));var MT;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Al.MessageDirection.serverToClient,n.type=new Al.ProtocolRequestType(n.method)})(MT||(Hr.WorkDoneProgressCreateRequest=MT={}));var $T;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Al.MessageDirection.clientToServer,n.type=new Al.ProtocolNotificationType(n.method)})($T||(Hr.WorkDoneProgressCancelNotification=$T={}))});var FT=w(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CallHierarchyOutgoingCallsRequest=Kr.CallHierarchyIncomingCallsRequest=Kr.CallHierarchyPrepareRequest=void 0;var Di=Je(),xT;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(xT||(Kr.CallHierarchyPrepareRequest=xT={}));var qT;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(qT||(Kr.CallHierarchyIncomingCallsRequest=qT={}));var jT;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(jT||(Kr.CallHierarchyOutgoingCallsRequest=jT={}))});var KT=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 Dr=Je(),BT;(function(n){n.Relative="relative"})(BT||(Zt.TokenFormat=BT={}));var Jo;(function(n){n.method="textDocument/semanticTokens",n.type=new Dr.RegistrationType(n.method)})(Jo||(Zt.SemanticTokensRegistrationType=Jo={}));var UT;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(UT||(Zt.SemanticTokensRequest=UT={}));var VT;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(VT||(Zt.SemanticTokensDeltaRequest=VT={}));var WT;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(WT||(Zt.SemanticTokensRangeRequest=WT={}));var HT;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Dr.MessageDirection.serverToClient,n.type=new Dr.ProtocolRequestType0(n.method)})(HT||(Zt.SemanticTokensRefreshRequest=HT={}))});var YT=w(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.ShowDocumentRequest=void 0;var zT=Je(),GT;(function(n){n.method="window/showDocument",n.messageDirection=zT.MessageDirection.serverToClient,n.type=new zT.ProtocolRequestType(n.method)})(GT||(Il.ShowDocumentRequest=GT={}))});var QT=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.LinkedEditingRangeRequest=void 0;var JT=Je(),XT;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=JT.MessageDirection.clientToServer,n.type=new JT.ProtocolRequestType(n.method)})(XT||(Ml.LinkedEditingRangeRequest=XT={}))});var o_=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.WillDeleteFilesRequest=qt.DidDeleteFilesNotification=qt.DidRenameFilesNotification=qt.WillRenameFilesRequest=qt.DidCreateFilesNotification=qt.WillCreateFilesRequest=qt.FileOperationPatternKind=void 0;var bn=Je(),ZT;(function(n){n.file="file",n.folder="folder"})(ZT||(qt.FileOperationPatternKind=ZT={}));var e_;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(e_||(qt.WillCreateFilesRequest=e_={}));var t_;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(t_||(qt.DidCreateFilesNotification=t_={}));var n_;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(n_||(qt.WillRenameFilesRequest=n_={}));var r_;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(r_||(qt.DidRenameFilesNotification=r_={}));var s_;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(s_||(qt.DidDeleteFilesNotification=s_={}));var i_;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(i_||(qt.WillDeleteFilesRequest=i_={}))});var d_=w(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.MonikerRequest=zr.MonikerKind=zr.UniquenessLevel=void 0;var a_=Je(),c_;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(c_||(zr.UniquenessLevel=c_={}));var l_;(function(n){n.$import="import",n.$export="export",n.local="local"})(l_||(zr.MonikerKind=l_={}));var u_;(function(n){n.method="textDocument/moniker",n.messageDirection=a_.MessageDirection.clientToServer,n.type=new a_.ProtocolRequestType(n.method)})(u_||(zr.MonikerRequest=u_={}))});var m_=w(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.TypeHierarchySubtypesRequest=Gr.TypeHierarchySupertypesRequest=Gr.TypeHierarchyPrepareRequest=void 0;var Ci=Je(),f_;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(f_||(Gr.TypeHierarchyPrepareRequest=f_={}));var h_;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(h_||(Gr.TypeHierarchySupertypesRequest=h_={}));var p_;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(p_||(Gr.TypeHierarchySubtypesRequest=p_={}))});var b_=w(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.InlineValueRefreshRequest=Oi.InlineValueRequest=void 0;var $l=Je(),g_;(function(n){n.method="textDocument/inlineValue",n.messageDirection=$l.MessageDirection.clientToServer,n.type=new $l.ProtocolRequestType(n.method)})(g_||(Oi.InlineValueRequest=g_={}));var y_;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=$l.MessageDirection.serverToClient,n.type=new $l.ProtocolRequestType0(n.method)})(y_||(Oi.InlineValueRefreshRequest=y_={}))});var S_=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.InlayHintRefreshRequest=Yr.InlayHintResolveRequest=Yr.InlayHintRequest=void 0;var Ai=Je(),v_;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(v_||(Yr.InlayHintRequest=v_={}));var T_;(function(n){n.method="inlayHint/resolve",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(T_||(Yr.InlayHintResolveRequest=T_={}));var __;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Ai.MessageDirection.serverToClient,n.type=new Ai.ProtocolRequestType0(n.method)})(__||(Yr.InlayHintRefreshRequest=__={}))});var D_=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DiagnosticRefreshRequest=vn.WorkspaceDiagnosticRequest=vn.DocumentDiagnosticRequest=vn.DocumentDiagnosticReportKind=vn.DiagnosticServerCancellationData=void 0;var R_=Is(),AA=wl(),Ii=Je(),w_;(function(n){function e(t){let r=t;return r&&AA.boolean(r.retriggerRequest)}n.is=e})(w_||(vn.DiagnosticServerCancellationData=w_={}));var k_;(function(n){n.Full="full",n.Unchanged="unchanged"})(k_||(vn.DocumentDiagnosticReportKind=k_={}));var E_;(function(n){n.method="textDocument/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new R_.ProgressType})(E_||(vn.DocumentDiagnosticRequest=E_={}));var N_;(function(n){n.method="workspace/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new R_.ProgressType})(N_||(vn.WorkspaceDiagnosticRequest=N_={}));var P_;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=Ii.MessageDirection.serverToClient,n.type=new Ii.ProtocolRequestType0(n.method)})(P_||(vn.DiagnosticRefreshRequest=P_={}))});var L_=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(),qn=wl(),tr=Je(),bp;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(bp||(rt.NotebookCellKind=bp={}));var vp;(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 qn.objectLiteral(i)&&Xo.uinteger.is(i.executionOrder)&&(i.success===void 0||qn.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})(vp||(rt.ExecutionSummary=vp={}));var Ll;(function(n){function e(i,o){return{kind:i,document:o}}n.create=e;function t(i){let o=i;return qn.objectLiteral(o)&&bp.is(o.kind)&&Xo.DocumentUri.is(o.document)&&(o.metadata===void 0||qn.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)&&!vp.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(qn.objectLiteral(i)&&qn.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 C_;(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 qn.objectLiteral(s)&&qn.string(s.uri)&&Xo.integer.is(s.version)&&qn.typedArray(s.cells,Ll.is)}n.is=t})(C_||(rt.NotebookDocument=C_={}));var Mi;(function(n){n.method="notebookDocument/sync",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.RegistrationType(n.method)})(Mi||(rt.NotebookDocumentSyncRegistrationType=Mi={}));var O_;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(O_||(rt.DidOpenNotebookDocumentNotification=O_={}));var A_;(function(n){function e(r){let s=r;return qn.objectLiteral(s)&&Xo.uinteger.is(s.start)&&Xo.uinteger.is(s.deleteCount)&&(s.cells===void 0||qn.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})(A_||(rt.NotebookCellArrayChange=A_={}));var I_;(function(n){n.method="notebookDocument/didChange",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(I_||(rt.DidChangeNotebookDocumentNotification=I_={}));var M_;(function(n){n.method="notebookDocument/didSave",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(M_||(rt.DidSaveNotebookDocumentNotification=M_={}));var $_;(function(n){n.method="notebookDocument/didClose",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})($_||(rt.DidCloseNotebookDocumentNotification=$_={}))});var j_=w(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.InlineCompletionRequest=void 0;var x_=Je(),q_;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=x_.MessageDirection.clientToServer,n.type=new x_.ProtocolRequestType(n.method)})(q_||(xl.InlineCompletionRequest=q_={}))});var QS=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 q=Je(),F_=Sl(),St=wl(),IA=dT();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return IA.ImplementationRequest}});var MA=pT();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return MA.TypeDefinitionRequest}});var GS=yT();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return GS.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return GS.DidChangeWorkspaceFoldersNotification}});var $A=TT();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return $A.ConfigurationRequest}});var YS=wT();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return YS.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return YS.ColorPresentationRequest}});var JS=NT();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return JS.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return JS.FoldingRangeRefreshRequest}});var LA=DT();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return LA.DeclarationRequest}});var xA=AT();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return xA.SelectionRangeRequest}});var kp=LT();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return kp.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return kp.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return kp.WorkDoneProgressCancelNotification}});var Ep=FT();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyPrepareRequest}});var $i=KT();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return $i.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return $i.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return $i.SemanticTokensRegistrationType}});var qA=YT();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return qA.ShowDocumentRequest}});var jA=QT();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return jA.LinkedEditingRangeRequest}});var Ms=o_();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ms.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ms.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ms.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ms.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ms.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ms.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ms.WillDeleteFilesRequest}});var Np=d_();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return Np.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return Np.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return Np.MonikerRequest}});var Pp=m_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchySupertypesRequest}});var XS=b_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return XS.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return XS.InlineValueRefreshRequest}});var Rp=S_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return Rp.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Rp.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Rp.InlayHintRefreshRequest}});var Qo=D_();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 nr=L_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return nr.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return nr.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return nr.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return nr.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return nr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return nr.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidCloseNotebookDocumentNotification}});var FA=j_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return FA.InlineCompletionRequest}});var Tp;(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})(Tp||(_.TextDocumentFilter=Tp={}));var _p;(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})(_p||(_.NotebookDocumentFilter=_p={}));var Sp;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(St.string(r.notebook)||_p.is(r.notebook))&&(r.language===void 0||St.string(r.language))}n.is=e})(Sp||(_.NotebookCellTextDocumentFilter=Sp={}));var wp;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let r of t)if(!St.string(r)&&!Tp.is(r)&&!Sp.is(r))return!1;return!0}n.is=e})(wp||(_.DocumentSelector=wp={}));var B_;(function(n){n.method="client/registerCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(B_||(_.RegistrationRequest=B_={}));var U_;(function(n){n.method="client/unregisterCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(U_||(_.UnregistrationRequest=U_={}));var V_;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(V_||(_.ResourceOperationKind=V_={}));var W_;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(W_||(_.FailureHandlingKind=W_={}));var H_;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(H_||(_.PositionEncodingKind=H_={}));var K_;(function(n){function e(t){let r=t;return r&&St.string(r.id)&&r.id.length>0}n.hasId=e})(K_||(_.StaticRegistrationOptions=K_={}));var z_;(function(n){function e(t){let r=t;return r&&(r.documentSelector===null||wp.is(r.documentSelector))}n.is=e})(z_||(_.TextDocumentRegistrationOptions=z_={}));var G_;(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})(G_||(_.WorkDoneProgressOptions=G_={}));var Y_;(function(n){n.method="initialize",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Y_||(_.InitializeRequest=Y_={}));var J_;(function(n){n.unknownProtocolVersion=1})(J_||(_.InitializeErrorCodes=J_={}));var X_;(function(n){n.method="initialized",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(X_||(_.InitializedNotification=X_={}));var Q_;(function(n){n.method="shutdown",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType0(n.method)})(Q_||(_.ShutdownRequest=Q_={}));var Z_;(function(n){n.method="exit",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType0(n.method)})(Z_||(_.ExitNotification=Z_={}));var eS;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(eS||(_.DidChangeConfigurationNotification=eS={}));var tS;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(tS||(_.MessageType=tS={}));var nS;(function(n){n.method="window/showMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(nS||(_.ShowMessageNotification=nS={}));var rS;(function(n){n.method="window/showMessageRequest",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(rS||(_.ShowMessageRequest=rS={}));var sS;(function(n){n.method="window/logMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(sS||(_.LogMessageNotification=sS={}));var iS;(function(n){n.method="telemetry/event",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(iS||(_.TelemetryEventNotification=iS={}));var oS;(function(n){n.None=0,n.Full=1,n.Incremental=2})(oS||(_.TextDocumentSyncKind=oS={}));var aS;(function(n){n.method="textDocument/didOpen",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(aS||(_.DidOpenTextDocumentNotification=aS={}));var cS;(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})(cS||(_.TextDocumentContentChangeEvent=cS={}));var lS;(function(n){n.method="textDocument/didChange",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(lS||(_.DidChangeTextDocumentNotification=lS={}));var uS;(function(n){n.method="textDocument/didClose",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(uS||(_.DidCloseTextDocumentNotification=uS={}));var dS;(function(n){n.method="textDocument/didSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(dS||(_.DidSaveTextDocumentNotification=dS={}));var fS;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(fS||(_.TextDocumentSaveReason=fS={}));var hS;(function(n){n.method="textDocument/willSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(hS||(_.WillSaveTextDocumentNotification=hS={}));var pS;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(pS||(_.WillSaveTextDocumentWaitUntilRequest=pS={}));var mS;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(mS||(_.DidChangeWatchedFilesNotification=mS={}));var gS;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(gS||(_.FileChangeType=gS={}));var yS;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(F_.URI.is(r.baseUri)||F_.WorkspaceFolder.is(r.baseUri))&&St.string(r.pattern)}n.is=e})(yS||(_.RelativePattern=yS={}));var bS;(function(n){n.Create=1,n.Change=2,n.Delete=4})(bS||(_.WatchKind=bS={}));var vS;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(vS||(_.PublishDiagnosticsNotification=vS={}));var TS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(TS||(_.CompletionTriggerKind=TS={}));var _S;(function(n){n.method="textDocument/completion",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(_S||(_.CompletionRequest=_S={}));var SS;(function(n){n.method="completionItem/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(SS||(_.CompletionResolveRequest=SS={}));var wS;(function(n){n.method="textDocument/hover",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(wS||(_.HoverRequest=wS={}));var kS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(kS||(_.SignatureHelpTriggerKind=kS={}));var ES;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(ES||(_.SignatureHelpRequest=ES={}));var NS;(function(n){n.method="textDocument/definition",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(NS||(_.DefinitionRequest=NS={}));var PS;(function(n){n.method="textDocument/references",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(PS||(_.ReferencesRequest=PS={}));var RS;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(RS||(_.DocumentHighlightRequest=RS={}));var DS;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(DS||(_.DocumentSymbolRequest=DS={}));var CS;(function(n){n.method="textDocument/codeAction",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(CS||(_.CodeActionRequest=CS={}));var OS;(function(n){n.method="codeAction/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(OS||(_.CodeActionResolveRequest=OS={}));var AS;(function(n){n.method="workspace/symbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(AS||(_.WorkspaceSymbolRequest=AS={}));var IS;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(IS||(_.WorkspaceSymbolResolveRequest=IS={}));var MS;(function(n){n.method="textDocument/codeLens",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(MS||(_.CodeLensRequest=MS={}));var $S;(function(n){n.method="codeLens/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})($S||(_.CodeLensResolveRequest=$S={}));var LS;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType0(n.method)})(LS||(_.CodeLensRefreshRequest=LS={}));var xS;(function(n){n.method="textDocument/documentLink",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(xS||(_.DocumentLinkRequest=xS={}));var qS;(function(n){n.method="documentLink/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(qS||(_.DocumentLinkResolveRequest=qS={}));var jS;(function(n){n.method="textDocument/formatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(jS||(_.DocumentFormattingRequest=jS={}));var FS;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(FS||(_.DocumentRangeFormattingRequest=FS={}));var BS;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(BS||(_.DocumentRangesFormattingRequest=BS={}));var US;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(US||(_.DocumentOnTypeFormattingRequest=US={}));var VS;(function(n){n.Identifier=1})(VS||(_.PrepareSupportDefaultBehavior=VS={}));var WS;(function(n){n.method="textDocument/rename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(WS||(_.RenameRequest=WS={}));var HS;(function(n){n.method="textDocument/prepareRename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(HS||(_.PrepareRenameRequest=HS={}));var KS;(function(n){n.method="workspace/executeCommand",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(KS||(_.ExecuteCommandRequest=KS={}));var zS;(function(n){n.method="workspace/applyEdit",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType("workspace/applyEdit")})(zS||(_.ApplyWorkspaceEditRequest=zS={}))});var ew=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.createProtocolConnection=void 0;var ZS=Is();function BA(n,e,t,r){return ZS.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,ZS.createMessageConnection)(n,e,t,r)}ql.createProtocolConnection=BA});var nw=w(en=>{"use strict";var UA=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)&&UA(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(QS(),en);var VA=ew();Object.defineProperty(en,"createProtocolConnection",{enumerable:!0,get:function(){return VA.createProtocolConnection}});var tw;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(tw||(en.LSPErrorCodes=tw={}))});var st=w(rr=>{"use strict";var WA=rr&&rr.__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]}),rw=rr&&rr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&WA(e,n,t)};Object.defineProperty(rr,"__esModule",{value:!0});rr.createProtocolConnection=void 0;var HA=fp();rw(fp(),rr);rw(nw(),rr);function KA(n,e,t,r){return(0,HA.createMessageConnection)(n,e,t,r)}rr.createProtocolConnection=KA});var Dp=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 sw(){return new ea}Tn.v4=sw;var zA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function iw(n){return zA.test(n)}Tn.isUUID=iw;function GA(n){if(!iw(n))throw new Error("invalid uuid");return new Zo(n)}Tn.parse=GA;function YA(){return sw().asHex()}Tn.generateUuid=YA});var ow=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.attachPartialResult=Xr.ProgressFeature=Xr.attachWorkDone=void 0;var Jr=st(),JA=Dp(),$s=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(Jr.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(Jr.WorkDoneProgress.type,this._token,r)}done(){n.Instances.delete(this._token),this._connection.sendProgress(Jr.WorkDoneProgress.type,this._token,{kind:"end"})}};$s.Instances=new Map;var Fl=class extends $s{constructor(e,t){super(e,t),this._source=new Jr.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 Jr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function XA(n,e){if(e===void 0||e.workDoneToken===void 0)return new ta;let t=e.workDoneToken;return delete e.workDoneToken,new $s(n,t)}Xr.attachWorkDone=XA;var QA=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Jr.WorkDoneProgressCancelNotification.type,t=>{let r=$s.Instances.get(t.token);(r instanceof Fl||r instanceof Bl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ta:new $s(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,JA.generateUuid)();return this.connection.sendRequest(Jr.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fl(this.connection,e))}else return Promise.resolve(new Bl)}};Xr.ProgressFeature=QA;var Cp;(function(n){n.type=new Jr.ProgressType})(Cp||(Cp={}));var Op=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Cp.type,this._token,e)}};function ZA(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Op(n,t)}Xr.attachPartialResult=ZA});var aw=w(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ConfigurationFeature=void 0;var eI=st(),tI=Zc(),nI=n=>class extends n{getConfiguration(e){return e?tI.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(eI.ConfigurationRequest.type,t).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ul.ConfigurationFeature=nI});var cw=w(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.WorkspaceFoldersFeature=void 0;var Vl=st(),rI=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=rI});var lw=w(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.CallHierarchyFeature=void 0;var Ap=st(),sI=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ap.CallHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Ap.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onOutgoingCalls:e=>{let t=Ap.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Hl.CallHierarchyFeature=sI});var Mp=w(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.SemanticTokensBuilder=Qr.SemanticTokensDiff=Qr.SemanticTokensFeature=void 0;var Kl=st(),iI=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)))}}}};Qr.SemanticTokensFeature=iI;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}]:[]}};Qr.SemanticTokensDiff=zl;var Ip=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()}};Qr.SemanticTokensBuilder=Ip});var uw=w(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.ShowDocumentFeature=void 0;var oI=st(),aI=n=>class extends n{showDocument(e){return this.connection.sendRequest(oI.ShowDocumentRequest.type,e)}};Gl.ShowDocumentFeature=aI});var dw=w(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.FileOperationsFeature=void 0;var Li=st(),cI=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=cI});var fw=w(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.LinkedEditingRangeFeature=void 0;var lI=st(),uI=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(lI.LinkedEditingRangeRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0))}};Jl.LinkedEditingRangeFeature=uI});var hw=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.TypeHierarchyFeature=void 0;var $p=st(),dI=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest($p.TypeHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=$p.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onSubtypes:e=>{let t=$p.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Xl.TypeHierarchyFeature=dI});var mw=w(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.InlineValueFeature=void 0;var pw=st(),fI=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(pw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(pw.InlineValueRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Ql.InlineValueFeature=fI});var yw=w(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.FoldingRangeFeature=void 0;var gw=st(),hI=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(gw.FoldingRangeRefreshRequest.type),on:e=>{let t=gw.FoldingRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Zl.FoldingRangeFeature=hI});var bw=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.InlayHintFeature=void 0;var Lp=st(),pI=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Lp.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Lp.InlayHintRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Lp.InlayHintResolveRequest.type,(t,r)=>e(t,r))}}};eu.InlayHintFeature=pI});var vw=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.DiagnosticFeature=void 0;var na=st(),mI=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=mI});var qp=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.TextDocuments=void 0;var Ls=st(),xp=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=xp});var Fp=w(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.NotebookDocuments=xi.NotebookSyncFeature=void 0;var _n=st(),Tw=qp(),gI=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)})}}};xi.NotebookSyncFeature=gI;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 jp=class{constructor(e){e instanceof Tw.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Tw.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 k=c.cells;if(k.structure!==void 0){let v=k.structure.array;if(i.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),k.structure.didOpen!==void 0)for(let b of k.structure.didOpen)t.openTextDocument({textDocument:b}),l.push(b.uri);if(k.structure.didClose)for(let b of k.structure.didClose)t.closeTextDocument({textDocument:b}),u.push(b.uri)}if(k.data!==void 0){let v=new Map(k.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(k.textContent!==void 0)for(let v of k.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 k of l)T.push(this.getNotebookCell(k));let g=[];for(let k of u)g.push(this.getNotebookCell(k));let S=[];for(let k of f)S.push(this.getNotebookCell(k));(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])}};xi.NotebookDocuments=jp});var _w=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MonikerFeature=void 0;var yI=st(),bI=n=>class extends n{get moniker(){return{on:e=>{let t=yI.MonikerRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};su.MonikerFeature=bI});var Kp=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(),Up=Dp(),ne=ow(),vI=aw(),TI=cw(),_I=lw(),SI=Mp(),wI=uw(),kI=dw(),EI=fw(),NI=hw(),PI=mw(),RI=yw(),DI=bw(),CI=vw(),OI=Fp(),AI=_w();function Bp(n){if(n!==null)return n}var Vp=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=Vp;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")})}},Wp=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(Bp)}showWarningMessage(e,...t){let r={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Bp)}showInformationMessage(e,...t){let r={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Bp)}},Sw=(0,wI.ShowDocumentFeature)((0,ne.ProgressFeature)(Wp)),ww;(function(n){function e(){return new ou}n.create=e})(ww||(Se.BulkRegistration=ww={}));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=Up.generateUuid();this._registrations.push({id:s,method:r,registerOptions:t||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},kw;(function(n){function e(){return new ra(void 0,[])}n.create=e})(kw||(Se.BulkUnregistration=kw={}));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=Up.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=Up.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)))}},Hp=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)}},Ew=(0,kI.FileOperationsFeature)((0,TI.WorkspaceFoldersFeature)((0,vI.ConfigurationFeature)(Hp))),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 Nw=(0,RI.FoldingRangeFeature)((0,AI.MonikerFeature)((0,CI.DiagnosticFeature)((0,DI.InlayHintFeature)((0,PI.InlineValueFeature)((0,NI.TypeHierarchyFeature)((0,EI.LinkedEditingRangeFeature)((0,SI.SemanticTokensFeature)((0,_I.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 Pw=(0,OI.NotebookSyncFeature)(du);function Rw(n,e){return function(t){return e(n(t))}}Se.combineConsoleFeatures=Rw;function Dw(n,e){return function(t){return e(n(t))}}Se.combineTelemetryFeatures=Dw;function Cw(n,e){return function(t){return e(n(t))}}Se.combineTracerFeatures=Cw;function Ow(n,e){return function(t){return e(n(t))}}Se.combineClientFeatures=Ow;function Aw(n,e){return function(t){return e(n(t))}}Se.combineWindowFeatures=Aw;function Iw(n,e){return function(t){return e(n(t))}}Se.combineWorkspaceFeatures=Iw;function Mw(n,e){return function(t){return e(n(t))}}Se.combineLanguagesFeatures=Mw;function $w(n,e){return function(t){return e(n(t))}}Se.combineNotebooksFeatures=$w;function II(n,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(n.console,e.console,Rw),tracer:t(n.tracer,e.tracer,Cw),telemetry:t(n.telemetry,e.telemetry,Dw),client:t(n.client,e.client,Ow),window:t(n.window,e.window,Aw),workspace:t(n.workspace,e.workspace,Iw),languages:t(n.languages,e.languages,Mw),notebooks:t(n.notebooks,e.notebooks,$w)}}Se.combineFeatures=II;function MI(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(Sw)):new Sw,l=t&&t.workspace?new(t.workspace(Ew)):new Ew,u=t&&t.languages?new(t.languages(Nw)):new Nw,d=t&&t.notebooks?new(t.notebooks(Pw)):new Pw,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,k={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(k);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(k.__textDocumentSync)?k.__textDocumentSync:U.TextDocumentSyncKind.None:!Sn.number(L.textDocumentSync)&&!Sn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Sn.number(k.__textDocumentSync)?k.__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)}),k}Se.createConnection=MI});var Lw=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 $I=require("url"),jn=require("path"),zp=require("fs"),Xp=require("child_process");function LI(n){let e=$I.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=LI;function Gp(){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&&zp.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,Xp.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 Yp(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};Gp()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,Xp.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?Gp()?jn.join(o,"node_modules"):jn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}tn.resolveGlobalNodePath=Yp;function xI(n){let e="yarn",t={encoding:"utf8"};Gp()&&(e="yarn.cmd",t.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,Xp.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=xI;var Jp;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!zp.existsSync(__filename.toUpperCase())||!zp.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})(Jp||(tn.FileSystem=Jp={}));function qI(n,e,t,r){return t?(jn.isAbsolute(t)||(t=jn.join(n,t)),fu(e,t,t,r).then(s=>Jp.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>fu(e,Yp(r),n,r))):fu(e,Yp(r),n,r)}tn.resolveModulePath=qI});var Qp=w((IK,xw)=>{"use strict";xw.exports=st()});var qw=w(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.InlineCompletionFeature=void 0;var jI=st(),FI=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(jI.InlineCompletionRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};hu.InlineCompletionFeature=FI});var Bw=w(jt=>{"use strict";var BI=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]}),Fw=jt&&jt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&BI(e,n,t)};Object.defineProperty(jt,"__esModule",{value:!0});jt.ProposedFeatures=jt.NotebookDocuments=jt.TextDocuments=jt.SemanticTokensBuilder=void 0;var UI=Mp();Object.defineProperty(jt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return UI.SemanticTokensBuilder}});var VI=qw();Fw(st(),jt);var WI=qp();Object.defineProperty(jt,"TextDocuments",{enumerable:!0,get:function(){return WI.TextDocuments}});var HI=Fp();Object.defineProperty(jt,"NotebookDocuments",{enumerable:!0,get:function(){return HI.NotebookDocuments}});Fw(Kp(),jt);var jw;(function(n){n.all={__brand:"features",languages:VI.InlineCompletionFeature}})(jw||(jt.ProposedFeatures=jw={}))});var X=w(wn=>{"use strict";var KI=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]}),Hw=wn&&wn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&KI(e,n,t)};Object.defineProperty(wn,"__esModule",{value:!0});wn.createConnection=wn.Files=void 0;var Uw=require("node:util"),Zp=Zc(),zI=Kp(),sa=Lw(),xs=Qp();Hw(Qp(),wn);Hw(Bw(),wn);var Vw;(function(n){n.uriToFilePath=sa.uriToFilePath,n.resolveGlobalNodePath=sa.resolveGlobalNodePath,n.resolveGlobalYarnPath=sa.resolveGlobalYarnPath,n.resolve=sa.resolve,n.resolveModulePath=sa.resolveModulePath})(Vw||(wn.Files=Vw={}));var Ww;function pu(){if(Ww!==void 0)try{Ww.end()}catch{}}var qi=!1,Kw;function GI(){let n="--clientProcessId";function e(t){try{let r=parseInt(t);isNaN(r)||(Kw=setInterval(()=>{try{process.kill(r,0)}catch{pu(),process.exit(qi?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])}}}GI();var YI={initialize:n=>{let e=n.processId;Zp.number(e)&&Kw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(qi?0:1)}},3e3)},get shutdownReceived(){return qi},set shutdownReceived(n){qi=n},exit:n=>{pu(),process.exit(n)}};function JI(n,e,t,r){let s,i,o,a;return n!==void 0&&n.__brand==="features"&&(s=n,n=e,e=t,t=r),xs.ConnectionStrategy.is(n)||xs.ConnectionOptions.is(n)?a=n:(i=n,o=e,a=t),XI(i,o,a,s)}wn.createConnection=JI;function XI(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 xs.IPCMessageReader(process),e=new xs.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,xs.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,xs.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(Zp.func(n.read)&&Zp.func(n.on)){let c=n;c.on("end",()=>{pu(),process.exit(qi?0:1)}),c.on("close",()=>{pu(),process.exit(qi?0:1)})}let a=c=>{let l=(0,xs.createProtocolConnection)(n,e,c,t);return s&&QI(c),l};return(0,zI.createConnection)(a,YI,r)}function QI(n){function e(r){return r.map(s=>typeof s=="string"?s:(0,Uw.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,Uw.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){
|
|
38
|
-
`)}};
|
|
39
|
-
`)?
|
|
34
|
+
`,"\r"];var qv;(function(p){function N(C,$,ie,st){return new nA(C,$,ie,st)}p.create=N;function P(C){var $=C;return!!(O.defined($)&&O.string($.uri)&&(O.undefined($.languageId)||O.string($.languageId))&&O.uinteger($.lineCount)&&O.func($.getText)&&O.func($.positionAt)&&O.func($.offsetAt))}p.is=P;function y(C,$){for(var ie=C.getText(),st=h($,function(_i,ll){var jv=_i.range.start.line-ll.range.start.line;return jv===0?_i.range.start.character-ll.range.start.character:jv}),Ve=ie.length,jr=st.length-1;jr>=0;jr--){var Fr=st[jr],On=C.offsetAt(Fr.range.start),pe=C.offsetAt(Fr.range.end);if(pe<=Ve)ie=ie.substring(0,On)+Fr.newText+ie.substring(pe,ie.length);else throw new Error("Overlapping edit");Ve=On}return ie}p.applyEdits=y;function h(C,$){if(C.length<=1)return C;var ie=C.length/2|0,st=C.slice(0,ie),Ve=C.slice(ie);h(st,$),h(Ve,$);for(var jr=0,Fr=0,On=0;jr<st.length&&Fr<Ve.length;){var pe=$(st[jr],Ve[Fr]);pe<=0?C[On++]=st[jr++]:C[On++]=Ve[Fr++]}for(;jr<st.length;)C[On++]=st[jr++];for(;Fr<Ve.length;)C[On++]=Ve[Fr++];return C}})(qv||(e.TextDocument=qv={}));var nA=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 C=P.charAt(h);y=C==="\r"||C===`
|
|
35
|
+
`,C==="\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 C=Math.floor((y+h)/2);P[C]>N?h=C:y=C+1}var $=y-1;return o.create($,N-P[$])},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}(),O;(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 C(pe){return N.call(pe)==="[object String]"}p.string=C;function $(pe){return N.call(pe)==="[object Number]"}p.number=$;function ie(pe,_i,ll){return N.call(pe)==="[object Number]"&&_i<=pe&&pe<=ll}p.numberRange=ie;function st(pe){return N.call(pe)==="[object Number]"&&-2147483648<=pe&&pe<=2147483647}p.integer=st;function Ve(pe){return N.call(pe)==="[object Number]"&&0<=pe&&pe<=2147483647}p.uinteger=Ve;function jr(pe){return N.call(pe)==="[object Function]"}p.func=jr;function Fr(pe){return pe!==null&&typeof pe=="object"}p.objectLiteral=Fr;function On(pe,_i){return Array.isArray(pe)&&pe.every(_i)}p.typedArray=On})(O||(O={}))})});var Qe=E(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.ProtocolNotificationType=tr.ProtocolNotificationType0=tr.ProtocolRequestType=tr.ProtocolRequestType0=tr.RegistrationType=tr.MessageDirection=void 0;var Ci=xs(),TT;(function(r){r.clientToServer="clientToServer",r.serverToClient="serverToClient",r.both="both"})(TT||(tr.MessageDirection=TT={}));var wp=class{constructor(e){this.method=e}};tr.RegistrationType=wp;var kp=class extends Ci.RequestType0{constructor(e){super(e)}};tr.ProtocolRequestType0=kp;var Np=class extends Ci.RequestType{constructor(e){super(e,Ci.ParameterStructures.byName)}};tr.ProtocolRequestType=Np;var Pp=class extends Ci.NotificationType0{constructor(e){super(e)}};tr.ProtocolNotificationType0=Pp;var Rp=class extends Ci.NotificationType{constructor(e){super(e,Ci.ParameterStructures.byName)}};tr.ProtocolNotificationType=Rp});var Ml=E(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.objectLiteral=ht.typedArray=ht.stringArray=ht.array=ht.func=ht.error=ht.number=ht.string=ht.boolean=void 0;function XA(r){return r===!0||r===!1}ht.boolean=XA;function _T(r){return typeof r=="string"||r instanceof String}ht.string=_T;function QA(r){return typeof r=="number"||r instanceof Number}ht.number=QA;function ZA(r){return r instanceof Error}ht.error=ZA;function eI(r){return typeof r=="function"}ht.func=eI;function ST(r){return Array.isArray(r)}ht.array=ST;function tI(r){return ST(r)&&r.every(e=>_T(e))}ht.stringArray=tI;function rI(r,e){return Array.isArray(r)&&r.every(e)}ht.typedArray=rI;function nI(r){return r!==null&&typeof r=="object"}ht.objectLiteral=nI});var kT=E($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.ImplementationRequest=void 0;var ET=Qe(),wT;(function(r){r.method="textDocument/implementation",r.messageDirection=ET.MessageDirection.clientToServer,r.type=new ET.ProtocolRequestType(r.method)})(wT||($l.ImplementationRequest=wT={}))});var RT=E(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.TypeDefinitionRequest=void 0;var NT=Qe(),PT;(function(r){r.method="textDocument/typeDefinition",r.messageDirection=NT.MessageDirection.clientToServer,r.type=new NT.ProtocolRequestType(r.method)})(PT||(Ll.TypeDefinitionRequest=PT={}))});var OT=E(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.DidChangeWorkspaceFoldersNotification=Oi.WorkspaceFoldersRequest=void 0;var xl=Qe(),DT;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=xl.MessageDirection.serverToClient,r.type=new xl.ProtocolRequestType0(r.method)})(DT||(Oi.WorkspaceFoldersRequest=DT={}));var CT;(function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=xl.MessageDirection.clientToServer,r.type=new xl.ProtocolNotificationType(r.method)})(CT||(Oi.DidChangeWorkspaceFoldersNotification=CT={}))});var MT=E(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.ConfigurationRequest=void 0;var AT=Qe(),IT;(function(r){r.method="workspace/configuration",r.messageDirection=AT.MessageDirection.serverToClient,r.type=new AT.ProtocolRequestType(r.method)})(IT||(ql.ConfigurationRequest=IT={}))});var xT=E(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ColorPresentationRequest=Ai.DocumentColorRequest=void 0;var jl=Qe(),$T;(function(r){r.method="textDocument/documentColor",r.messageDirection=jl.MessageDirection.clientToServer,r.type=new jl.ProtocolRequestType(r.method)})($T||(Ai.DocumentColorRequest=$T={}));var LT;(function(r){r.method="textDocument/colorPresentation",r.messageDirection=jl.MessageDirection.clientToServer,r.type=new jl.ProtocolRequestType(r.method)})(LT||(Ai.ColorPresentationRequest=LT={}))});var FT=E(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.FoldingRangeRefreshRequest=Ii.FoldingRangeRequest=void 0;var Fl=Qe(),qT;(function(r){r.method="textDocument/foldingRange",r.messageDirection=Fl.MessageDirection.clientToServer,r.type=new Fl.ProtocolRequestType(r.method)})(qT||(Ii.FoldingRangeRequest=qT={}));var jT;(function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=Fl.MessageDirection.serverToClient,r.type=new Fl.ProtocolRequestType0(r.method)})(jT||(Ii.FoldingRangeRefreshRequest=jT={}))});var VT=E(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.DeclarationRequest=void 0;var BT=Qe(),UT;(function(r){r.method="textDocument/declaration",r.messageDirection=BT.MessageDirection.clientToServer,r.type=new BT.ProtocolRequestType(r.method)})(UT||(Bl.DeclarationRequest=UT={}))});var zT=E(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.SelectionRangeRequest=void 0;var WT=Qe(),HT;(function(r){r.method="textDocument/selectionRange",r.messageDirection=WT.MessageDirection.clientToServer,r.type=new WT.ProtocolRequestType(r.method)})(HT||(Ul.SelectionRangeRequest=HT={}))});var JT=E(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WorkDoneProgressCancelNotification=Jn.WorkDoneProgressCreateRequest=Jn.WorkDoneProgress=void 0;var sI=xs(),Vl=Qe(),KT;(function(r){r.type=new sI.ProgressType;function e(t){return t===r.type}r.is=e})(KT||(Jn.WorkDoneProgress=KT={}));var GT;(function(r){r.method="window/workDoneProgress/create",r.messageDirection=Vl.MessageDirection.serverToClient,r.type=new Vl.ProtocolRequestType(r.method)})(GT||(Jn.WorkDoneProgressCreateRequest=GT={}));var YT;(function(r){r.method="window/workDoneProgress/cancel",r.messageDirection=Vl.MessageDirection.clientToServer,r.type=new Vl.ProtocolNotificationType(r.method)})(YT||(Jn.WorkDoneProgressCancelNotification=YT={}))});var e_=E(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CallHierarchyOutgoingCallsRequest=Xn.CallHierarchyIncomingCallsRequest=Xn.CallHierarchyPrepareRequest=void 0;var Mi=Qe(),XT;(function(r){r.method="textDocument/prepareCallHierarchy",r.messageDirection=Mi.MessageDirection.clientToServer,r.type=new Mi.ProtocolRequestType(r.method)})(XT||(Xn.CallHierarchyPrepareRequest=XT={}));var QT;(function(r){r.method="callHierarchy/incomingCalls",r.messageDirection=Mi.MessageDirection.clientToServer,r.type=new Mi.ProtocolRequestType(r.method)})(QT||(Xn.CallHierarchyIncomingCallsRequest=QT={}));var ZT;(function(r){r.method="callHierarchy/outgoingCalls",r.messageDirection=Mi.MessageDirection.clientToServer,r.type=new Mi.ProtocolRequestType(r.method)})(ZT||(Xn.CallHierarchyOutgoingCallsRequest=ZT={}))});var o_=E(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.SemanticTokensRefreshRequest=rr.SemanticTokensRangeRequest=rr.SemanticTokensDeltaRequest=rr.SemanticTokensRequest=rr.SemanticTokensRegistrationType=rr.TokenFormat=void 0;var In=Qe(),t_;(function(r){r.Relative="relative"})(t_||(rr.TokenFormat=t_={}));var sa;(function(r){r.method="textDocument/semanticTokens",r.type=new In.RegistrationType(r.method)})(sa||(rr.SemanticTokensRegistrationType=sa={}));var r_;(function(r){r.method="textDocument/semanticTokens/full",r.messageDirection=In.MessageDirection.clientToServer,r.type=new In.ProtocolRequestType(r.method),r.registrationMethod=sa.method})(r_||(rr.SemanticTokensRequest=r_={}));var n_;(function(r){r.method="textDocument/semanticTokens/full/delta",r.messageDirection=In.MessageDirection.clientToServer,r.type=new In.ProtocolRequestType(r.method),r.registrationMethod=sa.method})(n_||(rr.SemanticTokensDeltaRequest=n_={}));var s_;(function(r){r.method="textDocument/semanticTokens/range",r.messageDirection=In.MessageDirection.clientToServer,r.type=new In.ProtocolRequestType(r.method),r.registrationMethod=sa.method})(s_||(rr.SemanticTokensRangeRequest=s_={}));var i_;(function(r){r.method="workspace/semanticTokens/refresh",r.messageDirection=In.MessageDirection.serverToClient,r.type=new In.ProtocolRequestType0(r.method)})(i_||(rr.SemanticTokensRefreshRequest=i_={}))});var l_=E(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.ShowDocumentRequest=void 0;var a_=Qe(),c_;(function(r){r.method="window/showDocument",r.messageDirection=a_.MessageDirection.serverToClient,r.type=new a_.ProtocolRequestType(r.method)})(c_||(Wl.ShowDocumentRequest=c_={}))});var f_=E(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.LinkedEditingRangeRequest=void 0;var u_=Qe(),d_;(function(r){r.method="textDocument/linkedEditingRange",r.messageDirection=u_.MessageDirection.clientToServer,r.type=new u_.ProtocolRequestType(r.method)})(d_||(Hl.LinkedEditingRangeRequest=d_={}))});var T_=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.WillDeleteFilesRequest=Ft.DidDeleteFilesNotification=Ft.DidRenameFilesNotification=Ft.WillRenameFilesRequest=Ft.DidCreateFilesNotification=Ft.WillCreateFilesRequest=Ft.FileOperationPatternKind=void 0;var Tr=Qe(),h_;(function(r){r.file="file",r.folder="folder"})(h_||(Ft.FileOperationPatternKind=h_={}));var p_;(function(r){r.method="workspace/willCreateFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolRequestType(r.method)})(p_||(Ft.WillCreateFilesRequest=p_={}));var m_;(function(r){r.method="workspace/didCreateFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolNotificationType(r.method)})(m_||(Ft.DidCreateFilesNotification=m_={}));var g_;(function(r){r.method="workspace/willRenameFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolRequestType(r.method)})(g_||(Ft.WillRenameFilesRequest=g_={}));var y_;(function(r){r.method="workspace/didRenameFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolNotificationType(r.method)})(y_||(Ft.DidRenameFilesNotification=y_={}));var b_;(function(r){r.method="workspace/didDeleteFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolNotificationType(r.method)})(b_||(Ft.DidDeleteFilesNotification=b_={}));var v_;(function(r){r.method="workspace/willDeleteFiles",r.messageDirection=Tr.MessageDirection.clientToServer,r.type=new Tr.ProtocolRequestType(r.method)})(v_||(Ft.WillDeleteFilesRequest=v_={}))});var k_=E(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.MonikerRequest=Qn.MonikerKind=Qn.UniquenessLevel=void 0;var __=Qe(),S_;(function(r){r.document="document",r.project="project",r.group="group",r.scheme="scheme",r.global="global"})(S_||(Qn.UniquenessLevel=S_={}));var E_;(function(r){r.$import="import",r.$export="export",r.local="local"})(E_||(Qn.MonikerKind=E_={}));var w_;(function(r){r.method="textDocument/moniker",r.messageDirection=__.MessageDirection.clientToServer,r.type=new __.ProtocolRequestType(r.method)})(w_||(Qn.MonikerRequest=w_={}))});var D_=E(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TypeHierarchySubtypesRequest=Zn.TypeHierarchySupertypesRequest=Zn.TypeHierarchyPrepareRequest=void 0;var $i=Qe(),N_;(function(r){r.method="textDocument/prepareTypeHierarchy",r.messageDirection=$i.MessageDirection.clientToServer,r.type=new $i.ProtocolRequestType(r.method)})(N_||(Zn.TypeHierarchyPrepareRequest=N_={}));var P_;(function(r){r.method="typeHierarchy/supertypes",r.messageDirection=$i.MessageDirection.clientToServer,r.type=new $i.ProtocolRequestType(r.method)})(P_||(Zn.TypeHierarchySupertypesRequest=P_={}));var R_;(function(r){r.method="typeHierarchy/subtypes",r.messageDirection=$i.MessageDirection.clientToServer,r.type=new $i.ProtocolRequestType(r.method)})(R_||(Zn.TypeHierarchySubtypesRequest=R_={}))});var A_=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.InlineValueRefreshRequest=Li.InlineValueRequest=void 0;var zl=Qe(),C_;(function(r){r.method="textDocument/inlineValue",r.messageDirection=zl.MessageDirection.clientToServer,r.type=new zl.ProtocolRequestType(r.method)})(C_||(Li.InlineValueRequest=C_={}));var O_;(function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=zl.MessageDirection.serverToClient,r.type=new zl.ProtocolRequestType0(r.method)})(O_||(Li.InlineValueRefreshRequest=O_={}))});var L_=E(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.InlayHintRefreshRequest=es.InlayHintResolveRequest=es.InlayHintRequest=void 0;var xi=Qe(),I_;(function(r){r.method="textDocument/inlayHint",r.messageDirection=xi.MessageDirection.clientToServer,r.type=new xi.ProtocolRequestType(r.method)})(I_||(es.InlayHintRequest=I_={}));var M_;(function(r){r.method="inlayHint/resolve",r.messageDirection=xi.MessageDirection.clientToServer,r.type=new xi.ProtocolRequestType(r.method)})(M_||(es.InlayHintResolveRequest=M_={}));var $_;(function(r){r.method="workspace/inlayHint/refresh",r.messageDirection=xi.MessageDirection.serverToClient,r.type=new xi.ProtocolRequestType0(r.method)})($_||(es.InlayHintRefreshRequest=$_={}))});var V_=E(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.DiagnosticRefreshRequest=_r.WorkspaceDiagnosticRequest=_r.DocumentDiagnosticRequest=_r.DocumentDiagnosticReportKind=_r.DiagnosticServerCancellationData=void 0;var U_=xs(),iI=Ml(),qi=Qe(),x_;(function(r){function e(t){let n=t;return n&&iI.boolean(n.retriggerRequest)}r.is=e})(x_||(_r.DiagnosticServerCancellationData=x_={}));var q_;(function(r){r.Full="full",r.Unchanged="unchanged"})(q_||(_r.DocumentDiagnosticReportKind=q_={}));var j_;(function(r){r.method="textDocument/diagnostic",r.messageDirection=qi.MessageDirection.clientToServer,r.type=new qi.ProtocolRequestType(r.method),r.partialResult=new U_.ProgressType})(j_||(_r.DocumentDiagnosticRequest=j_={}));var F_;(function(r){r.method="workspace/diagnostic",r.messageDirection=qi.MessageDirection.clientToServer,r.type=new qi.ProtocolRequestType(r.method),r.partialResult=new U_.ProgressType})(F_||(_r.WorkspaceDiagnosticRequest=F_={}));var B_;(function(r){r.method="workspace/diagnostic/refresh",r.messageDirection=qi.MessageDirection.serverToClient,r.type=new qi.ProtocolRequestType0(r.method)})(B_||(_r.DiagnosticRefreshRequest=B_={}))});var J_=E(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.DidCloseNotebookDocumentNotification=it.DidSaveNotebookDocumentNotification=it.DidChangeNotebookDocumentNotification=it.NotebookCellArrayChange=it.DidOpenNotebookDocumentNotification=it.NotebookDocumentSyncRegistrationType=it.NotebookDocument=it.NotebookCell=it.ExecutionSummary=it.NotebookCellKind=void 0;var ia=Il(),Ur=Ml(),on=Qe(),Dp;(function(r){r.Markup=1,r.Code=2;function e(t){return t===1||t===2}r.is=e})(Dp||(it.NotebookCellKind=Dp={}));var Cp;(function(r){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}r.create=e;function t(s){let i=s;return Ur.objectLiteral(i)&&ia.uinteger.is(i.executionOrder)&&(i.success===void 0||Ur.boolean(i.success))}r.is=t;function n(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}r.equals=n})(Cp||(it.ExecutionSummary=Cp={}));var Kl;(function(r){function e(i,o){return{kind:i,document:o}}r.create=e;function t(i){let o=i;return Ur.objectLiteral(o)&&Dp.is(o.kind)&&ia.DocumentUri.is(o.document)&&(o.metadata===void 0||Ur.objectLiteral(o.metadata))}r.is=t;function n(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)&&!Cp.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}r.diff=n;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(Ur.objectLiteral(i)&&Ur.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(Kl||(it.NotebookCell=Kl={}));var W_;(function(r){function e(n,s,i,o){return{uri:n,notebookType:s,version:i,cells:o}}r.create=e;function t(n){let s=n;return Ur.objectLiteral(s)&&Ur.string(s.uri)&&ia.integer.is(s.version)&&Ur.typedArray(s.cells,Kl.is)}r.is=t})(W_||(it.NotebookDocument=W_={}));var ji;(function(r){r.method="notebookDocument/sync",r.messageDirection=on.MessageDirection.clientToServer,r.type=new on.RegistrationType(r.method)})(ji||(it.NotebookDocumentSyncRegistrationType=ji={}));var H_;(function(r){r.method="notebookDocument/didOpen",r.messageDirection=on.MessageDirection.clientToServer,r.type=new on.ProtocolNotificationType(r.method),r.registrationMethod=ji.method})(H_||(it.DidOpenNotebookDocumentNotification=H_={}));var z_;(function(r){function e(n){let s=n;return Ur.objectLiteral(s)&&ia.uinteger.is(s.start)&&ia.uinteger.is(s.deleteCount)&&(s.cells===void 0||Ur.typedArray(s.cells,Kl.is))}r.is=e;function t(n,s,i){let o={start:n,deleteCount:s};return i!==void 0&&(o.cells=i),o}r.create=t})(z_||(it.NotebookCellArrayChange=z_={}));var K_;(function(r){r.method="notebookDocument/didChange",r.messageDirection=on.MessageDirection.clientToServer,r.type=new on.ProtocolNotificationType(r.method),r.registrationMethod=ji.method})(K_||(it.DidChangeNotebookDocumentNotification=K_={}));var G_;(function(r){r.method="notebookDocument/didSave",r.messageDirection=on.MessageDirection.clientToServer,r.type=new on.ProtocolNotificationType(r.method),r.registrationMethod=ji.method})(G_||(it.DidSaveNotebookDocumentNotification=G_={}));var Y_;(function(r){r.method="notebookDocument/didClose",r.messageDirection=on.MessageDirection.clientToServer,r.type=new on.ProtocolNotificationType(r.method),r.registrationMethod=ji.method})(Y_||(it.DidCloseNotebookDocumentNotification=Y_={}))});var Z_=E(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.InlineCompletionRequest=void 0;var X_=Qe(),Q_;(function(r){r.method="textDocument/inlineCompletion",r.messageDirection=X_.MessageDirection.clientToServer,r.type=new X_.ProtocolRequestType(r.method)})(Q_||(Gl.InlineCompletionRequest=Q_={}))});var fE=E(_=>{"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 q=Qe(),eS=Il(),Et=Ml(),oI=kT();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return oI.ImplementationRequest}});var aI=RT();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return aI.TypeDefinitionRequest}});var cE=OT();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return cE.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return cE.DidChangeWorkspaceFoldersNotification}});var cI=MT();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return cI.ConfigurationRequest}});var lE=xT();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return lE.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return lE.ColorPresentationRequest}});var uE=FT();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return uE.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return uE.FoldingRangeRefreshRequest}});var lI=VT();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return lI.DeclarationRequest}});var uI=zT();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return uI.SelectionRangeRequest}});var $p=JT();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return $p.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return $p.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return $p.WorkDoneProgressCancelNotification}});var Lp=e_();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Lp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Lp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Lp.CallHierarchyPrepareRequest}});var Fi=o_();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return Fi.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return Fi.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Fi.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Fi.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Fi.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Fi.SemanticTokensRegistrationType}});var dI=l_();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return dI.ShowDocumentRequest}});var fI=f_();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return fI.LinkedEditingRangeRequest}});var qs=T_();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return qs.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qs.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qs.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qs.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qs.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qs.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qs.WillDeleteFilesRequest}});var xp=k_();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return xp.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return xp.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return xp.MonikerRequest}});var qp=D_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return qp.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return qp.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return qp.TypeHierarchySupertypesRequest}});var dE=A_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return dE.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return dE.InlineValueRefreshRequest}});var jp=L_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return jp.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return jp.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return jp.InlayHintRefreshRequest}});var oa=V_();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return oa.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return oa.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return oa.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return oa.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return oa.DiagnosticRefreshRequest}});var an=J_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return an.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return an.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return an.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return an.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return an.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return an.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return an.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return an.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return an.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return an.DidCloseNotebookDocumentNotification}});var hI=Z_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return hI.InlineCompletionRequest}});var Op;(function(r){function e(t){let n=t;return Et.string(n)||Et.string(n.language)||Et.string(n.scheme)||Et.string(n.pattern)}r.is=e})(Op||(_.TextDocumentFilter=Op={}));var Ap;(function(r){function e(t){let n=t;return Et.objectLiteral(n)&&(Et.string(n.notebookType)||Et.string(n.scheme)||Et.string(n.pattern))}r.is=e})(Ap||(_.NotebookDocumentFilter=Ap={}));var Ip;(function(r){function e(t){let n=t;return Et.objectLiteral(n)&&(Et.string(n.notebook)||Ap.is(n.notebook))&&(n.language===void 0||Et.string(n.language))}r.is=e})(Ip||(_.NotebookCellTextDocumentFilter=Ip={}));var Mp;(function(r){function e(t){if(!Array.isArray(t))return!1;for(let n of t)if(!Et.string(n)&&!Op.is(n)&&!Ip.is(n))return!1;return!0}r.is=e})(Mp||(_.DocumentSelector=Mp={}));var tS;(function(r){r.method="client/registerCapability",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(tS||(_.RegistrationRequest=tS={}));var rS;(function(r){r.method="client/unregisterCapability",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(rS||(_.UnregistrationRequest=rS={}));var nS;(function(r){r.Create="create",r.Rename="rename",r.Delete="delete"})(nS||(_.ResourceOperationKind=nS={}));var sS;(function(r){r.Abort="abort",r.Transactional="transactional",r.TextOnlyTransactional="textOnlyTransactional",r.Undo="undo"})(sS||(_.FailureHandlingKind=sS={}));var iS;(function(r){r.UTF8="utf-8",r.UTF16="utf-16",r.UTF32="utf-32"})(iS||(_.PositionEncodingKind=iS={}));var oS;(function(r){function e(t){let n=t;return n&&Et.string(n.id)&&n.id.length>0}r.hasId=e})(oS||(_.StaticRegistrationOptions=oS={}));var aS;(function(r){function e(t){let n=t;return n&&(n.documentSelector===null||Mp.is(n.documentSelector))}r.is=e})(aS||(_.TextDocumentRegistrationOptions=aS={}));var cS;(function(r){function e(n){let s=n;return Et.objectLiteral(s)&&(s.workDoneProgress===void 0||Et.boolean(s.workDoneProgress))}r.is=e;function t(n){let s=n;return s&&Et.boolean(s.workDoneProgress)}r.hasWorkDoneProgress=t})(cS||(_.WorkDoneProgressOptions=cS={}));var lS;(function(r){r.method="initialize",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(lS||(_.InitializeRequest=lS={}));var uS;(function(r){r.unknownProtocolVersion=1})(uS||(_.InitializeErrorCodes=uS={}));var dS;(function(r){r.method="initialized",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(dS||(_.InitializedNotification=dS={}));var fS;(function(r){r.method="shutdown",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType0(r.method)})(fS||(_.ShutdownRequest=fS={}));var hS;(function(r){r.method="exit",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType0(r.method)})(hS||(_.ExitNotification=hS={}));var pS;(function(r){r.method="workspace/didChangeConfiguration",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(pS||(_.DidChangeConfigurationNotification=pS={}));var mS;(function(r){r.Error=1,r.Warning=2,r.Info=3,r.Log=4,r.Debug=5})(mS||(_.MessageType=mS={}));var gS;(function(r){r.method="window/showMessage",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(gS||(_.ShowMessageNotification=gS={}));var yS;(function(r){r.method="window/showMessageRequest",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType(r.method)})(yS||(_.ShowMessageRequest=yS={}));var bS;(function(r){r.method="window/logMessage",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(bS||(_.LogMessageNotification=bS={}));var vS;(function(r){r.method="telemetry/event",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(vS||(_.TelemetryEventNotification=vS={}));var TS;(function(r){r.None=0,r.Full=1,r.Incremental=2})(TS||(_.TextDocumentSyncKind=TS={}));var _S;(function(r){r.method="textDocument/didOpen",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(_S||(_.DidOpenTextDocumentNotification=_S={}));var SS;(function(r){function e(n){let s=n;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}r.isIncremental=e;function t(n){let s=n;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}r.isFull=t})(SS||(_.TextDocumentContentChangeEvent=SS={}));var ES;(function(r){r.method="textDocument/didChange",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(ES||(_.DidChangeTextDocumentNotification=ES={}));var wS;(function(r){r.method="textDocument/didClose",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(wS||(_.DidCloseTextDocumentNotification=wS={}));var kS;(function(r){r.method="textDocument/didSave",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(kS||(_.DidSaveTextDocumentNotification=kS={}));var NS;(function(r){r.Manual=1,r.AfterDelay=2,r.FocusOut=3})(NS||(_.TextDocumentSaveReason=NS={}));var PS;(function(r){r.method="textDocument/willSave",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(PS||(_.WillSaveTextDocumentNotification=PS={}));var RS;(function(r){r.method="textDocument/willSaveWaitUntil",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(RS||(_.WillSaveTextDocumentWaitUntilRequest=RS={}));var DS;(function(r){r.method="workspace/didChangeWatchedFiles",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolNotificationType(r.method)})(DS||(_.DidChangeWatchedFilesNotification=DS={}));var CS;(function(r){r.Created=1,r.Changed=2,r.Deleted=3})(CS||(_.FileChangeType=CS={}));var OS;(function(r){function e(t){let n=t;return Et.objectLiteral(n)&&(eS.URI.is(n.baseUri)||eS.WorkspaceFolder.is(n.baseUri))&&Et.string(n.pattern)}r.is=e})(OS||(_.RelativePattern=OS={}));var AS;(function(r){r.Create=1,r.Change=2,r.Delete=4})(AS||(_.WatchKind=AS={}));var IS;(function(r){r.method="textDocument/publishDiagnostics",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolNotificationType(r.method)})(IS||(_.PublishDiagnosticsNotification=IS={}));var MS;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.TriggerForIncompleteCompletions=3})(MS||(_.CompletionTriggerKind=MS={}));var $S;(function(r){r.method="textDocument/completion",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})($S||(_.CompletionRequest=$S={}));var LS;(function(r){r.method="completionItem/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(LS||(_.CompletionResolveRequest=LS={}));var xS;(function(r){r.method="textDocument/hover",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(xS||(_.HoverRequest=xS={}));var qS;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.ContentChange=3})(qS||(_.SignatureHelpTriggerKind=qS={}));var jS;(function(r){r.method="textDocument/signatureHelp",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(jS||(_.SignatureHelpRequest=jS={}));var FS;(function(r){r.method="textDocument/definition",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(FS||(_.DefinitionRequest=FS={}));var BS;(function(r){r.method="textDocument/references",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(BS||(_.ReferencesRequest=BS={}));var US;(function(r){r.method="textDocument/documentHighlight",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(US||(_.DocumentHighlightRequest=US={}));var VS;(function(r){r.method="textDocument/documentSymbol",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(VS||(_.DocumentSymbolRequest=VS={}));var WS;(function(r){r.method="textDocument/codeAction",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(WS||(_.CodeActionRequest=WS={}));var HS;(function(r){r.method="codeAction/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(HS||(_.CodeActionResolveRequest=HS={}));var zS;(function(r){r.method="workspace/symbol",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(zS||(_.WorkspaceSymbolRequest=zS={}));var KS;(function(r){r.method="workspaceSymbol/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(KS||(_.WorkspaceSymbolResolveRequest=KS={}));var GS;(function(r){r.method="textDocument/codeLens",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(GS||(_.CodeLensRequest=GS={}));var YS;(function(r){r.method="codeLens/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(YS||(_.CodeLensResolveRequest=YS={}));var JS;(function(r){r.method="workspace/codeLens/refresh",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType0(r.method)})(JS||(_.CodeLensRefreshRequest=JS={}));var XS;(function(r){r.method="textDocument/documentLink",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(XS||(_.DocumentLinkRequest=XS={}));var QS;(function(r){r.method="documentLink/resolve",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(QS||(_.DocumentLinkResolveRequest=QS={}));var ZS;(function(r){r.method="textDocument/formatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(ZS||(_.DocumentFormattingRequest=ZS={}));var eE;(function(r){r.method="textDocument/rangeFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(eE||(_.DocumentRangeFormattingRequest=eE={}));var tE;(function(r){r.method="textDocument/rangesFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(tE||(_.DocumentRangesFormattingRequest=tE={}));var rE;(function(r){r.method="textDocument/onTypeFormatting",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(rE||(_.DocumentOnTypeFormattingRequest=rE={}));var nE;(function(r){r.Identifier=1})(nE||(_.PrepareSupportDefaultBehavior=nE={}));var sE;(function(r){r.method="textDocument/rename",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(sE||(_.RenameRequest=sE={}));var iE;(function(r){r.method="textDocument/prepareRename",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(iE||(_.PrepareRenameRequest=iE={}));var oE;(function(r){r.method="workspace/executeCommand",r.messageDirection=q.MessageDirection.clientToServer,r.type=new q.ProtocolRequestType(r.method)})(oE||(_.ExecuteCommandRequest=oE={}));var aE;(function(r){r.method="workspace/applyEdit",r.messageDirection=q.MessageDirection.serverToClient,r.type=new q.ProtocolRequestType("workspace/applyEdit")})(aE||(_.ApplyWorkspaceEditRequest=aE={}))});var pE=E(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.createProtocolConnection=void 0;var hE=xs();function pI(r,e,t,n){return hE.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,hE.createMessageConnection)(r,e,t,n)}Yl.createProtocolConnection=pI});var gE=E(nr=>{"use strict";var mI=nr&&nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=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(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Jl=nr&&nr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mI(e,r,t)};Object.defineProperty(nr,"__esModule",{value:!0});nr.LSPErrorCodes=nr.createProtocolConnection=void 0;Jl(xs(),nr);Jl(Il(),nr);Jl(Qe(),nr);Jl(fE(),nr);var gI=pE();Object.defineProperty(nr,"createProtocolConnection",{enumerable:!0,get:function(){return gI.createProtocolConnection}});var mE;(function(r){r.lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800})(mE||(nr.LSPErrorCodes=mE={}))});var at=E(cn=>{"use strict";var yI=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=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(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yE=cn&&cn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yI(e,r,t)};Object.defineProperty(cn,"__esModule",{value:!0});cn.createProtocolConnection=void 0;var bI=Ep();yE(Ep(),cn);yE(gE(),cn);function vI(r,e,t,n){return(0,bI.createMessageConnection)(r,e,t,n)}cn.createProtocolConnection=vI});var Fp=E(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.generateUuid=Sr.parse=Sr.isUUID=Sr.v4=Sr.empty=void 0;var aa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ca=class r extends aa{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}};ca._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ca._timeHighBits=["8","9","a","b"];Sr.empty=new aa("00000000-0000-0000-0000-000000000000");function bE(){return new ca}Sr.v4=bE;var TI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vE(r){return TI.test(r)}Sr.isUUID=vE;function _I(r){if(!vE(r))throw new Error("invalid uuid");return new aa(r)}Sr.parse=_I;function SI(){return bE().asHex()}Sr.generateUuid=SI});var TE=E(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.attachPartialResult=rs.ProgressFeature=rs.attachWorkDone=void 0;var ts=at(),EI=Fp(),js=class r{constructor(e,t){this._connection=e,this._token=t,r.Instances.set(this._token,this)}begin(e,t,n,s){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:s};this._connection.sendProgress(ts.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};typeof e=="number"?(n.percentage=e,t!==void 0&&(n.message=t)):n.message=e,this._connection.sendProgress(ts.WorkDoneProgress.type,this._token,n)}done(){r.Instances.delete(this._token),this._connection.sendProgress(ts.WorkDoneProgress.type,this._token,{kind:"end"})}};js.Instances=new Map;var Xl=class extends js{constructor(e,t){super(e,t),this._source=new ts.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},la=class{constructor(){}begin(){}report(){}done(){}},Ql=class extends la{constructor(){super(),this._source=new ts.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function wI(r,e){if(e===void 0||e.workDoneToken===void 0)return new la;let t=e.workDoneToken;return delete e.workDoneToken,new js(r,t)}rs.attachWorkDone=wI;var kI=r=>class extends r{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ts.WorkDoneProgressCancelNotification.type,t=>{let n=js.Instances.get(t.token);(n instanceof Xl||n instanceof Ql)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new la:new js(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,EI.generateUuid)();return this.connection.sendRequest(ts.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Xl(this.connection,e))}else return Promise.resolve(new Ql)}};rs.ProgressFeature=kI;var Bp;(function(r){r.type=new ts.ProgressType})(Bp||(Bp={}));var Up=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Bp.type,this._token,e)}};function NI(r,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Up(r,t)}rs.attachPartialResult=NI});var _E=E(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.ConfigurationFeature=void 0;var PI=at(),RI=ul(),DI=r=>class extends r{getConfiguration(e){return e?RI.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(PI.ConfigurationRequest.type,t).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Zl.ConfigurationFeature=DI});var SE=E(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.WorkspaceFoldersFeature=void 0;var eu=at(),CI=r=>class extends r{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new eu.Emitter,this.connection.onNotification(eu.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(eu.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(eu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};tu.WorkspaceFoldersFeature=CI});var EE=E(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.CallHierarchyFeature=void 0;var Vp=at(),OI=r=>class extends r{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Vp.CallHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Vp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onOutgoingCalls:e=>{let t=Vp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};ru.CallHierarchyFeature=OI});var Hp=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.SemanticTokensBuilder=ns.SemanticTokensDiff=ns.SemanticTokensFeature=void 0;var nu=at(),AI=r=>class extends r{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(nu.SemanticTokensRefreshRequest.type),on:e=>{let t=nu.SemanticTokensRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onDelta:e=>{let t=nu.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onRange:e=>{let t=nu.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};ns.SemanticTokensFeature=AI;var su=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let s=e-1,i=t-1;for(;s>=n&&i>=n&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<n||i<n)&&(s++,i++);let o=s-n+1,a=this.modifiedSequence.slice(n,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};ns.SemanticTokensDiff=su;var Wp=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,n,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++]=n,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 su(this._prevData,this._data).computeDiff()}:this.build()}};ns.SemanticTokensBuilder=Wp});var wE=E(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.ShowDocumentFeature=void 0;var II=at(),MI=r=>class extends r{showDocument(e){return this.connection.sendRequest(II.ShowDocumentRequest.type,e)}};iu.ShowDocumentFeature=MI});var kE=E(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.FileOperationsFeature=void 0;var Bi=at(),$I=r=>class extends r{onDidCreateFiles(e){return this.connection.onNotification(Bi.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Bi.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Bi.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Bi.WillCreateFilesRequest.type,(t,n)=>e(t,n))}onWillRenameFiles(e){return this.connection.onRequest(Bi.WillRenameFilesRequest.type,(t,n)=>e(t,n))}onWillDeleteFiles(e){return this.connection.onRequest(Bi.WillDeleteFilesRequest.type,(t,n)=>e(t,n))}};ou.FileOperationsFeature=$I});var NE=E(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.LinkedEditingRangeFeature=void 0;var LI=at(),xI=r=>class extends r{onLinkedEditingRange(e){return this.connection.onRequest(LI.LinkedEditingRangeRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))}};au.LinkedEditingRangeFeature=xI});var PE=E(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.TypeHierarchyFeature=void 0;var zp=at(),qI=r=>class extends r{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(zp.TypeHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=zp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))},onSubtypes:e=>{let t=zp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};cu.TypeHierarchyFeature=qI});var DE=E(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.InlineValueFeature=void 0;var RE=at(),jI=r=>class extends r{get inlineValue(){return{refresh:()=>this.connection.sendRequest(RE.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(RE.InlineValueRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}};lu.InlineValueFeature=jI});var OE=E(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.FoldingRangeFeature=void 0;var CE=at(),FI=r=>class extends r{get foldingRange(){return{refresh:()=>this.connection.sendRequest(CE.FoldingRangeRefreshRequest.type),on:e=>{let t=CE.FoldingRangeRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};uu.FoldingRangeFeature=FI});var AE=E(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.InlayHintFeature=void 0;var Kp=at(),BI=r=>class extends r{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Kp.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Kp.InlayHintRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Kp.InlayHintResolveRequest.type,(t,n)=>e(t,n))}}};du.InlayHintFeature=BI});var IE=E(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.DiagnosticFeature=void 0;var ua=at(),UI=r=>class extends r{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ua.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ua.DocumentDiagnosticRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ua.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(ua.WorkspaceDiagnosticRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ua.WorkspaceDiagnosticRequest.partialResult,t)))}}};fu.DiagnosticFeature=UI});var Yp=E(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.TextDocuments=void 0;var Fs=at(),Gp=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Fs.Emitter,this._onDidOpen=new Fs.Emitter,this._onDidClose=new Fs.Emitter,this._onDidSave=new Fs.Emitter,this._onWillSave=new Fs.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=Fs.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(n=>{let s=n.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(n=>{let s=n.textDocument,i=n.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(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),t.push(e.onWillSaveTextDocument(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:n.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((n,s)=>{let i=this._syncedDocuments.get(n.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:n.reason}),s):[]})),t.push(e.onDidSaveTextDocument(n=>{let s=this._syncedDocuments.get(n.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),Fs.Disposable.create(()=>{t.forEach(n=>n.dispose())})}};hu.TextDocuments=Gp});var Xp=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.NotebookDocuments=Ui.NotebookSyncFeature=void 0;var Er=at(),ME=Yp(),VI=r=>class extends r{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Er.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Er.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Er.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Er.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};Ui.NotebookSyncFeature=VI;var pu=class r{onDidOpenTextDocument(e){return this.openHandler=e,Er.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Er.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Er.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}};pu.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Jp=class{constructor(e){e instanceof ME.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ME.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Er.Emitter,this._onDidChange=new Er.Emitter,this._onDidSave=new Er.Emitter,this._onDidClose=new Er.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,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new pu,n=[];return n.push(this.cellTextDocuments.listen(t)),n.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)})),n.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 w=c.cells;if(w.structure!==void 0){let v=w.structure.array;if(i.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),w.structure.didOpen!==void 0)for(let b of w.structure.didOpen)t.openTextDocument({textDocument:b}),l.push(b.uri);if(w.structure.didClose)for(let b of w.structure.didClose)t.closeTextDocument({textDocument:b}),u.push(b.uri)}if(w.data!==void 0){let v=new Map(w.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 A=i.cells.splice(b,1,R);if(d.push({old:A[0],new:R}),v.delete(R.document),v.size===0)break}}}if(w.textContent!==void 0)for(let v of w.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 w of l)T.push(this.getNotebookCell(w));let g=[];for(let w of u)g.push(this.getNotebookCell(w));let S=[];for(let w of f)S.push(this.getNotebookCell(w));(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)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),n.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)}})),Er.Disposable.create(()=>{n.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};Ui.NotebookDocuments=Jp});var $E=E(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.MonikerFeature=void 0;var WI=at(),HI=r=>class extends r{get moniker(){return{on:e=>{let t=WI.MonikerRequest.type;return this.connection.onRequest(t,(n,s)=>e(n,s,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n)))}}}};mu.MonikerFeature=HI});var nm=E(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.createConnection=Ee.combineFeatures=Ee.combineNotebooksFeatures=Ee.combineLanguagesFeatures=Ee.combineWorkspaceFeatures=Ee.combineWindowFeatures=Ee.combineClientFeatures=Ee.combineTracerFeatures=Ee.combineTelemetryFeatures=Ee.combineConsoleFeatures=Ee._NotebooksImpl=Ee._LanguagesImpl=Ee.BulkUnregistration=Ee.BulkRegistration=Ee.ErrorMessageTracker=void 0;var U=at(),wr=ul(),Zp=Fp(),ne=TE(),zI=_E(),KI=SE(),GI=EE(),YI=Hp(),JI=wE(),XI=kE(),QI=NE(),ZI=PE(),eM=DE(),tM=OE(),rM=AE(),nM=IE(),sM=Xp(),iM=$E();function Qp(r){if(r!==null)return r}var em=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)})}};Ee.ErrorMessageTracker=em;var gu=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")})}},tm=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 n={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(Qp)}showWarningMessage(e,...t){let n={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(Qp)}showInformationMessage(e,...t){let n={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,n).then(Qp)}},LE=(0,JI.ShowDocumentFeature)((0,ne.ProgressFeature)(tm)),xE;(function(r){function e(){return new yu}r.create=e})(xE||(Ee.BulkRegistration=xE={}));var yu=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let n=wr.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let s=Zp.generateUuid();this._registrations.push({id:s,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},qE;(function(r){function e(){return new da(void 0,[])}r.create=e})(qE||(Ee.BulkUnregistration=qE={}));var da=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=wr.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let s={unregisterations:[n]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},bu=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,n){return e instanceof yu?this.registerMany(e):e instanceof da?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){let s=wr.string(t)?t:t.method,i=Zp.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:n||{}}]};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 n=wr.string(e)?e:e.method,s=Zp.generateUuid(),i={registrations:[{id:s,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.Disposable.create(()=>{this.unregisterSingle(s,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,n).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 da(this._connection,t.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},rm=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 n=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,n)}},jE=(0,XI.FileOperationsFeature)((0,KI.WorkspaceFoldersFeature)((0,zI.ConfigurationFeature)(rm))),vu=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(()=>{})}},Tu=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")})}},_u=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)}};Ee._LanguagesImpl=_u;var FE=(0,tM.FoldingRangeFeature)((0,iM.MonikerFeature)((0,nM.DiagnosticFeature)((0,rM.InlayHintFeature)((0,eM.InlineValueFeature)((0,ZI.TypeHierarchyFeature)((0,QI.LinkedEditingRangeFeature)((0,YI.SemanticTokensFeature)((0,GI.CallHierarchyFeature)(_u))))))))),Su=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)}};Ee._NotebooksImpl=Su;var BE=(0,sM.NotebookSyncFeature)(Su);function UE(r,e){return function(t){return e(r(t))}}Ee.combineConsoleFeatures=UE;function VE(r,e){return function(t){return e(r(t))}}Ee.combineTelemetryFeatures=VE;function WE(r,e){return function(t){return e(r(t))}}Ee.combineTracerFeatures=WE;function HE(r,e){return function(t){return e(r(t))}}Ee.combineClientFeatures=HE;function zE(r,e){return function(t){return e(r(t))}}Ee.combineWindowFeatures=zE;function KE(r,e){return function(t){return e(r(t))}}Ee.combineWorkspaceFeatures=KE;function GE(r,e){return function(t){return e(r(t))}}Ee.combineLanguagesFeatures=GE;function YE(r,e){return function(t){return e(r(t))}}Ee.combineNotebooksFeatures=YE;function oM(r,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(r.console,e.console,UE),tracer:t(r.tracer,e.tracer,WE),telemetry:t(r.telemetry,e.telemetry,VE),client:t(r.client,e.client,HE),window:t(r.window,e.window,zE),workspace:t(r.workspace,e.workspace,KE),languages:t(r.languages,e.languages,GE),notebooks:t(r.notebooks,e.notebooks,YE)}}Ee.combineFeatures=oM;function aM(r,e,t){let n=t&&t.console?new(t.console(gu)):new gu,s=r(n);n.rawAttach(s);let i=t&&t.tracer?new(t.tracer(vu)):new vu,o=t&&t.telemetry?new(t.telemetry(Tu)):new Tu,a=t&&t.client?new(t.client(bu)):new bu,c=t&&t.window?new(t.window(LE)):new LE,l=t&&t.workspace?new(t.workspace(jE)):new jE,u=t&&t.languages?new(t.languages(FE)):new FE,d=t&&t.notebooks?new(t.notebooks(BE)):new BE,f=[n,i,o,a,c,l,u,d];function m(v){return v instanceof Promise?v:wr.thenable(v)?new Promise((b,R)=>{v.then(A=>b(A),A=>R(A))}):Promise.resolve(v)}let T,g,S,w={listen:()=>s.listen(),sendRequest:(v,...b)=>s.sendRequest(wr.string(v)?v:v.method,...b),onRequest:(v,b)=>s.onRequest(v,b),sendNotification:(v,b)=>{let R=wr.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 n},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(w);return s.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),wr.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 A=R;A||(A={capabilities:{}});let L=A.capabilities;L||(L={},A.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=wr.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None:!wr.number(L.textDocumentSync)&&!wr.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=wr.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None);for(let W of f)W.fillServerCapabilities(L);return A})}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)}),w}Ee.createConnection=aM});var JE=E(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.resolveModulePath=sr.FileSystem=sr.resolveGlobalYarnPath=sr.resolveGlobalNodePath=sr.resolve=sr.uriToFilePath=void 0;var cM=require("url"),Vr=require("path"),sm=require("fs"),cm=require("child_process");function lM(r){let e=cM.parse(r);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var n=0,s=t.length;n<s;n++)t[n]=decodeURIComponent(t[n]);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 Vr.normalize(t.join("/"))}sr.uriToFilePath=lM;function im(){return process.platform==="win32"}function Eu(r,e,t,n){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&&sm.existsSync(e)&&(l[s]?l[s]=e+Vr.delimiter+l[s]:l[s]=e,n&&n(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,cm.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${r} 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: ${r}`)))});let d={c:"rs",a:r};u.send(d)}catch(u){a(u)}})}sr.resolve=Eu;function om(r){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:t};im()&&(e="npm.cmd",n.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,cm.spawnSync)(e,["config","get","prefix"],n).stdout;if(!i){r&&r("'npm config get prefix' didn't return a value.");return}let o=i.trim();return r&&r(`'npm config get prefix' value is: ${o}`),o.length>0?im()?Vr.join(o,"node_modules"):Vr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}sr.resolveGlobalNodePath=om;function uM(r){let e="yarn",t={encoding:"utf8"};im()&&(e="yarn.cmd",t.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let s=(0,cm.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){r&&(r("'yarn global dir' didn't return a value."),s.stderr&&r(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 Vr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}sr.resolveGlobalYarnPath=uM;var am;(function(r){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!sm.existsSync(__filename.toUpperCase())||!sm.existsSync(__filename.toLowerCase())),e}r.isCaseSensitive=t;function n(s,i){return t()?Vr.normalize(i).indexOf(Vr.normalize(s))===0:Vr.normalize(i).toLowerCase().indexOf(Vr.normalize(s).toLowerCase())===0}r.isParent=n})(am||(sr.FileSystem=am={}));function dM(r,e,t,n){return t?(Vr.isAbsolute(t)||(t=Vr.join(r,t)),Eu(e,t,t,n).then(s=>am.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>Eu(e,om(n),r,n))):Eu(e,om(n),r,n)}sr.resolveModulePath=dM});var lm=E((fK,XE)=>{"use strict";XE.exports=at()});var QE=E(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.InlineCompletionFeature=void 0;var fM=at(),hM=r=>class extends r{get inlineCompletion(){return{on:e=>this.connection.onRequest(fM.InlineCompletionRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}};wu.InlineCompletionFeature=hM});var tw=E(Bt=>{"use strict";var pM=Bt&&Bt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=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(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ew=Bt&&Bt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&pM(e,r,t)};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProposedFeatures=Bt.NotebookDocuments=Bt.TextDocuments=Bt.SemanticTokensBuilder=void 0;var mM=Hp();Object.defineProperty(Bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return mM.SemanticTokensBuilder}});var gM=QE();ew(at(),Bt);var yM=Yp();Object.defineProperty(Bt,"TextDocuments",{enumerable:!0,get:function(){return yM.TextDocuments}});var bM=Xp();Object.defineProperty(Bt,"NotebookDocuments",{enumerable:!0,get:function(){return bM.NotebookDocuments}});ew(nm(),Bt);var ZE;(function(r){r.all={__brand:"features",languages:gM.InlineCompletionFeature}})(ZE||(Bt.ProposedFeatures=ZE={}))});var Y=E(kr=>{"use strict";var vM=kr&&kr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=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(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),iw=kr&&kr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vM(e,r,t)};Object.defineProperty(kr,"__esModule",{value:!0});kr.createConnection=kr.Files=void 0;var rw=require("node:util"),um=ul(),TM=nm(),fa=JE(),Bs=lm();iw(lm(),kr);iw(tw(),kr);var nw;(function(r){r.uriToFilePath=fa.uriToFilePath,r.resolveGlobalNodePath=fa.resolveGlobalNodePath,r.resolveGlobalYarnPath=fa.resolveGlobalYarnPath,r.resolve=fa.resolve,r.resolveModulePath=fa.resolveModulePath})(nw||(kr.Files=nw={}));var sw;function ku(){if(sw!==void 0)try{sw.end()}catch{}}var Vi=!1,ow;function _M(){let r="--clientProcessId";function e(t){try{let n=parseInt(t);isNaN(n)||(ow=setInterval(()=>{try{process.kill(n,0)}catch{ku(),process.exit(Vi?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let n=process.argv[t];if(n===r&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=n.split("=");s[0]===r&&e(s[1])}}}_M();var SM={initialize:r=>{let e=r.processId;um.number(e)&&ow===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Vi?0:1)}},3e3)},get shutdownReceived(){return Vi},set shutdownReceived(r){Vi=r},exit:r=>{ku(),process.exit(r)}};function EM(r,e,t,n){let s,i,o,a;return r!==void 0&&r.__brand==="features"&&(s=r,r=e,e=t,t=n),Bs.ConnectionStrategy.is(r)||Bs.ConnectionOptions.is(r)?a=r:(i=r,o=e,a=t),wM(i,o,a,s)}kr.createConnection=EM;function wM(r,e,t,n){let s=!1;if(!r&&!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"){r=new Bs.IPCMessageReader(process),e=new Bs.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,r=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,Bs.createServerSocketTransport)(c);r=d[0],e=d[1]}else if(l){let d=(0,Bs.createServerPipeTransport)(l);r=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!r)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(um.func(r.read)&&um.func(r.on)){let c=r;c.on("end",()=>{ku(),process.exit(Vi?0:1)}),c.on("close",()=>{ku(),process.exit(Vi?0:1)})}let a=c=>{let l=(0,Bs.createProtocolConnection)(r,e,c,t);return s&&kM(c),l};return(0,TM.createConnection)(a,SM,n)}function kM(r){function e(n){return n.map(s=>typeof s=="string"?s:(0,rw.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)r.error("Assertion failed");else{let[o,...a]=i;r.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),r.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){r.log(e(s))},console.dir=function(s,i){r.log((0,rw.inspect)(s,i))},console.log=function(...s){r.log(e(s))},console.error=function(...s){r.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),r.log(`${o}
|
|
37
|
+
${i}`)},console.warn=function(...s){r.warn(e(s))}}});var cw=E((yK,aw)=>{"use strict";aw.exports=Y()});var ye=E(Mt=>{"use strict";var Em=Symbol.for("yaml.alias"),Vk=Symbol.for("yaml.document"),od=Symbol.for("yaml.map"),Wk=Symbol.for("yaml.pair"),wm=Symbol.for("yaml.scalar"),ad=Symbol.for("yaml.seq"),Ln=Symbol.for("yaml.node.type"),f$=r=>!!r&&typeof r=="object"&&r[Ln]===Em,h$=r=>!!r&&typeof r=="object"&&r[Ln]===Vk,p$=r=>!!r&&typeof r=="object"&&r[Ln]===od,m$=r=>!!r&&typeof r=="object"&&r[Ln]===Wk,Hk=r=>!!r&&typeof r=="object"&&r[Ln]===wm,g$=r=>!!r&&typeof r=="object"&&r[Ln]===ad;function zk(r){if(r&&typeof r=="object")switch(r[Ln]){case od:case ad:return!0}return!1}function y$(r){if(r&&typeof r=="object")switch(r[Ln]){case Em:case od:case wm:case ad:return!0}return!1}var b$=r=>(Hk(r)||zk(r))&&!!r.anchor;Mt.ALIAS=Em;Mt.DOC=Vk;Mt.MAP=od;Mt.NODE_TYPE=Ln;Mt.PAIR=Wk;Mt.SCALAR=wm;Mt.SEQ=ad;Mt.hasAnchor=b$;Mt.isAlias=f$;Mt.isCollection=zk;Mt.isDocument=h$;Mt.isMap=p$;Mt.isNode=y$;Mt.isPair=m$;Mt.isScalar=Hk;Mt.isSeq=g$});var Ea=E(km=>{"use strict";var Tt=ye(),or=Symbol("break visit"),Kk=Symbol("skip children"),mn=Symbol("remove node");function cd(r,e){let t=Gk(e);Tt.isDocument(r)?lo(null,r.contents,t,Object.freeze([r]))===mn&&(r.contents=null):lo(null,r,t,Object.freeze([]))}cd.BREAK=or;cd.SKIP=Kk;cd.REMOVE=mn;function lo(r,e,t,n){let s=Yk(r,e,t,n);if(Tt.isNode(s)||Tt.isPair(s))return Jk(r,n,s),lo(r,s,t,n);if(typeof s!="symbol"){if(Tt.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=lo(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===or)return or;o===mn&&(e.items.splice(i,1),i-=1)}}}else if(Tt.isPair(e)){n=Object.freeze(n.concat(e));let i=lo("key",e.key,t,n);if(i===or)return or;i===mn&&(e.key=null);let o=lo("value",e.value,t,n);if(o===or)return or;o===mn&&(e.value=null)}}return s}async function ld(r,e){let t=Gk(e);Tt.isDocument(r)?await uo(null,r.contents,t,Object.freeze([r]))===mn&&(r.contents=null):await uo(null,r,t,Object.freeze([]))}ld.BREAK=or;ld.SKIP=Kk;ld.REMOVE=mn;async function uo(r,e,t,n){let s=await Yk(r,e,t,n);if(Tt.isNode(s)||Tt.isPair(s))return Jk(r,n,s),uo(r,s,t,n);if(typeof s!="symbol"){if(Tt.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=await uo(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===or)return or;o===mn&&(e.items.splice(i,1),i-=1)}}}else if(Tt.isPair(e)){n=Object.freeze(n.concat(e));let i=await uo("key",e.key,t,n);if(i===or)return or;i===mn&&(e.key=null);let o=await uo("value",e.value,t,n);if(o===or)return or;o===mn&&(e.value=null)}}return s}function Gk(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function Yk(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(Tt.isMap(e))return t.Map?.(r,e,n);if(Tt.isSeq(e))return t.Seq?.(r,e,n);if(Tt.isPair(e))return t.Pair?.(r,e,n);if(Tt.isScalar(e))return t.Scalar?.(r,e,n);if(Tt.isAlias(e))return t.Alias?.(r,e,n)}function Jk(r,e,t){let n=e[e.length-1];if(Tt.isCollection(n))n.items[r]=t;else if(Tt.isPair(n))r==="key"?n.key=t:n.value=t;else if(Tt.isDocument(n))n.contents=t;else{let s=Tt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}km.visit=cd;km.visitAsync=ld});var Nm=E(Qk=>{"use strict";var Xk=ye(),v$=Ea(),T$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_$=r=>r.replace(/[!,[\]{}]/g,e=>T$[e]),wa=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;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[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+_$(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),s;if(e&&n.length>0&&Xk.isNode(e.contents)){let i={};v$.visit(e.contents,(o,a)=>{Xk.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
38
|
+
`)}};wa.defaultYaml={explicit:!1,version:"1.2"};wa.defaultTags={"!!":"tag:yaml.org,2002:"};Qk.Directives=wa});var ud=E(ka=>{"use strict";var Zk=ye(),S$=Ea();function E$(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(t)}return!0}function eN(r){let e=new Set;return S$.visit(r,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function tN(r,e){for(let t=1;;++t){let n=`${r}${t}`;if(!e.has(n))return n}}function w$(r,e){let t=[],n=new Map,s=null;return{onAnchor:i=>{t.push(i),s||(s=eN(r));let o=tN(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=n.get(i);if(typeof o=="object"&&o.anchor&&(Zk.isScalar(o.node)||Zk.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:n}}ka.anchorIsValid=E$;ka.anchorNames=eN;ka.createNodeAnchors=w$;ka.findNewAnchor=tN});var Pm=E(rN=>{"use strict";function Na(r,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0,i=n.length;s<i;++s){let o=n[s],a=Na(r,n,String(s),o);a===void 0?delete n[s]:a!==o&&(n[s]=a)}else if(n instanceof Map)for(let s of Array.from(n.keys())){let i=n.get(s),o=Na(r,n,s,i);o===void 0?n.delete(s):o!==i&&n.set(s,o)}else if(n instanceof Set)for(let s of Array.from(n)){let i=Na(r,n,s,s);i===void 0?n.delete(s):i!==s&&(n.delete(s),n.add(i))}else for(let[s,i]of Object.entries(n)){let o=Na(r,n,s,i);o===void 0?delete n[s]:o!==i&&(n[s]=o)}return r.call(e,t,n)}rN.applyReviver=Na});var us=E(sN=>{"use strict";var k$=ye();function nN(r,e,t){if(Array.isArray(r))return r.map((n,s)=>nN(n,String(s),t));if(r&&typeof r.toJSON=="function"){if(!t||!k$.hasAnchor(r))return r.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(r,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let s=r.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof r=="bigint"&&!t?.keep?Number(r):r}sN.toJS=nN});var dd=E(oN=>{"use strict";var N$=Pm(),iN=ye(),P$=us(),Rm=class{constructor(e){Object.defineProperty(this,iN.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:n,onAnchor:s,reviver:i}={}){if(!iN.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 n=="number"?n:100},a=P$.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?N$.applyReviver(i,{"":a},"",a):a}};oN.NodeBase=Rm});var Pa=E(cN=>{"use strict";var R$=ud(),aN=Ea(),fd=ye(),D$=dd(),C$=us(),Dm=class extends D$.NodeBase{constructor(e){super(fd.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return aN.visit(e,{Node:(n,s)=>{if(s===this)return aN.visit.BREAK;s.anchor===this.source&&(t=s)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,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=n.get(o);if(a||(C$.toJS(o,null,t),a=n.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=hd(s,o,n)),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,n){let s=`*${this.source}`;if(e){if(R$.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 hd(r,e,t){if(fd.isAlias(e)){let n=e.resolve(r),s=t&&n&&t.get(n);return s?s.count*s.aliasCount:0}else if(fd.isCollection(e)){let n=0;for(let s of e.items){let i=hd(r,s,t);i>n&&(n=i)}return n}else if(fd.isPair(e)){let n=hd(r,e.key,t),s=hd(r,e.value,t);return Math.max(n,s)}return 1}cN.Alias=Dm});var gt=E(Cm=>{"use strict";var O$=ye(),A$=dd(),I$=us(),M$=r=>!r||typeof r!="function"&&typeof r!="object",ds=class extends A$.NodeBase{constructor(e){super(O$.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:I$.toJS(this.value,e,t)}toString(){return String(this.value)}};ds.BLOCK_FOLDED="BLOCK_FOLDED";ds.BLOCK_LITERAL="BLOCK_LITERAL";ds.PLAIN="PLAIN";ds.QUOTE_DOUBLE="QUOTE_DOUBLE";ds.QUOTE_SINGLE="QUOTE_SINGLE";Cm.Scalar=ds;Cm.isScalarValue=M$});var Ra=E(uN=>{"use strict";var $$=Pa(),Gs=ye(),lN=gt(),L$="tag:yaml.org,2002:";function x$(r,e,t){if(e){let n=t.filter(i=>i.tag===e),s=n.find(i=>!i.format)??n[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(n=>n.identify?.(r)&&!n.format)}function q$(r,e,t){if(Gs.isDocument(r)&&(r=r.contents),Gs.isNode(r))return r;if(Gs.isPair(r)){let d=t.schema[Gs.MAP].createNode?.(t.schema,null,t);return d.items.push(r),d}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt<"u"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:n,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(n&&r&&typeof r=="object"){if(c=a.get(r),c)return c.anchor||(c.anchor=s(r)),new $$.Alias(c.anchor);c={anchor:null,node:null},a.set(r,c)}e?.startsWith("!!")&&(e=L$+e.slice(2));let l=x$(r,e,o.tags);if(!l){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let d=new lN.Scalar(r);return c&&(c.node=d),d}l=r instanceof Map?o[Gs.MAP]:Symbol.iterator in Object(r)?o[Gs.SEQ]:o[Gs.MAP]}i&&(i(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,r,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,r,t):new lN.Scalar(r);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}uN.createNode=q$});var md=E(pd=>{"use strict";var j$=Ra(),gn=ye(),F$=dd();function Om(r,e,t){let n=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]=n,n=o}else n=new Map([[i,n]])}return j$.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var dN=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,Am=class extends F$.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(n=>gn.isNode(n)||gn.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(dN(e))this.add(t);else{let[n,...s]=e,i=this.get(n,!0);if(gn.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(n,Om(this.schema,s,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let s=this.get(t,!0);if(gn.isCollection(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...s]=e,i=this.get(n,!0);return s.length===0?!t&&gn.isScalar(i)?i.value:i:gn.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!gn.isPair(t))return!1;let n=t.value;return n==null||e&&gn.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let s=this.get(t,!0);return gn.isCollection(s)?s.hasIn(n):!1}setIn(e,t){let[n,...s]=e;if(s.length===0)this.set(n,t);else{let i=this.get(n,!0);if(gn.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(n,Om(this.schema,s,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}};pd.Collection=Am;pd.collectionFromPath=Om;pd.isEmptyPath=dN});var Da=E(gd=>{"use strict";var B$=r=>r.replace(/^(?!$)(?: $)?/gm,"#");function Im(r,e){return/^\n+$/.test(r)?r.substring(1):e?r.replace(/^(?! *$)/gm,e):r}var U$=(r,e,t)=>r.endsWith(`
|
|
39
|
+
`)?Im(t,e):t.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)t===
|
|
43
|
-
`&&m!==" "){let R=
|
|
44
|
-
`&&R!==" "&&(f=g)}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===
|
|
45
|
-
${e}${
|
|
46
|
-
${e}${
|
|
47
|
-
`);
|
|
48
|
-
`){if(i-o>
|
|
41
|
+
`+Im(t,e):(r.endsWith(" ")?"":" ")+t;gd.indentComment=Im;gd.lineComment=U$;gd.stringifyComment=B$});var hN=E(Ca=>{"use strict";var V$="flow",Mm="block",yd="quoted";function W$(r,e,t="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return r;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(r.length<=c)return r;let l=[],u={},d=s-e.length;typeof n=="number"&&(n>s-Math.max(2,i)?l.push(0):d=s-n);let f,m,T=!1,g=-1,S=-1,w=-1;t===Mm&&(g=fN(r,g,e.length),g!==-1&&(d=g+c));for(let b;b=r[g+=1];){if(t===yd&&b==="\\"){switch(S=g,r[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}w=g}if(b===`
|
|
42
|
+
`)t===Mm&&(g=fN(r,g,e.length)),d=g+e.length+c,f=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
43
|
+
`&&m!==" "){let R=r[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===yd){for(;m===" "||m===" ";)m=b,b=r[g+=1],T=!0;let R=g>w+1?g-2:S-1;if(u[R])return r;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 r;o&&o();let v=r.slice(0,l[0]);for(let b=0;b<l.length;++b){let R=l[b],A=l[b+1]||r.length;R===0?v=`
|
|
45
|
+
${e}${r.slice(0,A)}`:(t===yd&&u[R]&&(v+=`${r[R]}\\`),v+=`
|
|
46
|
+
${e}${r.slice(R+1,A)}`)}return v}function fN(r,e,t){let n=e,s=e+1,i=r[s];for(;i===" "||i===" ";)if(e<s+t)i=r[++e];else{do i=r[++e];while(i&&i!==`
|
|
47
|
+
`);n=e,s=e+1,i=r[s]}return n}Ca.FOLD_BLOCK=Mm;Ca.FOLD_FLOW=V$;Ca.FOLD_QUOTED=yd;Ca.foldFlowLines=W$});var Aa=E(pN=>{"use strict";var Gr=gt(),fs=hN(),vd=(r,e)=>({indentAtStart:e?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),Td=r=>/^(%|---|\.\.\.)/m.test(r);function H$(r,e,t){if(!e||e<0)return!1;let n=e-t,s=r.length;if(s<=n)return!1;for(let i=0,o=0;i<s;++i)if(r[i]===`
|
|
48
|
+
`){if(i-o>n)return!0;if(o=i+1,s-o<=n)return!1}return!0}function Oa(r,e){let t=JSON.stringify(r);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Td(r)?" ":""),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(n||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+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
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,n?o:fs.foldFlowLines(o,i,fs.FOLD_QUOTED,vd(e,!1))}function $m(r,e){if(e.options.singleQuote===!1||e.implicitKey&&r.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(r))return Oa(r,e);let t=e.indent||(Td(r)?" ":""),n="'"+r.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${t}`)+"'";return e.implicitKey?n:fs.foldFlowLines(n,t,fs.FOLD_FLOW,vd(e,!1))}function fo(r,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Oa;else{let s=r.includes('"'),i=r.includes("'");s&&!i?n=$m:i&&!s?n=Oa:n=t?$m:Oa}return n(r,e)}var Lm;try{Lm=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{Lm=/\n+(?!\n|$)/g}function bd({comment:r,type:e,value:t},n,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return fo(t,n);let l=n.indent||(n.forceBlockIndent||Td(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===Gr.Scalar.BLOCK_FOLDED?!1:e===Gr.Scalar.BLOCK_LITERAL?!0:!H$(t,c,l.length);if(!t)return u?`|
|
|
57
57
|
`:`>
|
|
58
|
-
`;let d,f;for(f=t.length;f>0;--f){let
|
|
59
|
-
`&&
|
|
58
|
+
`;let d,f;for(f=t.length;f>0;--f){let A=t[f-1];if(A!==`
|
|
59
|
+
`&&A!==" "&&A!==" ")break}let m=t.substring(f),T=m.indexOf(`
|
|
60
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(
|
|
62
|
-
`)
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,
|
|
61
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Lm,`$&${l}`));let g=!1,S,w=-1;for(S=0;S<t.length;++S){let A=t[S];if(A===" ")g=!0;else if(A===`
|
|
62
|
+
`)w=S;else break}let v=t.substring(0,w<S?w+1:S);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let R=(g?l?"2":"1":"")+d;if(r&&(R+=" "+a(r.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let A=t.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,W=vd(n,!0);o!=="folded"&&e!==Gr.Scalar.BLOCK_FOLDED&&(W.onOverflow=()=>{L=!0});let j=fs.foldFlowLines(`${v}${A}${m}`,l,fs.FOLD_BLOCK,W);if(!L)return`>${R}
|
|
64
64
|
${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${R}
|
|
65
|
-
${l}${v}${t}${m}`}function
|
|
66
|
-
`)||u&&/[[\]{},]/.test(i))return
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
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
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(S=`${S}:`,f&&(S+=
|
|
72
|
-
`:"",v){let
|
|
73
|
-
${
|
|
65
|
+
${l}${v}${t}${m}`}function z$(r,e,t,n){let{type:s,value:i}=r,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(i))return fo(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
67
|
+
`)?fo(i,e):bd(r,e,t,n);if(!a&&!u&&s!==Gr.Scalar.PLAIN&&i.includes(`
|
|
68
|
+
`))return bd(r,e,t,n);if(Td(i)){if(c==="")return e.forceBlockIndent=!0,bd(r,e,t,n);if(a&&c===l)return fo(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 fo(i,e)}return a?d:fs.foldFlowLines(d,c,fs.FOLD_FLOW,vd(e,!1))}function K$(r,e,t,n){let{implicitKey:s,inFlow:i}=e,o=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:a}=r;a!==Gr.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Gr.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Gr.Scalar.BLOCK_FOLDED:case Gr.Scalar.BLOCK_LITERAL:return s||i?fo(o.value,e):bd(o,e,t,n);case Gr.Scalar.QUOTE_DOUBLE:return Oa(o.value,e);case Gr.Scalar.QUOTE_SINGLE:return $m(o.value,e);case Gr.Scalar.PLAIN:return z$(o,e,t,n);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}pN.stringifyString=K$});var Ia=E(xm=>{"use strict";var G$=ud(),hs=ye(),Y$=Da(),J$=Aa();function X$(r,e){let t=Object.assign({blockQuote:!0,commentString:Y$.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},r.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:r,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Q$(r,e){if(e.tag){let s=r.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,n;if(hs.isScalar(e)){n=e.value;let s=r.filter(i=>i.identify?.(n));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 n=e,t=r.find(s=>s.nodeClass&&n instanceof s.nodeClass);if(!t){let s=n?.constructor?.name??typeof n;throw new Error(`Tag not resolved for ${s} value`)}return t}function Z$(r,e,{anchors:t,doc:n}){if(!n.directives)return"";let s=[],i=(hs.isScalar(r)||hs.isCollection(r))&&r.anchor;i&&G$.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=r.tag?r.tag:e.default?null:e.tag;return o&&s.push(n.directives.tagString(o)),s.join(" ")}function e1(r,e,t,n){if(hs.isPair(r))return r.toString(e,t,n);if(hs.isAlias(r)){if(e.doc.directives)return r.toString(e);if(e.resolvedAliases?.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(r):e.resolvedAliases=new Set([r]),r=r.resolve(e.doc)}let s,i=hs.isNode(r)?r:e.doc.createNode(r,{onTagObj:c=>s=c});s||(s=Q$(e.doc.schema.tags,i));let o=Z$(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,n):hs.isScalar(i)?J$.stringifyString(i,e,t,n):i.toString(e,t,n);return o?hs.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}xm.createStringifyContext=X$;xm.stringify=e1});var bN=E(yN=>{"use strict";var xn=ye(),mN=gt(),gN=Ia(),Ma=Da();function t1({key:r,value:e},t,n,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,f=xn.isNode(r)&&r.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(xn.isCollection(r)||!xn.isNode(r)&&typeof r=="object"){let W="With simple keys, collection cannot be used as a key value";throw new Error(W)}}let m=!d&&(!r||f&&e==null&&!t.inFlow||xn.isCollection(r)||(xn.isScalar(r)?r.type===mN.Scalar.BLOCK_FOLDED||r.type===mN.Scalar.BLOCK_LITERAL:typeof r=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(d||!i),indent:a+c});let T=!1,g=!1,S=gN.stringify(r,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&&n&&n(),S===""?"?":m?`? ${S}`:S}else if(i&&!d||e==null&&m)return S=`? ${S}`,f&&!T?S+=Ma.lineComment(S,t.indent,l(f)):g&&s&&s(),S;T&&(f=null),m?(f&&(S+=Ma.lineComment(S,t.indent,l(f))),S=`? ${S}
|
|
71
|
+
${a}:`):(S=`${S}:`,f&&(S+=Ma.lineComment(S,t.indent,l(f))));let w,v,b;xn.isNode(e)?(w=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(w=!1,v=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&xn.isScalar(e)&&(t.indentAtStart=S.length+1),g=!1,!u&&c.length>=2&&!t.inFlow&&!m&&xn.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let R=!1,A=gN.stringify(e,t,()=>R=!0,()=>g=!0),L=" ";if(f||w||v){if(L=w?`
|
|
72
|
+
`:"",v){let W=l(v);L+=`
|
|
73
|
+
${Ma.indentComment(W,t.indent)}`}A===""&&!t.inFlow?L===`
|
|
74
74
|
`&&(L=`
|
|
75
75
|
|
|
76
76
|
`):L+=`
|
|
77
|
-
${t.indent}`}else if(!m&&
|
|
78
|
-
`),
|
|
79
|
-
${t.indent}`)}}else(
|
|
80
|
-
`)&&(L="");return S+=L+
|
|
77
|
+
${t.indent}`}else if(!m&&xn.isCollection(e)){let W=A[0],j=A.indexOf(`
|
|
78
|
+
`),se=j!==-1,Me=t.inFlow??e.flow??e.items.length===0;if(se||!Me){let yt=!1;if(se&&(W==="&"||W==="!")){let de=A.indexOf(" ");W==="&"&&de!==-1&&de<j&&A[de+1]==="!"&&(de=A.indexOf(" ",de+1)),(de===-1||j<de)&&(yt=!0)}yt||(L=`
|
|
79
|
+
${t.indent}`)}}else(A===""||A[0]===`
|
|
80
|
+
`)&&(L="");return S+=L+A,t.inFlow?R&&n&&n():b&&!R?S+=Ma.lineComment(S,t.indent,l(b)):g&&s&&s(),S}yN.stringifyPair=t1});var jm=E(qm=>{"use strict";function r1(r,...e){r==="debug"&&console.log(...e)}function n1(r,e){(r==="debug"||r==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}qm.debug=r1;qm.warn=n1});var wd=E(Ed=>{"use strict";var $a=ye(),vN=gt(),_d="<<",Sd={identify:r=>r===_d||typeof r=="symbol"&&r.description===_d,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new vN.Scalar(Symbol(_d)),{addToJSMap:TN}),stringify:()=>_d},s1=(r,e)=>(Sd.identify(e)||$a.isScalar(e)&&(!e.type||e.type===vN.Scalar.PLAIN)&&Sd.identify(e.value))&&r?.doc.schema.tags.some(t=>t.tag===Sd.tag&&t.default);function TN(r,e,t){if(t=r&&$a.isAlias(t)?t.resolve(r.doc):t,$a.isSeq(t))for(let n of t.items)Fm(r,e,n);else if(Array.isArray(t))for(let n of t)Fm(r,e,n);else Fm(r,e,t)}function Fm(r,e,t){let n=r&&$a.isAlias(t)?t.resolve(r.doc):t;if(!$a.isMap(n))throw new Error("Merge sources must be maps or map aliases");let s=n.toJSON(null,r,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}Ed.addMergeToJSMap=TN;Ed.isMergeKey=s1;Ed.merge=Sd});var Um=E(EN=>{"use strict";var i1=jm(),_N=wd(),o1=Ia(),SN=ye(),Bm=us();function a1(r,e,{key:t,value:n}){if(SN.isNode(t)&&t.addToJSMap)t.addToJSMap(r,e,n);else if(_N.isMergeKey(r,t))_N.addMergeToJSMap(r,e,n);else{let s=Bm.toJS(t,"",r);if(e instanceof Map)e.set(s,Bm.toJS(n,s,r));else if(e instanceof Set)e.add(s);else{let i=c1(t,s,r),o=Bm.toJS(n,i,r);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function c1(r,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(SN.isNode(r)&&t?.doc){let n=o1.createStringifyContext(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let s=r.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),i1.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)}EN.addPairToJSMap=a1});var ps=E(Vm=>{"use strict";var wN=Ra(),l1=bN(),u1=Um(),kd=ye();function d1(r,e,t){let n=wN.createNode(r,void 0,t),s=wN.createNode(e,void 0,t);return new Nd(n,s)}var Nd=class r{constructor(e,t=null){Object.defineProperty(this,kd.NODE_TYPE,{value:kd.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return kd.isNode(t)&&(t=t.clone(e)),kd.isNode(n)&&(n=n.clone(e)),new r(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return u1.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?l1.stringifyPair(this,e,t,n):JSON.stringify(this)}};Vm.Pair=Nd;Vm.createPair=d1});var Wm=E(NN=>{"use strict";var Ys=ye(),kN=Ia(),Pd=Da();function f1(r,e,t){return(e.inFlow??r.flow?p1:h1)(r,e,t)}function h1({comment:r,items:e},t,{blockItemPrefix:n,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(Ys.isNode(g))!d&&g.spaceBefore&&f.push(""),Rd(t,f,g.commentBefore,d),g.comment&&(S=g.comment);else if(Ys.isPair(g)){let v=Ys.isNode(g.key)?g.key:null;v&&(!d&&v.spaceBefore&&f.push(""),Rd(t,f,v.commentBefore,d))}d=!1;let w=kN.stringify(g,u,()=>S=null,()=>d=!0);S&&(w+=Pd.lineComment(w,i,l(S))),d&&S&&(d=!1),f.push(n+w)}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
81
|
${c}${g}`:`
|
|
82
|
-
`}}return
|
|
83
|
-
`+
|
|
84
|
-
`))&&(l=!0),d.push(
|
|
82
|
+
`}}return r?(m+=`
|
|
83
|
+
`+Pd.indentComment(l(r),c),a&&a()):d&&o&&o(),m}function p1({items:r},e,{flowChars:t,itemIndent:n}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;n+=i;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let T=0;T<r.length;++T){let g=r[T],S=null;if(Ys.isNode(g))g.spaceBefore&&d.push(""),Rd(e,d,g.commentBefore,!1),g.comment&&(S=g.comment);else if(Ys.isPair(g)){let v=Ys.isNode(g.key)?g.key:null;v&&(v.spaceBefore&&d.push(""),Rd(e,d,v.commentBefore,!1),v.comment&&(l=!0));let b=Ys.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 w=kN.stringify(g,c,()=>S=null);T<r.length-1&&(w+=","),S&&(w+=Pd.lineComment(w,n,a(S))),!l&&(d.length>u||w.includes(`
|
|
84
|
+
`))&&(l=!0),d.push(w),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
85
|
${i}${s}${g}`:`
|
|
86
86
|
`;return`${T}
|
|
87
|
-
${s}${m}`}else return`${f}${o}${d.join(" ")}${o}${m}`}function
|
|
88
|
-
`:" ")}return
|
|
89
|
-
${s.key.commentBefore}`:
|
|
90
|
-
${i.comment}`:r.comment}r=s}n.items[t]=Nd.isPair(r)?r:new Vm.Pair(r)}}else e("Expected a sequence for this tag");return n}function _N(n,e,t){let{replacer:r}=t,s=new _1.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(Vm.createPair(a,c,t))}return s}var S1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:TN,createNode:_N};Pd.createPairs=_N;Pd.pairs=S1;Pd.resolvePairs=TN});var Km=w(Hm=>{"use strict";var SN=ye(),Wm=os(),Na=fs(),w1=hs(),wN=Rd(),Hs=class n extends w1.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(SN.isPair(s)?(i=Wm.toJS(s.key,"",t),o=Wm.toJS(s.value,i,t)):i=Wm.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=wN.createPairs(e,t,r),i=new this;return i.items=s.items,i}};Hs.tag="tag:yaml.org,2002:omap";var k1={collection:"seq",identify:n=>n instanceof Map,nodeClass:Hs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=wN.resolvePairs(n,e),r=[];for(let{key:s}of t.items)SN.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)};Hm.YAMLOMap=Hs;Hm.omap=k1});var RN=w(zm=>{"use strict";var kN=gt();function EN({value:n,source:e},t){return e&&(n?NN:PN).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var NN={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 kN.Scalar(!0),stringify:EN},PN={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 kN.Scalar(!1),stringify:EN};zm.falseTag=PN;zm.trueTag=NN});var DN=w(Dd=>{"use strict";var E1=gt(),Gm=ao(),N1={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:Gm.stringifyNumber},P1={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():Gm.stringifyNumber(n)}},R1={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 E1.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:Gm.stringifyNumber};Dd.float=R1;Dd.floatExp=P1;Dd.floatNaN=N1});var ON=w(Ra=>{"use strict";var CN=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 Ym(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 CN.stringifyNumber(n)}var D1={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=>Ym(n,2,"0b")},C1={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=>Ym(n,8,"0")},O1={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:CN.stringifyNumber},A1={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=>Ym(n,16,"0x")};Ra.int=O1;Ra.intBin=D1;Ra.intHex=A1;Ra.intOct=C1});var Xm=w(Jm=>{"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 I1={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}};Jm.YAMLSet=Ks;Jm.set=I1});var Zm=w(Md=>{"use strict";var M1=ao();function Qm(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 AN(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return M1.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 $1={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})=>Qm(n,t),stringify:AN},L1={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=>Qm(n,!1),stringify:AN},IN={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(IN.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=Qm(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$/,"")};Md.floatTime=L1;Md.intTime=$1;Md.timestamp=IN});var LN=w($N=>{"use strict";var x1=io(),q1=_d(),j1=oo(),F1=Ea(),B1=Um(),MN=RN(),eg=DN(),$d=ON(),U1=hd(),V1=Km(),W1=Rd(),H1=Xm(),tg=Zm(),K1=[x1.map,j1.seq,F1.string,q1.nullTag,MN.trueTag,MN.falseTag,$d.intBin,$d.intOct,$d.int,$d.intHex,eg.floatNaN,eg.floatExp,eg.float,B1.binary,U1.merge,V1.omap,W1.pairs,H1.set,tg.intTime,tg.floatTime,tg.timestamp];$N.schema=K1});var KN=w(sg=>{"use strict";var FN=io(),z1=_d(),BN=oo(),G1=Ea(),Y1=Mm(),ng=Lm(),rg=qm(),J1=mN(),X1=bN(),UN=Um(),Da=hd(),VN=Km(),WN=Rd(),xN=LN(),HN=Xm(),Ld=Zm(),qN=new Map([["core",J1.schema],["failsafe",[FN.map,BN.seq,G1.string]],["json",X1.schema],["yaml11",xN.schema],["yaml-1.1",xN.schema]]),jN={binary:UN.binary,bool:Y1.boolTag,float:ng.float,floatExp:ng.floatExp,floatNaN:ng.floatNaN,floatTime:Ld.floatTime,int:rg.int,intHex:rg.intHex,intOct:rg.intOct,intTime:Ld.intTime,map:FN.map,merge:Da.merge,null:z1.nullTag,omap:VN.omap,pairs:WN.pairs,seq:BN.seq,set:HN.set,timestamp:Ld.timestamp},Q1={"tag:yaml.org,2002:binary":UN.binary,"tag:yaml.org,2002:merge":Da.merge,"tag:yaml.org,2002:omap":VN.omap,"tag:yaml.org,2002:pairs":WN.pairs,"tag:yaml.org,2002:set":HN.set,"tag:yaml.org,2002:timestamp":Ld.timestamp};function Z1(n,e,t){let r=qN.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(qN.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"?jN[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(jN).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},[])}sg.coreKnownTags=Q1;sg.getTags=Z1});var ag=w(zN=>{"use strict";var ig=ye(),eL=io(),tL=oo(),nL=Ea(),xd=KN(),rL=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,og=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?xd.getTags(e,"compat"):e?xd.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?xd.coreKnownTags:{},this.tags=xd.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,ig.MAP,{value:eL.map}),Object.defineProperty(this,ig.SCALAR,{value:nL.string}),Object.defineProperty(this,ig.SEQ,{value:tL.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?rL:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};zN.Schema=og});var YN=w(GN=>{"use strict";var sL=ye(),cg=_a(),Ca=ya();function iL(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=cg.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(sL.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=cg.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(cg.stringify(n.contents,s));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
|
|
91
|
-
`)?(t.push("..."),t.push(
|
|
87
|
+
${s}${m}`}else return`${f}${o}${d.join(" ")}${o}${m}`}function Rd({indent:r,options:{commentString:e}},t,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){let i=Pd.indentComment(e(n),r);t.push(i.trimStart())}}NN.stringifyCollection=f1});var gs=E(zm=>{"use strict";var m1=Wm(),g1=Um(),y1=md(),ms=ye(),Dd=ps(),b1=gt();function La(r,e){let t=ms.isScalar(e)?e.value:e;for(let n of r)if(ms.isPair(n)&&(n.key===e||n.key===t||ms.isScalar(n.key)&&n.key.value===t))return n}var Hm=class extends y1.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ms.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:s,replacer:i}=n,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(Dd.createPair(c,l,n))};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 n;ms.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Dd.Pair(e,e?.value):n=new Dd.Pair(e.key,e.value);let s=La(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);ms.isScalar(s.value)&&b1.isScalarValue(n.value)?s.value.value=n.value:s.value=n.value}else if(i){let o=this.items.findIndex(a=>i(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=La(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=La(this.items,e)?.value;return(!t&&ms.isScalar(s)?s.value:s)??void 0}has(e){return!!La(this.items,e)}set(e,t){this.add(new Dd.Pair(e,t),!0)}toJSON(e,t,n){let s=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)g1.addPairToJSMap(t,s,i);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(let s of this.items)if(!ms.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})),m1.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};zm.YAMLMap=Hm;zm.findPair=La});var ho=E(RN=>{"use strict";var v1=ye(),PN=gs(),T1={collection:"map",default:!0,nodeClass:PN.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(r,e){return v1.isMap(r)||e("Expected a mapping for this tag"),r},createNode:(r,e,t)=>PN.YAMLMap.from(r,e,t)};RN.map=T1});var ys=E(DN=>{"use strict";var _1=Ra(),S1=Wm(),E1=md(),Od=ye(),w1=gt(),k1=us(),Km=class extends E1.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Od.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Cd(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Cd(e);if(typeof n!="number")return;let s=this.items[n];return!t&&Od.isScalar(s)?s.value:s}has(e){let t=Cd(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Cd(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[n];Od.isScalar(s)&&w1.isScalarValue(t)?s.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let s=0;for(let i of this.items)n.push(k1.toJS(i,String(s++),t));return n}toString(e,t,n){return e?S1.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:s}=n,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(_1.createNode(a,void 0,n))}}return i}};function Cd(r){let e=Od.isScalar(r)?r.value:r;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}DN.YAMLSeq=Km});var po=E(ON=>{"use strict";var N1=ye(),CN=ys(),P1={collection:"seq",default:!0,nodeClass:CN.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(r,e){return N1.isSeq(r)||e("Expected a sequence for this tag"),r},createNode:(r,e,t)=>CN.YAMLSeq.from(r,e,t)};ON.seq=P1});var xa=E(AN=>{"use strict";var R1=Aa(),D1={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,e,t,n){return e=Object.assign({actualString:!0},e),R1.stringifyString(r,e,t,n)}};AN.string=D1});var Ad=E($N=>{"use strict";var IN=gt(),MN={identify:r=>r==null,createNode:()=>new IN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new IN.Scalar(null),stringify:({source:r},e)=>typeof r=="string"&&MN.test.test(r)?r:e.options.nullStr};$N.nullTag=MN});var Gm=E(xN=>{"use strict";var C1=gt(),LN={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new C1.Scalar(r[0]==="t"||r[0]==="T"),stringify({source:r,value:e},t){if(r&&LN.test.test(r)){let n=r[0]==="t"||r[0]==="T";if(e===n)return r}return e?t.options.trueStr:t.options.falseStr}};xN.boolTag=LN});var mo=E(qN=>{"use strict";function O1({format:r,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let s=typeof n=="number"?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(n);if(!r&&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}qN.stringifyNumber=O1});var Jm=E(Id=>{"use strict";var A1=gt(),Ym=mo(),I1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ym.stringifyNumber},M1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():Ym.stringifyNumber(r)}},$1={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let e=new A1.Scalar(parseFloat(r)),t=r.indexOf(".");return t!==-1&&r[r.length-1]==="0"&&(e.minFractionDigits=r.length-t-1),e},stringify:Ym.stringifyNumber};Id.float=$1;Id.floatExp=M1;Id.floatNaN=I1});var Qm=E($d=>{"use strict";var jN=mo(),Md=r=>typeof r=="bigint"||Number.isInteger(r),Xm=(r,e,t,{intAsBigInt:n})=>n?BigInt(r):parseInt(r.substring(e),t);function FN(r,e,t){let{value:n}=r;return Md(n)&&n>=0?t+n.toString(e):jN.stringifyNumber(r)}var L1={identify:r=>Md(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,e,t)=>Xm(r,2,8,t),stringify:r=>FN(r,8,"0o")},x1={identify:Md,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,e,t)=>Xm(r,0,10,t),stringify:jN.stringifyNumber},q1={identify:r=>Md(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,e,t)=>Xm(r,2,16,t),stringify:r=>FN(r,16,"0x")};$d.int=x1;$d.intHex=q1;$d.intOct=L1});var UN=E(BN=>{"use strict";var j1=ho(),F1=Ad(),B1=po(),U1=xa(),V1=Gm(),Zm=Jm(),eg=Qm(),W1=[j1.map,B1.seq,U1.string,F1.nullTag,V1.boolTag,eg.intOct,eg.int,eg.intHex,Zm.floatNaN,Zm.floatExp,Zm.float];BN.schema=W1});var HN=E(WN=>{"use strict";var H1=gt(),z1=ho(),K1=po();function VN(r){return typeof r=="bigint"||Number.isInteger(r)}var Ld=({value:r})=>JSON.stringify(r),G1=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:Ld},{identify:r=>r==null,createNode:()=>new H1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ld},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:Ld},{identify:VN,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,e,{intAsBigInt:t})=>t?BigInt(r):parseInt(r,10),stringify:({value:r})=>VN(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:Ld}],Y1={default:!0,tag:"",test:/^/,resolve(r,e){return e(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},J1=[z1.map,K1.seq].concat(G1,Y1);WN.schema=J1});var rg=E(zN=>{"use strict";var tg=gt(),X1=Aa(),Q1={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,e){if(typeof Buffer=="function")return Buffer.from(r,"base64");if(typeof atob=="function"){let t=atob(r.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let s=0;s<t.length;++s)n[s]=t.charCodeAt(s);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),r},stringify({comment:r,type:e,value:t},n,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=tg.Scalar.BLOCK_LITERAL),e!==tg.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===tg.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return X1.stringifyString({comment:r,type:e,value:a},n,s,i)}};zN.binary=Q1});var jd=E(qd=>{"use strict";var xd=ye(),ng=ps(),Z1=gt(),eL=ys();function KN(r,e){if(xd.isSeq(r))for(let t=0;t<r.items.length;++t){let n=r.items[t];if(!xd.isPair(n)){if(xd.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let s=n.items[0]||new ng.Pair(new Z1.Scalar(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
|
|
89
|
+
${s.key.commentBefore}`:n.commentBefore),n.comment){let i=s.value??s.key;i.comment=i.comment?`${n.comment}
|
|
90
|
+
${i.comment}`:n.comment}n=s}r.items[t]=xd.isPair(n)?n:new ng.Pair(n)}}else e("Expected a sequence for this tag");return r}function GN(r,e,t){let{replacer:n}=t,s=new eL.YAMLSeq(r);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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(ng.createPair(a,c,t))}return s}var tL={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:KN,createNode:GN};qd.createPairs=GN;qd.pairs=tL;qd.resolvePairs=KN});var og=E(ig=>{"use strict";var YN=ye(),sg=us(),qa=gs(),rL=ys(),JN=jd(),Js=class r extends rL.YAMLSeq{constructor(){super(),this.add=qa.YAMLMap.prototype.add.bind(this),this.delete=qa.YAMLMap.prototype.delete.bind(this),this.get=qa.YAMLMap.prototype.get.bind(this),this.has=qa.YAMLMap.prototype.has.bind(this),this.set=qa.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let s of this.items){let i,o;if(YN.isPair(s)?(i=sg.toJS(s.key,"",t),o=sg.toJS(s.value,i,t)):i=sg.toJS(s,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let s=JN.createPairs(e,t,n),i=new this;return i.items=s.items,i}};Js.tag="tag:yaml.org,2002:omap";var nL={collection:"seq",identify:r=>r instanceof Map,nodeClass:Js,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=JN.resolvePairs(r,e),n=[];for(let{key:s}of t.items)YN.isScalar(s)&&(n.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new Js,t)},createNode:(r,e,t)=>Js.from(r,e,t)};ig.YAMLOMap=Js;ig.omap=nL});var tP=E(ag=>{"use strict";var XN=gt();function QN({value:r,source:e},t){return e&&(r?ZN:eP).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var ZN={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new XN.Scalar(!0),stringify:QN},eP={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new XN.Scalar(!1),stringify:QN};ag.falseTag=eP;ag.trueTag=ZN});var rP=E(Fd=>{"use strict";var sL=gt(),cg=mo(),iL={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:cg.stringifyNumber},oL={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():cg.stringifyNumber(r)}},aL={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new sL.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:cg.stringifyNumber};Fd.float=aL;Fd.floatExp=oL;Fd.floatNaN=iL});var sP=E(Fa=>{"use strict";var nP=mo(),ja=r=>typeof r=="bigint"||Number.isInteger(r);function Bd(r,e,t,{intAsBigInt:n}){let s=r[0];if((s==="-"||s==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let o=BigInt(r);return s==="-"?BigInt(-1)*o:o}let i=parseInt(r,t);return s==="-"?-1*i:i}function lg(r,e,t){let{value:n}=r;if(ja(n)){let s=n.toString(e);return n<0?"-"+t+s.substr(1):t+s}return nP.stringifyNumber(r)}var cL={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Bd(r,2,2,t),stringify:r=>lg(r,2,"0b")},lL={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Bd(r,1,8,t),stringify:r=>lg(r,8,"0")},uL={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Bd(r,0,10,t),stringify:nP.stringifyNumber},dL={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Bd(r,2,16,t),stringify:r=>lg(r,16,"0x")};Fa.int=uL;Fa.intBin=cL;Fa.intHex=dL;Fa.intOct=lL});var dg=E(ug=>{"use strict";var Wd=ye(),Ud=ps(),Vd=gs(),Xs=class r extends Vd.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;Wd.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ud.Pair(e.key,null):t=new Ud.Pair(e,null),Vd.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Vd.findPair(this.items,e);return!t&&Wd.isPair(n)?Wd.isScalar(n.key)?n.key.value:n.key:n}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 n=Vd.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ud.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:s}=n,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(Ud.createPair(o,null,n));return i}};Xs.tag="tag:yaml.org,2002:set";var fL={collection:"map",identify:r=>r instanceof Set,nodeClass:Xs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>Xs.from(r,e,t),resolve(r,e){if(Wd.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new Xs,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};ug.YAMLSet=Xs;ug.set=fL});var hg=E(Hd=>{"use strict";var hL=mo();function fg(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,s=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function iP(r){let{value:e}=r,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return hL.stringifyNumber(r);let n="";e<0&&(n="-",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))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var pL={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>fg(r,t),stringify:iP},mL={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>fg(r,!1),stringify:iP},oP={identify:r=>r 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(r){let e=r.match(oP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,n-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=fg(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:r})=>r.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Hd.floatTime=mL;Hd.intTime=pL;Hd.timestamp=oP});var lP=E(cP=>{"use strict";var gL=ho(),yL=Ad(),bL=po(),vL=xa(),TL=rg(),aP=tP(),pg=rP(),zd=sP(),_L=wd(),SL=og(),EL=jd(),wL=dg(),mg=hg(),kL=[gL.map,bL.seq,vL.string,yL.nullTag,aP.trueTag,aP.falseTag,zd.intBin,zd.intOct,zd.int,zd.intHex,pg.floatNaN,pg.floatExp,pg.float,TL.binary,_L.merge,SL.omap,EL.pairs,wL.set,mg.intTime,mg.floatTime,mg.timestamp];cP.schema=kL});var vP=E(bg=>{"use strict";var hP=ho(),NL=Ad(),pP=po(),PL=xa(),RL=Gm(),gg=Jm(),yg=Qm(),DL=UN(),CL=HN(),mP=rg(),Ba=wd(),gP=og(),yP=jd(),uP=lP(),bP=dg(),Kd=hg(),dP=new Map([["core",DL.schema],["failsafe",[hP.map,pP.seq,PL.string]],["json",CL.schema],["yaml11",uP.schema],["yaml-1.1",uP.schema]]),fP={binary:mP.binary,bool:RL.boolTag,float:gg.float,floatExp:gg.floatExp,floatNaN:gg.floatNaN,floatTime:Kd.floatTime,int:yg.int,intHex:yg.intHex,intOct:yg.intOct,intTime:Kd.intTime,map:hP.map,merge:Ba.merge,null:NL.nullTag,omap:gP.omap,pairs:yP.pairs,seq:pP.seq,set:bP.set,timestamp:Kd.timestamp},OL={"tag:yaml.org,2002:binary":mP.binary,"tag:yaml.org,2002:merge":Ba.merge,"tag:yaml.org,2002:omap":gP.omap,"tag:yaml.org,2002:pairs":yP.pairs,"tag:yaml.org,2002:set":bP.set,"tag:yaml.org,2002:timestamp":Kd.timestamp};function AL(r,e,t){let n=dP.get(e);if(n&&!r)return t&&!n.includes(Ba.merge)?n.concat(Ba.merge):n.slice();let s=n;if(!s)if(Array.isArray(r))s=[];else{let i=Array.from(dP.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(r))for(let i of r)s=s.concat(i);else typeof r=="function"&&(s=r(s.slice()));return t&&(s=s.concat(Ba.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?fP[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(fP).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},[])}bg.coreKnownTags=OL;bg.getTags=AL});var _g=E(TP=>{"use strict";var vg=ye(),IL=ho(),ML=po(),$L=xa(),Gd=vP(),LL=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,Tg=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Gd.getTags(e,"compat"):e?Gd.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Gd.coreKnownTags:{},this.tags=Gd.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,vg.MAP,{value:IL.map}),Object.defineProperty(this,vg.SCALAR,{value:$L.string}),Object.defineProperty(this,vg.SEQ,{value:ML.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?LL:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};TP.Schema=Tg});var SP=E(_P=>{"use strict";var xL=ye(),Sg=Ia(),Ua=Da();function qL(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let s=Sg.createStringifyContext(r,e),{commentString:i}=s.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=i(r.commentBefore);t.unshift(Ua.indentComment(c,""))}let o=!1,a=null;if(r.contents){if(xL.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let u=i(r.contents.commentBefore);t.push(Ua.indentComment(u,""))}s.forceBlockIndent=!!r.comment,a=r.contents.comment}let c=a?void 0:()=>o=!0,l=Sg.stringify(r.contents,s,()=>a=null,c);a&&(l+=Ua.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(Sg.stringify(r.contents,s));if(r.directives?.docEnd)if(r.comment){let c=i(r.comment);c.includes(`
|
|
91
|
+
`)?(t.push("..."),t.push(Ua.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=r.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ua.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
|
+
`}_P.stringifyDocument=qL});var Va=E(EP=>{"use strict";var jL=Pa(),go=md(),Dr=ye(),FL=ps(),BL=us(),UL=_g(),VL=SP(),Eg=ud(),WL=Pm(),HL=Ra(),wg=Nm(),kg=class r{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Dr.NODE_TYPE,{value:Dr.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:n===void 0&&t&&(n=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"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new wg.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,s,n)}clone(){let e=Object.create(r.prototype,{[Dr.NODE_TYPE]:{value:Dr.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=Dr.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){yo(this.contents)&&this.contents.add(e)}addIn(e,t){yo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Eg.anchorNames(this);e.anchor=!t||n.has(t)?Eg.findNewAnchor(t||"a",n):t}return new jL.Alias(e.anchor)}createNode(e,t,n){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,w=t.filter(S).map(String);w.length>0&&(t=t.concat(w)),s=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:m}=Eg.createNodeAnchors(this,o||"a"),T={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=HL.createNode(e,u,T);return a&&Dr.isCollection(g)&&(g.flow=!0),f(),g}createPair(e,t,n={}){let s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new FL.Pair(s,i)}delete(e){return yo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return go.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):yo(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Dr.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return go.isEmptyPath(e)?!t&&Dr.isScalar(this.contents)?this.contents.value:this.contents:Dr.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Dr.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return go.isEmptyPath(e)?this.contents!==void 0:Dr.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=go.collectionFromPath(this.schema,[e],t):yo(this.contents)&&this.contents.set(e,t)}setIn(e,t){go.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=go.collectionFromPath(this.schema,Array.from(e),t):yo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new wg.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new wg.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=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(n)this.schema=new UL.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=BL.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"?WL.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 VL.stringifyDocument(this,e)}};function yo(r){if(Dr.isCollection(r))return!0;throw new Error("Expected a YAML collection as document contents")}EP.Document=kg});var za=E(Ha=>{"use strict";var Wa=class extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}},Ng=class extends Wa{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Pg=class extends Wa{constructor(e,t,n){super("YAMLWarning",e,t,n)}},zL=(r,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:s}=t.linePos[0];t.message+=` at line ${n}, column ${s}`;let i=s-1,o=r.substring(e.lineStarts[n-1],e.lineStarts[n]).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"),n>1&&/^ *$/.test(o.substring(0,i))){let a=r.substring(e.lineStarts[n-2],e.lineStarts[n-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===n&&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(
|
|
100
|
-
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||
|
|
101
|
-
`+b.comment:v.comment=b.comment);let R=new
|
|
102
|
-
`+L.comment:l.comment=L.comment),d=L.end;continue}!o&&t.options.strict&&
|
|
103
|
-
`+
|
|
104
|
-
`+
|
|
105
|
-
`+S.comment:l.comment=S.comment),l.range=[
|
|
106
|
-
`.repeat(Math.max(1,o.length-1)):"",S=
|
|
107
|
-
`;for(let g=u;g<a;++g){let[S,
|
|
108
|
-
`):S.length>c||
|
|
98
|
+
`}};Ha.YAMLError=Wa;Ha.YAMLParseError=Ng;Ha.YAMLWarning=Pg;Ha.prettifyError=zL});var Ka=E(wP=>{"use strict";function KL(r,{flow:e,indicator:t,next:n,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,w=null,v=null,b=null,R=null,A=null;for(let j of r)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"||n?.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 se=j.source.substring(1)||" ";d?d+=f+se:d=se,f="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:f+=j.source,l=!0,m=!0,(S||w)&&(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,A===null&&(A=j.offset),l=!1,u=!1,T=!0;break;case"tag":{w&&i(j,"MULTIPLE_TAGS","A node can have at most one tag"),w=j,A===null&&(A=j.offset),l=!1,u=!1,T=!0;break}case t:(S||w)&&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=r[r.length-1],W=L?L.offset+L.source.length:s;return T&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||n?.type==="block-map"||n?.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:w,newlineAfterProp:v,end:W,start:A??W}}wP.resolveProps=KL});var Yd=E(kP=>{"use strict";function Rg(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(`
|
|
99
|
+
`))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.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(Rg(e.key)||Rg(e.value))return!0}return!1;default:return!0}}kP.containsNewline=Rg});var Dg=E(NP=>{"use strict";var GL=Yd();function YL(r,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===r&&(n.source==="]"||n.source==="}")&&GL.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}NP.flowIndentCheck=YL});var Cg=E(RP=>{"use strict";var PP=ye();function JL(r,e,t){let{uniqueKeys:n}=r.options;if(n===!1)return!1;let s=typeof n=="function"?n:(i,o)=>i===o||PP.isScalar(i)&&PP.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}RP.mapIncludes=JL});var MP=E(IP=>{"use strict";var DP=ps(),XL=gs(),CP=Ka(),QL=Yd(),OP=Dg(),ZL=Cg(),AP="All mapping items must start at the same column";function ex({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=i?.nodeClass??XL.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:m,value:T}=u,g=CP.resolveProps(d,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:s,parentIndent:n.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!==n.indent&&s(c,"BAD_INDENT",AP)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||QL.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==n.indent&&s(c,"BAD_INDENT",AP);t.atKey=!0;let w=g.end,v=f?r(t,f,g,s):e(t,w,d,null,g,s);t.schema.compat&&OP.flowIndentCheck(n.indent,f,s),t.atKey=!1,ZL.mapIncludes(t,a.items,v)&&s(w,"DUPLICATE_KEY","Map keys must be unique");let b=CP.resolveProps(m??[],{indicator:"map-value-ind",next:T,offset:v.range[2],onError:s,parentIndent:n.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?r(t,T,b,s):e(t,c,m,null,b,s);t.schema.compat&&OP.flowIndentCheck(n.indent,T,s),c=R.range[2];let A=new DP.Pair(v,R);t.options.keepSourceTokens&&(A.srcToken=u),a.items.push(A)}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 DP.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=[n.offset,c,l??c],a}IP.resolveBlockMap=ex});var LP=E($P=>{"use strict";var tx=ys(),rx=Ka(),nx=Dg();function sx({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=i?.nodeClass??tx.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=rx.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:n.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?r(t,d,f,s):e(t,f.end,u,null,f,s);t.schema.compat&&nx.flowIndentCheck(n.indent,d,s),c=m.range[2],a.items.push(m)}return a.range=[n.offset,c,l??c],a}$P.resolveBlockSeq=sx});var bo=E(xP=>{"use strict";function ix(r,e,t,n){let s="";if(r){let i=!1,o="";for(let a of r){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&n(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:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}xP.resolveEnd=ix});var BP=E(FP=>{"use strict";var ox=ye(),ax=ps(),qP=gs(),cx=ys(),lx=bo(),jP=Ka(),ux=Yd(),dx=Cg(),Og="Block collections are not allowed within flow collections",Ag=r=>r&&(r.type==="block-map"||r.type==="block-seq");function fx({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?qP.YAMLMap:cx.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=n.offset+n.start.source.length;for(let S=0;S<n.items.length;++S){let w=n.items[S],{start:v,key:b,sep:R,value:A}=w,L=jP.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:b??R?.[0],offset:d,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!R&&!A){S===0&&L.comma?s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<n.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&&ux.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 W="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":W=j.source.substring(1);break e;default:break e}if(W){let j=l.items[l.items.length-1];ox.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
|
|
103
|
+
`+W:j.comment=W,L.comment=L.comment.substring(W.length+1)}}if(!o&&!R&&!L.found){let W=A?r(t,A,L,s):e(t,L.end,R,null,L,s);l.items.push(W),d=W.range[2],Ag(A)&&s(W.range,"BLOCK_IN_FLOW",Og)}else{t.atKey=!0;let W=L.end,j=b?r(t,b,L,s):e(t,W,v,null,L,s);Ag(b)&&s(j.range,"BLOCK_IN_FLOW",Og),t.atKey=!1;let se=jP.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:A,offset:j.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(se.found){if(!o&&!L.found&&t.options.strict){if(R)for(let de of R){if(de===se.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<se.found.offset-1024&&s(se.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?s(A,"MISSING_CHAR",`Missing space after : in ${a}`):s(se.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Me=A?r(t,A,se,s):se.found?e(t,se.end,R,null,se,s):null;Me?Ag(A)&&s(Me.range,"BLOCK_IN_FLOW",Og):se.comment&&(j.comment?j.comment+=`
|
|
104
|
+
`+se.comment:j.comment=se.comment);let yt=new ax.Pair(j,Me);if(t.options.keepSourceTokens&&(yt.srcToken=w),o){let de=l;dx.mapIncludes(t,de.items,j)&&s(W,"DUPLICATE_KEY","Map keys must be unique"),de.items.push(yt)}else{let de=new qP.YAMLMap(t.schema);de.flow=!0,de.items.push(yt);let vr=(Me??j).range;de.range=[j.range[0],vr[1],vr[2]],l.items.push(de)}d=Me?Me.range[2]:se.end}}let f=o?"}":"]",[m,...T]=n.end,g=d;if(m&&m.source===f)g=m.offset+m.source.length;else{let S=a[0].toUpperCase()+a.substring(1),w=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",w),m&&m.source.length!==1&&T.unshift(m)}if(T.length>0){let S=lx.resolveEnd(T,g,t.options.strict,s);S.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+S.comment:l.comment=S.comment),l.range=[n.offset,g,S.offset]}else l.range=[n.offset,g,g];return l}FP.resolveFlowCollection=fx});var VP=E(UP=>{"use strict";var hx=ye(),px=gt(),mx=gs(),gx=ys(),yx=MP(),bx=LP(),vx=BP();function Ig(r,e,t,n,s,i){let o=t.type==="block-map"?yx.resolveBlockMap(r,e,t,n,i):t.type==="block-seq"?bx.resolveBlockSeq(r,e,t,n,i):vx.resolveFlowCollection(r,e,t,n,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Tx(r,e,t,n,s){let i=n.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}=n,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===mx.YAMLMap.tagName&&a==="map"||o===gx.YAMLSeq.tagName&&a==="seq")return Ig(r,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),Ig(r,e,t,s,o)}let l=Ig(r,e,t,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=hx.isNode(u)?u:new px.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}UP.composeCollection=Tx});var $g=E(WP=>{"use strict";var Mg=gt();function _x(r,e,t){let n=e.offset,s=Sx(e,r.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};let i=s.mode===">"?Mg.Scalar.BLOCK_FOLDED:Mg.Scalar.BLOCK_LITERAL,o=e.source?Ex(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=n+s.length;return e.source&&(S+=e.source.length),{value:g,type:i,comment:s.comment,range:[n,S,S]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let g=0;g<a;++g){let[S,w]=o[g];if(w===""||w==="\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&&!r.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=S.length+w.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,w]=o[g];l+=S.length+w.length+1;let v=w[w.length-1]==="\r";if(v&&(w=w.slice(0,-1)),w&&S.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-w.length-(v?2:1),"BAD_INDENT",R),S=""}i===Mg.Scalar.BLOCK_LITERAL?(d+=f+S.slice(c)+w,f=`
|
|
108
|
+
`):S.length>c||w[0]===" "?(f===" "?f=`
|
|
109
109
|
`:!m&&f===`
|
|
110
110
|
`&&(f=`
|
|
111
111
|
|
|
112
|
-
`),d+=f+S.slice(c)+
|
|
113
|
-
`,m=!0):
|
|
112
|
+
`),d+=f+S.slice(c)+w,f=`
|
|
113
|
+
`,m=!0):w===""?f===`
|
|
114
114
|
`?d+=`
|
|
115
115
|
`:f=`
|
|
116
|
-
`:(d+=f+
|
|
116
|
+
`:(d+=f+w,f=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)d+=`
|
|
117
117
|
`+o[g][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let T=
|
|
120
|
+
`}let T=n+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[n,T,T]}}function Sx({offset:r,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(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=r+f)}}c!==-1&&n(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&&n(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":n(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let T=`Unexpected token in block scalar header: ${m.type}`;n(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 Ex(r){let e=r.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}WP.resolveBlockScalar=_x});var xg=E(zP=>{"use strict";var Lg=gt(),wx=bo();function kx(r,e,t){let{offset:n,type:s,source:i,end:o}=r,a,c,l=(f,m,T)=>t(n+f,m,T);switch(s){case"scalar":a=Lg.Scalar.PLAIN,c=Nx(i,l);break;case"single-quoted-scalar":a=Lg.Scalar.QUOTE_SINGLE,c=Px(i,l);break;case"double-quoted-scalar":a=Lg.Scalar.QUOTE_DOUBLE,c=Rx(i,l);break;default:return t(r,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let u=n+i.length,d=wx.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function Nx(r,e){let t="";switch(r[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 ${r[0]}`;break}case"@":case"`":{t=`reserved character ${r[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),HP(r)}function Px(r,e){return(r[r.length-1]!=="'"||r.length===1)&&e(r.length,"MISSING_CHAR","Missing closing 'quote"),HP(r.slice(1,-1)).replace(/''/g,"'")}function HP(r){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
|
|
122
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(r);if(!n)return r;let s=n[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(r);)n[1]===""?i===`
|
|
123
123
|
`?s+=i:i=`
|
|
124
|
-
`:(s+=i+
|
|
124
|
+
`:(s+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(r),s+i+(n?.[1]??"")}function Rx(r,e){let t="";for(let n=1;n<r.length-1;++n){let s=r[n];if(!(s==="\r"&&r[n+1]===`
|
|
125
125
|
`))if(s===`
|
|
126
|
-
`){let{fold:i,offset:o}=
|
|
127
|
-
`)for(i=n
|
|
128
|
-
`)for(i=
|
|
129
|
-
`&&!(o==="\r"&&n
|
|
130
|
-
`)&&(t+=
|
|
131
|
-
`||
|
|
132
|
-
`);)
|
|
126
|
+
`){let{fold:i,offset:o}=Dx(r,n);t+=i,n=o}else if(s==="\\"){let i=r[++n],o=Cx[i];if(o)t+=o;else if(i===`
|
|
127
|
+
`)for(i=r[n+1];i===" "||i===" ";)i=r[++n+1];else if(i==="\r"&&r[n+1]===`
|
|
128
|
+
`)for(i=r[++n+1];i===" "||i===" ";)i=r[++n+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=Ox(r,n+1,a,e),n+=a}else{let a=r.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=n,o=r[n+1];for(;o===" "||o===" ";)o=r[++n+1];o!==`
|
|
129
|
+
`&&!(o==="\r"&&r[n+2]===`
|
|
130
|
+
`)&&(t+=n>i?r.slice(i,n+1):s)}else t+=s}return(r[r.length-1]!=='"'||r.length===1)&&e(r.length,"MISSING_CHAR",'Missing closing "quote'),t}function Dx(r,e){let t="",n=r[e+1];for(;(n===" "||n===" "||n===`
|
|
131
|
+
`||n==="\r")&&!(n==="\r"&&r[e+2]!==`
|
|
132
|
+
`);)n===`
|
|
133
133
|
`&&(t+=`
|
|
134
|
-
`),e+=1,r
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}var Cx={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 Ox(r,e,t,n){let s=r.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}zP.resolveFlowScalar=kx});var YP=E(GP=>{"use strict";var Qs=ye(),KP=gt(),Ax=$g(),Ix=xg();function Mx(r,e,t,n){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?Ax.resolveBlockScalar(r,e,n):Ix.resolveFlowScalar(e,r.options.strict,n),c=t?r.directives.tagName(t.source,d=>n(t,"TAG_RESOLVE_FAILED",d)):null,l;r.options.stringKeys&&r.atKey?l=r.schema[Qs.SCALAR]:c?l=$x(r.schema,s,c,t,n):e.type==="scalar"?l=Lx(r,s,e,n):l=r.schema[Qs.SCALAR];let u;try{let d=l.resolve(s,f=>n(t??e,"TAG_RESOLVE_FAILED",f),r.options);u=Qs.isScalar(d)?d:new KP.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(t??e,"TAG_RESOLVE_FAILED",f),u=new KP.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 $x(r,e,t,n,s){if(t==="!")return r[Qs.SCALAR];let i=[];for(let a of r.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=r.knownTags[t];return o&&!o.collection?(r.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[Qs.SCALAR])}function Lx({atKey:r,directives:e,schema:t},n,s,i){let o=t.tags.find(a=>(a.default===!0||r&&a.default==="key")&&a.test?.test(n))||t[Qs.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(n))??t[Qs.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}GP.composeScalar=Mx});var XP=E(JP=>{"use strict";function xx(r,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let s=e[n];switch(s.type){case"space":case"comment":case"newline":r-=s.source.length;continue}for(s=e[++n];s?.type==="space";)r+=s.source.length,s=e[++n];break}}return r}JP.emptyScalarPosition=xx});var e0=E(jg=>{"use strict";var qx=Pa(),jx=ye(),Fx=VP(),QP=YP(),Bx=bo(),Ux=XP(),Vx={composeNode:ZP,composeEmptyNode:qg};function ZP(r,e,t,n){let s=r.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=Wx(r,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=QP.composeScalar(r,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Fx.composeCollection(Vx,r,e,t,n),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=qg(r,e.offset,void 0,null,t,n),u=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&r.options.stringKeys&&(!jx.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),r.options.keepSourceTokens&&u&&(l.srcToken=e),l}function qg(r,e,t,n,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:Ux.emptyScalarPosition(e,t,n),indent:-1,source:""},d=QP.composeScalar(r,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 Wx({options:r},{offset:e,source:t,end:n},s){let i=new qx.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=Bx.resolveEnd(n,o,r.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}jg.composeEmptyNode=qg;jg.composeNode=ZP});var n0=E(r0=>{"use strict";var Hx=Va(),t0=e0(),zx=bo(),Kx=Ka();function Gx(r,e,{offset:t,start:n,value:s,end:i},o){let a=Object.assign({_directives:e},r),c=new Hx.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Kx.resolveProps(n,{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?t0.composeNode(l,s,u,o):t0.composeEmptyNode(l,u.end,n,null,u,o);let d=c.contents.range[2],f=zx.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,d,f.offset],c}r0.composeDoc=Gx});var Bg=E(o0=>{"use strict";var Yx=Nm(),Jx=Va(),Ga=za(),s0=ye(),Xx=n0(),Qx=bo();function Ya(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:e,source:t}=r;return[e,e+(typeof t=="string"?t.length:1)]}function i0(r){let e="",t=!1,n=!1;for(let s=0;s<r.length;++s){let i=r[s];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(i.substring(1)||" "),t=!0,
|
|
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,n=!1;break;case"%":r[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Fg=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,s,i)=>{let o=Ya(t);i?this.warnings.push(new Ga.YAMLWarning(o,n,s)):this.errors.push(new Ga.YAMLParseError(o,n,s))},this.directives=new Yx.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:s}=i0(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${n}`:n;else if(s||e.directives.docStart||!i)e.commentBefore=n;else if(s0.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];s0.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
140
|
+
${a}`:n}else{let o=i.commentBefore;i.commentBefore=o?`${n}
|
|
141
|
+
${o}`:n}}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:i0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let s of e)yield*this.next(s);yield*this.end(t,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,s)=>{let i=Ya(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Xx.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,n=new Ga.YAMLParseError(Ya(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ga.YAMLParseError(Ya(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Qx.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
142
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ga.YAMLParseError(Ya(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 n=Object.assign({_directives:this.directives},this.options),s=new Jx.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};o0.Composer=Fg});var l0=E(Jd=>{"use strict";var Zx=$g(),eq=xg(),tq=za(),a0=Aa();function rq(r,e=!0,t){if(r){let n=(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 tq.YAMLParseError([a,a+1],i,o)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return eq.resolveFlowScalar(r,e,n);case"block-scalar":return Zx.resolveBlockScalar({options:{strict:e}},r,n)}}return null}function nq(r,e){let{implicitKey:t=!1,indent:n,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=a0.stringifyString({type:o,value:r},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
143
143
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
144
144
|
`),u=a.substring(0,l),d=a.substring(l+1)+`
|
|
145
|
-
`,f=[{type:"block-scalar-header",offset:i,indent:
|
|
146
|
-
`}),{type:"block-scalar",offset:i,indent:
|
|
147
|
-
`),
|
|
148
|
-
`;if(
|
|
149
|
-
`});for(let c of Object.keys(
|
|
150
|
-
`};delete
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:n,source:u}];return c0(f,c)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:i,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:c};default:return{type:"scalar",offset:i,indent:n,source:a,end:c}}}function sq(r,e,t={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in r?r.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(r.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=r.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=a0.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">":iq(r,c);break;case'"':Ug(r,c,"double-quoted-scalar");break;case"'":Ug(r,c,"single-quoted-scalar");break;default:Ug(r,c,"scalar")}}function iq(r,e){let t=e.indexOf(`
|
|
147
|
+
`),n=e.substring(0,t),s=e.substring(t+1)+`
|
|
148
|
+
`;if(r.type==="block-scalar"){let i=r.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,r.source=s}else{let{offset:i}=r,o="indent"in r?r.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];c0(a,"end"in r?r.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
|
+
`});for(let c of Object.keys(r))c!=="type"&&c!=="offset"&&delete r[c];Object.assign(r,{type:"block-scalar",indent:o,props:a,source:s})}}function c0(r,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":r.push(t);break;case"newline":return r.push(t),!0}return!1}function Ug(r,e,t){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=t,r.source=e;break;case"block-scalar":{let n=r.props.slice(1),s=e.length;r.props[0].type==="block-scalar-header"&&(s-=r.props[0].source.length);for(let i of n)i.offset+=s;delete r.props,Object.assign(r,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let s={type:"newline",offset:r.offset+e.length,indent:r.indent,source:`
|
|
150
|
+
`};delete r.items,Object.assign(r,{type:t,source:e,end:[s]});break}default:{let n="indent"in r?r.indent:-1,s="end"in r&&Array.isArray(r.end)?r.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(r))i!=="type"&&i!=="offset"&&delete r[i];Object.assign(r,{type:t,indent:n,source:e,end:s})}}}Jd.createScalarToken=nq;Jd.resolveAsScalar=rq;Jd.setScalarValue=sq});var d0=E(u0=>{"use strict";var oq=r=>"type"in r?Qd(r):Xd(r);function Qd(r){switch(r.type){case"block-scalar":{let e="";for(let t of r.props)e+=Qd(t);return e+r.source}case"block-map":case"block-seq":{let e="";for(let t of r.items)e+=Xd(t);return e}case"flow-collection":{let e=r.start.source;for(let t of r.items)e+=Xd(t);for(let t of r.end)e+=t.source;return e}case"document":{let e=Xd(r);if(r.end)for(let t of r.end)e+=t.source;return e}default:{let e=r.source;if("end"in r&&r.end)for(let t of r.end)e+=t.source;return e}}}function Xd({start:r,key:e,sep:t,value:n}){let s="";for(let i of r)s+=i.source;if(e&&(s+=Qd(e)),t)for(let i of t)s+=i.source;return n&&(s+=Qd(n)),s}u0.stringify=oq});var m0=E(p0=>{"use strict";var Vg=Symbol("break visit"),aq=Symbol("skip children"),f0=Symbol("remove item");function Zs(r,e){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),h0(Object.freeze([]),r,e)}Zs.BREAK=Vg;Zs.SKIP=aq;Zs.REMOVE=f0;Zs.itemAtPath=(r,e)=>{let t=r;for(let[n,s]of e){let i=t?.[n];if(i&&"items"in i)t=i.items[s];else return}return t};Zs.parentCollection=(r,e)=>{let t=Zs.itemAtPath(r,e.slice(0,-1)),n=e[e.length-1][0],s=t?.[n];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function h0(r,e,t){let n=t(e,r);if(typeof n=="symbol")return n;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=h0(Object.freeze(r.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Vg)return Vg;a===f0&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&s==="key"&&(n=n(e,r))}}return typeof n=="function"?n(e,r):n}p0.visit=Zs});var Zd=E(ar=>{"use strict";var Wg=l0(),cq=d0(),lq=m0(),Hg="\uFEFF",zg="",Kg="",Gg="",uq=r=>!!r&&"items"in r,dq=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar");function fq(r){switch(r){case Hg:return"<BOM>";case zg:return"<DOC>";case Kg:return"<FLOW_END>";case Gg:return"<SCALAR>";default:return JSON.stringify(r)}}function hq(r){switch(r){case Hg:return"byte-order-mark";case zg:return"doc-mode";case Kg:return"flow-error-end";case Gg: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(
|
|
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(r[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}ar.createScalarToken=Wg.createScalarToken;ar.resolveAsScalar=Wg.resolveAsScalar;ar.setScalarValue=Wg.setScalarValue;ar.stringify=cq.stringify;ar.visit=lq.visit;ar.BOM=Hg;ar.DOCUMENT=zg;ar.FLOW_END=Kg;ar.SCALAR=Gg;ar.isCollection=uq;ar.isScalar=dq;ar.prettyToken=fq;ar.tokenType=hq});var Xg=E(y0=>{"use strict";var Ja=Zd();function Yr(r){switch(r){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var g0=new Set("0123456789ABCDEFabcdef"),pq=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ef=new Set(",[]{}"),mq=new Set(` ,[]{}
|
|
154
|
+
\r `),Yg=r=>!r||mq.has(r),Jg=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 n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}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
|
-
`||!s&&!this.atEnd)return e+
|
|
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(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=
|
|
161
|
-
`,i)}s!==-1&&(t=s-(
|
|
156
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let s=this.buffer[n+e+1];if(s===`
|
|
157
|
+
`||!s&&!this.atEnd)return e+n+1}return t===`
|
|
158
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Yr(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]===Ja.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+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 Ja.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==="...")&&Yr(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&&!Yr(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===":")&&Yr(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,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(Yg),"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,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&s[0]!=="#"||n===0&&(s.startsWith("---")||s.startsWith("..."))&&Yr(s[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Ja.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(Yg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Yr(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 n=this.buffer.substring(0,t),s=n.indexOf(`
|
|
160
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=n.indexOf(`
|
|
161
|
+
`,i)}s!==-1&&(t=s-(n[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=>Yr(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
|
|
162
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(!
|
|
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(
|
|
165
|
-
`;)
|
|
166
|
-
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield
|
|
167
|
-
`?(
|
|
168
|
-
`,i=this.buffer[
|
|
169
|
-
`){let o=this.continueScalar(
|
|
163
|
+
`)break}default:break e}if(!n&&!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(n=this.buffer[s];n===" ";)n=this.buffer[++s];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
165
|
+
`;)n=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 Ja.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,s;for(;s=this.buffer[++n];)if(s===":"){let i=this.buffer[n+1];if(Yr(i)||e&&ef.has(i))break;t=n}else if(Yr(s)){let i=this.buffer[n+1];if(s==="\r"&&(i===`
|
|
167
|
+
`?(n+=1,s=`
|
|
168
|
+
`,i=this.buffer[n+1]):t=n),i==="#"||e&&ef.has(i))break;if(s===`
|
|
169
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ef.has(s))break;t=n}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ja.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 n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.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(Yg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Yr(t)||e&&ef.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(;!Yr(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(pq.has(t))t=this.buffer[++e];else if(t==="%"&&g0.has(this.buffer[e+1])&&g0.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,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");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,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};y0.Lexer=Jg});var Zg=E(b0=>{"use strict";var Qg=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=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}}}};b0.LineCounter=Qg});var ty=E(E0=>{"use strict";var v0=Zd(),gq=Xg();function ei(r,e){for(let t=0;t<r.length;++t)if(r[t].type===e)return!0;return!1}function T0(r){for(let e=0;e<r.length;++e)switch(r[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function S0(r){switch(r?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tf(r){switch(r.type){case"document":return r.start;case"block-map":{let e=r.items[r.items.length-1];return e.sep??e.start}case"block-seq":return r.items[r.items.length-1].start;default:return[]}}function vo(r){if(r.length===0)return[];let e=r.length;e:for(;--e>=0;)switch(r[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;r[++e]?.type==="space";);return r.splice(e,r.length)}function _0(r){if(r.start.type==="flow-seq-start")for(let e of r.items)e.sep&&!e.value&&!ei(e.start,"explicit-key-ind")&&!ei(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,S0(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 ey=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 gq.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",v0.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=v0.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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let 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 n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&_0(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let s=n.items[n.items.length-1];if(s.value){n.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=n.items[n.items.length-1];s.value?n.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=n.items[n.items.length-1];!s||s.value?n.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((n.type==="document"||n.type==="block-map"||n.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&&T0(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=s.start:n.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":{T0(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=tf(this.peek(2)),n=vo(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:n,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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 n=!this.onKeyLine&&this.indent===e.indent,s=n&&(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(ei(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(S0(t.key)&&!ei(t.sep,"newline")){let o=vo(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(ei(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=vo(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]}):ei(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){n&&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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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||ei(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!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 n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let s=tf(n),i=vo(s);_0(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=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())}}};JP.Parser=Fg});var t0=w(Fa=>{"use strict";var XP=Pg(),qx=Oa(),ja=Ma(),jx=Em(),Fx=ye(),Bx=jg(),QP=Bg();function ZP(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Bx.LineCounter||null,prettyErrors:e}}function Ux(n,e={}){let{lineCounter:t,prettyErrors:r}=ZP(e),s=new QP.Parser(t?.addNewLine),i=new XP.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 e0(n,e={}){let{lineCounter:t,prettyErrors:r}=ZP(e),s=new QP.Parser(t?.addNewLine),i=new XP.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 Vx(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=e0(n,t);if(!s)return null;if(s.warnings.forEach(i=>jx.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 Wx(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 Fx.isDocument(n)&&!r?n.toString(t):new qx.Document(n,r,t).toString(t)}Fa.parse=Vx;Fa.parseAllDocuments=Ux;Fa.parseDocument=e0;Fa.stringify=Wx});var Vg=w(De=>{"use strict";var Hx=Pg(),Kx=Oa(),zx=ag(),Ug=Ma(),Gx=ma(),ps=ye(),Yx=us(),Jx=gt(),Xx=fs(),Qx=hs(),Zx=Ud(),eq=xg(),tq=jg(),nq=Bg(),Hd=t0(),n0=da();De.Composer=Hx.Composer;De.Document=Kx.Document;De.Schema=zx.Schema;De.YAMLError=Ug.YAMLError;De.YAMLParseError=Ug.YAMLParseError;De.YAMLWarning=Ug.YAMLWarning;De.Alias=Gx.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=Yx.Pair;De.Scalar=Jx.Scalar;De.YAMLMap=Xx.YAMLMap;De.YAMLSeq=Qx.YAMLSeq;De.CST=Zx;De.Lexer=eq.Lexer;De.LineCounter=tq.LineCounter;De.Parser=nq.Parser;De.parse=Hd.parse;De.parseAllDocuments=Hd.parseAllDocuments;De.parseDocument=Hd.parseDocument;De.stringify=Hd.stringify;De.visit=n0.visit;De.visitAsync=n0.visitAsync});var a0=w((IQ,o0)=>{"use strict";o0.exports=s0;function s0(n,e,t){n instanceof RegExp&&(n=r0(n,t)),e instanceof RegExp&&(e=r0(e,t));var r=i0(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 r0(n,e){var t=e.match(n);return t?t[0]:null}s0.range=i0;function i0(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 m0=w((MQ,p0)=>{var c0=a0();p0.exports=iq;var l0="\0SLASH"+Math.random()+"\0",u0="\0OPEN"+Math.random()+"\0",Hg="\0CLOSE"+Math.random()+"\0",d0="\0COMMA"+Math.random()+"\0",f0="\0PERIOD"+Math.random()+"\0";function Wg(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function rq(n){return n.split("\\\\").join(l0).split("\\{").join(u0).split("\\}").join(Hg).split("\\,").join(d0).split("\\.").join(f0)}function sq(n){return n.split(l0).join("\\").split(u0).join("{").split(Hg).join("}").split(d0).join(",").split(f0).join(".")}function h0(n){if(!n)return[""];var e=[],t=c0("{","}",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=h0(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function iq(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Ba(rq(n),!0).map(sq)):[]}function oq(n){return"{"+n+"}"}function aq(n){return/^-?0\d/.test(n)}function cq(n,e){return n<=e}function lq(n,e){return n>=e}function Ba(n,e){var t=[],r=c0("{","}",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+Hg+r.post,Ba(n)):[n];var f;if(u)f=r.body.split(/\.\./);else if(f=h0(r.body),f.length===1&&(f=Ba(f[0],!1).map(oq),f.length===1))return i.map(function(Oe){return r.pre+f[0]+Oe});var m;if(u){var T=Wg(f[0]),g=Wg(f[1]),S=Math.max(f[0].length,f[1].length),k=f.length==3?Math.abs(Wg(f[2])):1,v=cq,b=g<T;b&&(k*=-1,v=lq);var R=f.some(aq);m=[];for(var O=T;v(O,g);O+=k){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(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.regexpCode=ve.getEsmExportName=ve.getProperty=ve.safeStringify=ve.stringify=ve.strConcat=ve.addCodeArg=ve.str=ve._=ve.nil=ve._Code=ve.Name=ve.IDENTIFIER=ve._CodeOrName=void 0;var rc=class{};ve._CodeOrName=rc;ve.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Zs=class extends rc{constructor(e){if(super(),!ve.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}}};ve.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),{})}};ve._Code=Dn;ve.nil=new Dn("");function nR(n,...e){let t=[n[0]],r=0;for(;r<e.length;)uy(t,e[r]),t.push(n[++r]);return new Dn(t)}ve._=nR;var ly=new Dn("+");function rR(n,...e){let t=[sc(n[0])],r=0;for(;r<e.length;)t.push(ly),uy(t,e[r]),t.push(ly,sc(n[++r]));return yj(t),new Dn(t)}ve.str=rR;function uy(n,e){e instanceof Dn?n.push(...e._items):e instanceof Zs?n.push(e):n.push(Tj(e))}ve.addCodeArg=uy;function yj(n){let e=1;for(;e<n.length-1;){if(n[e]===ly){let t=bj(n[e-1],n[e+1]);if(t!==void 0){n.splice(e-1,3,t);continue}n[e++]="+"}e++}}function bj(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 vj(n,e){return e.emptyStr()?n:n.emptyStr()?e:rR`${n}${e}`}ve.strConcat=vj;function Tj(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:sc(Array.isArray(n)?n.join(","):n)}function _j(n){return new Dn(sc(n))}ve.stringify=_j;function sc(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ve.safeStringify=sc;function Sj(n){return typeof n=="string"&&ve.IDENTIFIER.test(n)?new Dn(`.${n}`):nR`[${n}]`}ve.getProperty=Sj;function wj(n){if(typeof n=="string"&&ve.IDENTIFIER.test(n))return new Dn(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}ve.getEsmExportName=wj;function kj(n){return new Dn(n.toString())}ve.regexpCode=kj});var hy=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(),dy=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 Ej=(0,on._)`\n`,fy=class extends hf{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ej: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 dy(l);c.set(l,ff.Completed)})}return i}};an.ValueScope=fy});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(),Jn=hy(),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=hy();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 $r=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},py=class extends $r{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Jn.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=Eo(this.rhs,e,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},mf=class extends $r{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=Eo(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return yf(e,this.rhs)}},my=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}},gy=class extends $r{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},yy=class extends $r{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},by=class extends $r{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vy=class extends $r{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=Eo(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},oc=class extends $r{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)||(Nj(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),{})}},Lr=class extends oc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Ty=class extends oc{},ko=class extends Lr{};ko.kind="else";var ei=class n extends Lr{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 ko(r):r}if(t)return e===!1?t instanceof n?t:t.nodes:this.nodes.length?this:new n(sR(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=Eo(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 Lr{};ti.kind="for";var _y=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=Eo(this.iteration,e,t),this}get names(){return ni(super.names,this.iteration.names)}},Sy=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?Jn.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=Eo(this.iterable,e,t),this}get names(){return ni(super.names,this.iterable.names)}},ac=class extends Lr{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 wy=class extends Lr{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 Lr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};lc.kind="catch";var uc=class extends Lr{render(e){return"finally"+super.render(e)}};uc.kind="finally";var ky=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
176
|
-
`:""},this._extScope=e,this._scope=new Jn.Scope({parent:e}),this._nodes=[new Ty]}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 py(e,i,r)),i}const(e,t,r){return this._def(Jn.varKinds.const,e,t,r)}let(e,t,r){return this._def(Jn.varKinds.let,e,t,r)}var(e,t,r){return this._def(Jn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new mf(e,t,r))}add(e,t){return this._leafNode(new my(e,le.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==ge.nil&&this._leafNode(new vy(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 ko)}endIf(){return this._endBlockNode(ei,ko)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _y(e),t)}forRange(e,t,r,s,i=this.opts.es5?Jn.varKinds.var:Jn.varKinds.let){let o=this._scope.toName(e);return this._for(new Sy(i,o,t,r),()=>s(o))}forOf(e,t,r,s=Jn.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?Jn.varKinds.var:Jn.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 gy(e))}break(e){return this._leafNode(new yy(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 wy;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 by(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=ky;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 Eo(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 Nj(n,e){for(let t in e)n[t]=(n[t]||0)-(e[t]||0)}function sR(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,ge._)`!${Ey(n)}`}le.not=sR;var Pj=iR(le.operators.AND);function Rj(...n){return n.reduce(Pj)}le.and=Rj;var Dj=iR(le.operators.OR);function Cj(...n){return n.reduce(Dj)}le.or=Cj;function iR(n){return(e,t)=>e===ge.nil?t:t===ge.nil?e:(0,ge._)`${Ey(e)} ${n} ${Ey(t)}`}function Ey(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 Le=ae(),Oj=ic();function Aj(n){let e={};for(let t of n)e[t]=!0;return e}ue.toHash=Aj;function Ij(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(cR(n,e),!lR(e,n.self.RULES.all))}ue.alwaysValidSchema=Ij;function cR(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]||fR(n,`unknown keyword: "${i}"`)}ue.checkUnknownRules=cR;function lR(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(e[t])return!0;return!1}ue.schemaHasRules=lR;function Mj(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=Mj;function $j({topSchemaRef:n,schemaPath:e},t,r,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Le._)`${t}`}return(0,Le._)`${n}${e}${(0,Le.getProperty)(r)}`}ue.schemaRefOrVal=$j;function Lj(n){return uR(decodeURIComponent(n))}ue.unescapeFragment=Lj;function xj(n){return encodeURIComponent(Py(n))}ue.escapeFragment=xj;function Py(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Py;function uR(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=uR;function qj(n,e){if(Array.isArray(n))for(let t of n)e(t);else e(n)}ue.eachItem=qj;function oR({mergeNames:n,mergeToName:e,mergeValues:t,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Le.Name?(i instanceof Le.Name?n(s,i,o):e(s,i,o),o):i instanceof Le.Name?(e(s,o,i),i):t(i,o);return a===Le.Name&&!(c instanceof Le.Name)?r(s,c):c}}ue.mergeEvaluated={props:oR({mergeNames:(n,e,t)=>n.if((0,Le._)`${t} !== true && ${e} !== undefined`,()=>{n.if((0,Le._)`${e} === true`,()=>n.assign(t,!0),()=>n.assign(t,(0,Le._)`${t} || {}`).code((0,Le._)`Object.assign(${t}, ${e})`))}),mergeToName:(n,e,t)=>n.if((0,Le._)`${t} !== true`,()=>{e===!0?n.assign(t,!0):(n.assign(t,(0,Le._)`${t} || {}`),Ry(n,t,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:dR}),items:oR({mergeNames:(n,e,t)=>n.if((0,Le._)`${t} !== true && ${e} !== undefined`,()=>n.assign(t,(0,Le._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(n,e,t)=>n.if((0,Le._)`${t} !== true`,()=>n.assign(t,e===!0?!0:(0,Le._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function dR(n,e){if(e===!0)return n.var("props",!0);let t=n.var("props",(0,Le._)`{}`);return e!==void 0&&Ry(n,t,e),t}ue.evaluatedPropsToName=dR;function Ry(n,e,t){Object.keys(t).forEach(r=>n.assign((0,Le._)`${e}${(0,Le.getProperty)(r)}`,!0))}ue.setEvaluated=Ry;var aR={};function jj(n,e){return n.scopeValue("func",{ref:e,code:aR[e.code]||(aR[e.code]=new Oj._Code(e.code))})}ue.useFunc=jj;var Ny;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(Ny||(ue.Type=Ny={}));function Fj(n,e,t){if(n instanceof Le.Name){let r=e===Ny.Num;return t?r?(0,Le._)`"[" + ${n} + "]"`:(0,Le._)`"['" + ${n} + "']"`:r?(0,Le._)`"/" + ${n}`:(0,Le._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Le.getProperty)(n).toString():"/"+Py(n)}ue.getErrorPath=Fj;function fR(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=fR});var Cn=w(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});var Ut=ae(),Bj={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")};Dy.default=Bj});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 Uj(n,e=Vt.keywordError,t,r){let{it:s}=n,{gen:i,compositeRule:o,allErrors:a}=s,c=mR(n,e,t);r??(o||a)?hR(i,c):pR(s,(0,be._)`[${c}]`)}Vt.reportError=Uj;function Vj(n,e=Vt.keywordError,t){let{it:r}=n,{gen:s,compositeRule:i,allErrors:o}=r,a=mR(n,e,t);hR(s,a),i||o||pR(r,Yt.default.vErrors)}Vt.reportExtraError=Vj;function Wj(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=Wj;function Hj({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=Hj;function hR(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 pR(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 mR(n,e,t){let{createErrors:r}=n.it;return r===!1?(0,be._)`{}`:Kj(n,e,t)}function Kj(n,e,t={}){let{gen:r,it:s}=n,i=[zj(s,t),Gj(n,t)];return Yj(n,e,i),r.object(...i)}function zj({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 Gj({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 Yj(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 yR=w(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.boolOrEmptySchema=No.topBoolOrEmptySchema=void 0;var Jj=dc(),Xj=ae(),Qj=Cn(),Zj={message:"boolean schema is false"};function eF(n){let{gen:e,schema:t,validateName:r}=n;t===!1?gR(n,!1):typeof t=="object"&&t.$async===!0?e.return(Qj.default.data):(e.assign((0,Xj._)`${r}.errors`,null),e.return(!0))}No.topBoolOrEmptySchema=eF;function tF(n,e){let{gen:t,schema:r}=n;r===!1?(t.var(e,!1),gR(n)):t.var(e,!0)}No.boolOrEmptySchema=tF;function gR(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,Jj.reportError)(s,Zj,void 0,e)}});var Cy=w(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getRules=Po.isJSONType=void 0;var nF=["string","number","integer","boolean","null","object","array"],rF=new Set(nF);function sF(n){return typeof n=="string"&&rF.has(n)}Po.isJSONType=sF;function iF(){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=iF});var Oy=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.shouldUseRule=Ts.shouldUseGroup=Ts.schemaHasRulesForType=void 0;function oF({schema:n,self:e},t){let r=e.RULES.types[t];return r&&r!==!0&&bR(n,r)}Ts.schemaHasRulesForType=oF;function bR(n,e){return e.rules.some(t=>vR(n,t))}Ts.shouldUseGroup=bR;function vR(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=vR});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 aF=Cy(),cF=Oy(),lF=dc(),ce=ae(),TR=he(),Ro;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(Ro||(Wt.DataType=Ro={}));function uF(n){let e=_R(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=uF;function _R(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(aF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Wt.getJSONTypes=_R;function dF(n,e){let{gen:t,data:r,opts:s}=n,i=fF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,cF.schemaHasRulesForType)(n,e[0]));if(o){let a=Iy(e,r,s.strictNumbers,Ro.Wrong);t.if(a,()=>{i.length?hF(n,e,i):My(n)})}return o}Wt.coerceAndCheckDataType=dF;var SR=new Set(["string","number","integer","boolean","null"]);function fF(n,e){return e?n.filter(t=>SR.has(t)||e==="array"&&t==="array"):[]}function hF(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(Iy(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,ce._)`${a} !== undefined`);for(let l of t)(SR.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),My(n),r.endIf(),r.if((0,ce._)`${a} !== undefined`,()=>{r.assign(s,a),pF(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":
|
|
178
|
-
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,ce._)`+${s}`);return;case"boolean":
|
|
179
|
-
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,ce._)`[${s}]`)}}}function pF({gen:n,parentData:e,parentDataProperty:t},r){n.if((0,ce._)`${e} !== undefined`,()=>n.assign((0,ce._)`${e}[${t}]`,r))}function Ay(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=Ay;function Iy(n,e,t,r){if(n.length===1)return Ay(n[0],e,t,r);let s,i=(0,TR.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,Ay(o,e,t,r));return s}Wt.checkDataTypes=Iy;var mF={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,ce._)`{type: ${n}}`:(0,ce._)`{type: ${e}}`};function My(n){let e=gF(n);(0,lF.reportError)(e,mF)}Wt.reportTypeError=My;function gF(n){let{gen:e,data:t,schema:r}=n,s=(0,TR.schemaRefOrVal)(n,r,"type");return{gen:e,keyword:"type",data:t,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:n}}});var kR=w(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.assignDefaults=void 0;var Do=ae(),yF=he();function bF(n,e){let{properties:t,items:r}=n.schema;if(e==="object"&&t)for(let s in t)wR(n,s,t[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>wR(n,i,s.default))}Tf.assignDefaults=bF;function wR(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,yF.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(),$y=he(),_s=Cn(),vF=he();function TF(n,e){let{gen:t,data:r,it:s}=n;t.if(xy(t,r,e,s.opts.ownProperties),()=>{n.setParams({missingProperty:(0,ze._)`${e}`},!0),n.error()})}Me.checkReportMissingProp=TF;function _F({gen:n,data:e,it:{opts:t}},r,s){return(0,ze.or)(...r.map(i=>(0,ze.and)(xy(n,e,i,t.ownProperties),(0,ze._)`${s} = ${i}`)))}Me.checkMissingProp=_F;function SF(n,e){n.setParams({missingProperty:e},!0),n.error()}Me.reportMissingProp=SF;function ER(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ze._)`Object.prototype.hasOwnProperty`})}Me.hasPropFunc=ER;function Ly(n,e,t){return(0,ze._)`${ER(n)}.call(${e}, ${t})`}Me.isOwnProperty=Ly;function wF(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} !== undefined`;return r?(0,ze._)`${s} && ${Ly(n,e,t)}`:s}Me.propertyInData=wF;function xy(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} === undefined`;return r?(0,ze.or)(s,(0,ze.not)(Ly(n,e,t))):s}Me.noPropertyInData=xy;function NR(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}Me.allSchemaProperties=NR;function kF(n,e){return NR(e).filter(t=>!(0,$y.alwaysValidSchema)(n,e[t]))}Me.schemaProperties=kF;function EF({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=EF;var NF=(0,ze._)`new RegExp`;function PF({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"?NF:(0,vF.useFunc)(n,s)}(${t}, ${r})`})}Me.usePattern=PF;function RF(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:$y.Type.Num},i),e.if((0,ze.not)(i),a)})}}Me.validateArray=RF;function DF(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,$y.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=DF});var DR=w(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.validateKeywordUsage=gr.validSchemaType=gr.funcKeywordCode=gr.macroKeywordCode=void 0;var Jt=ae(),si=Cn(),CF=On(),OF=dc();function AF(n,e){let{gen:t,keyword:r,schema:s,parentSchema:i,it:o}=n,a=e.macro.call(o.self,s,i,o),c=RR(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))}gr.macroKeywordCode=AF;function IF(n,e){var t;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=n;$F(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=RR(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&&PR(n),S(()=>n.error());else{let k=e.async?m():T();e.modifying&&PR(n),S(()=>MF(n,k))}}function m(){let k=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(k,(0,Jt._)`${v}.errors`),()=>r.throw(v))),k}function T(){let k=(0,Jt._)`${u}.errors`;return r.assign(k,null),g(Jt.nil),k}function g(k=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._)`${k}${(0,CF.callValidateCode)(n,u,v,b)}`,e.modifying)}function S(k){var v;r.if((0,Jt.not)((v=e.valid)!==null&&v!==void 0?v:d),k)}}gr.funcKeywordCode=IF;function PR(n){let{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,Jt._)`${r.parentData}[${r.parentDataProperty}]`))}function MF(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,OF.extendErrors)(n)},()=>n.error())}function $F({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function RR(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 LF(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")}gr.validSchemaType=LF;function xF({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)}}gr.validateKeywordUsage=xF});var OR=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.extendSubschemaMode=Ss.extendSubschemaData=Ss.getSubschema=void 0;var yr=ae(),CR=he();function qF(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,yr._)`${n.schemaPath}${(0,yr.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,yr._)`${n.schemaPath}${(0,yr.getProperty)(e)}${(0,yr.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,CR.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=qF;function jF(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,yr._)`${e.data}${(0,yr.getProperty)(t)}`,!0);c(f),n.errorPath=(0,yr.str)`${l}${(0,CR.getErrorPath)(t,r,d.jsPropertySyntax)}`,n.parentDataProperty=(0,yr._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(s!==void 0){let l=s instanceof yr.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=jF;function FF(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=FF});var qy=w((z8,AR)=>{"use strict";AR.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 MR=w((G8,IR)=>{"use strict";var ws=IR.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+"/"+BF(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 BF(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 UF=he(),VF=qy(),WF=MR(),HF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function KF(n,e=!0){return typeof n=="boolean"?!0:e===!0?!jy(n):e?$R(n)<=e:!1}cn.inlineRef=KF;var zF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jy(n){for(let e in n){if(zF.has(e))return!0;let t=n[e];if(Array.isArray(t)&&t.some(jy)||typeof t=="object"&&jy(t))return!0}return!1}function $R(n){let e=0;for(let t in n){if(t==="$ref")return 1/0;if(e++,!HF.has(t)&&(typeof n[t]=="object"&&(0,UF.eachItem)(n[t],r=>e+=$R(r)),e===1/0))return 1/0}return e}function LR(n,e="",t){t!==!1&&(e=Co(e));let r=n.parse(e);return xR(n,r)}cn.getFullPath=LR;function xR(n,e){return n.serialize(e).split("#")[0]+"#"}cn._getFullPath=xR;var GF=/#\/?$/;function Co(n){return n?n.replace(GF,""):""}cn.normalizeId=Co;function YF(n,e,t){return t=Co(t),n.resolve(e,t)}cn.resolveUrl=YF;var JF=/^[a-z_][-a-z0-9._]*$/i;function XF(n,e){if(typeof n=="boolean")return{};let{schemaId:t,uriResolver:r}=this.opts,s=Co(n[t]||e),i={"":s},o=LR(r,s,!1),a={},c=new Set;return WF(n,{allKeys:!0},(d,f,m,T)=>{if(T===void 0)return;let g=o+f,S=i[T];typeof d[t]=="string"&&(S=k.call(this,d[t])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),i[f]=S;function k(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(!JF.test(b))throw new Error(`invalid anchor "${b}"`);k.call(this,`#${b}`)}}}),a;function l(d,f,m){if(f!==void 0&&!VF(d,f))throw u(m)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}cn.getSchemaRefs=XF});var gc=w(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.getData=ks.KeywordCxt=ks.validateFunctionCode=void 0;var UR=yR(),qR=fc(),By=Oy(),Sf=fc(),QF=kR(),mc=DR(),Fy=OR(),K=ae(),te=Cn(),ZF=hc(),xr=he(),pc=dc();function eB(n){if(HR(n)&&(KR(n),WR(n))){rB(n);return}VR(n,()=>(0,UR.topBoolOrEmptySchema)(n))}ks.validateFunctionCode=eB;function VR({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"; ${jR(t,s)}`),nB(n,s),n.code(i)}):n.func(e,(0,K._)`${te.default.data}, ${tB(s)}`,r.$async,()=>n.code(jR(t,s)).code(i))}function tB(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 nB(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 rB(n){let{schema:e,opts:t,gen:r}=n;VR(n,()=>{t.$comment&&e.$comment&&GR(n),cB(n),r.let(te.default.vErrors,null),r.let(te.default.errors,0),t.unevaluated&&sB(n),zR(n),dB(n)})}function sB(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 jR(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 iB(n,e){if(HR(n)&&(KR(n),WR(n))){oB(n,e);return}(0,UR.boolOrEmptySchema)(n,e)}function WR({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 HR(n){return typeof n.schema!="boolean"}function oB(n,e){let{schema:t,gen:r,opts:s}=n;s.$comment&&t.$comment&&GR(n),lB(n),uB(n);let i=r.const("_errs",te.default.errors);zR(n,i),r.var(e,(0,K._)`${i} === ${te.default.errors}`)}function KR(n){(0,xr.checkUnknownRules)(n),aB(n)}function zR(n,e){if(n.opts.jtd)return FR(n,[],!1,e);let t=(0,qR.getSchemaTypes)(n.schema),r=(0,qR.coerceAndCheckDataType)(n,t);FR(n,t,!r,e)}function aB(n){let{schema:e,errSchemaPath:t,opts:r,self:s}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,xr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function cB(n){let{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,xr.checkStrictMode)(n,"default is ignored in the schema root")}function lB(n){let e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,ZF.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function uB(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function GR({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 dB(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&&fB(n),e.return((0,K._)`${te.default.errors} === 0`))}function fB({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 FR(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,xr.schemaHasRulesButRef)(i,u))){s.block(()=>JR(n,"$ref",u.all.$ref.definition));return}c.jtd||hB(n,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,By.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Sf.checkDataType)(f.type,o,c.strictNumbers)),BR(n,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Sf.reportTypeError)(n)),s.endIf()):BR(n,f),a||s.if((0,K._)`${te.default.errors} === ${r||0}`))}}function BR(n,e){let{gen:t,schema:r,opts:{useDefaults:s}}=n;s&&(0,QF.assignDefaults)(n,e.type),t.block(()=>{for(let i of e.rules)(0,By.shouldUseRule)(r,i)&&JR(n,i.keyword,i.definition,e.type)})}function hB(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(pB(n,e),n.opts.allowUnionTypes||mB(n,e),gB(n,n.dataTypes))}function pB(n,e){if(e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{YR(n.dataTypes,t)||Uy(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),bB(n,e)}}function mB(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Uy(n,"use allowUnionTypes to allow union type keyword")}function gB(n,e){let t=n.self.RULES.all;for(let r in t){let s=t[r];if(typeof s=="object"&&(0,By.shouldUseRule)(n.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>yB(e,o))&&Uy(n,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function yB(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function YR(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function bB(n,e){let t=[];for(let r of n.dataTypes)YR(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function Uy(n,e){let t=n.schemaEnv.baseId+n.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,xr.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,xr.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",XR(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,Fy.getSubschema)(this.it,e);(0,Fy.extendSubschemaData)(r,this.it,e),(0,Fy.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return iB(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=xr.mergeEvaluated.props(s,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=xr.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}};ks.KeywordCxt=wf;function JR(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 vB=/^\/(?:[^~]|~0|~1)*$/,TB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function XR(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let s,i;if(n==="")return te.default.rootData;if(n[0]==="/"){if(!vB.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);s=n,i=te.default.rootData}else{let l=TB.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,xr.unescapeJsonPointer)(l))}`,o=(0,K._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ks.getData=XR});var kf=w(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});var Vy=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Wy.default=Vy});var yc=w(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var Hy=hc(),Ky=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Hy.resolveUrl)(e,t,r),this.missingSchema=(0,Hy.normalizeId)((0,Hy.getFullPath)(e,this.missingRef))}};zy.default=Ky});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 Xn=ae(),_B=kf(),ii=Cn(),Qn=hc(),QR=he(),SB=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,Qn.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 Yy(n){let e=ZR.call(this,n);if(e)return e;let t=(0,Qn.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Xn.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;n.$async&&(a=o.scopeValue("Error",{ref:_B.default,code:(0,Xn._)`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:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Xn.stringify)(n.schema)}:{ref:n.schema}),validateName:c,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Xn.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(n),(0,SB.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 Xn.Name?void 0:T,items:g instanceof Xn.Name?void 0:g,dynamicProps:T instanceof Xn.Name,dynamicItems:g instanceof Xn.Name},m.source&&(m.source.evaluated=(0,Xn.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=Yy;function wB(n,e,t){var r;t=(0,Qn.resolveUrl)(this.opts.uriResolver,e,t);let s=n.refs[t];if(s)return s;let i=NB.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]=kB.call(this,i)}An.resolveRef=wB;function kB(n){return(0,Qn.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Yy.call(this,n)}function ZR(n){for(let e of this._compilations)if(EB(e,n))return e}An.getCompilingSchema=ZR;function EB(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function NB(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Ef.call(this,n,e)}function Ef(n,e){let t=this.opts.uriResolver.parse(e),r=(0,Qn._getFullPath)(this.opts.uriResolver,t),s=(0,Qn.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===s)return Gy.call(this,t,n);let i=(0,Qn.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Ef.call(this,n,o);return typeof a?.schema!="object"?void 0:Gy.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Yy.call(this,o),i===(0,Qn.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Qn.resolveUrl)(this.opts.uriResolver,s,l)),new Oo({schema:a,schemaId:c,root:n,baseId:s})}return Gy.call(this,t,o)}}An.resolveSchema=Ef;var PB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gy(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,QR.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!PB.has(a)&&l&&(e=(0,Qn.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,QR.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Qn.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Ef.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 eD=w((eZ,RB)=>{RB.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 nD=w((tZ,tD)=>{"use strict";var DB={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};tD.exports={HEX:DB}});var uD=w((nZ,lD)=>{"use strict";var{HEX:CB}=nD(),OB=/^(?:(?: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 oD(n){if(cD(n,".")<3)return{host:n,isIPV4:!1};let e=n.match(OB)||[],[t]=e;return t?{host:IB(t,"."),isIPV4:!0}:{host:n,isIPV4:!1}}function Jy(n,e=!1){let t="",r=!0;for(let s of n){if(CB[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(t+=s)}return e&&t.length===0&&(t="0"),t}function AB(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=Jy(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(Jy(s))),t.address=r.join(""),t}function aD(n){if(cD(n,":")<2)return{host:n,isIPV6:!1};let e=AB(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 IB(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 cD(n,e){let t=0;for(let r=0;r<n.length;r++)n[r]===e&&t++;return t}var rD=/^\.\.?\//u,sD=/^\/\.(?:\/|$)/u,iD=/^\/\.\.(?:\/|$)/u,MB=/^\/?(?:.|\n)*?(?=\/|$)/u;function $B(n){let e=[];for(;n.length;)if(n.match(rD))n=n.replace(rD,"");else if(n.match(sD))n=n.replace(sD,"/");else if(n.match(iD))n=n.replace(iD,"/"),e.pop();else if(n==="."||n==="..")n="";else{let t=n.match(MB);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 LB(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 xB(n){let e=[];if(n.userinfo!==void 0&&(e.push(n.userinfo),e.push("@")),n.host!==void 0){let t=unescape(n.host),r=oD(t);if(r.isIPV4)t=r.host;else{let s=aD(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}lD.exports={recomposeAuthority:xB,normalizeComponentEncoding:LB,removeDotSegments:$B,normalizeIPv4:oD,normalizeIPv6:aD,stringArrayToHexStripped:Jy}});var gD=w((rZ,mD)=>{"use strict";var qB=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,jB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function dD(n){return typeof n.secure=="boolean"?n.secure:String(n.scheme).toLowerCase()==="wss"}function fD(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function hD(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 FB(n){return n.secure=dD(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function BB(n){if((n.port===(dD(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 UB(n,e){if(!n.path)return n.error="URN can not be parsed",n;let t=n.path.match(jB);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=Xy[s];n.path=void 0,i&&(n=i.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n}function VB(n,e){let t=e.scheme||n.scheme||"urn",r=n.nid.toLowerCase(),s=`${t}:${e.nid||r}`,i=Xy[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 WB(n,e){let t=n;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!qB.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function HB(n){let e=n;return e.nss=(n.uuid||"").toLowerCase(),e}var pD={scheme:"http",domainHost:!0,parse:fD,serialize:hD},KB={scheme:"https",domainHost:pD.domainHost,parse:fD,serialize:hD},Nf={scheme:"ws",domainHost:!0,parse:FB,serialize:BB},zB={scheme:"wss",domainHost:Nf.domainHost,parse:Nf.parse,serialize:Nf.serialize},GB={scheme:"urn",parse:UB,serialize:VB,skipNormalize:!0},YB={scheme:"urn:uuid",parse:WB,serialize:HB,skipNormalize:!0},Xy={http:pD,https:KB,ws:Nf,wss:zB,urn:GB,"urn:uuid":YB};mD.exports=Xy});var bD=w((sZ,Rf)=>{"use strict";var{normalizeIPv6:JB,normalizeIPv4:XB,removeDotSegments:vc,recomposeAuthority:QB,normalizeComponentEncoding:Pf}=uD(),Qy=gD();function ZB(n,e){return typeof n=="string"?n=br(qr(n,e),e):typeof n=="object"&&(n=qr(br(n,e),e)),n}function eU(n,e,t){let r=Object.assign({scheme:"null"},t),s=yD(qr(n,r),qr(e,r),r,!0);return br(s,{...r,skipEscape:!0})}function yD(n,e,t,r){let s={};return r||(n=qr(br(n,t),t),e=qr(br(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 tU(n,e,t){return typeof n=="string"?(n=unescape(n),n=br(Pf(qr(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=br(Pf(n,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=br(Pf(qr(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=br(Pf(e,!0),{...t,skipEscape:!0})),n.toLowerCase()===e.toLowerCase()}function br(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=Qy[(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=QB(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 nU=Array.from({length:127},(n,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function rU(n){let e=0;for(let t=0,r=n.length;t<r;++t)if(e=n.charCodeAt(t),e>126||nU[e])return!0;return!1}var sU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function qr(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(sU);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=XB(r.host);if(c.isIPV4===!1){let l=JB(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=Qy[(t.scheme||r.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&rU(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 Zy={SCHEMES:Qy,normalize:ZB,resolve:eU,resolveComponents:yD,equal:tU,serialize:br,parse:qr};Rf.exports=Zy;Rf.exports.default=Zy;Rf.exports.fastUri=Zy});var TD=w(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var vD=bD();vD.code='require("ajv/dist/runtime/uri").default';eb.default=vD});var RD=w(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.CodeGen=Mt.Name=Mt.nil=Mt.stringify=Mt.str=Mt._=Mt.KeywordCxt=void 0;var iU=gc();Object.defineProperty(Mt,"KeywordCxt",{enumerable:!0,get:function(){return iU.KeywordCxt}});var Ao=ae();Object.defineProperty(Mt,"_",{enumerable:!0,get:function(){return Ao._}});Object.defineProperty(Mt,"str",{enumerable:!0,get:function(){return Ao.str}});Object.defineProperty(Mt,"stringify",{enumerable:!0,get:function(){return Ao.stringify}});Object.defineProperty(Mt,"nil",{enumerable:!0,get:function(){return Ao.nil}});Object.defineProperty(Mt,"Name",{enumerable:!0,get:function(){return Ao.Name}});Object.defineProperty(Mt,"CodeGen",{enumerable:!0,get:function(){return Ao.CodeGen}});var oU=kf(),ED=yc(),aU=Cy(),Tc=bc(),cU=ae(),_c=hc(),Df=fc(),nb=he(),_D=eD(),lU=TD(),ND=(n,e)=>new RegExp(n,e);ND.code="new RegExp";var uU=["removeAdditional","useDefaults","coerceTypes"],dU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),fU={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."},hU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},SD=200;function pU(n){var e,t,r,s,i,o,a,c,l,u,d,f,m,T,g,S,k,v,b,R,O,L,V,j,re;let Oe=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:ND,jr=(s=n.uriResolver)!==null&&s!==void 0?s:lU.default;return{strictSchema:(o=(i=n.strictSchema)!==null&&i!==void 0?i:Oe)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=n.strictNumbers)!==null&&a!==void 0?a:Oe)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=n.strictTypes)!==null&&l!==void 0?l:Oe)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=n.strictTuples)!==null&&d!==void 0?d:Oe)!==null&&f!==void 0?f:"log",strictRequired:(T=(m=n.strictRequired)!==null&&m!==void 0?m:Oe)!==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:SD,loopEnum:(S=n.loopEnum)!==null&&S!==void 0?S:SD,meta:(k=n.meta)!==null&&k!==void 0?k:!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:jr}}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,...pU(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new cU.ValueScope({scope:{},prefixes:dU,es5:t,lines:r}),this.logger=TU(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,aU.getRules)(),wD.call(this,fU,e,"NOT SUPPORTED"),wD.call(this,hU,e,"DEPRECATED","warn"),this._metaOpts=bU.call(this),e.formats&&gU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&yU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),mU.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=_D;r==="id"&&(s={..._D},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 ED.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=kD.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=kD.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(SU.call(this,r,t),!t)return(0,nb.eachItem)(r,i=>tb.call(this,i)),this;kU.call(this,t);let s={...t,type:(0,Df.getJSONTypes)(t.type),schemaType:(0,Df.getJSONTypes)(t.schemaType)};return(0,nb.eachItem)(r,s.type.length===0?i=>tb.call(this,i,s):i=>s.type.forEach(o=>tb.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]=PD(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=oU.default;Sc.MissingRefError=ED.default;Mt.default=Sc;function wD(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 kD(n){return n=(0,_c.normalizeId)(n),this.schemas[n]||this.refs[n]}function mU(){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 gU(){for(let n in this.opts.formats){let e=this.opts.formats[n];e&&this.addFormat(n,e)}}function yU(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 bU(){let n={...this.opts};for(let e of uU)delete n[e];return n}var vU={log(){},warn(){},error(){}};function TU(n){if(n===!1)return vU;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 _U=/^[a-z_$][a-z0-9_$:-]*$/i;function SU(n,e){let{RULES:t}=this;if((0,nb.eachItem)(n,r=>{if(t.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!_U.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 tb(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?wU.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 wU(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 kU(n){let{metaSchema:e}=n;e!==void 0&&(n.$data&&this.opts.$data&&(e=PD(e)),n.validateSchema=this.compile(e,!0))}var EU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function PD(n){return{anyOf:[n,EU]}}});var DD=w(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var NU={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rb.default=NU});var Af=w(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.callRef=oi.getValidate=void 0;var PU=yc(),CD=On(),ln=ae(),Io=Cn(),OD=bc(),Cf=he(),RU={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=OD.resolveRef.call(c,l,s,t);if(u===void 0)throw new PU.default(r.opts.uriResolver,s,t);if(u instanceof OD.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=AD(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"),k=n.subschema({schema:T,dataTypes:[],schemaPath:ln.nil,topSchemaRef:g,errSchemaPath:t},S);n.mergeEvaluated(k),n.ok(S)}}};function AD(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=AD;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,CD.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,CD.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 k=s.var("props",(0,ln._)`${T}.evaluated.props`);i.props=Cf.mergeEvaluated.props(s,k,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 k=s.var("items",(0,ln._)`${T}.evaluated.items`);i.items=Cf.mergeEvaluated.items(s,k,i.items,ln.Name)}}}oi.callRef=Of;oi.default=RU});var ID=w(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var DU=DD(),CU=Af(),OU=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DU.default,CU.default];sb.default=OU});var MD=w(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var If=ae(),Es=If.operators,Mf={maximum:{okStr:"<=",ok:Es.LTE,fail:Es.GT},minimum:{okStr:">=",ok:Es.GTE,fail:Es.LT},exclusiveMaximum:{okStr:"<",ok:Es.LT,fail:Es.GTE},exclusiveMinimum:{okStr:">",ok:Es.GT,fail:Es.LTE}},AU={message:({keyword:n,schemaCode:e})=>(0,If.str)`must be ${Mf[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,If._)`{comparison: ${Mf[n].okStr}, limit: ${e}}`},IU={keyword:Object.keys(Mf),type:"number",schemaType:"number",$data:!0,error:AU,code(n){let{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,If._)`${t} ${Mf[e].fail} ${r} || isNaN(${t})`)}};ib.default=IU});var $D=w(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var wc=ae(),MU={message:({schemaCode:n})=>(0,wc.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,wc._)`{multipleOf: ${n}}`},$U={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:MU,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}))`)}};ob.default=$U});var xD=w(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});function LD(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}ab.default=LD;LD.code='require("ajv/dist/runtime/ucs2length").default'});var qD=w(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var ai=ae(),LU=he(),xU=xD(),qU={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}}`},jU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qU,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,LU.useFunc)(n.gen,xU.default)}(${t})`;n.fail$data((0,ai._)`${o} ${i} ${r}`)}};cb.default=jU});var jD=w(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var FU=On(),$f=ae(),BU={message:({schemaCode:n})=>(0,$f.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,$f._)`{pattern: ${n}}`},UU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:BU,code(n){let{data:e,$data:t,schema:r,schemaCode:s,it:i}=n,o=i.opts.unicodeRegExp?"u":"",a=t?(0,$f._)`(new RegExp(${s}, ${o}))`:(0,FU.usePattern)(n,r);n.fail$data((0,$f._)`!${a}.test(${e})`)}};lb.default=UU});var FD=w(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var kc=ae(),VU={message({keyword:n,schemaCode:e}){let t=n==="maxProperties"?"more":"fewer";return(0,kc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,kc._)`{limit: ${n}}`},WU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:VU,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxProperties"?kc.operators.GT:kc.operators.LT;n.fail$data((0,kc._)`Object.keys(${t}).length ${s} ${r}`)}};ub.default=WU});var BD=w(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var Ec=On(),Nc=ae(),HU=he(),KU={message:({params:{missingProperty:n}})=>(0,Nc.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,Nc._)`{missingProperty: ${n}}`},zU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:KU,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,k=`required property "${g}" is not defined at "${S}" (strictRequired)`;(0,HU.checkStrictMode)(o,k,o.opts.strictRequired)}}function l(){if(c||i)n.block$data(Nc.nil,d);else for(let m of t)(0,Ec.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,Ec.checkMissingProp)(n,t,m)),(0,Ec.reportMissingProp)(n,m),e.else()}function d(){e.forOf("prop",r,m=>{n.setParams({missingProperty:m}),e.if((0,Ec.noPropertyInData)(e,s,m,a.ownProperties),()=>n.error())})}function f(m,T){n.setParams({missingProperty:m}),e.forOf(m,r,()=>{e.assign(T,(0,Ec.propertyInData)(e,s,m,a.ownProperties)),e.if((0,Nc.not)(T),()=>{n.error(),e.break()})},Nc.nil)}}};db.default=zU});var UD=w(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var Pc=ae(),GU={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}}`},YU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GU,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}`)}};fb.default=YU});var Lf=w(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var VD=qy();VD.code='require("ajv/dist/runtime/equal").default';hb.default=VD});var WD=w(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=fc(),$t=ae(),JU=he(),XU=Lf(),QU={message:({params:{i:n,j:e}})=>(0,$t.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,$t._)`{i: ${n}, j: ${e}}`},ZU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:QU,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,pb.getSchemaTypes)(i.items):[];n.block$data(c,u,(0,$t._)`${o} === false`),n.ok(c);function u(){let T=e.let("i",(0,$t._)`${t}.length`),g=e.let("j");n.setParams({i:T,j:g}),e.assign(c,!0),e.if((0,$t._)`${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"),k=(0,pb.checkDataTypes)(l,S,a.opts.strictNumbers,pb.DataType.Wrong),v=e.const("indices",(0,$t._)`{}`);e.for((0,$t._)`;${T}--;`,()=>{e.let(S,(0,$t._)`${t}[${T}]`),e.if(k,(0,$t._)`continue`),l.length>1&&e.if((0,$t._)`typeof ${S} == "string"`,(0,$t._)`${S} += "_"`),e.if((0,$t._)`typeof ${v}[${S}] == "number"`,()=>{e.assign(g,(0,$t._)`${v}[${S}]`),n.error(),e.assign(c,!1).break()}).code((0,$t._)`${v}[${S}] = ${T}`)})}function m(T,g){let S=(0,JU.useFunc)(e,XU.default),k=e.name("outer");e.label(k).for((0,$t._)`;${T}--;`,()=>e.for((0,$t._)`${g} = ${T}; ${g}--;`,()=>e.if((0,$t._)`${S}(${t}[${T}], ${t}[${g}])`,()=>{n.error(),e.assign(c,!1).break(k)})))}}};mb.default=ZU});var HD=w(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var gb=ae(),eV=he(),tV=Lf(),nV={message:"must be equal to constant",params:({schemaCode:n})=>(0,gb._)`{allowedValue: ${n}}`},rV={keyword:"const",$data:!0,error:nV,code(n){let{gen:e,data:t,$data:r,schemaCode:s,schema:i}=n;r||i&&typeof i=="object"?n.fail$data((0,gb._)`!${(0,eV.useFunc)(e,tV.default)}(${t}, ${s})`):n.fail((0,gb._)`${i} !== ${t}`)}};yb.default=rV});var KD=w(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var Rc=ae(),sV=he(),iV=Lf(),oV={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,Rc._)`{allowedValues: ${n}}`},aV={keyword:"enum",schemaType:"array",$data:!0,error:oV,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,sV.useFunc)(e,iV.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}`}}};bb.default=aV});var zD=w(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var cV=MD(),lV=$D(),uV=qD(),dV=jD(),fV=FD(),hV=BD(),pV=UD(),mV=WD(),gV=HD(),yV=KD(),bV=[cV.default,lV.default,uV.default,dV.default,fV.default,hV.default,pV.default,mV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gV.default,yV.default];vb.default=bV});var _b=w(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.validateAdditionalItems=void 0;var ci=ae(),Tb=he(),vV={message:({params:{len:n}})=>(0,ci.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,ci._)`{limit: ${n}}`},TV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vV,code(n){let{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,Tb.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}GD(n,r)}};function GD(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,Tb.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:Tb.Type.Num},l),o.allErrors||t.if((0,ci.not)(l),()=>t.break())})}}Dc.validateAdditionalItems=GD;Dc.default=TV});var Sb=w(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.validateTuple=void 0;var YD=ae(),xf=he(),_V=On(),SV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){let{schema:e,it:t}=n;if(Array.isArray(e))return JD(n,"additionalItems",e);t.items=!0,!(0,xf.alwaysValidSchema)(t,e)&&n.ok((0,_V.validateArray)(n))}};function JD(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=xf.mergeEvaluated.items(r,t.length,a.items));let c=r.name("valid"),l=r.const("len",(0,YD._)`${i}.length`);t.forEach((d,f)=>{(0,xf.alwaysValidSchema)(a,d)||(r.if((0,YD._)`${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,xf.checkStrictMode)(a,S,f.strictTuples)}}}Cc.validateTuple=JD;Cc.default=SV});var XD=w(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var wV=Sb(),kV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,wV.validateTuple)(n,"items")};wb.default=kV});var ZD=w(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var QD=ae(),EV=he(),NV=On(),PV=_b(),RV={message:({params:{len:n}})=>(0,QD.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,QD._)`{limit: ${n}}`},DV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RV,code(n){let{schema:e,parentSchema:t,it:r}=n,{prefixItems:s}=t;r.items=!0,!(0,EV.alwaysValidSchema)(r,e)&&(s?(0,PV.validateAdditionalItems)(n,s):n.ok((0,NV.validateArray)(n)))}};kb.default=DV});var eC=w(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var In=ae(),qf=he(),CV={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}}`},OV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:CV,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,qf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,qf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,qf.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,k=>{n.subschema({keyword:"contains",dataProp:k,dataPropType:qf.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)))}}};Eb.default=OV});var jf=w(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.validateSchemaDeps=vr.validatePropertyDeps=vr.error=void 0;var Nb=ae(),AV=he(),Oc=On();vr.error={message:({params:{property:n,depsCount:e,deps:t}})=>{let r=e===1?"property":"properties";return(0,Nb.str)`must have ${r} ${t} when property ${n} is present`},params:({params:{property:n,depsCount:e,deps:t,missingProperty:r}})=>(0,Nb._)`{property: ${n},
|
|
180
|
-
missingProperty: ${
|
|
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=tf(e),n=vo(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tf(e),n=vo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};E0.Parser=ey});var R0=E(Qa=>{"use strict";var w0=Bg(),yq=Va(),Xa=za(),bq=jm(),vq=ye(),Tq=Zg(),k0=ty();function N0(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new Tq.LineCounter||null,prettyErrors:e}}function _q(r,e={}){let{lineCounter:t,prettyErrors:n}=N0(e),s=new k0.Parser(t?.addNewLine),i=new w0.Composer(e),o=Array.from(i.compose(s.parse(r)));if(n&&t)for(let a of o)a.errors.forEach(Xa.prettifyError(r,t)),a.warnings.forEach(Xa.prettifyError(r,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function P0(r,e={}){let{lineCounter:t,prettyErrors:n}=N0(e),s=new k0.Parser(t?.addNewLine),i=new w0.Composer(e),o=null;for(let a of i.compose(s.parse(r),!0,r.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Xa.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Xa.prettifyError(r,t)),o.warnings.forEach(Xa.prettifyError(r,t))),o}function Sq(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=P0(r,t);if(!s)return null;if(s.warnings.forEach(i=>bq.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:n},t))}function Eq(r,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=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(r===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return vq.isDocument(r)&&!n?r.toString(t):new yq.Document(r,n,t).toString(t)}Qa.parse=Sq;Qa.parseAllDocuments=_q;Qa.parseDocument=P0;Qa.stringify=Eq});var ny=E(Ae=>{"use strict";var wq=Bg(),kq=Va(),Nq=_g(),ry=za(),Pq=Pa(),bs=ye(),Rq=ps(),Dq=gt(),Cq=gs(),Oq=ys(),Aq=Zd(),Iq=Xg(),Mq=Zg(),$q=ty(),rf=R0(),D0=Ea();Ae.Composer=wq.Composer;Ae.Document=kq.Document;Ae.Schema=Nq.Schema;Ae.YAMLError=ry.YAMLError;Ae.YAMLParseError=ry.YAMLParseError;Ae.YAMLWarning=ry.YAMLWarning;Ae.Alias=Pq.Alias;Ae.isAlias=bs.isAlias;Ae.isCollection=bs.isCollection;Ae.isDocument=bs.isDocument;Ae.isMap=bs.isMap;Ae.isNode=bs.isNode;Ae.isPair=bs.isPair;Ae.isScalar=bs.isScalar;Ae.isSeq=bs.isSeq;Ae.Pair=Rq.Pair;Ae.Scalar=Dq.Scalar;Ae.YAMLMap=Cq.YAMLMap;Ae.YAMLSeq=Oq.YAMLSeq;Ae.CST=Aq;Ae.Lexer=Iq.Lexer;Ae.LineCounter=Mq.LineCounter;Ae.Parser=$q.Parser;Ae.parse=rf.parse;Ae.parseAllDocuments=rf.parseAllDocuments;Ae.parseDocument=rf.parseDocument;Ae.stringify=rf.stringify;Ae.visit=D0.visit;Ae.visitAsync=D0.visitAsync});var M0=E((OZ,I0)=>{"use strict";I0.exports=O0;function O0(r,e,t){r instanceof RegExp&&(r=C0(r,t)),e instanceof RegExp&&(e=C0(e,t));var n=A0(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}function C0(r,e){var t=e.match(r);return t?t[0]:null}O0.range=A0;function A0(r,e,t){var n,s,i,o,a,c=t.indexOf(r),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(r===e)return[c,l];for(n=[],i=t.length;u>=0&&!a;)u==c?(n.push(u),c=t.indexOf(r,u+1)):n.length==1?a=[n.pop(),l]:(s=n.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;n.length&&(a=[i,o])}return a}});var U0=E((AZ,B0)=>{var $0=M0();B0.exports=qq;var L0="\0SLASH"+Math.random()+"\0",x0="\0OPEN"+Math.random()+"\0",iy="\0CLOSE"+Math.random()+"\0",q0="\0COMMA"+Math.random()+"\0",j0="\0PERIOD"+Math.random()+"\0";function sy(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Lq(r){return r.split("\\\\").join(L0).split("\\{").join(x0).split("\\}").join(iy).split("\\,").join(q0).split("\\.").join(j0)}function xq(r){return r.split(L0).join("\\").split(x0).join("{").split(iy).join("}").split(q0).join(",").split(j0).join(".")}function F0(r){if(!r)return[""];var e=[],t=$0("{","}",r);if(!t)return r.split(",");var n=t.pre,s=t.body,i=t.post,o=n.split(",");o[o.length-1]+="{"+s+"}";var a=F0(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function qq(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Za(Lq(r),!0).map(xq)):[]}function jq(r){return"{"+r+"}"}function Fq(r){return/^-?0\d/.test(r)}function Bq(r,e){return r<=e}function Uq(r,e){return r>=e}function Za(r,e){var t=[],n=$0("{","}",r);if(!n)return[r];var s=n.pre,i=n.post.length?Za(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<i.length;o++){var a=s+"{"+n.body+"}"+i[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=c||l,d=n.body.indexOf(",")>=0;if(!u&&!d)return n.post.match(/,.*\}/)?(r=n.pre+"{"+n.body+iy+n.post,Za(r)):[r];var f;if(u)f=n.body.split(/\.\./);else if(f=F0(n.body),f.length===1&&(f=Za(f[0],!1).map(jq),f.length===1))return i.map(function(Me){return n.pre+f[0]+Me});var m;if(u){var T=sy(f[0]),g=sy(f[1]),S=Math.max(f[0].length,f[1].length),w=f.length==3?Math.abs(sy(f[2])):1,v=Bq,b=g<T;b&&(w*=-1,v=Uq);var R=f.some(Fq);m=[];for(var A=T;v(A,g);A+=w){var L;if(l)L=String.fromCharCode(A),L==="\\"&&(L="");else if(L=String(A),R){var W=S-L.length;if(W>0){var j=new Array(W+1).join("0");A<0?L="-"+j+L.slice(1):L=j+L}}m.push(L)}}else{m=[];for(var se=0;se<f.length;se++)m.push.apply(m,Za(f[se],!1))}for(var se=0;se<m.length;se++)for(var o=0;o<i.length;o++){var a=s+m[se]+i[o];(!e||u||a)&&t.push(a)}}return t}});var yc=E(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 mc=class{};Te._CodeOrName=mc;Te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var si=class extends mc{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=si;var Ir=class extends mc{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,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof si&&(t[n.str]=(t[n.str]||0)+1),t),{})}};Te._Code=Ir;Te.nil=new Ir("");function DR(r,...e){let t=[r[0]],n=0;for(;n<e.length;)wy(t,e[n]),t.push(r[++n]);return new Ir(t)}Te._=DR;var Ey=new Ir("+");function CR(r,...e){let t=[gc(r[0])],n=0;for(;n<e.length;)t.push(Ey),wy(t,e[n]),t.push(Ey,gc(r[++n]));return Jj(t),new Ir(t)}Te.str=CR;function wy(r,e){e instanceof Ir?r.push(...e._items):e instanceof si?r.push(e):r.push(Zj(e))}Te.addCodeArg=wy;function Jj(r){let e=1;for(;e<r.length-1;){if(r[e]===Ey){let t=Xj(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Xj(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof si||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof si))return`"${r}${e.slice(1)}`}function Qj(r,e){return e.emptyStr()?r:r.emptyStr()?e:CR`${r}${e}`}Te.strConcat=Qj;function Zj(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:gc(Array.isArray(r)?r.join(","):r)}function eF(r){return new Ir(gc(r))}Te.stringify=eF;function gc(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Te.safeStringify=gc;function tF(r){return typeof r=="string"&&Te.IDENTIFIER.test(r)?new Ir(`.${r}`):DR`[${r}]`}Te.getProperty=tF;function rF(r){if(typeof r=="string"&&Te.IDENTIFIER.test(r))return new Ir(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}Te.getEsmExportName=rF;function nF(r){return new Ir(r.toString())}Te.regexpCode=nF});var Py=E(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.ValueScope=lr.ValueScopeName=lr.Scope=lr.varKinds=lr.UsedValueState=void 0;var cr=yc(),ky=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ef;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Ef||(lr.UsedValueState=Ef={}));lr.varKinds={const:new cr.Name("const"),let:new cr.Name("let"),var:new cr.Name("var")};var wf=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof cr.Name?e:this.name(e)}name(e){return new cr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};lr.Scope=wf;var kf=class extends cr.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,cr._)`.${new cr.Name(t)}[${n}]`}};lr.ValueScopeName=kf;var sF=(0,cr._)`\n`,Ny=class extends wf{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?sF:cr.nil}}get(){return this._scope}name(e){return new kf(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=t.key)!==null&&n!==void 0?n: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 n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,cr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,n)}_reduceValues(e,t,n={},s){let i=cr.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Ef.Started);let u=t(l);if(u){let d=this.opts.es5?lr.varKinds.var:lr.varKinds.const;i=(0,cr._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,cr._)`${i}${u}${this.opts._n}`;else throw new ky(l);c.set(l,Ef.Completed)})}return i}};lr.ValueScope=Ny});var ae=E(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=yc(),en=Py(),Es=yc();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return Es._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return Es.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return Es.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return Es.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return Es.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return Es.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return Es.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return Es.Name}});var Df=Py();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return Df.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return Df.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return Df.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return Df.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 Fn=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Ry=class extends Fn{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?en.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Ao(this.rhs,e,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},Nf=class extends Fn{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}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=Ao(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return Rf(e,this.rhs)}},Dy=class extends Nf{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Cy=class extends Fn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Oy=class extends Fn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ay=class extends Fn{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Iy=class extends Fn{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=Ao(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},bc=class extends Fn{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,t)||(iF(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ai(e,t.names),{})}},Bn=class extends bc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},My=class extends bc{},Oo=class extends Bn{};Oo.kind="else";var ii=class r extends Bn{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 n=t.optimizeNodes();t=this.else=Array.isArray(n)?new Oo(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(OR(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Ao(this.condition,e,t),this}get names(){let e=super.names;return Rf(e,this.condition),this.else&&ai(e,this.else.names),e}};ii.kind="if";var oi=class extends Bn{};oi.kind="for";var $y=class extends oi{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=Ao(this.iteration,e,t),this}get names(){return ai(super.names,this.iteration.names)}},Ly=class extends oi{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){let t=e.es5?en.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Rf(super.names,this.from);return Rf(e,this.to)}},Pf=class extends oi{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,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=Ao(this.iterable,e,t),this}get names(){return ai(super.names,this.iterable.names)}},vc=class extends Bn{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};vc.kind="func";var Tc=class extends bc{render(e){return"return "+super.render(e)}};Tc.kind="return";var xy=class extends Bn{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 n,s;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ai(e,this.catch.names),this.finally&&ai(e,this.finally.names),e}},_c=class extends Bn{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};_c.kind="catch";var Sc=class extends Bn{render(e){return"finally"+super.render(e)}};Sc.kind="finally";var qy=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new en.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 n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}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,n,s){let i=this._scope.toName(t);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Ry(e,i,n)),i}const(e,t,n){return this._def(en.varKinds.const,e,t,n)}let(e,t,n){return this._def(en.varKinds.let,e,t,n)}var(e,t,n){return this._def(en.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new Nf(e,t,n))}add(e,t){return this._leafNode(new Dy(e,le.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==ge.nil&&this._leafNode(new Iy(e)),this}object(...e){let t=["{"];for(let[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,ge.addCodeArg)(t,s));return t.push("}"),new ge._Code(t)}if(e,t,n){if(this._blockNode(new ii(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ii(e))}else(){return this._elseNode(new Oo)}endIf(){return this._endBlockNode(ii,Oo)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new $y(e),t)}forRange(e,t,n,s,i=this.opts.es5?en.varKinds.var:en.varKinds.let){let o=this._scope.toName(e);return this._for(new Ly(i,o,t,n),()=>s(o))}forOf(e,t,n,s=en.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}]`),n(i)})}return this._for(new Pf("of",s,i,t),()=>n(i))}forIn(e,t,n,s=this.opts.es5?en.varKinds.var:en.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ge._)`Object.keys(${t})`,n);let i=this._scope.toName(e);return this._for(new Pf("in",s,i,t),()=>n(i))}endFor(){return this._endBlockNode(oi)}label(e){return this._leafNode(new Cy(e))}break(e){return this._leafNode(new Oy(e))}return(e){let t=new Tc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Tc)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new xy;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new _c(i),t(i)}return n&&(this._currNode=s.finally=new Sc,this.code(n)),this._endBlockNode(_c,Sc)}throw(e){return this._leafNode(new Ay(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 n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=ge.nil,n,s){return this._blockNode(new vc(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(vc)}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 n=this._currNode;if(n instanceof e||t&&n 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 ii))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=qy;function ai(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function Rf(r,e){return e instanceof ge._CodeOrName?ai(r,e.names):r}function Ao(r,e,t){if(r instanceof ge.Name)return n(r);if(!s(r))return r;return new ge._Code(r._items.reduce((i,o)=>(o instanceof ge.Name&&(o=n(o)),o instanceof ge._Code?i.push(...o._items):i.push(o),i),[]));function n(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 iF(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function OR(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,ge._)`!${jy(r)}`}le.not=OR;var oF=AR(le.operators.AND);function aF(...r){return r.reduce(oF)}le.and=aF;var cF=AR(le.operators.OR);function lF(...r){return r.reduce(cF)}le.or=lF;function AR(r){return(e,t)=>e===ge.nil?t:t===ge.nil?e:(0,ge._)`${jy(e)} ${r} ${jy(t)}`}function jy(r){return r instanceof ge.Name?r:(0,ge._)`(${r})`}});var he=E(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 Be=ae(),uF=yc();function dF(r){let e={};for(let t of r)e[t]=!0;return e}ue.toHash=dF;function fF(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:($R(r,e),!LR(e,r.self.RULES.all))}ue.alwaysValidSchema=fF;function $R(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||jR(r,`unknown keyword: "${i}"`)}ue.checkUnknownRules=$R;function LR(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}ue.schemaHasRules=LR;function hF(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}ue.schemaHasRulesButRef=hF;function pF({topSchemaRef:r,schemaPath:e},t,n,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Be._)`${t}`}return(0,Be._)`${r}${e}${(0,Be.getProperty)(n)}`}ue.schemaRefOrVal=pF;function mF(r){return xR(decodeURIComponent(r))}ue.unescapeFragment=mF;function gF(r){return encodeURIComponent(By(r))}ue.escapeFragment=gF;function By(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=By;function xR(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=xR;function yF(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}ue.eachItem=yF;function IR({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Be.Name?(i instanceof Be.Name?r(s,i,o):e(s,i,o),o):i instanceof Be.Name?(e(s,o,i),i):t(i,o);return a===Be.Name&&!(c instanceof Be.Name)?n(s,c):c}}ue.mergeEvaluated={props:IR({mergeNames:(r,e,t)=>r.if((0,Be._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,Be._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,Be._)`${t} || {}`).code((0,Be._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,Be._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,Be._)`${t} || {}`),Uy(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:qR}),items:IR({mergeNames:(r,e,t)=>r.if((0,Be._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,Be._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,Be._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,Be._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function qR(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,Be._)`{}`);return e!==void 0&&Uy(r,t,e),t}ue.evaluatedPropsToName=qR;function Uy(r,e,t){Object.keys(t).forEach(n=>r.assign((0,Be._)`${e}${(0,Be.getProperty)(n)}`,!0))}ue.setEvaluated=Uy;var MR={};function bF(r,e){return r.scopeValue("func",{ref:e,code:MR[e.code]||(MR[e.code]=new uF._Code(e.code))})}ue.useFunc=bF;var Fy;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(Fy||(ue.Type=Fy={}));function vF(r,e,t){if(r instanceof Be.Name){let n=e===Fy.Num;return t?n?(0,Be._)`"[" + ${r} + "]"`:(0,Be._)`"['" + ${r} + "']"`:n?(0,Be._)`"/" + ${r}`:(0,Be._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Be.getProperty)(r).toString():"/"+By(r)}ue.getErrorPath=vF;function jR(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}ue.checkStrictMode=jR});var Mr=E(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});var Wt=ae(),TF={data:new Wt.Name("data"),valCxt:new Wt.Name("valCxt"),instancePath:new Wt.Name("instancePath"),parentData:new Wt.Name("parentData"),parentDataProperty:new Wt.Name("parentDataProperty"),rootData:new Wt.Name("rootData"),dynamicAnchors:new Wt.Name("dynamicAnchors"),vErrors:new Wt.Name("vErrors"),errors:new Wt.Name("errors"),this:new Wt.Name("this"),self:new Wt.Name("self"),scope:new Wt.Name("scope"),json:new Wt.Name("json"),jsonPos:new Wt.Name("jsonPos"),jsonLen:new Wt.Name("jsonLen"),jsonPart:new Wt.Name("jsonPart")};Vy.default=TF});var Ec=E(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.extendErrors=Ht.resetErrorsCount=Ht.reportExtraError=Ht.reportError=Ht.keyword$DataError=Ht.keywordError=void 0;var be=ae(),Cf=he(),Qt=Mr();Ht.keywordError={message:({keyword:r})=>(0,be.str)`must pass "${r}" keyword validation`};Ht.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,be.str)`"${r}" keyword must be ${e} ($data)`:(0,be.str)`"${r}" keyword is invalid ($data)`};function _F(r,e=Ht.keywordError,t,n){let{it:s}=r,{gen:i,compositeRule:o,allErrors:a}=s,c=UR(r,e,t);n??(o||a)?FR(i,c):BR(s,(0,be._)`[${c}]`)}Ht.reportError=_F;function SF(r,e=Ht.keywordError,t){let{it:n}=r,{gen:s,compositeRule:i,allErrors:o}=n,a=UR(r,e,t);FR(s,a),i||o||BR(n,Qt.default.vErrors)}Ht.reportExtraError=SF;function EF(r,e){r.assign(Qt.default.errors,e),r.if((0,be._)`${Qt.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,be._)`${Qt.default.vErrors}.length`,e),()=>r.assign(Qt.default.vErrors,null)))}Ht.resetErrorsCount=EF;function wF({gen:r,keyword:e,schemaValue:t,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",s,Qt.default.errors,a=>{r.const(o,(0,be._)`${Qt.default.vErrors}[${a}]`),r.if((0,be._)`${o}.instancePath === undefined`,()=>r.assign((0,be._)`${o}.instancePath`,(0,be.strConcat)(Qt.default.instancePath,i.errorPath))),r.assign((0,be._)`${o}.schemaPath`,(0,be.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(r.assign((0,be._)`${o}.schema`,t),r.assign((0,be._)`${o}.data`,n))})}Ht.extendErrors=wF;function FR(r,e){let t=r.const("err",e);r.if((0,be._)`${Qt.default.vErrors} === null`,()=>r.assign(Qt.default.vErrors,(0,be._)`[${t}]`),(0,be._)`${Qt.default.vErrors}.push(${t})`),r.code((0,be._)`${Qt.default.errors}++`)}function BR(r,e){let{gen:t,validateName:n,schemaEnv:s}=r;s.$async?t.throw((0,be._)`new ${r.ValidationError}(${e})`):(t.assign((0,be._)`${n}.errors`,e),t.return(!1))}var ci={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 UR(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,be._)`{}`:kF(r,e,t)}function kF(r,e,t={}){let{gen:n,it:s}=r,i=[NF(s,t),PF(r,t)];return RF(r,e,i),n.object(...i)}function NF({errorPath:r},{instancePath:e}){let t=e?(0,be.str)`${r}${(0,Cf.getErrorPath)(e,Cf.Type.Str)}`:r;return[Qt.default.instancePath,(0,be.strConcat)(Qt.default.instancePath,t)]}function PF({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let s=n?e:(0,be.str)`${e}/${r}`;return t&&(s=(0,be.str)`${s}${(0,Cf.getErrorPath)(t,Cf.Type.Str)}`),[ci.schemaPath,s]}function RF(r,{params:e,message:t},n){let{keyword:s,data:i,schemaValue:o,it:a}=r,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([ci.keyword,s],[ci.params,typeof e=="function"?e(r):e||(0,be._)`{}`]),c.messages&&n.push([ci.message,typeof t=="function"?t(r):t]),c.verbose&&n.push([ci.schema,o],[ci.parentSchema,(0,be._)`${u}${d}`],[Qt.default.data,i]),l&&n.push([ci.propertyName,l])}});var WR=E(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.boolOrEmptySchema=Io.topBoolOrEmptySchema=void 0;var DF=Ec(),CF=ae(),OF=Mr(),AF={message:"boolean schema is false"};function IF(r){let{gen:e,schema:t,validateName:n}=r;t===!1?VR(r,!1):typeof t=="object"&&t.$async===!0?e.return(OF.default.data):(e.assign((0,CF._)`${n}.errors`,null),e.return(!0))}Io.topBoolOrEmptySchema=IF;function MF(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),VR(r)):t.var(e,!0)}Io.boolOrEmptySchema=MF;function VR(r,e){let{gen:t,data:n}=r,s={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,DF.reportError)(s,AF,void 0,e)}});var Wy=E(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.getRules=Mo.isJSONType=void 0;var $F=["string","number","integer","boolean","null","object","array"],LF=new Set($F);function xF(r){return typeof r=="string"&&LF.has(r)}Mo.isJSONType=xF;function qF(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}Mo.getRules=qF});var Hy=E(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.shouldUseRule=ws.shouldUseGroup=ws.schemaHasRulesForType=void 0;function jF({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&HR(r,n)}ws.schemaHasRulesForType=jF;function HR(r,e){return e.rules.some(t=>zR(r,t))}ws.shouldUseGroup=HR;function zR(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}ws.shouldUseRule=zR});var wc=E(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.reportTypeError=zt.checkDataTypes=zt.checkDataType=zt.coerceAndCheckDataType=zt.getJSONTypes=zt.getSchemaTypes=zt.DataType=void 0;var FF=Wy(),BF=Hy(),UF=Ec(),ce=ae(),KR=he(),$o;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})($o||(zt.DataType=$o={}));function VF(r){let e=GR(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}zt.getSchemaTypes=VF;function GR(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(FF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}zt.getJSONTypes=GR;function WF(r,e){let{gen:t,data:n,opts:s}=r,i=HF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,BF.schemaHasRulesForType)(r,e[0]));if(o){let a=Ky(e,n,s.strictNumbers,$o.Wrong);t.if(a,()=>{i.length?zF(r,e,i):Gy(r)})}return o}zt.coerceAndCheckDataType=WF;var YR=new Set(["string","number","integer","boolean","null"]);function HF(r,e){return e?r.filter(t=>YR.has(t)||e==="array"&&t==="array"):[]}function zF(r,e,t){let{gen:n,data:s,opts:i}=r,o=n.let("dataType",(0,ce._)`typeof ${s}`),a=n.let("coerced",(0,ce._)`undefined`);i.coerceTypes==="array"&&n.if((0,ce._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,ce._)`${s}[0]`).assign(o,(0,ce._)`typeof ${s}`).if(Ky(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,ce._)`${a} !== undefined`);for(let l of t)(YR.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),Gy(r),n.endIf(),n.if((0,ce._)`${a} !== undefined`,()=>{n.assign(s,a),KF(r,a)});function c(l){switch(l){case"string":n.elseIf((0,ce._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ce._)`"" + ${s}`).elseIf((0,ce._)`${s} === null`).assign(a,(0,ce._)`""`);return;case"number":n.elseIf((0,ce._)`${o} == "boolean" || ${s} === null
|
|
177
|
+
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,ce._)`+${s}`);return;case"integer":n.elseIf((0,ce._)`${o} === "boolean" || ${s} === null
|
|
178
|
+
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,ce._)`+${s}`);return;case"boolean":n.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":n.elseIf((0,ce._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,ce._)`${o} === "string" || ${o} === "number"
|
|
179
|
+
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,ce._)`[${s}]`)}}}function KF({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,ce._)`${e} !== undefined`,()=>r.assign((0,ce._)`${e}[${t}]`,n))}function zy(r,e,t,n=$o.Correct){let s=n===$o.Correct?ce.operators.EQ:ce.operators.NEQ,i;switch(r){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} ${r}`}return n===$o.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)}}zt.checkDataType=zy;function Ky(r,e,t,n){if(r.length===1)return zy(r[0],e,t,n);let s,i=(0,KR.toHash)(r);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,zy(o,e,t,n));return s}zt.checkDataTypes=Ky;var GF={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,ce._)`{type: ${r}}`:(0,ce._)`{type: ${e}}`};function Gy(r){let e=YF(r);(0,UF.reportError)(e,GF)}zt.reportTypeError=Gy;function YF(r){let{gen:e,data:t,schema:n}=r,s=(0,KR.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:r}}});var XR=E(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.assignDefaults=void 0;var Lo=ae(),JF=he();function XF(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let s in t)JR(r,s,t[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>JR(r,i,s.default))}Of.assignDefaults=XF;function JR(r,e,t){let{gen:n,compositeRule:s,data:i,opts:o}=r;if(t===void 0)return;let a=(0,Lo._)`${i}${(0,Lo.getProperty)(e)}`;if(s){(0,JF.checkStrictMode)(r,`default is ignored for: ${a}`);return}let c=(0,Lo._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Lo._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Lo._)`${a} = ${(0,Lo.stringify)(t)}`)}});var $r=E(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.validateUnion=xe.validateArray=xe.usePattern=xe.callValidateCode=xe.schemaProperties=xe.allSchemaProperties=xe.noPropertyInData=xe.propertyInData=xe.isOwnProperty=xe.hasPropFunc=xe.reportMissingProp=xe.checkMissingProp=xe.checkReportMissingProp=void 0;var Ye=ae(),Yy=he(),ks=Mr(),QF=he();function ZF(r,e){let{gen:t,data:n,it:s}=r;t.if(Xy(t,n,e,s.opts.ownProperties),()=>{r.setParams({missingProperty:(0,Ye._)`${e}`},!0),r.error()})}xe.checkReportMissingProp=ZF;function eB({gen:r,data:e,it:{opts:t}},n,s){return(0,Ye.or)(...n.map(i=>(0,Ye.and)(Xy(r,e,i,t.ownProperties),(0,Ye._)`${s} = ${i}`)))}xe.checkMissingProp=eB;function tB(r,e){r.setParams({missingProperty:e},!0),r.error()}xe.reportMissingProp=tB;function QR(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ye._)`Object.prototype.hasOwnProperty`})}xe.hasPropFunc=QR;function Jy(r,e,t){return(0,Ye._)`${QR(r)}.call(${e}, ${t})`}xe.isOwnProperty=Jy;function rB(r,e,t,n){let s=(0,Ye._)`${e}${(0,Ye.getProperty)(t)} !== undefined`;return n?(0,Ye._)`${s} && ${Jy(r,e,t)}`:s}xe.propertyInData=rB;function Xy(r,e,t,n){let s=(0,Ye._)`${e}${(0,Ye.getProperty)(t)} === undefined`;return n?(0,Ye.or)(s,(0,Ye.not)(Jy(r,e,t))):s}xe.noPropertyInData=Xy;function ZR(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}xe.allSchemaProperties=ZR;function nB(r,e){return ZR(e).filter(t=>!(0,Yy.alwaysValidSchema)(r,e[t]))}xe.schemaProperties=nB;function sB({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,Ye._)`${r}, ${e}, ${n}${s}`:e,d=[[ks.default.instancePath,(0,Ye.strConcat)(ks.default.instancePath,i)],[ks.default.parentData,o.parentData],[ks.default.parentDataProperty,o.parentDataProperty],[ks.default.rootData,ks.default.rootData]];o.opts.dynamicRef&&d.push([ks.default.dynamicAnchors,ks.default.dynamicAnchors]);let f=(0,Ye._)`${u}, ${t.object(...d)}`;return c!==Ye.nil?(0,Ye._)`${a}.call(${c}, ${f})`:(0,Ye._)`${a}(${f})`}xe.callValidateCode=sB;var iB=(0,Ye._)`new RegExp`;function oB({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,n);return r.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ye._)`${s.code==="new RegExp"?iB:(0,QF.useFunc)(r,s)}(${t}, ${n})`})}xe.usePattern=oB;function aB(r){let{gen:e,data:t,keyword:n,it:s}=r,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,Ye._)`${t}.length`);e.forRange("i",0,c,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:Yy.Type.Num},i),e.if((0,Ye.not)(i),a)})}}xe.validateArray=aB;function cB(r){let{gen:e,schema:t,keyword:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,Yy.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=r.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,Ye._)`${o} || ${a}`),r.mergeValidEvaluated(u,a)||e.if((0,Ye.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}xe.validateUnion=cB});var rD=E(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.validateKeywordUsage=Tn.validSchemaType=Tn.funcKeywordCode=Tn.macroKeywordCode=void 0;var Zt=ae(),li=Mr(),lB=$r(),uB=Ec();function dB(r,e){let{gen:t,keyword:n,schema:s,parentSchema:i,it:o}=r,a=e.macro.call(o.self,s,i,o),c=tD(t,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");r.subschema({schema:a,schemaPath:Zt.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),r.pass(l,()=>r.error(!0))}Tn.macroKeywordCode=dB;function fB(r,e){var t;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=r;pB(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=tD(n,s,l),d=n.let("valid");r.block$data(d,f),r.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)g(),e.modifying&&eD(r),S(()=>r.error());else{let w=e.async?m():T();e.modifying&&eD(r),S(()=>hB(r,w))}}function m(){let w=n.let("ruleErrs",null);return n.try(()=>g((0,Zt._)`await `),v=>n.assign(d,!1).if((0,Zt._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Zt._)`${v}.errors`),()=>n.throw(v))),w}function T(){let w=(0,Zt._)`${u}.errors`;return n.assign(w,null),g(Zt.nil),w}function g(w=e.async?(0,Zt._)`await `:Zt.nil){let v=c.opts.passContext?li.default.this:li.default.self,b=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Zt._)`${w}${(0,lB.callValidateCode)(r,u,v,b)}`,e.modifying)}function S(w){var v;n.if((0,Zt.not)((v=e.valid)!==null&&v!==void 0?v:d),w)}}Tn.funcKeywordCode=fB;function eD(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,Zt._)`${n.parentData}[${n.parentDataProperty}]`))}function hB(r,e){let{gen:t}=r;t.if((0,Zt._)`Array.isArray(${e})`,()=>{t.assign(li.default.vErrors,(0,Zt._)`${li.default.vErrors} === null ? ${e} : ${li.default.vErrors}.concat(${e})`).assign(li.default.errors,(0,Zt._)`${li.default.vErrors}.length`),(0,uB.extendErrors)(r)},()=>r.error())}function pB({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function tD(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Zt.stringify)(t)})}function mB(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}Tn.validSchemaType=mB;function gB({schema:r,opts:e,self:t,errSchemaPath:n},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(r,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(r[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}Tn.validateKeywordUsage=gB});var sD=E(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.extendSubschemaMode=Ns.extendSubschemaData=Ns.getSubschema=void 0;var _n=ae(),nD=he();function yB(r,{keyword:e,schemaProp:t,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,_n._)`${r.schemaPath}${(0,_n.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,_n._)`${r.schemaPath}${(0,_n.getProperty)(e)}${(0,_n.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,nD.escapeFragment)(t)}`}}if(n!==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:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ns.getSubschema=yB;function bB(r,e,{dataProp:t,dataPropType:n,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,_n._)`${e.data}${(0,_n.getProperty)(t)}`,!0);c(f),r.errorPath=(0,_n.str)`${l}${(0,nD.getErrorPath)(t,n,d.jsPropertySyntax)}`,r.parentDataProperty=(0,_n._)`${t}`,r.dataPathArr=[...u,r.parentDataProperty]}if(s!==void 0){let l=s instanceof _n.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(r.propertyName=o)}i&&(r.dataTypes=i);function c(l){r.data=l,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,l]}}Ns.extendSubschemaData=bB;function vB(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(r.compositeRule=n),s!==void 0&&(r.createErrors=s),i!==void 0&&(r.allErrors=i),r.jtdDiscriminator=e,r.jtdMetadata=t}Ns.extendSubschemaMode=vB});var Qy=E((H5,iD)=>{"use strict";iD.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!r(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),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var aD=E((z5,oD)=>{"use strict";var Ps=oD.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};Af(e,n,s,r,"",r)};Ps.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ps.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ps.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ps.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 Af(r,e,t,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Ps.arrayKeywords)for(var f=0;f<d.length;f++)Af(r,e,t,d[f],s+"/"+u+"/"+f,i,s,u,n,f)}else if(u in Ps.propsKeywords){if(d&&typeof d=="object")for(var m in d)Af(r,e,t,d[m],s+"/"+u+"/"+TB(m),i,s,u,n,m)}else(u in Ps.keywords||r.allKeys&&!(u in Ps.skipKeywords))&&Af(r,e,t,d,s+"/"+u,i,s,u,n)}t(n,s,i,o,a,c,l)}}function TB(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var kc=E(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.getSchemaRefs=ur.resolveUrl=ur.normalizeId=ur._getFullPath=ur.getFullPath=ur.inlineRef=void 0;var _B=he(),SB=Qy(),EB=aD(),wB=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function kB(r,e=!0){return typeof r=="boolean"?!0:e===!0?!Zy(r):e?cD(r)<=e:!1}ur.inlineRef=kB;var NB=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Zy(r){for(let e in r){if(NB.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(Zy)||typeof t=="object"&&Zy(t))return!0}return!1}function cD(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!wB.has(t)&&(typeof r[t]=="object"&&(0,_B.eachItem)(r[t],n=>e+=cD(n)),e===1/0))return 1/0}return e}function lD(r,e="",t){t!==!1&&(e=xo(e));let n=r.parse(e);return uD(r,n)}ur.getFullPath=lD;function uD(r,e){return r.serialize(e).split("#")[0]+"#"}ur._getFullPath=uD;var PB=/#\/?$/;function xo(r){return r?r.replace(PB,""):""}ur.normalizeId=xo;function RB(r,e,t){return t=xo(t),r.resolve(e,t)}ur.resolveUrl=RB;var DB=/^[a-z_][-a-z0-9._]*$/i;function CB(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,s=xo(r[t]||e),i={"":s},o=lD(n,s,!1),a={},c=new Set;return EB(r,{allKeys:!0},(d,f,m,T)=>{if(T===void 0)return;let g=o+f,S=i[T];typeof d[t]=="string"&&(S=w.call(this,d[t])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),i[f]=S;function w(b){let R=this.opts.uriResolver.resolve;if(b=xo(S?R(S,b):b),c.has(b))throw u(b);c.add(b);let A=this.refs[b];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,b):b!==xo(g)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=g),b}function v(b){if(typeof b=="string"){if(!DB.test(b))throw new Error(`invalid anchor "${b}"`);w.call(this,`#${b}`)}}}),a;function l(d,f,m){if(f!==void 0&&!SB(d,f))throw u(m)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ur.getSchemaRefs=CB});var Rc=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.getData=Rs.KeywordCxt=Rs.validateFunctionCode=void 0;var mD=WR(),dD=wc(),tb=Hy(),If=wc(),OB=XR(),Pc=rD(),eb=sD(),G=ae(),re=Mr(),AB=kc(),Un=he(),Nc=Ec();function IB(r){if(bD(r)&&(vD(r),yD(r))){LB(r);return}gD(r,()=>(0,mD.topBoolOrEmptySchema)(r))}Rs.validateFunctionCode=IB;function gD({gen:r,validateName:e,schema:t,schemaEnv:n,opts:s},i){s.code.es5?r.func(e,(0,G._)`${re.default.data}, ${re.default.valCxt}`,n.$async,()=>{r.code((0,G._)`"use strict"; ${fD(t,s)}`),$B(r,s),r.code(i)}):r.func(e,(0,G._)`${re.default.data}, ${MB(s)}`,n.$async,()=>r.code(fD(t,s)).code(i))}function MB(r){return(0,G._)`{${re.default.instancePath}="", ${re.default.parentData}, ${re.default.parentDataProperty}, ${re.default.rootData}=${re.default.data}${r.dynamicRef?(0,G._)`, ${re.default.dynamicAnchors}={}`:G.nil}}={}`}function $B(r,e){r.if(re.default.valCxt,()=>{r.var(re.default.instancePath,(0,G._)`${re.default.valCxt}.${re.default.instancePath}`),r.var(re.default.parentData,(0,G._)`${re.default.valCxt}.${re.default.parentData}`),r.var(re.default.parentDataProperty,(0,G._)`${re.default.valCxt}.${re.default.parentDataProperty}`),r.var(re.default.rootData,(0,G._)`${re.default.valCxt}.${re.default.rootData}`),e.dynamicRef&&r.var(re.default.dynamicAnchors,(0,G._)`${re.default.valCxt}.${re.default.dynamicAnchors}`)},()=>{r.var(re.default.instancePath,(0,G._)`""`),r.var(re.default.parentData,(0,G._)`undefined`),r.var(re.default.parentDataProperty,(0,G._)`undefined`),r.var(re.default.rootData,re.default.data),e.dynamicRef&&r.var(re.default.dynamicAnchors,(0,G._)`{}`)})}function LB(r){let{schema:e,opts:t,gen:n}=r;gD(r,()=>{t.$comment&&e.$comment&&_D(r),BB(r),n.let(re.default.vErrors,null),n.let(re.default.errors,0),t.unevaluated&&xB(r),TD(r),WB(r)})}function xB(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,G._)`${t}.evaluated`),e.if((0,G._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,G._)`${r.evaluated}.props`,(0,G._)`undefined`)),e.if((0,G._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,G._)`${r.evaluated}.items`,(0,G._)`undefined`))}function fD(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,G._)`/*# sourceURL=${t} */`:G.nil}function qB(r,e){if(bD(r)&&(vD(r),yD(r))){jB(r,e);return}(0,mD.boolOrEmptySchema)(r,e)}function yD({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function bD(r){return typeof r.schema!="boolean"}function jB(r,e){let{schema:t,gen:n,opts:s}=r;s.$comment&&t.$comment&&_D(r),UB(r),VB(r);let i=n.const("_errs",re.default.errors);TD(r,i),n.var(e,(0,G._)`${i} === ${re.default.errors}`)}function vD(r){(0,Un.checkUnknownRules)(r),FB(r)}function TD(r,e){if(r.opts.jtd)return hD(r,[],!1,e);let t=(0,dD.getSchemaTypes)(r.schema),n=(0,dD.coerceAndCheckDataType)(r,t);hD(r,t,!n,e)}function FB(r){let{schema:e,errSchemaPath:t,opts:n,self:s}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,Un.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function BB(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Un.checkStrictMode)(r,"default is ignored in the schema root")}function UB(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,AB.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function VB(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function _D({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:s}){let i=t.$comment;if(s.$comment===!0)r.code((0,G._)`${re.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,G.str)`${n}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,G._)`${re.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function WB(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:s,opts:i}=r;t.$async?e.if((0,G._)`${re.default.errors} === 0`,()=>e.return(re.default.data),()=>e.throw((0,G._)`new ${s}(${re.default.vErrors})`)):(e.assign((0,G._)`${n}.errors`,re.default.vErrors),i.unevaluated&&HB(r),e.return((0,G._)`${re.default.errors} === 0`))}function HB({gen:r,evaluated:e,props:t,items:n}){t instanceof G.Name&&r.assign((0,G._)`${e}.props`,t),n instanceof G.Name&&r.assign((0,G._)`${e}.items`,n)}function hD(r,e,t,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=r,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Un.schemaHasRulesButRef)(i,u))){s.block(()=>ED(r,"$ref",u.all.$ref.definition));return}c.jtd||zB(r,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,tb.shouldUseGroup)(i,f)&&(f.type?(s.if((0,If.checkDataType)(f.type,o,c.strictNumbers)),pD(r,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,If.reportTypeError)(r)),s.endIf()):pD(r,f),a||s.if((0,G._)`${re.default.errors} === ${n||0}`))}}function pD(r,e){let{gen:t,schema:n,opts:{useDefaults:s}}=r;s&&(0,OB.assignDefaults)(r,e.type),t.block(()=>{for(let i of e.rules)(0,tb.shouldUseRule)(n,i)&&ED(r,i.keyword,i.definition,e.type)})}function zB(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(KB(r,e),r.opts.allowUnionTypes||GB(r,e),YB(r,r.dataTypes))}function KB(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{SD(r.dataTypes,t)||rb(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),XB(r,e)}}function GB(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&rb(r,"use allowUnionTypes to allow union type keyword")}function YB(r,e){let t=r.self.RULES.all;for(let n in t){let s=t[n];if(typeof s=="object"&&(0,tb.shouldUseRule)(r.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>JB(e,o))&&rb(r,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function JB(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function SD(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function XB(r,e){let t=[];for(let n of r.dataTypes)SD(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function rb(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Un.checkStrictMode)(r,e,r.opts.strictTypes)}var Mf=class{constructor(e,t,n){if((0,Pc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Un.schemaRefOrVal)(e,this.schema,n,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",wD(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Pc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",re.default.errors))}result(e,t,n){this.failResult((0,G.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():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,G.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,G._)`${t} !== undefined && (${(0,G.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?Nc.reportExtraError:Nc.reportError)(this,this.def.error,t)}$dataError(){(0,Nc.reportError)(this,this.def.$dataError||Nc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Nc.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,n=G.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=G.nil,t=G.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,G.or)((0,G._)`${s} === undefined`,t)),e!==G.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==G.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:s,it:i}=this;return(0,G.or)(o(),a());function o(){if(n.length){if(!(t instanceof G.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,G._)`${(0,If.checkDataTypes)(c,t,i.opts.strictNumbers,If.DataType.Wrong)}`}return G.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,G._)`!${c}(${t})`}return G.nil}}subschema(e,t){let n=(0,eb.getSubschema)(this.it,e);(0,eb.extendSubschemaData)(n,this.it,e),(0,eb.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return qB(s,t),s}mergeEvaluated(e,t){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Un.mergeEvaluated.props(s,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=Un.mergeEvaluated.items(s,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,G.Name)),!0}};Rs.KeywordCxt=Mf;function ED(r,e,t,n){let s=new Mf(r,t,e);"code"in t?t.code(s,n):s.$data&&t.validate?(0,Pc.funcKeywordCode)(s,t):"macro"in t?(0,Pc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,Pc.funcKeywordCode)(s,t)}var QB=/^\/(?:[^~]|~0|~1)*$/,ZB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function wD(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let s,i;if(r==="")return re.default.rootData;if(r[0]==="/"){if(!QB.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);s=r,i=re.default.rootData}else{let l=ZB.exec(r);if(!l)throw new Error(`Invalid JSON-pointer: ${r}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return n[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,G._)`${i}${(0,G.getProperty)((0,Un.unescapeJsonPointer)(l))}`,o=(0,G._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Rs.getData=wD});var $f=E(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var nb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};sb.default=nb});var Dc=E(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var ib=kc(),ob=class extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,ib.resolveUrl)(e,t,n),this.missingSchema=(0,ib.normalizeId)((0,ib.getFullPath)(e,this.missingRef))}};ab.default=ob});var Cc=E(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.resolveSchema=Lr.getCompilingSchema=Lr.resolveRef=Lr.compileSchema=Lr.SchemaEnv=void 0;var tn=ae(),eU=$f(),ui=Mr(),rn=kc(),kD=he(),tU=Rc(),qo=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,rn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Lr.SchemaEnv=qo;function lb(r){let e=ND.call(this,r);if(e)return e;let t=(0,rn.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new tn.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;r.$async&&(a=o.scopeValue("Error",{ref:eU.default,code:(0,tn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");r.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ui.default.data,parentData:ui.default.parentData,parentDataProperty:ui.default.parentDataProperty,dataNames:[ui.default.data],dataPathArr:[tn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,tn.stringify)(r.schema)}:{ref:r.schema}),validateName:c,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:tn.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,tn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(r),(0,tU.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(ui.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,r));let m=new Function(`${ui.default.self}`,`${ui.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=r.schema,m.schemaEnv=r,r.$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 tn.Name?void 0:T,items:g instanceof tn.Name?void 0:g,dynamicProps:T instanceof tn.Name,dynamicItems:g instanceof tn.Name},m.source&&(m.source.evaluated=(0,tn.stringify)(m.evaluated))}return r.validate=m,r}catch(d){throw delete r.validate,delete r.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(r)}}Lr.compileSchema=lb;function rU(r,e,t){var n;t=(0,rn.resolveUrl)(this.opts.uriResolver,e,t);let s=r.refs[t];if(s)return s;let i=iU.call(this,r,t);if(i===void 0){let o=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:a}=this.opts;o&&(i=new qo({schema:o,schemaId:a,root:r,baseId:e}))}if(i!==void 0)return r.refs[t]=nU.call(this,i)}Lr.resolveRef=rU;function nU(r){return(0,rn.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:lb.call(this,r)}function ND(r){for(let e of this._compilations)if(sU(e,r))return e}Lr.getCompilingSchema=ND;function sU(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function iU(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Lf.call(this,r,e)}function Lf(r,e){let t=this.opts.uriResolver.parse(e),n=(0,rn._getFullPath)(this.opts.uriResolver,t),s=(0,rn.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===s)return cb.call(this,t,r);let i=(0,rn.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Lf.call(this,r,o);return typeof a?.schema!="object"?void 0:cb.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||lb.call(this,o),i===(0,rn.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,rn.resolveUrl)(this.opts.uriResolver,s,l)),new qo({schema:a,schemaId:c,root:r,baseId:s})}return cb.call(this,t,o)}}Lr.resolveSchema=Lf;var oU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function cb(r,{baseId:e,schema:t,root:n}){var s;if(((s=r.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,kD.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!oU.has(a)&&l&&(e=(0,rn.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,kD.schemaHasRulesButRef)(t,this.RULES)){let a=(0,rn.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Lf.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new qo({schema:t,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var PD=E((Q5,aU)=>{aU.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 DD=E((Z5,RD)=>{"use strict";var cU={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};RD.exports={HEX:cU}});var xD=E((e7,LD)=>{"use strict";var{HEX:lU}=DD(),uU=/^(?:(?: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 ID(r){if($D(r,".")<3)return{host:r,isIPV4:!1};let e=r.match(uU)||[],[t]=e;return t?{host:fU(t,"."),isIPV4:!0}:{host:r,isIPV4:!1}}function ub(r,e=!1){let t="",n=!0;for(let s of r){if(lU[s]===void 0)return;s!=="0"&&n===!0&&(n=!1),n||(t+=s)}return e&&t.length===0&&(t="0"),t}function dU(r){let e=0,t={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=ub(s);if(l!==void 0)n.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<r.length;l++){let u=r[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){t.error=!0;break}l-1>=0&&r[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?n.push(s.join("")):n.push(ub(s))),t.address=n.join(""),t}function MD(r){if($D(r,":")<2)return{host:r,isIPV6:!1};let e=dU(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,escapedHost:n,isIPV6:!0}}}function fU(r,e){let t="",n=!0,s=r.length;for(let i=0;i<s;i++){let o=r[i];o==="0"&&n?(i+1<=s&&r[i+1]===e||i+1===s)&&(t+=o,n=!1):(o===e?n=!0:n=!1,t+=o)}return t}function $D(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}var CD=/^\.\.?\//u,OD=/^\/\.(?:\/|$)/u,AD=/^\/\.\.(?:\/|$)/u,hU=/^\/?(?:.|\n)*?(?=\/|$)/u;function pU(r){let e=[];for(;r.length;)if(r.match(CD))r=r.replace(CD,"");else if(r.match(OD))r=r.replace(OD,"/");else if(r.match(AD))r=r.replace(AD,"/"),e.pop();else if(r==="."||r==="..")r="";else{let t=r.match(hU);if(t){let n=t[0];r=r.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function mU(r,e){let t=e!==!0?escape:unescape;return r.scheme!==void 0&&(r.scheme=t(r.scheme)),r.userinfo!==void 0&&(r.userinfo=t(r.userinfo)),r.host!==void 0&&(r.host=t(r.host)),r.path!==void 0&&(r.path=t(r.path)),r.query!==void 0&&(r.query=t(r.query)),r.fragment!==void 0&&(r.fragment=t(r.fragment)),r}function gU(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host),n=ID(t);if(n.isIPV4)t=n.host;else{let s=MD(n.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=r.host}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}LD.exports={recomposeAuthority:gU,normalizeComponentEncoding:mU,removeDotSegments:pU,normalizeIPv4:ID,normalizeIPv6:MD,stringArrayToHexStripped:ub}});var VD=E((t7,UD)=>{"use strict";var yU=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,bU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function qD(r){return typeof r.secure=="boolean"?r.secure:String(r.scheme).toLowerCase()==="wss"}function jD(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function FD(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function vU(r){return r.secure=qD(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function TU(r){if((r.port===(qD(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function _U(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(bU);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let s=`${n}:${e.nid||r.nid}`,i=db[s];r.path=void 0,i&&(r=i.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function SU(r,e){let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),s=`${t}:${e.nid||n}`,i=db[s];i&&(r=i.serialize(r,e));let o=r,a=r.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function EU(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!yU.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function wU(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var BD={scheme:"http",domainHost:!0,parse:jD,serialize:FD},kU={scheme:"https",domainHost:BD.domainHost,parse:jD,serialize:FD},xf={scheme:"ws",domainHost:!0,parse:vU,serialize:TU},NU={scheme:"wss",domainHost:xf.domainHost,parse:xf.parse,serialize:xf.serialize},PU={scheme:"urn",parse:_U,serialize:SU,skipNormalize:!0},RU={scheme:"urn:uuid",parse:EU,serialize:wU,skipNormalize:!0},db={http:BD,https:kU,ws:xf,wss:NU,urn:PU,"urn:uuid":RU};UD.exports=db});var HD=E((r7,jf)=>{"use strict";var{normalizeIPv6:DU,normalizeIPv4:CU,removeDotSegments:Oc,recomposeAuthority:OU,normalizeComponentEncoding:qf}=xD(),fb=VD();function AU(r,e){return typeof r=="string"?r=Sn(Vn(r,e),e):typeof r=="object"&&(r=Vn(Sn(r,e),e)),r}function IU(r,e,t){let n=Object.assign({scheme:"null"},t),s=WD(Vn(r,n),Vn(e,n),n,!0);return Sn(s,{...n,skipEscape:!0})}function WD(r,e,t,n){let s={};return n||(r=Vn(Sn(r,t),t),e=Vn(Sn(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=Oc(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=Oc(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=Oc(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?s.path="/"+e.path:r.path?s.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=Oc(s.path)),s.query=e.query):(s.path=r.path,e.query!==void 0?s.query=e.query:s.query=r.query),s.userinfo=r.userinfo,s.host=r.host,s.port=r.port),s.scheme=r.scheme),s.fragment=e.fragment,s}function MU(r,e,t){return typeof r=="string"?(r=unescape(r),r=Sn(qf(Vn(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=Sn(qf(r,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Sn(qf(Vn(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Sn(qf(e,!0),{...t,skipEscape:!0})),r.toLowerCase()===e.toLowerCase()}function Sn(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),s=[],i=fb[(n.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=OU(t);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=Oc(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 $U=Array.from({length:127},(r,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function LU(r){let e=0;for(let t=0,n=r.length;t<n;++t)if(e=r.charCodeAt(t),e>126||$U[e])return!0;return!1}var xU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Vn(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=r.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(r=(t.scheme?t.scheme+":":"")+"//"+r);let o=r.match(xU);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=CU(n.host);if(c.isIPV4===!1){let l=DU(c.host);n.host=l.host.toLowerCase(),i=l.isIPV6}else n.host=c.host,i=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let a=fb[(t.scheme||n.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&LU(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),s&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}var hb={SCHEMES:fb,normalize:AU,resolve:IU,resolveComponents:WD,equal:MU,serialize:Sn,parse:Vn};jf.exports=hb;jf.exports.default=hb;jf.exports.fastUri=hb});var KD=E(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var zD=HD();zD.code='require("ajv/dist/runtime/uri").default';pb.default=zD});var tC=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.CodeGen=Lt.Name=Lt.nil=Lt.stringify=Lt.str=Lt._=Lt.KeywordCxt=void 0;var qU=Rc();Object.defineProperty(Lt,"KeywordCxt",{enumerable:!0,get:function(){return qU.KeywordCxt}});var jo=ae();Object.defineProperty(Lt,"_",{enumerable:!0,get:function(){return jo._}});Object.defineProperty(Lt,"str",{enumerable:!0,get:function(){return jo.str}});Object.defineProperty(Lt,"stringify",{enumerable:!0,get:function(){return jo.stringify}});Object.defineProperty(Lt,"nil",{enumerable:!0,get:function(){return jo.nil}});Object.defineProperty(Lt,"Name",{enumerable:!0,get:function(){return jo.Name}});Object.defineProperty(Lt,"CodeGen",{enumerable:!0,get:function(){return jo.CodeGen}});var jU=$f(),QD=Dc(),FU=Wy(),Ac=Cc(),BU=ae(),Ic=kc(),Ff=wc(),gb=he(),GD=PD(),UU=KD(),ZD=(r,e)=>new RegExp(r,e);ZD.code="new RegExp";var VU=["removeAdditional","useDefaults","coerceTypes"],WU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),HU={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."},zU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},YD=200;function KU(r){var e,t,n,s,i,o,a,c,l,u,d,f,m,T,g,S,w,v,b,R,A,L,W,j,se;let Me=r.strict,yt=(e=r.code)===null||e===void 0?void 0:e.optimize,de=yt===!0||yt===void 0?1:yt||0,vr=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:ZD,Wn=(s=r.uriResolver)!==null&&s!==void 0?s:UU.default;return{strictSchema:(o=(i=r.strictSchema)!==null&&i!==void 0?i:Me)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=r.strictNumbers)!==null&&a!==void 0?a:Me)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=r.strictTypes)!==null&&l!==void 0?l:Me)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=r.strictTuples)!==null&&d!==void 0?d:Me)!==null&&f!==void 0?f:"log",strictRequired:(T=(m=r.strictRequired)!==null&&m!==void 0?m:Me)!==null&&T!==void 0?T:!1,code:r.code?{...r.code,optimize:de,regExp:vr}:{optimize:de,regExp:vr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:YD,loopEnum:(S=r.loopEnum)!==null&&S!==void 0?S:YD,meta:(w=r.meta)!==null&&w!==void 0?w:!0,messages:(v=r.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=r.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(R=r.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(A=r.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(L=r.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(W=r.validateFormats)!==null&&W!==void 0?W:!0,unicodeRegExp:(j=r.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(se=r.int32range)!==null&&se!==void 0?se:!0,uriResolver:Wn}}var Mc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...KU(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new BU.ValueScope({scope:{},prefixes:WU,es5:t,lines:n}),this.logger=ZU(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,FU.getRules)(),JD.call(this,HU,e,"NOT SUPPORTED"),JD.call(this,zU,e,"DEPRECATED","warn"),this._metaOpts=XU.call(this),e.formats&&YU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&JU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),GU.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,s=GD;n==="id"&&(s={...GD},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[n],!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 n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(t);return"$async"in n||(this.errors=n.errors),s}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=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 QD.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]=n(u))}finally{delete this._loading[u]}}}addSchema(e,t,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,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,Ic.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,s,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,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=XD.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,s=new Ac.SchemaEnv({schema:{},schemaId:n});if(t=Ac.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=XD.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 n=e[this.opts.schemaId];return n&&(n=(0,Ic.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),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 n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(tV.call(this,n,t),!t)return(0,gb.eachItem)(n,i=>mb.call(this,i)),this;nV.call(this,t);let s={...t,type:(0,Ff.getJSONTypes)(t.type),schemaType:(0,Ff.getJSONTypes)(t.schemaType)};return(0,gb.eachItem)(n,s.type.length===0?i=>mb.call(this,i,s):i=>s.type.forEach(o=>mb.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 n of t.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.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:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let n=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 n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=eC(u))}}return e}_removeAllSchemas(e,t){for(let n in e){let s=e[n];(!t||t.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,t,n,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;n=(0,Ic.normalizeId)(o||n);let l=Ic.getSchemaRefs.call(this,e,n);return c=new Ac.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=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):Ac.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{Ac.compileSchema.call(this,e)}finally{this.opts=t}}};Mc.ValidationError=jU.default;Mc.MissingRefError=QD.default;Lt.default=Mc;function JD(r,e,t,n="error"){for(let s in r){let i=s;i in e&&this.logger[n](`${t}: option ${s}. ${r[i]}`)}}function XD(r){return r=(0,Ic.normalizeId)(r),this.schemas[r]||this.refs[r]}function GU(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function YU(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function JU(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function XU(){let r={...this.opts};for(let e of VU)delete r[e];return r}var QU={log(){},warn(){},error(){}};function ZU(r){if(r===!1)return QU;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var eV=/^[a-z_$][a-z0-9_$:-]*$/i;function tV(r,e){let{RULES:t}=this;if((0,gb.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!eV.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function mb(r,e,t){var n;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[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,Ff.getJSONTypes)(e.type),schemaType:(0,Ff.getJSONTypes)(e.schemaType)}};e.before?rV.call(this,o,a,e.before):o.rules.push(a),i.all[r]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function rV(r,e,t){let n=r.rules.findIndex(s=>s.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function nV(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=eC(e)),r.validateSchema=this.compile(e,!0))}var sV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function eC(r){return{anyOf:[r,sV]}}});var rC=E(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var iV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yb.default=iV});var Vf=E(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.callRef=di.getValidate=void 0;var oV=Dc(),nC=$r(),dr=ae(),Fo=Mr(),sC=Cc(),Bf=he(),aV={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=sC.resolveRef.call(c,l,s,t);if(u===void 0)throw new oV.default(n.opts.uriResolver,s,t);if(u instanceof sC.SchemaEnv)return f(u);return m(u);function d(){if(i===l)return Uf(r,o,i,i.$async);let T=e.scopeValue("root",{ref:l});return Uf(r,(0,dr._)`${T}.validate`,l,l.$async)}function f(T){let g=iC(r,T);Uf(r,g,T,T.$async)}function m(T){let g=e.scopeValue("schema",a.code.source===!0?{ref:T,code:(0,dr.stringify)(T)}:{ref:T}),S=e.name("valid"),w=r.subschema({schema:T,dataTypes:[],schemaPath:dr.nil,topSchemaRef:g,errSchemaPath:t},S);r.mergeEvaluated(w),r.ok(S)}}};function iC(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,dr._)`${t.scopeValue("wrapper",{ref:e})}.validate`}di.getValidate=iC;function Uf(r,e,t,n){let{gen:s,it:i}=r,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?Fo.default.this:dr.nil;n?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,dr._)`await ${(0,nC.callValidateCode)(r,e,l)}`),m(e),o||s.assign(T,!0)},g=>{s.if((0,dr._)`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(T,!1)}),r.ok(T)}function d(){r.result((0,nC.callValidateCode)(r,e,l),()=>m(e),()=>f(e))}function f(T){let g=(0,dr._)`${T}.errors`;s.assign(Fo.default.vErrors,(0,dr._)`${Fo.default.vErrors} === null ? ${g} : ${Fo.default.vErrors}.concat(${g})`),s.assign(Fo.default.errors,(0,dr._)`${Fo.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=Bf.mergeEvaluated.props(s,S.props,i.props));else{let w=s.var("props",(0,dr._)`${T}.evaluated.props`);i.props=Bf.mergeEvaluated.props(s,w,i.props,dr.Name)}if(i.items!==!0)if(S&&!S.dynamicItems)S.items!==void 0&&(i.items=Bf.mergeEvaluated.items(s,S.items,i.items));else{let w=s.var("items",(0,dr._)`${T}.evaluated.items`);i.items=Bf.mergeEvaluated.items(s,w,i.items,dr.Name)}}}di.callRef=Uf;di.default=aV});var oC=E(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var cV=rC(),lV=Vf(),uV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cV.default,lV.default];bb.default=uV});var aC=E(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var Wf=ae(),Ds=Wf.operators,Hf={maximum:{okStr:"<=",ok:Ds.LTE,fail:Ds.GT},minimum:{okStr:">=",ok:Ds.GTE,fail:Ds.LT},exclusiveMaximum:{okStr:"<",ok:Ds.LT,fail:Ds.GTE},exclusiveMinimum:{okStr:">",ok:Ds.GT,fail:Ds.LTE}},dV={message:({keyword:r,schemaCode:e})=>(0,Wf.str)`must be ${Hf[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Wf._)`{comparison: ${Hf[r].okStr}, limit: ${e}}`},fV={keyword:Object.keys(Hf),type:"number",schemaType:"number",$data:!0,error:dV,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,Wf._)`${t} ${Hf[e].fail} ${n} || isNaN(${t})`)}};vb.default=fV});var cC=E(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var $c=ae(),hV={message:({schemaCode:r})=>(0,$c.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,$c._)`{multipleOf: ${r}}`},pV={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:hV,code(r){let{gen:e,data:t,schemaCode:n,it:s}=r,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,$c._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,$c._)`${o} !== parseInt(${o})`;r.fail$data((0,$c._)`(${n} === 0 || (${o} = ${t}/${n}, ${a}))`)}};Tb.default=pV});var uC=E(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});function lC(r){let e=r.length,t=0,n=0,s;for(;n<e;)t++,s=r.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=r.charCodeAt(n),(s&64512)===56320&&n++);return t}_b.default=lC;lC.code='require("ajv/dist/runtime/ucs2length").default'});var dC=E(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var fi=ae(),mV=he(),gV=uC(),yV={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,fi.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,fi._)`{limit: ${r}}`},bV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:yV,code(r){let{keyword:e,data:t,schemaCode:n,it:s}=r,i=e==="maxLength"?fi.operators.GT:fi.operators.LT,o=s.opts.unicode===!1?(0,fi._)`${t}.length`:(0,fi._)`${(0,mV.useFunc)(r.gen,gV.default)}(${t})`;r.fail$data((0,fi._)`${o} ${i} ${n}`)}};Sb.default=bV});var fC=E(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var vV=$r(),zf=ae(),TV={message:({schemaCode:r})=>(0,zf.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,zf._)`{pattern: ${r}}`},_V={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:TV,code(r){let{data:e,$data:t,schema:n,schemaCode:s,it:i}=r,o=i.opts.unicodeRegExp?"u":"",a=t?(0,zf._)`(new RegExp(${s}, ${o}))`:(0,vV.usePattern)(r,n);r.fail$data((0,zf._)`!${a}.test(${e})`)}};Eb.default=_V});var hC=E(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var Lc=ae(),SV={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,Lc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,Lc._)`{limit: ${r}}`},EV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:SV,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxProperties"?Lc.operators.GT:Lc.operators.LT;r.fail$data((0,Lc._)`Object.keys(${t}).length ${s} ${n}`)}};wb.default=EV});var pC=E(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var xc=$r(),qc=ae(),wV=he(),kV={message:({params:{missingProperty:r}})=>(0,qc.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,qc._)`{missingProperty: ${r}}`},NV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:kV,code(r){let{gen:e,schema:t,schemaCode:n,data:s,$data:i,it:o}=r,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let m=r.parentSchema.properties,{definedProperties:T}=r.it;for(let g of t)if(m?.[g]===void 0&&!T.has(g)){let S=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${g}" is not defined at "${S}" (strictRequired)`;(0,wV.checkStrictMode)(o,w,o.opts.strictRequired)}}function l(){if(c||i)r.block$data(qc.nil,d);else for(let m of t)(0,xc.checkReportMissingProp)(r,m)}function u(){let m=e.let("missing");if(c||i){let T=e.let("valid",!0);r.block$data(T,()=>f(m,T)),r.ok(T)}else e.if((0,xc.checkMissingProp)(r,t,m)),(0,xc.reportMissingProp)(r,m),e.else()}function d(){e.forOf("prop",n,m=>{r.setParams({missingProperty:m}),e.if((0,xc.noPropertyInData)(e,s,m,a.ownProperties),()=>r.error())})}function f(m,T){r.setParams({missingProperty:m}),e.forOf(m,n,()=>{e.assign(T,(0,xc.propertyInData)(e,s,m,a.ownProperties)),e.if((0,qc.not)(T),()=>{r.error(),e.break()})},qc.nil)}}};kb.default=NV});var mC=E(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var jc=ae(),PV={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,jc.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,jc._)`{limit: ${r}}`},RV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:PV,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxItems"?jc.operators.GT:jc.operators.LT;r.fail$data((0,jc._)`${t}.length ${s} ${n}`)}};Nb.default=RV});var Kf=E(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var gC=Qy();gC.code='require("ajv/dist/runtime/equal").default';Pb.default=gC});var yC=E(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var Rb=wc(),xt=ae(),DV=he(),CV=Kf(),OV={message:({params:{i:r,j:e}})=>(0,xt.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,xt._)`{i: ${r}, j: ${e}}`},AV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:OV,code(r){let{gen:e,data:t,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=r;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,Rb.getSchemaTypes)(i.items):[];r.block$data(c,u,(0,xt._)`${o} === false`),r.ok(c);function u(){let T=e.let("i",(0,xt._)`${t}.length`),g=e.let("j");r.setParams({i:T,j:g}),e.assign(c,!0),e.if((0,xt._)`${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"),w=(0,Rb.checkDataTypes)(l,S,a.opts.strictNumbers,Rb.DataType.Wrong),v=e.const("indices",(0,xt._)`{}`);e.for((0,xt._)`;${T}--;`,()=>{e.let(S,(0,xt._)`${t}[${T}]`),e.if(w,(0,xt._)`continue`),l.length>1&&e.if((0,xt._)`typeof ${S} == "string"`,(0,xt._)`${S} += "_"`),e.if((0,xt._)`typeof ${v}[${S}] == "number"`,()=>{e.assign(g,(0,xt._)`${v}[${S}]`),r.error(),e.assign(c,!1).break()}).code((0,xt._)`${v}[${S}] = ${T}`)})}function m(T,g){let S=(0,DV.useFunc)(e,CV.default),w=e.name("outer");e.label(w).for((0,xt._)`;${T}--;`,()=>e.for((0,xt._)`${g} = ${T}; ${g}--;`,()=>e.if((0,xt._)`${S}(${t}[${T}], ${t}[${g}])`,()=>{r.error(),e.assign(c,!1).break(w)})))}}};Db.default=AV});var bC=E(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var Cb=ae(),IV=he(),MV=Kf(),$V={message:"must be equal to constant",params:({schemaCode:r})=>(0,Cb._)`{allowedValue: ${r}}`},LV={keyword:"const",$data:!0,error:$V,code(r){let{gen:e,data:t,$data:n,schemaCode:s,schema:i}=r;n||i&&typeof i=="object"?r.fail$data((0,Cb._)`!${(0,IV.useFunc)(e,MV.default)}(${t}, ${s})`):r.fail((0,Cb._)`${i} !== ${t}`)}};Ob.default=LV});var vC=E(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var Fc=ae(),xV=he(),qV=Kf(),jV={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,Fc._)`{allowedValues: ${r}}`},FV={keyword:"enum",schemaType:"array",$data:!0,error:jV,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,xV.useFunc)(e,qV.default)),u;if(a||n)u=e.let("valid"),r.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let m=e.const("vSchema",i);u=(0,Fc.or)(...s.map((T,g)=>f(m,g)))}r.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,m=>e.if((0,Fc._)`${l()}(${t}, ${m})`,()=>e.assign(u,!0).break()))}function f(m,T){let g=s[T];return typeof g=="object"&&g!==null?(0,Fc._)`${l()}(${t}, ${m}[${T}])`:(0,Fc._)`${t} === ${g}`}}};Ab.default=FV});var TC=E(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var BV=aC(),UV=cC(),VV=dC(),WV=fC(),HV=hC(),zV=pC(),KV=mC(),GV=yC(),YV=bC(),JV=vC(),XV=[BV.default,UV.default,VV.default,WV.default,HV.default,zV.default,KV.default,GV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},YV.default,JV.default];Ib.default=XV});var $b=E(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.validateAdditionalItems=void 0;var hi=ae(),Mb=he(),QV={message:({params:{len:r}})=>(0,hi.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,hi._)`{limit: ${r}}`},ZV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:QV,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,Mb.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}_C(r,n)}};function _C(r,e){let{gen:t,schema:n,data:s,keyword:i,it:o}=r;o.items=!0;let a=t.const("len",(0,hi._)`${s}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,hi._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,Mb.alwaysValidSchema)(o,n)){let l=t.var("valid",(0,hi._)`${a} <= ${e.length}`);t.if((0,hi.not)(l),()=>c(l)),r.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{r.subschema({keyword:i,dataProp:u,dataPropType:Mb.Type.Num},l),o.allErrors||t.if((0,hi.not)(l),()=>t.break())})}}Bc.validateAdditionalItems=_C;Bc.default=ZV});var Lb=E(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.validateTuple=void 0;var SC=ae(),Gf=he(),eW=$r(),tW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return EC(r,"additionalItems",e);t.items=!0,!(0,Gf.alwaysValidSchema)(t,e)&&r.ok((0,eW.validateArray)(r))}};function EC(r,e,t=r.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=r;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=Gf.mergeEvaluated.items(n,t.length,a.items));let c=n.name("valid"),l=n.const("len",(0,SC._)`${i}.length`);t.forEach((d,f)=>{(0,Gf.alwaysValidSchema)(a,d)||(n.if((0,SC._)`${l} > ${f}`,()=>r.subschema({keyword:o,schemaProp:f,dataProp:f},c)),r.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,Gf.checkStrictMode)(a,S,f.strictTuples)}}}Uc.validateTuple=EC;Uc.default=tW});var wC=E(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var rW=Lb(),nW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,rW.validateTuple)(r,"items")};xb.default=nW});var NC=E(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var kC=ae(),sW=he(),iW=$r(),oW=$b(),aW={message:({params:{len:r}})=>(0,kC.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,kC._)`{limit: ${r}}`},cW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:aW,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:s}=t;n.items=!0,!(0,sW.alwaysValidSchema)(n,e)&&(s?(0,oW.validateAdditionalItems)(r,s):r.ok((0,iW.validateArray)(r)))}};qb.default=cW});var PC=E(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var xr=ae(),Yf=he(),lW={message:({params:{min:r,max:e}})=>e===void 0?(0,xr.str)`must contain at least ${r} valid item(s)`:(0,xr.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,xr._)`{minContains: ${r}}`:(0,xr._)`{minContains: ${r}, maxContains: ${e}}`},uW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:lW,code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,xr._)`${s}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,Yf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Yf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Yf.alwaysValidSchema)(i,t)){let g=(0,xr._)`${u} >= ${o}`;a!==void 0&&(g=(0,xr._)`${g} && ${u} <= ${a}`),r.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,xr._)`${s}.length > 0`,f)):(e.let(d,!1),f()),r.result(d,()=>r.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,w=>{r.subschema({keyword:"contains",dataProp:w,dataPropType:Yf.Type.Num,compositeRule:!0},g),S()})}function T(g){e.code((0,xr._)`${g}++`),a===void 0?e.if((0,xr._)`${g} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,xr._)`${g} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,xr._)`${g} >= ${o}`,()=>e.assign(d,!0)))}}};jb.default=uW});var Jf=E(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.validateSchemaDeps=En.validatePropertyDeps=En.error=void 0;var Fb=ae(),dW=he(),Vc=$r();En.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,Fb.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,Fb._)`{property: ${r},
|
|
180
|
+
missingProperty: ${n},
|
|
181
181
|
depsCount: ${e},
|
|
182
|
-
deps: ${t}}`};var IV={keyword:"dependencies",type:"object",schemaType:"object",error:vr.error,code(n){let[e,t]=MV(n);tC(n,e),nC(n,t)}};function MV({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 tC(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,Nb._)`${c} && (${(0,Oc.checkMissingProp)(n,a,i)})`),(0,Oc.reportMissingProp)(n,i),t.else())}}vr.validatePropertyDeps=tC;function nC(n,e=n.schema){let{gen:t,data:r,keyword:s,it:i}=n,o=t.name("valid");for(let a in e)(0,AV.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))}vr.validateSchemaDeps=nC;vr.default=IV});var sC=w(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var rC=ae(),$V=he(),LV={message:"property name must be valid",params:({params:n})=>(0,rC._)`{propertyName: ${n.propertyName}}`},xV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:LV,code(n){let{gen:e,schema:t,data:r,it:s}=n;if((0,$V.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,rC.not)(i),()=>{n.error(!0),s.allErrors||e.break()})}),n.ok(i)}};Pb.default=xV});var Db=w(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Ff=On(),Zn=ae(),qV=Cn(),Bf=he(),jV={message:"must NOT have additional properties",params:({params:n})=>(0,Zn._)`{additionalProperty: ${n.additionalProperty}}`},FV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jV,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,Zn._)`${i} === ${qV.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 k;if(l.length>8){let v=(0,Bf.schemaRefOrVal)(o,r.properties,"properties");k=(0,Ff.isOwnProperty)(e,v,S)}else l.length?k=(0,Zn.or)(...l.map(v=>(0,Zn._)`${S} === ${v}`)):k=Zn.nil;return u.length&&(k=(0,Zn.or)(k,...u.map(v=>(0,Zn._)`${(0,Ff.usePattern)(n,v)}.test(${S})`))),(0,Zn.not)(k)}function m(S){e.code((0,Zn._)`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 k=e.name("valid");c.removeAdditional==="failing"?(g(S,k,!1),e.if((0,Zn.not)(k),()=>{n.reset(),m(S)})):(g(S,k),a||e.if((0,Zn.not)(k),()=>e.break()))}}function g(S,k,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,k)}}};Rb.default=FV});var aC=w(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var BV=gc(),iC=On(),Cb=he(),oC=Db(),UV={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&&oC.default.code(new BV.KeywordCxt(i,oC.default,"additionalProperties"));let o=(0,iC.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Cb.mergeEvaluated.props(e,(0,Cb.toHash)(o),i.props));let a=o.filter(d=>!(0,Cb.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,iC.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)}}};Ob.default=UV});var dC=w(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var cC=On(),Uf=ae(),lC=he(),uC=he(),VV={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,cC.allSchemaProperties)(t),c=a.filter(g=>(0,lC.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,uC.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,lC.checkStrictMode)(i,`property ${S} matches pattern ${g} (use allowMatchingProperties)`)}function T(g){e.forIn("key",r,S=>{e.if((0,Uf._)`${(0,cC.usePattern)(n,g)}.test(${S})`,()=>{let k=c.includes(g);k||n.subschema({keyword:"patternProperties",schemaProp:g,dataProp:S,dataPropType:uC.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,Uf._)`${d}[${S}]`,!0):!k&&!i.allErrors&&e.if((0,Uf.not)(u),()=>e.break())})})}}};Ab.default=VV});var fC=w(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var WV=he(),HV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:e,schema:t,it:r}=n;if((0,WV.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"}};Ib.default=HV});var hC=w(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var KV=On(),zV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:KV.validateUnion,error:{message:"must match a schema in anyOf"}};Mb.default=zV});var pC=w($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Vf=ae(),GV=he(),YV={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,Vf._)`{passingSchemas: ${n.passing}}`},JV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YV,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,GV.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)})})}}};$b.default=JV});var mC=w(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var XV=he(),QV={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,XV.alwaysValidSchema)(r,i))return;let a=n.subschema({keyword:"allOf",schemaProp:o},s);n.ok(s),n.mergeEvaluated(a)})}};Lb.default=QV});var bC=w(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var Wf=ae(),yC=he(),ZV={message:({params:n})=>(0,Wf.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Wf._)`{failingKeyword: ${n.ifClause}}`},e2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ZV,code(n){let{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,yC.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=gC(r,"then"),i=gC(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 gC(n,e){let t=n.schema[e];return t!==void 0&&!(0,yC.alwaysValidSchema)(n,t)}xb.default=e2});var vC=w(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var t2=he(),n2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,t2.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};qb.default=n2});var TC=w(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var r2=_b(),s2=XD(),i2=Sb(),o2=ZD(),a2=eC(),c2=jf(),l2=sC(),u2=Db(),d2=aC(),f2=dC(),h2=fC(),p2=hC(),m2=pC(),g2=mC(),y2=bC(),b2=vC();function v2(n=!1){let e=[h2.default,p2.default,m2.default,g2.default,y2.default,b2.default,l2.default,u2.default,c2.default,d2.default,f2.default];return n?e.push(s2.default,o2.default):e.push(r2.default,i2.default),e.push(a2.default),e}jb.default=v2});var _C=w(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var ot=ae(),T2={message:({schemaCode:n})=>(0,ot.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,ot._)`{format: ${n}}`},_2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:T2,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"),k=t.let("format");t.if((0,ot._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(S,(0,ot._)`${g}.type || "string"`).assign(k,(0,ot._)`${g}.validate`),()=>t.assign(S,(0,ot._)`"string"`).assign(k,g)),n.fail$data((0,ot.or)(v(),b()));function v(){return c.strictSchema===!1?ot.nil:(0,ot._)`${o} && !${k}`}function b(){let R=u.$async?(0,ot._)`(${g}.async ? await ${k}(${r}) : ${k}(${r}))`:(0,ot._)`${k}(${r})`,O=(0,ot._)`(typeof ${k} == "function" ? ${R} : ${k}.test(${r}))`;return(0,ot._)`${k} && ${k} !== true && ${S} === ${e} && !${O}`}}function m(){let T=d.formats[i];if(!T){v();return}if(T===!0)return;let[g,S,k]=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 ${k}(${r})`}return typeof S=="function"?(0,ot._)`${k}(${r})`:(0,ot._)`${k}.test(${r})`}}}};Fb.default=_2});var SC=w(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var S2=_C(),w2=[S2.default];Bb.default=w2});var wC=w(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.contentVocabulary=Mo.metadataVocabulary=void 0;Mo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var EC=w(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var k2=ID(),E2=zD(),N2=TC(),P2=SC(),kC=wC(),R2=[k2.default,E2.default,(0,N2.default)(),P2.default,kC.metadataVocabulary,kC.contentVocabulary];Ub.default=R2});var Wb=w(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.dynamicAnchor=void 0;var Vb=ae(),D2=Cn(),NC=bc(),C2=Af(),O2={keyword:"$dynamicAnchor",schemaType:"string",code:n=>PC(n,n.schema)};function PC(n,e){let{gen:t,it:r}=n;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Vb._)`${D2.default.dynamicAnchors}${(0,Vb.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:A2(n);t.if((0,Vb._)`!${s}`,()=>t.assign(s,i))}Ac.dynamicAnchor=PC;function A2(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 NC.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return NC.compileSchema.call(r,l),(0,C2.getValidate)(n,l)}Ac.default=O2});var Hb=w(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.dynamicRef=void 0;var RC=ae(),I2=Cn(),DC=Af(),M2={keyword:"$dynamicRef",schemaType:"string",code:n=>CC(n,n.schema)};function CC(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,RC._)`${I2.default.dynamicAnchors}${(0,RC.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,DC.callRef)(n,c),t.let(l,!0)}):()=>(0,DC.callRef)(n,c)}}Ic.dynamicRef=CC;Ic.default=M2});var OC=w(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var $2=Wb(),L2=he(),x2={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,$2.dynamicAnchor)(n,""):(0,L2.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};Kb.default=x2});var AC=w(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var q2=Hb(),j2={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,q2.dynamicRef)(n,n.schema)};zb.default=j2});var IC=w(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var F2=Wb(),B2=Hb(),U2=OC(),V2=AC(),W2=[F2.default,B2.default,U2.default,V2.default];Gb.default=W2});var $C=w(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var MC=jf(),H2={keyword:"dependentRequired",type:"object",schemaType:"object",error:MC.error,code:n=>(0,MC.validatePropertyDeps)(n)};Yb.default=H2});var LC=w(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var K2=jf(),z2={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,K2.validateSchemaDeps)(n)};Jb.default=z2});var xC=w(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var G2=he(),Y2={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:e,it:t}){e.contains===void 0&&(0,G2.checkStrictMode)(t,`"${n}" without "contains" is ignored`)}};Xb.default=Y2});var qC=w(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var J2=$C(),X2=LC(),Q2=xC(),Z2=[J2.default,X2.default,Q2.default];Qb.default=Z2});var FC=w(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var Ns=ae(),jC=he(),eW=Cn(),tW={message:"must NOT have unevaluated properties",params:({params:n})=>(0,Ns._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`},nW={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:tW,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} === ${eW.default.errors}`);function c(d){if(t===!1){n.setParams({unevaluatedProperty:d}),n.error(),o||e.break();return}if(!(0,jC.alwaysValidSchema)(i,t)){let f=e.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:jC.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)}}};Zb.default=nW});var UC=w(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});var li=ae(),BC=he(),rW={message:({params:{len:n}})=>(0,li.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,li._)`{limit: ${n}}`},sW={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:rW,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,BC.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:BC.Type.Num},c),s.allErrors||e.if((0,li.not)(c),()=>e.break())})}}};ev.default=sW});var VC=w(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var iW=FC(),oW=UC(),aW=[iW.default,oW.default];tv.default=aW});var HC=w(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DiscrError=void 0;var WC;(function(n){n.Tag="tag",n.Mapping="mapping"})(WC||(Hf.DiscrError=WC={}))});var zC=w(rv=>{"use strict";Object.defineProperty(rv,"__esModule",{value:!0});var $o=ae(),nv=HC(),KC=bc(),cW=yc(),lW=he(),uW={message:({params:{discrError:n,tagName:e}})=>n===nv.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,$o._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},dW={keyword:"discriminator",type:"object",schemaType:"object",error:uW,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,$o._)`${t}${(0,$o.getProperty)(a)}`);e.if((0,$o._)`typeof ${l} == "string"`,()=>u(),()=>n.error(!1,{discrError:nv.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,$o._)`${l} === ${T}`),e.assign(c,d(m[T]));e.else(),n.error(!1,{discrError:nv.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,$o.Name),T}function f(){var m;let T={},g=k(s),S=!0;for(let R=0;R<o.length;R++){let O=o[R];if(O?.$ref&&!(0,lW.schemaHasRulesButRef)(O,i.self.RULES)){let V=O.$ref;if(O=KC.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,V),O instanceof KC.SchemaEnv&&(O=O.schema),O===void 0)throw new cW.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||k(O)),v(L,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return T;function k({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}}}};rv.default=dW});var GC=w((s5,fW)=>{fW.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 YC=w((i5,hW)=>{hW.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 JC=w((o5,pW)=>{pW.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 XC=w((a5,mW)=>{mW.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 QC=w((c5,gW)=>{gW.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((l5,yW)=>{yW.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 eO=w((u5,bW)=>{bW.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 tO=w(sv=>{"use strict";Object.defineProperty(sv,"__esModule",{value:!0});var vW=GC(),TW=YC(),_W=JC(),SW=XC(),wW=QC(),kW=ZC(),EW=eO(),NW=["/properties"];function PW(n){return[vW,TW,_W,SW,e(this,wW),kW,e(this,EW)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,r){return n?t.$dataMetaSchema(r,NW):r}}sv.default=PW});var nO=w((Ge,ov)=>{"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 RW=RD(),DW=EC(),CW=IC(),OW=qC(),AW=VC(),IW=zC(),MW=tO(),iv="https://json-schema.org/draft/2019-09/schema",Lo=class extends RW.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(CW.default),DW.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(OW.default),this.addVocabulary(AW.default),this.opts.discriminator&&this.addKeyword(IW.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(MW.default.call(this,e),this.refs["http://json-schema.org/schema"]=iv)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(iv)?iv:void 0)}};Ge.Ajv2019=Lo;ov.exports=Ge=Lo;ov.exports.Ajv2019=Lo;Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=Lo;var $W=gc();Object.defineProperty(Ge,"KeywordCxt",{enumerable:!0,get:function(){return $W.KeywordCxt}});var xo=ae();Object.defineProperty(Ge,"_",{enumerable:!0,get:function(){return xo._}});Object.defineProperty(Ge,"str",{enumerable:!0,get:function(){return xo.str}});Object.defineProperty(Ge,"stringify",{enumerable:!0,get:function(){return xo.stringify}});Object.defineProperty(Ge,"nil",{enumerable:!0,get:function(){return xo.nil}});Object.defineProperty(Ge,"Name",{enumerable:!0,get:function(){return xo.Name}});Object.defineProperty(Ge,"CodeGen",{enumerable:!0,get:function(){return xo.CodeGen}});var LW=kf();Object.defineProperty(Ge,"ValidationError",{enumerable:!0,get:function(){return LW.default}});var xW=yc();Object.defineProperty(Ge,"MissingRefError",{enumerable:!0,get:function(){return xW.default}})});var Ce=G(Gw());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=Jw(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=Yw(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=Yw(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=em(i.map(ZI),(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 em(n,e){if(n.length<=1)return n;let t=n.length/2|0,r=n.slice(0,t),s=n.slice(t);em(r,e),em(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 Yw(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 Jw(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 ZI(n){let e=Jw(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 Xw=G(X());var tm=(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=>tm(n.tokenIndexes.start,n.tokenIndexes.end),Qw=" ",Zw=n=>{Qw=n},ji=()=>Qw,qs=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)),ek=(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),tk=(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 sr=(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=Xw.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}),nk=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=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 x=(n,e)=>n?.tokens.some(t=>t===e),Xe=n=>e=>e?.value&&n===e.value?"yes":eM(n)(e),Pe=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",eM=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",ir=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,pn=(n,e)=>!!n&&!!e&&ir(n,e)&&n.pos.col+n.pos.len===e.pos.col,vu=n=>n.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),Fs=(n,e,t)=>vu(n).sort(s=>s.context.name===t?-1:0).find(s=>s.files.some(i=>i===e)),rk=(n,e)=>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(qs(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 ck=G(X());var sk=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:sk.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var ok=G(X());var ik=G(X());var or=class extends B{toJson(){return-1}},ia=class extends or{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 or{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:ik.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:ok.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 ak=G(X()),Zr=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:ak.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:ck.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 Zr?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 lk=G(X()),ar=class extends B{constructor(t,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:t,kind:lk.SymbolKind.Function}}};var kn=class extends ar{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 ar{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 kn)}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"/"}},kt=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)}},Ie=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(qs("type"),js("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{t(qs("decorator"),js("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var uk=G(X()),ke=class extends B{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:uk.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var lr=G(X());var bt=n=>n instanceof ar?!0:n instanceof Be?!1:n.parentNode?bt(n.parentNode):!1;var Ui=n=>[...n.filter(t=>t instanceof we||t instanceof kt).map(t=>t instanceof we?t.name:t.labelReference)].filter(t=>!!t);var ft=G(X());var dk=G(X());var Cr=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:dk.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 fk=require("path"),es=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,fk.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 cr=class extends B{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var tM=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 sr(s,e,r)},nm=n=>{if(n)return n instanceof Be?n:nm(n?.parentNode)},Hi=(n,e,t=0)=>!e||e.uri!==n?t:Hi(n,nm(e.parentNode),t+1),nM=(n,e)=>async t=>{let r=await tM(t.firstToken,e,n);return!r||r===t||t.allDescendants.some(i=>i===r)?0:r instanceof Be?Hi(e,nm(r)):void 0};async function hk(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 pk(n,i,r,nM(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
|
-
`))}},
|
|
184
|
-
${
|
|
182
|
+
deps: ${t}}`};var fW={keyword:"dependencies",type:"object",schemaType:"object",error:En.error,code(r){let[e,t]=hW(r);RC(r,e),DC(r,t)}};function hW({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let s=Array.isArray(r[n])?e:t;s[n]=r[n]}return[e,t]}function RC(r,e=r.schema){let{gen:t,data:n,it:s}=r;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,Vc.propertyInData)(t,n,o,s.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Vc.checkReportMissingProp)(r,l)}):(t.if((0,Fb._)`${c} && (${(0,Vc.checkMissingProp)(r,a,i)})`),(0,Vc.reportMissingProp)(r,i),t.else())}}En.validatePropertyDeps=RC;function DC(r,e=r.schema){let{gen:t,data:n,keyword:s,it:i}=r,o=t.name("valid");for(let a in e)(0,dW.alwaysValidSchema)(i,e[a])||(t.if((0,Vc.propertyInData)(t,n,a,i.opts.ownProperties),()=>{let c=r.subschema({keyword:s,schemaProp:a},o);r.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),r.ok(o))}En.validateSchemaDeps=DC;En.default=fW});var OC=E(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var CC=ae(),pW=he(),mW={message:"property name must be valid",params:({params:r})=>(0,CC._)`{propertyName: ${r.propertyName}}`},gW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:mW,code(r){let{gen:e,schema:t,data:n,it:s}=r;if((0,pW.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",n,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,CC.not)(i),()=>{r.error(!0),s.allErrors||e.break()})}),r.ok(i)}};Bb.default=gW});var Vb=E(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Xf=$r(),nn=ae(),yW=Mr(),Qf=he(),bW={message:"must NOT have additional properties",params:({params:r})=>(0,nn._)`{additionalProperty: ${r.additionalProperty}}`},vW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:bW,code(r){let{gen:e,schema:t,parentSchema:n,data:s,errsCount:i,it:o}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Qf.alwaysValidSchema)(o,t))return;let l=(0,Xf.allSchemaProperties)(n.properties),u=(0,Xf.allSchemaProperties)(n.patternProperties);d(),r.ok((0,nn._)`${i} === ${yW.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 w;if(l.length>8){let v=(0,Qf.schemaRefOrVal)(o,n.properties,"properties");w=(0,Xf.isOwnProperty)(e,v,S)}else l.length?w=(0,nn.or)(...l.map(v=>(0,nn._)`${S} === ${v}`)):w=nn.nil;return u.length&&(w=(0,nn.or)(w,...u.map(v=>(0,nn._)`${(0,Xf.usePattern)(r,v)}.test(${S})`))),(0,nn.not)(w)}function m(S){e.code((0,nn._)`delete ${s}[${S}]`)}function T(S){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){m(S);return}if(t===!1){r.setParams({additionalProperty:S}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,Qf.alwaysValidSchema)(o,t)){let w=e.name("valid");c.removeAdditional==="failing"?(g(S,w,!1),e.if((0,nn.not)(w),()=>{r.reset(),m(S)})):(g(S,w),a||e.if((0,nn.not)(w),()=>e.break()))}}function g(S,w,v){let b={keyword:"additionalProperties",dataProp:S,dataPropType:Qf.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(b,w)}}};Ub.default=vW});var MC=E(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var TW=Rc(),AC=$r(),Wb=he(),IC=Vb(),_W={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&IC.default.code(new TW.KeywordCxt(i,IC.default,"additionalProperties"));let o=(0,AC.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Wb.mergeEvaluated.props(e,(0,Wb.toHash)(o),i.props));let a=o.filter(d=>!(0,Wb.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,AC.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),r.it.definedProperties.add(d),r.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){r.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Hb.default=_W});var qC=E(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var $C=$r(),Zf=ae(),LC=he(),xC=he(),SW={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:s,it:i}=r,{opts:o}=i,a=(0,$C.allSchemaProperties)(t),c=a.filter(g=>(0,LC.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 Zf.Name)&&(i.props=(0,xC.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,LC.checkStrictMode)(i,`property ${S} matches pattern ${g} (use allowMatchingProperties)`)}function T(g){e.forIn("key",n,S=>{e.if((0,Zf._)`${(0,$C.usePattern)(r,g)}.test(${S})`,()=>{let w=c.includes(g);w||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:S,dataPropType:xC.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,Zf._)`${d}[${S}]`,!0):!w&&!i.allErrors&&e.if((0,Zf.not)(u),()=>e.break())})})}}};zb.default=SW});var jC=E(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var EW=he(),wW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,EW.alwaysValidSchema)(n,t)){r.fail();return}let s=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};Kb.default=wW});var FC=E(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var kW=$r(),NW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:kW.validateUnion,error:{message:"must match a schema in anyOf"}};Gb.default=NW});var BC=E(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var eh=ae(),PW=he(),RW={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,eh._)`{passingSchemas: ${r.passing}}`},DW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:RW,code(r){let{gen:e,schema:t,parentSchema:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");r.setParams({passing:a}),e.block(l),r.result(o,()=>r.reset(),()=>r.error(!0));function l(){i.forEach((u,d)=>{let f;(0,PW.alwaysValidSchema)(s,u)?e.var(c,!0):f=r.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,eh._)`${c} && ${o}`).assign(o,!1).assign(a,(0,eh._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&r.mergeEvaluated(f,eh.Name)})})}}};Yb.default=DW});var UC=E(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var CW=he(),OW={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,CW.alwaysValidSchema)(n,i))return;let a=r.subschema({keyword:"allOf",schemaProp:o},s);r.ok(s),r.mergeEvaluated(a)})}};Jb.default=OW});var HC=E(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var th=ae(),WC=he(),AW={message:({params:r})=>(0,th.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,th._)`{failingKeyword: ${r.ifClause}}`},IW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:AW,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,WC.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=VC(n,"then"),i=VC(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),r.reset(),s&&i){let u=e.let("ifClause");r.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,th.not)(a),l("else"));r.pass(o,()=>r.error(!0));function c(){let u=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(u)}function l(u,d){return()=>{let f=r.subschema({keyword:u},a);e.assign(o,a),r.mergeValidEvaluated(f,o),d?e.assign(d,(0,th._)`${u}`):r.setParams({ifClause:u})}}}};function VC(r,e){let t=r.schema[e];return t!==void 0&&!(0,WC.alwaysValidSchema)(r,t)}Xb.default=IW});var zC=E(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var MW=he(),$W={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,MW.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};Qb.default=$W});var KC=E(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var LW=$b(),xW=wC(),qW=Lb(),jW=NC(),FW=PC(),BW=Jf(),UW=OC(),VW=Vb(),WW=MC(),HW=qC(),zW=jC(),KW=FC(),GW=BC(),YW=UC(),JW=HC(),XW=zC();function QW(r=!1){let e=[zW.default,KW.default,GW.default,YW.default,JW.default,XW.default,UW.default,VW.default,BW.default,WW.default,HW.default];return r?e.push(xW.default,jW.default):e.push(LW.default,qW.default),e.push(FW.default),e}Zb.default=QW});var GC=E(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});var dt=ae(),ZW={message:({schemaCode:r})=>(0,dt.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,dt._)`{format: ${r}}`},e2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ZW,code(r,e){let{gen:t,data:n,$data:s,schema:i,schemaCode:o,it:a}=r,{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,dt._)`${T}[${o}]`),S=t.let("fType"),w=t.let("format");t.if((0,dt._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(S,(0,dt._)`${g}.type || "string"`).assign(w,(0,dt._)`${g}.validate`),()=>t.assign(S,(0,dt._)`"string"`).assign(w,g)),r.fail$data((0,dt.or)(v(),b()));function v(){return c.strictSchema===!1?dt.nil:(0,dt._)`${o} && !${w}`}function b(){let R=u.$async?(0,dt._)`(${g}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,dt._)`${w}(${n})`,A=(0,dt._)`(typeof ${w} == "function" ? ${R} : ${w}.test(${n}))`;return(0,dt._)`${w} && ${w} !== true && ${S} === ${e} && !${A}`}}function m(){let T=d.formats[i];if(!T){v();return}if(T===!0)return;let[g,S,w]=b(T);g===e&&r.pass(R());function v(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function b(A){let L=A instanceof RegExp?(0,dt.regexpCode)(A):c.code.formats?(0,dt._)`${c.code.formats}${(0,dt.getProperty)(i)}`:void 0,W=t.scopeValue("formats",{key:i,ref:A,code:L});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,dt._)`${W}.validate`]:["string",A,W]}function R(){if(typeof T=="object"&&!(T instanceof RegExp)&&T.async){if(!u.$async)throw new Error("async format in sync schema");return(0,dt._)`await ${w}(${n})`}return typeof S=="function"?(0,dt._)`${w}(${n})`:(0,dt._)`${w}.test(${n})`}}}};ev.default=e2});var YC=E(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var t2=GC(),r2=[t2.default];tv.default=r2});var JC=E(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.contentVocabulary=Bo.metadataVocabulary=void 0;Bo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Bo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var QC=E(rv=>{"use strict";Object.defineProperty(rv,"__esModule",{value:!0});var n2=oC(),s2=TC(),i2=KC(),o2=YC(),XC=JC(),a2=[n2.default,s2.default,(0,i2.default)(),o2.default,XC.metadataVocabulary,XC.contentVocabulary];rv.default=a2});var sv=E(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.dynamicAnchor=void 0;var nv=ae(),c2=Mr(),ZC=Cc(),l2=Vf(),u2={keyword:"$dynamicAnchor",schemaType:"string",code:r=>eO(r,r.schema)};function eO(r,e){let{gen:t,it:n}=r;n.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,nv._)`${c2.default.dynamicAnchors}${(0,nv.getProperty)(e)}`,i=n.errSchemaPath==="#"?n.validateName:d2(r);t.if((0,nv._)`!${s}`,()=>t.assign(s,i))}Wc.dynamicAnchor=eO;function d2(r){let{schemaEnv:e,schema:t,self:n}=r.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new ZC.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return ZC.compileSchema.call(n,l),(0,l2.getValidate)(r,l)}Wc.default=u2});var iv=E(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.dynamicRef=void 0;var tO=ae(),f2=Mr(),rO=Vf(),h2={keyword:"$dynamicRef",schemaType:"string",code:r=>nO(r,r.schema)};function nO(r,e){let{gen:t,keyword:n,it:s}=r;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),r.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,tO._)`${f2.default.dynamicAnchors}${(0,tO.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,rO.callRef)(r,c),t.let(l,!0)}):()=>(0,rO.callRef)(r,c)}}Hc.dynamicRef=nO;Hc.default=h2});var sO=E(ov=>{"use strict";Object.defineProperty(ov,"__esModule",{value:!0});var p2=sv(),m2=he(),g2={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,p2.dynamicAnchor)(r,""):(0,m2.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};ov.default=g2});var iO=E(av=>{"use strict";Object.defineProperty(av,"__esModule",{value:!0});var y2=iv(),b2={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,y2.dynamicRef)(r,r.schema)};av.default=b2});var oO=E(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var v2=sv(),T2=iv(),_2=sO(),S2=iO(),E2=[v2.default,T2.default,_2.default,S2.default];cv.default=E2});var cO=E(lv=>{"use strict";Object.defineProperty(lv,"__esModule",{value:!0});var aO=Jf(),w2={keyword:"dependentRequired",type:"object",schemaType:"object",error:aO.error,code:r=>(0,aO.validatePropertyDeps)(r)};lv.default=w2});var lO=E(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var k2=Jf(),N2={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,k2.validateSchemaDeps)(r)};uv.default=N2});var uO=E(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});var P2=he(),R2={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,P2.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};dv.default=R2});var dO=E(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});var D2=cO(),C2=lO(),O2=uO(),A2=[D2.default,C2.default,O2.default];fv.default=A2});var hO=E(hv=>{"use strict";Object.defineProperty(hv,"__esModule",{value:!0});var Cs=ae(),fO=he(),I2=Mr(),M2={message:"must NOT have unevaluated properties",params:({params:r})=>(0,Cs._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},$2={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:M2,code(r){let{gen:e,schema:t,data:n,errsCount:s,it:i}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Cs.Name?e.if((0,Cs._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,r.ok((0,Cs._)`${s} === ${I2.default.errors}`);function c(d){if(t===!1){r.setParams({unevaluatedProperty:d}),r.error(),o||e.break();return}if(!(0,fO.alwaysValidSchema)(i,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:fO.Type.Str},f),o||e.if((0,Cs.not)(f),()=>e.break())}}function l(d,f){return(0,Cs._)`!${d} || !${d}[${f}]`}function u(d,f){let m=[];for(let T in d)d[T]===!0&&m.push((0,Cs._)`${f} !== ${T}`);return(0,Cs.and)(...m)}}};hv.default=$2});var mO=E(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});var pi=ae(),pO=he(),L2={message:({params:{len:r}})=>(0,pi.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,pi._)`{limit: ${r}}`},x2={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:L2,code(r){let{gen:e,schema:t,data:n,it:s}=r,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,pi._)`${n}.length`);if(t===!1)r.setParams({len:i}),r.fail((0,pi._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,pO.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,pi._)`${o} <= ${i}`);e.if((0,pi.not)(c),()=>a(c,i)),r.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{r.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:pO.Type.Num},c),s.allErrors||e.if((0,pi.not)(c),()=>e.break())})}}};pv.default=x2});var gO=E(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});var q2=hO(),j2=mO(),F2=[q2.default,j2.default];mv.default=F2});var bO=E(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.DiscrError=void 0;var yO;(function(r){r.Tag="tag",r.Mapping="mapping"})(yO||(rh.DiscrError=yO={}))});var TO=E(yv=>{"use strict";Object.defineProperty(yv,"__esModule",{value:!0});var Uo=ae(),gv=bO(),vO=Cc(),B2=Dc(),U2=he(),V2={message:({params:{discrError:r,tagName:e}})=>r===gv.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,Uo._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},W2={keyword:"discriminator",type:"object",schemaType:"object",error:V2,code(r){let{gen:e,data:t,schema:n,parentSchema:s,it:i}=r,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Uo._)`${t}${(0,Uo.getProperty)(a)}`);e.if((0,Uo._)`typeof ${l} == "string"`,()=>u(),()=>r.error(!1,{discrError:gv.DiscrError.Tag,tag:l,tagName:a})),r.ok(c);function u(){let m=f();e.if(!1);for(let T in m)e.elseIf((0,Uo._)`${l} === ${T}`),e.assign(c,d(m[T]));e.else(),r.error(!1,{discrError:gv.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(m){let T=e.name("valid"),g=r.subschema({keyword:"oneOf",schemaProp:m},T);return r.mergeEvaluated(g,Uo.Name),T}function f(){var m;let T={},g=w(s),S=!0;for(let R=0;R<o.length;R++){let A=o[R];if(A?.$ref&&!(0,U2.schemaHasRulesButRef)(A,i.self.RULES)){let W=A.$ref;if(A=vO.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,W),A instanceof vO.SchemaEnv&&(A=A.schema),A===void 0)throw new B2.default(i.opts.uriResolver,i.baseId,W)}let L=(m=A?.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||w(A)),v(L,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return T;function w({required:R}){return Array.isArray(R)&&R.includes(a)}function v(R,A){if(R.const)b(R.const,A);else if(R.enum)for(let L of R.enum)b(L,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(R,A){if(typeof R!="string"||R in T)throw new Error(`discriminator: "${a}" values must be unique strings`);T[R]=A}}}};yv.default=W2});var _O=E((ree,H2)=>{H2.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 SO=E((nee,z2)=>{z2.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 EO=E((see,K2)=>{K2.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 wO=E((iee,G2)=>{G2.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 kO=E((oee,Y2)=>{Y2.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 NO=E((aee,J2)=>{J2.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 PO=E((cee,X2)=>{X2.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 RO=E(bv=>{"use strict";Object.defineProperty(bv,"__esModule",{value:!0});var Q2=_O(),Z2=SO(),eH=EO(),tH=wO(),rH=kO(),nH=NO(),sH=PO(),iH=["/properties"];function oH(r){return[Q2,Z2,eH,tH,e(this,rH),nH,e(this,sH)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,n){return r?t.$dataMetaSchema(n,iH):n}}bv.default=oH});var DO=E((Je,Tv)=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.MissingRefError=Je.ValidationError=Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=Je.Ajv2019=void 0;var aH=tC(),cH=QC(),lH=oO(),uH=dO(),dH=gO(),fH=TO(),hH=RO(),vv="https://json-schema.org/draft/2019-09/schema",Vo=class extends aH.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(lH.default),cH.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(uH.default),this.addVocabulary(dH.default),this.opts.discriminator&&this.addKeyword(fH.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(hH.default.call(this,e),this.refs["http://json-schema.org/schema"]=vv)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(vv)?vv:void 0)}};Je.Ajv2019=Vo;Tv.exports=Je=Vo;Tv.exports.Ajv2019=Vo;Object.defineProperty(Je,"__esModule",{value:!0});Je.default=Vo;var pH=Rc();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return pH.KeywordCxt}});var Wo=ae();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return Wo._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return Wo.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return Wo.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return Wo.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return Wo.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return Wo.CodeGen}});var mH=$f();Object.defineProperty(Je,"ValidationError",{enumerable:!0,get:function(){return mH.default}});var gH=Dc();Object.defineProperty(Je,"MissingRefError",{enumerable:!0,get:function(){return gH.default}})});var Ie=K(cw());var Nu=class r{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,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),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let n of e)if(r.isIncremental(n)){let s=uw(n.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+n.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=lw(n.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=n.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(r.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=lw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,s=t.length;if(s===0)return{line:0,character:e};for(;n<s;){let o=Math.floor((n+s)/2);t[o]>e?s=o:n=o+1}let i=n-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 n=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,s),n)}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}},Pu;(function(r){function e(s,i,o,a){return new Nu(s,i,o,a)}r.create=e;function t(s,i,o){if(s instanceof Nu)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}r.update=t;function n(s,i){let o=s.getText(),a=dm(i.map(NM),(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("")}r.applyEdits=n})(Pu||(Pu={}));function dm(r,e){if(r.length<=1)return r;let t=r.length/2|0,n=r.slice(0,t),s=r.slice(t);dm(n,e),dm(s,e);let i=0,o=0,a=0;for(;i<n.length&&o<s.length;)e(n[i],s[o])<=0?r[a++]=n[i++]:r[a++]=s[o++];for(;i<n.length;)r[a++]=n[i++];for(;o<s.length;)r[a++]=s[o++];return r}function lw(r,e,t=0){let n=e?[t]:[];for(let s=0;s<r.length;s++){let i=r.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<r.length&&r.charCodeAt(s+1)===10&&s++,n.push(t+s+1))}return n}function uw(r){let e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}function NM(r){let e=uw(r.range);return e!==r.range?{newText:r.newText,range:e}:r}var Ru=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],Du=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var dw=K(Y());var Us=(r,e,t=!0,n=!0)=>({start:{line:r?.pos.line??0,character:t?r?.pos.col??0:(r?.pos.col??0)+(r?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}}),Q=r=>Us(r.tokenIndexes.start,r.tokenIndexes.end),fw=" ",hw=r=>{fw=r},Wi=()=>fw,Vs=r=>Ru.findIndex(e=>e===r),Ws=r=>Du.findIndex(e=>e===r),fm=(r,e,t)=>r.uri!==e||t.line<r.pos.line?!1:t.line>r.pos.line?!0:t.character>r.pos.col+r.pos.len,PM=(r,e,t)=>r.uri!==e?!1:t.line<r.pos.line?!0:t.line>r.pos.line?!1:t.character<r.pos.col,mr=(r,e,t)=>!!(r.uri===e&&r.tokenIndexes?.start&&r.tokenIndexes?.end&&(r.tokenIndexes.start.pos.line<t.line||r.tokenIndexes.start.pos.line===t.line&&r.tokenIndexes.start.pos.col<=t.character)&&(r.tokenIndexes.end.pos.line>t.line||r.tokenIndexes.end.pos.line===t.line&&r.tokenIndexes.end.pos.col+r.tokenIndexes.end.pos.len>=t.character)),pw=(r,e,t)=>!!(r.uri===e&&r.lastToken.value!==";"&&r.tokenIndexes?.start&&r.tokenIndexes?.end&&(r.tokenIndexes.start.pos.line===t.line||r.tokenIndexes.end.pos.line===t.line)&&t.character>=r.tokenIndexes.end.pos.col+r.tokenIndexes.end.pos.len),mw=(r,e,t)=>{if(!r)return!1;let s=r.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var ln=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].reverse().find(i=>mr(i,e,t));return n},ha=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].find(i=>PM(i.lastToken,e,t));return n===r?void 0:n},pa=(r,e,t)=>{let n=r,s=r;for(;s;)n=s,s=[...n.children].reverse().find(i=>fm(i.firstToken,e,t));return n===r?void 0:n},D=(r,e,t=dw.DiagnosticSeverity.Error,n=[],s=void 0,i=[],o,a)=>({issues:Array.isArray(r)?r:[r],astElement:e,severity:t,linkedTo:n,tags:s,templateStrings:i,edit:o,codeActionTitle:a}),gw=r=>[...r].sort((t,n)=>{if(t.sortKey===void 0||n.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==n.sortKey)return t.sortKey-n.sortKey;if(!t.tokenIndexes?.end||!n.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==n.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-n.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-n.tokenIndexes.end.pos.col});async function At(r,e,t,n){let s=r.textDocument.uri.replace("file://",""),i=Hs(e,s,n);if(!i)return[];console.time("search");let a=(await i.context.getRuntime()).getDeepestAstNode(s,r.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=r.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 X(r,e){return{start:r,end:e??r}}var x=(r,e)=>r?.tokens.some(t=>t===e),Ze=r=>e=>e?.value&&r===e.value?"yes":RM(r)(e),Ne=r=>e=>e?.tokens.some(t=>t===r)?"yes":"no",RM=r=>e=>e?.value&&r.startsWith(e.value)?"partial":"no",Nr=(r,e)=>!!r&&!!e&&r.pos.line===e.pos.line&&r.uri===e.uri,Kt=(r,e)=>!!r&&!!e&&Nr(r,e)&&r.pos.col+r.pos.len===e.pos.col,Cu=r=>r.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),Hs=(r,e,t)=>Cu(r).sort(s=>s.context.name===t?-1:0).find(s=>s.files.some(i=>i===e)),yw=(r,e)=>Cu(r).filter(n=>n.files.some(s=>s===e));var Hi=K(Y()),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(n=>n.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=Q(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=Q(this);return[{location:Hi.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===Hi.SymbolKind.File||t.kind===Hi.SymbolKind.Class||t.kind===Hi.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(Vs(this.semanticTokenType),Ws(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 zi=K(Y());var Sw=K(Y());var bw=K(Y()),Ce=class extends B{constructor(t,n){super(n);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:bw.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var Tw=K(Y());var vw=K(Y());function DM(r){return r.replace(/'(.)'/g,(e,t)=>t.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function CM(r){try{return(0,eval)(DM(r))}catch(e){console.log(e)}return r}var un=class extends B{toJson(){return-1}evaluate(e){return CM(e.expandMacros(this.toString()))}},ma=class extends un{constructor(t,n){super();this.expression=t;this.join=n;this.addChild(t),n&&(this.addChild(n.operator),this.addChild(n.expression))}addExpression(t,n){this.addChild(t),this.addChild(n)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var wt=class extends un{constructor(t,n){super(n);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:vw.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}toJson(){return this.value}};var pt=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:Tw.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}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),n=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{n.setUint32(i*4,s)}),n.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}};var _w=K(Y()),ss=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:_w.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}};var He=class extends B{constructor(t,n){super(n);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},je=class extends B{constructor(t,n=[]){super();this.propertyName=t;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:Sw.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 Ce?t.value.value:t.value instanceof pt?t.value.values.map(n=>n.value instanceof wt?n.value.value:NaN):t.value instanceof ss?t.value.values.map(n=>n.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(t=>t?.toString()??"NULL").join(", ")??"NULL"}`:""};`}};var Ew=K(Y()),Gt=class extends B{constructor(t,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:t,kind:Ew.SymbolKind.Function}}};var ir=class extends Gt{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 Fe=class extends Gt{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 ze=class r extends B{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof ct)return[this.pathName];if(!(this.parentNode instanceof r))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof r)}get deleteNodes(){return this.children.filter(e=>e instanceof ir)}addNodeChild(e){this.addChild(e)}},ct=class extends ze{constructor(){super(),this.docSymbolsMeta={name:"/",kind:zi.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof je)}get name(){return new Le("/",X(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof Fe)}get nodes(){return this.children.filter(e=>e instanceof Pe)}get pathName(){return"/"}},kt=class extends ze{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:zi.SymbolKind.Class},t.forEach(n=>{super.addChild(n)})}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:zi.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 Pe)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof je)}get deleteProperties(){return this.children.filter(t=>t instanceof Fe)}},Pe=class r extends ze{constructor(t=[],n){super();this.labels=t;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:zi.SymbolKind.Class},n&&this.addChild(n),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:zi.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof r)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof je)}get deleteProperties(){return this.children.filter(t=>t instanceof Fe)}},Ou=class extends B{constructor(t,n){super(n);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address.toString(16)}},Le=class extends B{constructor(t,n,s){super(n);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(n=>this.addChild(n)))}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 n={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(Vs("type"),Ws("declaration"),{start:n,end:n}),this.address!==void 0&&this.address.forEach(s=>{t(Vs("decorator"),Ws("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var ww=K(Y()),ve=class extends B{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:ww.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var zr=K(Y());var bt=r=>r instanceof Gt?!0:r instanceof ze?!1:r.parentNode?bt(r.parentNode):!1;var Ki=r=>[...r.map(e=>{if(e instanceof Pe||e instanceof ct)return e.name;if(e instanceof kt)return e.labelReference})].filter(e=>!!e),hm=(r,e)=>e?e.parentNode===r||hm(r,e.parentNode):!1;var ot=K(Y());var kw=K(Y());var Mn=class extends B{constructor(){super();this._pathParts=[]}addPath(t,n){this._pathParts.push(t),n&&this.addChild(n),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},Wr=class extends B{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:kw.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}};var rt=K(Y());var Au=K(Y());var Nw=require("path"),is=class extends B{constructor(t,n){super();this.keyword=t;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:Au.SymbolKind.File},this.addChild(t),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:Au.SymbolKind.File},this._resolvedPath=t}},Gi=class extends B{constructor(t,n,s){super(s);this._path=t;this.relative=n;this.docSymbolsMeta={name:(0,Nw.basename)(this.path),kind:Au.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var dn=class extends B{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var OM=async(r,e,t)=>{let n=rt.Position.create(r.pos.line,r.pos.col),s=t.find(i=>mr(i,e,n));if(s)return ln(s,e,n)},pm=r=>{if(r)return r instanceof ze?r:pm(r?.parentNode)},Ji=(r,e,t=0)=>!e||e.uri!==r?t:Ji(r,pm(e.parentNode),t+1),AM=(r,e)=>async t=>{let n=await OM(t.firstToken,e,r);return!n||n===t||t.allDescendants.some(i=>i===n)?0:n instanceof ze?Ji(e,pm(n)):void 0};async function Pw(r,e){let t=[],n=r.textDocument.uri.replace("file://",""),s=(await e.getRuntime()).fileTopMostAst(n);return t.push(...(await Promise.all(s.flatMap(async i=>await Rw(r,i,n,AM(s,n))))).flat()),t}var zs=(r,e=1)=>{if(r.prevToken){let t=r.pos.line-r.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return rt.TextEdit.replace(rt.Range.create(rt.Position.create(r.prevToken.pos.line,r.prevToken.pos.col+r.prevToken.pos.len),rt.Position.create(r.pos.line-e,r.pos.col)),"".padEnd(e-1,`
|
|
183
|
+
`))}},Yi=(r,e,t,n="")=>{if(r.pos.line===r.prevToken?.pos.line)return rt.TextEdit.replace(rt.Range.create(rt.Position.create(r.pos.line,r.pos.col),rt.Position.create(r.pos.line,r.pos.col)),`
|
|
184
|
+
${n}${"".padStart(e*t.length,t)}`)},os=(r,e,t,n="")=>rt.TextEdit.replace(rt.Range.create(rt.Position.create(r.pos.line,0),rt.Position.create(r.pos.line,r.pos.col)),`${"".padStart(e*t.length,t)}${n}`),mt=(r,e=1)=>{if(!r.nextToken)return[];if(r.nextToken?.pos.line!==r.pos.line){let n=zs(r.nextToken,0);if(!n)throw new Error("remove new LinesEdit must be defined");return[rt.TextEdit.insert(rt.Position.create(r.pos.line,r.pos.col+r.pos.len),"".padEnd(e," ")),n]}return r.nextToken.pos.col-(r.pos.col+r.pos.len)===e?[]:[rt.TextEdit.replace(rt.Range.create(rt.Position.create(r.pos.line,r.pos.col+r.pos.len),rt.Position.create(r.nextToken.pos.line,r.nextToken.pos.col)),"".padEnd(e," "))]},IM=async(r,e,t,n,s,i)=>{if(e.uri!==t)return[];let o=[],a=Yi(e.firstToken,n,s);if(a)o.push(a);else{o.push(os(e.firstToken,n,s));let l=zs(e.firstToken);l&&o.push(l)}if(e instanceof Pe||e instanceof kt)if(o.push(...e.labels.flatMap(l=>mt(l.lastToken))),e instanceof Pe){let l=e.name&&e.openScope?mt(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?mt(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>Rw(r,l,t,i,n+1)))).flat()),e.closeScope){let l=Yi(e.closeScope,n,s);if(l)o.push(l);else{o.push(os(e.closeScope,n,s));let u=zs(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?mt(e.lastToken.prevToken,0):[];return o.push(...c),o},MM=(r,e,t,n)=>{let s=[];if(s.push(...mt(r.lastToken,n?0:1)),r.firstToken.pos.line!==r.firstToken.prevToken?.pos.line){let i=zs(r.firstToken);i&&s.push(i),s.push(os(r.firstToken,e+1,t))}return r.value,s},$M=(r,e,t,n)=>{let s=[];return r instanceof pt||r instanceof ss?(r.openBracket&&s.push(...mt(r.openBracket,0)),s.push(...r.values.flatMap((i,o)=>MM(i,e,t,o+1===r.values.length&&r.lastToken.nextToken===r.closeBracket))),r.closeBracket&&r.closeBracket?.nextToken?.value!==";"&&r.openBracket&&s.push(...mt(r.closeBracket,0))):r?.lastToken&&n&&s.push(...mt(r.lastToken,r?.lastToken.nextToken?.value===","?0:1)),s},LM=(r,e,t,n)=>{let s=[];return s.push(...r.startLabels.flatMap((i,o)=>o+1===r.startLabels.length?[]:mt(i.lastToken))),s.push(...$M(r.value,e,t,!n||r.endLabels.length>0)),s.push(...r.endLabels.flatMap((i,o)=>o+1===r.endLabels.length?[]:mt(i.lastToken))),s},xM=(r,e,t)=>{let n=[],s=i=>{if(i&&mr(r,r.uri,rt.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return r.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=r.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)n.push(...mt(a,1));else if(c?.firstToken){let l=zs(c?.firstToken);l&&n.push(l),n.push(os(c?.firstToken,e+1,t))}}}),[...n,...r.values.flatMap((i,o)=>i?LM(i,e,t,o+1===r.values.length):[])]},qM=(r,e,t)=>{let n=[],s=Yi(r.firstToken,e,t);if(s)n.push(s);else{n.push(os(r.firstToken,e,t));let o=zs(r.firstToken);o&&n.push(o)}if(n.push(...r.labels.flatMap(o=>mt(o.lastToken))),r.values){if(r.propertyName){n.push(...mt(r.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(r.propertyName?.lastToken.nextToken);a&&n.push(...mt(a))}n.push(...xM(r.values,e,t))}let i=r.lastToken.value===";"&&r.lastToken.prevToken?mt(r.lastToken.prevToken,0):[];return n.push(...i),n},jM=(r,e,t)=>{let n=[],s=Yi(r.firstToken,e,t);s?n.push(s):n.push(os(r.firstToken,e,t));let i=mt(r.keyword.lastToken);n.push(...i);let o=r.lastToken.value===";"&&r.lastToken.prevToken?mt(r.lastToken.prevToken,0):[];return n.push(...o),n},FM=(r,e,t,n)=>{if(t===void 0)return[];if(r.uri!==e)return[];let s=[],i=Yi(r.firstToken,t,n);i?s.push(i):s.push(os(r.firstToken,t,n));let o=mt(r.keyword.lastToken);return s.push(...o),s},BM=(r,e,t)=>{let n=[];if(r.lastToken.pos.line===r.lastToken.nextToken?.pos.line&&r.lastToken.nextToken.value!==";"&&n.push(...mt(r.lastToken)),e!==void 0&&r.firstToken.pos.line===r.firstToken.prevToken?.pos.line&&r.firstToken.pos.line===r.lastToken.pos.line)return n.push(...mt(r.firstToken.prevToken)),n;if(e===void 0)return n;let s=r.firstToken.value.startsWith("*")?" ":"",i=Yi(r.firstToken,e,t,s);if(i)n.push(i);else{n.push(os(r.firstToken,e,t,s));let o=zs(r.firstToken);o&&n.push(o)}return n},Rw=async(r,e,t,n,s=0)=>{let i=r.options.tabSize,a=r.options.insertSpaces?"".padStart(i," "):" ";return hw(a),e instanceof ze?IM(r,e,t,s,a,n):e instanceof je?qM(e,s,a):e instanceof Gt?jM(e,s,a):e instanceof is?FM(e,t,await n(e),a):e instanceof dn?BM(e,await n(e),a):[]};var H=class{constructor(e,t,n="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:ot.MarkupKind.Markdown,value:[...this.description?["### Description",this.description.join(`
|
|
185
185
|
|
|
186
186
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
187
187
|
|
|
188
188
|
`)]:[]].join(`
|
|
189
|
-
`)});typeof
|
|
190
|
-
${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=fM(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}`})):[]}},fM=n=>n.ast.values?n.ast.values.values.map(e=>hM(e)):[0],hM=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 ke||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 ke)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 ke)return n.linksTo;if(n instanceof Fn)return n.path?.pathParts.at(-1)?.linksTo}},mk=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 gk=()=>{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()),yk=()=>{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 bk=()=>{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 vk=()=>{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 Tk=()=>{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 _k=G(X()),Sk=()=>{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,_k.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()),wk=()=>{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=mk(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 kk=()=>{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 Ek=()=>{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 Nk=G(X()),Pk=()=>{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,Nk.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 Rk=G(X()),Dk=()=>{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,Rk.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 {
|
|
189
|
+
`)});typeof n!="function"?this.required=()=>n:this.required=n,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,n,s){let i=this.required(t);if(s){if(i==="omitted")return[D(11,s.ast,ot.DiagnosticSeverity.Error,void 0,[],[n])]}else{if(i==="required"){let l=e.getOrderedNodeAst(t),u=Ki(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 D(0,u[m],ot.DiagnosticSeverity.Error,[],[],[n],ot.TextEdit.insert(ot.Position.create(T.pos.line,T.pos.col+1),`
|
|
190
|
+
${"".padEnd(Ji(u[m].uri,f)*Wi().length,Wi())}${n}${d};`))})]}return[]}let o=UM(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(D(m,d,ot.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(D(4,s.ast.values??s.ast,ot.DiagnosticSeverity.Error,[],[],[n,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(D(3,s.ast.values?.values[d]??s.ast))})}else{this.type[0].types.some(u=>u===5)?o.some(u=>c([5],u,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(u=>u!==0).every(u=>u===4)?o.some(u=>c(this.type[0].types,u,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(u=>u!==0)?a.push(D(8,s.ast.propertyName??s.ast,ot.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value);let l=this.values(s);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(s)??[]),l.length&&this.type[0].types.some(u=>u===3))){let u=s.ast.values?.values[0]?.value;l.some(d=>u.value===d)||a.push(D(9,s.ast.values?.values[0]?.value??s.ast,ot.DiagnosticSeverity.Error,[],[],[this.values(s).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,t,n){let s=this.type.at(t);return s?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:n?`${i}`:`"${i}"`,kind:ot.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):s?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:n?`${i}`:`<${i}>`,kind:ot.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},UM=r=>r.ast.values?r.ast.values.values.map(e=>VM(e)):[0],VM=r=>r?r.value instanceof Ce?3:r.value instanceof pt?r.value.values.length===1?1:r.value.values.length===2?2:4:r.value instanceof ve||r.value instanceof Wr?1:6:7,ga=class{},fn=class extends ga{constructor(t=()=>[]){super();this.additionalValidations=t;this._properties=[];this.noMismatchPropertiesAllowed=!1}getIssue(t,n){let s=[],i=n.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Ce&&o.value==="disabled")return[...n.definitions,...n.referencedBy].forEach(l=>s.push(D(22,l,ot.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[ot.DiagnosticTag.Unnecessary]))),s;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=n.getProperty(l.name);return f&&a.add(f),l.validateProperty(t,n,l.name,f)}let u=n.property.filter(f=>l.getNameMatch(f.name));u.forEach(f=>a.add(f));let d=this.properties.filter(f=>f!==l)??[];return d.length&&u.filter(f=>d.some(m=>m.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(t,n,f.name,f))});return a.size!==n.property.length&&this.noMismatchPropertiesAllowed&&n.property.filter(u=>!a.has(u)).forEach(u=>{s.push(D(28,u.ast,ot.DiagnosticSeverity.Error,[],[],[u.name],ot.TextEdit.del(Us(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...s,...c,...this.additionalValidations(t,n)]}get properties(){return this._properties}addProperty(t){Array.isArray(t)?t.forEach(n=>this._properties.push(n)):this._properties.push(t),this._properties.sort(n=>typeof n.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(t){t&&(this._childNodeType=n=>{let s=t(n);return s.bindingsPath=this.bindingsPath,s})}getOnPropertyHover(t){let n=this.properties.find(s=>s.getNameMatch(t));return n?.onHover.bind(n)()}getPropertyListCompletionItems(t){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(t)!=="omitted"&&typeof n.name=="string").map(n=>{let s=t&&n.required(t),i=!!t.property.some(a=>n.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${n.name}`,kind:ot.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var gr=class extends B{constructor(t,n,s,i){super();this.startLabels=t;this.value=n;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(n),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 Yt=r=>{if(!r?.values.some(e=>!(e?.value instanceof pt)))return r?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Re=(r,e,t)=>{let n=r.ast.values?.values.at(e)?.value;if(n instanceof pt){let s=n.values.at(t);if(s?.value instanceof wt)return s.value.value}},Hr=(r,e,t=0)=>{if(r instanceof gr){if(r?.value instanceof pt){let n=r.value.values.at(t);if(n?.value instanceof wt)return e.getPhandle(n.value.value);if(n?.value instanceof ve)return n.value.linksTo;if(n?.value instanceof Wr)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(r instanceof wt)return e.getPhandle(r.value);if(r instanceof ve)return r.linksTo;if(r instanceof Wr)return r.path?.pathParts.at(-1)?.linksTo}},Dw=r=>{let e=r.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof pt){let n=t.values.at(0)?.value;if(n instanceof wt)return{cellsProperty:e,node:r,value:n.value}}return{cellsProperty:e,node:r}},V=r=>Array.isArray(r)?[{types:r}]:[{types:[r]}];var Cw=()=>{let r=new H("compatible",V(5));return r.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."],r.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."],r};var Xi=K(Y()),Ow=()=>{let r=new H("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"required":"optional",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Ce&&t.value!==e.parent.name)return e.parent.name==="cpu"?[D(12,e.ast,Xi.DiagnosticSeverity.Error,[],[],[e.name])]:[D(13,e.ast,Xi.DiagnosticSeverity.Error,[],[],[e.name])]}return r.required(e.parent)!=="required"?[D(14,e.ast,Xi.DiagnosticSeverity.Hint,[],[Xi.DiagnosticTag.Deprecated],[e.name])]:[]});return r.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."],r};var Aw=()=>{let r=new H("#interrupt-cells",V(1));return r.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],r};var Iw=()=>{let r=new H("interrupt-controller",V(0),"optional");return r.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],r};var Mw=()=>{let r=new H("interrupt-parent",V(1));return r.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."],r};var $w=K(Y()),Lw=()=>{let r=new H("interrupts",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=n.getProperty("interrupt-parent"),i=n.root;return(s?Hr(s?.ast.values?.values.at(0),i):n.parent)?t:s?(t.push(D(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(D(16,e.ast,$w.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return r.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."],r.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```"],r};var Qi=K(Y()),xw=()=>{let r=new H("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=n.getProperty("interrupts");s&&t.push(D(15,s.ast,Qi.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=n.getProperty("interrupt-parent");i&&t.push(D(15,i.ast,Qi.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=n.root,a=Yt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=Hr(a[c],o);if(!l)return t.push(D(18,a[c],Qi.DiagnosticSeverity.Error)),t;let u=Dw(l);if(!u.cellsProperty)return t.push(D(16,e.ast,Qi.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(D(17,a[c],Qi.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return r.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."],r.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```"],r};var qw=()=>{let r=new H("dma-noncoherent",V(0));return r.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."],r};var jw=()=>{let r=new H("dma-coherent",V(0));return r.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."],r};var Fw=K(Y()),Bw=()=>{let r=new H("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],n=Yt(e.ast.values);if(!n?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Re(s,0,0)??1:1,c=i?Re(i,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(n.length===0||n.length%(c+l+a)!==0)&&t.push(D(20,n.at(n.length-n.length%(c+l+a))??e.ast,Fw.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 r.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)."],r};var Uw=K(Y()),Iu=()=>{let r=new H("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],n=Yt(e.ast.values);if(!n?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Re(s,0,0)??1:1,c=i?Re(i,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(n.length===0||n.length%(c+l+a)!==0)&&t.push(D(20,n.at(n.length-n.length%(c+l+a))??e.ast,Uw.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 r.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."],r.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
191
191
|
compatible = "simple-bus";
|
|
192
192
|
#address-cells = <1>;
|
|
193
193
|
#size-cells = <1>;
|
|
@@ -202,7 +202,7 @@ ${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=fM(s
|
|
|
202
202
|
};
|
|
203
203
|
};`,"```"].join(`
|
|
204
204
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
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."],
|
|
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."],r};var Vw=()=>{let r=new H("virtual-reg",V(1));return r.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."],r};var Mu=K(Y()),Ww=()=>{let r=new H("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],n=Yt(e.ast.values);if(!n)return[];let s=e.parent.parent?.getProperty("#size-cells"),i=e.parent.parent?.getProperty("#address-cells"),o=s?Re(s,0,0)??1:1,a=i?Re(i,0,0)??2:2;if(n.length===0||n.length%(o+a)!==0)return t.push(D(20,n.at(n.length-n.length%(o+a))??e.ast,Mu.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<n.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);n.slice(0,a).map((d,f)=>Re(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(D(10,e.ast,Mu.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(D(10,e.ast,Mu.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return r.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```"],r};var $u=()=>new H("#size-cells",V(1),"optional",1);var Lu=()=>{let r=new H("#address-cells",V(1),"optional",2);return r.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."],r.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
|
|
206
206
|
#address-cells = <1>;
|
|
207
207
|
#size-cells = <1>;
|
|
208
208
|
serial@4600 {
|
|
@@ -213,8 +213,8 @@ ${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=fM(s
|
|
|
213
213
|
interrupt-parent = <&ipic>;
|
|
214
214
|
};
|
|
215
215
|
};`,"```"].join(`
|
|
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)."],
|
|
217
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],
|
|
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)."],r};var Hw=()=>{let r=new H("status",V(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return r.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"`],r};var zw=K(Y()),Kw=()=>{let r=new H("phandle",V(1),"optional",void 0,[],e=>{let t=Re(e,0,0);if(t){let n=e.parent.root.getAllPhandle(t);if(n.length>1&&n.at(-1)===e.parent)return[D(19,e.ast.values?.values.at(0)??e.ast,zw.DiagnosticSeverity.Error,n.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[e.name])]}return[]});return r.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."],r.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
|
|
218
218
|
phandle = <1>;
|
|
219
219
|
interrupt-controller;
|
|
220
220
|
reg = <0x10000000 0x100>;
|
|
@@ -222,29 +222,53 @@ ${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=fM(s
|
|
|
222
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 {
|
|
223
223
|
interrupt-parent = <1>;
|
|
224
224
|
};`,"```"].join(`
|
|
225
|
-
`)],n};var xk=()=>{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()),qk=()=>{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 jk=()=>{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 k=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)%k===0?k:(i.length-d)%k).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 k=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)%k===0?k:(i.length-d)%k).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 Fk=()=>{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()),Bk=()=>{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 Uk=()=>{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 Vk=()=>{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 Wk=()=>{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 ns(){let n=new Ki;return n.addProperty([gk(),xk(),Lk(),Mk(),Ik(),Ak(),Ok(),Ck(),Dk(),Pk(),Ek(),kk(),qk(),yk(),Sk(),Tk(),wk(),bk(),vk(),jk(),Fk(),Bk(),Uk(),Vk(),Wk()]),n}var Ee=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=[ns()];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??[ns()]}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:sr(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):ek(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=sr(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:lr.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[lr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:lr.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[lr.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:lr.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[lr.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=[ns()])}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?`
|
|
225
|
+
`)],r};var Gw=()=>{let r=new H("model",V(3));return r.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.'],r.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],r};var xu=K(Y()),Yw=()=>{let r=new H("name",V(3),"optional",void 0,[],e=>[D(14,e.ast,xu.DiagnosticSeverity.Warning,[],[xu.DiagnosticTag.Deprecated],[e.name])]);return r.hideAutoComplete=!0,r};var Zi=K(Y());var Jw=()=>{let r=new H("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],n=e.parent,s=e.parent.root,i=Yt(e.ast.values);if(!i?.length)return[];let o=n.getProperty("#address-cells"),a=n.getProperty("#interrupt-cells");if(!a)return t.push(D(16,e.ast,Zi.DiagnosticSeverity.Error,[...n.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${n.path.slice(1).join("/")}`])),t;let c=0;for(;c<i.length;){let l=o?Re(o,0,0):2,u=Re(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,i.length<c+1){let w=l+u+1;t.push(D(21,i[i.length-1],Zi.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)%w===0?w:(i.length-d)%w).join(" ")}`]));break}let f=Hr(i[c],s);if(!f){t.push(D(18,i[c],Zi.DiagnosticSeverity.Error));break}let m=f.getProperty("#address-cells"),T=f.getProperty("#interrupt-cells");if(!T){t.push(D(16,i[c],Zi.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${n.path.slice(1).join("/")}`]));break}c++;let g=m?Re(m,0,0):2,S=Re(T,0,0);if(g==null||S==null)break;if(c+=g+S,i.length<c){let w=l+u+1+g+S;t.push(D(21,i[i.length-1],Zi.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)%w===0?w:(i.length-d)%w).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),f=Re(a,0,0);if(d==null||f==null||!(u.value instanceof pt))return t}return t});return r.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."],r};var Xw=()=>{let r=new H("interrupt-map-mask",V(4));return r.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."],r};var eo=K(Y()),Qw=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],n=[],s=e.parent,i=e.parent.root,o=s.getProperty(`#${t}-cells`);if(!o)return n.push(D(16,e.ast,eo.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),n;let a=Re(o,0,0);if(a==null)return n;let c=Yt(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;n.push(D(21,c[c.length-1],eo.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=Hr(c[l],i);if(!d){n.push(D(18,c[l],eo.DiagnosticSeverity.Error));break}let f=d.getProperty(`#${t}-cells`);if(!f)return n.push(D(16,c[l],eo.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),n;l++;let m=Re(f,0,0);if(m==null)break;if(l+=m,c.length<l){let T=a+1+m;n.push(D(21,c[c.length-1],eo.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 n});return r.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."],r.list=!0,r};var Zw=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return r.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."],r};var ek=()=>{let r=new H(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return r.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."],r};var tk=()=>{let r=new H(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return r.list=!0,r.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],r};function Pr(){let r=new fn;return r.addProperty([Cw(),Gw(),Kw(),Hw(),Lu(),$u(),Ww(),Vw(),Iu(),Bw(),jw(),qw(),Yw(),Ow(),Lw(),Mw(),xw(),Aw(),Iw(),Jw(),Xw(),Qw(),Zw(),ek(),tk()]),r}var rk=()=>{let r=new H("chassis-type",V(3),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return r.description=[`Specifiesastringthatidentifiestheform-factor
|
|
226
|
+
of the system.`],r};var nk=()=>{let r=new H("serial-number",V(3),"optional");return r.description=[`Specifies a string representing the device\u2019s se-
|
|
227
|
+
rialnumber.`],r};function sk(){let r=Pr();r.noMismatchPropertiesAllowed=!0;let e=r.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let t=r.properties.find(i=>i.name==="#size-cells");t.required=()=>"required";let n=r.properties.find(i=>i.name==="model");n.required=()=>"required";let s=r.properties.find(i=>i.name==="compatible");return s.required=()=>"required",r.addProperty([rk(),nk()]),r}var as=K(Y());function ik(){let r=new fn((t,n)=>{let s=[];return n.parent?.name!=="/"&&s.push(D(27,n.definitions[0],as.DiagnosticSeverity.Error,n.definitions.slice(1),[],["Aliases node can only be added to a root node"])),n.nodes.forEach(i=>{i.definitions.forEach(o=>{s.push(D(27,o,as.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],as.TextEdit.del(Us(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),s});r.noMismatchPropertiesAllowed=!0;let e=new H(t=>!!t.match(/^[-A-Za-z0-9]+$/),V([3,1]),void 0,void 0,void 0,t=>{let n=[],s=t.ast.quickValues;if(s?.length===1&&typeof s[0]=="string"){if(!s[0].startsWith("/"))return n.push(D(24,t.ast.values??t.ast,as.DiagnosticSeverity.Error,[],[],[s[0],t.name])),n;if(s[0].trim().endsWith("/"))return n.push(D(24,t.ast.values??t.ast,as.DiagnosticSeverity.Error,[],[],["",s[0]])),n;let i=t.parent.root,o=s[0].split("/").slice(1);for(;o[0];){let a=i,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(i=l?a.getNode(l,d,!1):void 0,!i){n.push(D(24,t.ast.values??t.ast,as.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return n});return e.description=["Each property of the /aliases node defines an alias."],r.addProperty([e]),r}function ok(){let r=Pr();r.noMismatchPropertiesAllowed=!0;let e=r.properties.find(n=>n.name==="device_type");e.required=()=>"required";let t=r.properties.find(n=>n.name==="reg");return t.required=()=>"required",r}var ck=K(Y());var ak=(r,e)=>{let t=r?.(e)??[],n=e.parent.root.getProperty(e.name),s=n?Re(n,0,0):void 0,i=e.parent.getProperty(e.name);return(i?Re(i,0,0):void 0)!==s&&t.push(D(29,e.ast,ck.DiagnosticSeverity.Error,[...n?.ast?[n.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),t};function lk(){let r=new fn;r.noMismatchPropertiesAllowed=!0;let e=Lu(),t=e?.additionalTypeCheck;e.additionalTypeCheck=o=>ak(t,o),e.required=()=>"required";let n=$u(),s=n?.additionalTypeCheck;n.additionalTypeCheck=o=>ak(s,o),n.required=()=>"required";let i=Iu();return i.required=()=>"required",i.type=V(0),i.additionalTypeCheck=void 0,r.addProperty([e,n,i]),r}var uk=K(Y());function dk(){let r=Pr();r.additionalValidations=(s,i)=>i.parent?.name!=="/"?[D(27,i.definitions[0],uk.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Chosen node can only be added to a root node"])]:[];let e=new H("bootargs",V(3));e.description=[`A string that specifies the boot arguments for
|
|
228
|
+
theclientprogram. Thevaluecouldpotentially
|
|
229
|
+
be a null string if no boot arguments are re-
|
|
230
|
+
quired.`];let t=new H("stdout-path ",V(3));t.description=[`A string that specifies the full path to the node
|
|
231
|
+
representingthedevicetobeusedforbootcon-
|
|
232
|
+
soleoutput. Ifthecharacter\u201C:\u201Dispresentinthe
|
|
233
|
+
valueit terminates thepath. Thevalue maybe
|
|
234
|
+
an alias. If the stdin-path property is not spec-
|
|
235
|
+
ified, stdout-path should be assumed to define
|
|
236
|
+
theinput device.`];let n=new H("stdin-path ",V(3));return n.description=[`A string that specifies the boot arguments for
|
|
237
|
+
theclientprogram. Thevaluecouldpotentially
|
|
238
|
+
be a null string if no boot arguments are re-
|
|
239
|
+
quired.`],r.addProperty([e,t,n]),r}var mm=K(Y());function fk(){let r=Pr();r.additionalValidations=(s,i)=>i.parent?.name!=="/"?[D(27,i.definitions[0],mm.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=r.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let t=r.properties.find(s=>s.name==="#size-cells");t.required=()=>"required";let n=t?.additionalTypeCheck;return t.additionalTypeCheck=s=>{let i=n?.(s)??[],o=s.parent.getProperty(s.name);return(o?Re(o,0,0):void 0)!==0&&i.push(D(29,s.ast,mm.DiagnosticSeverity.Error,void 0,void 0,[`${s.name} value in cpus node must be '0'`])),i},r}var hk=K(Y());function pk(){let r=Pr();r.additionalValidations=(n,s)=>s.parent?.name!=="cpus"?[D(27,s.definitions[0],hk.DiagnosticSeverity.Error,s.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=r.properties.find(n=>n.name==="device_type");e.required=()=>"required";let t=r.properties.find(n=>n.name==="reg");return t.required=()=>"required",t.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
|
|
240
|
+
CP U/threads represented by the CPU node.
|
|
241
|
+
If a CPU supports more than one thread (i.e. multiple streams of execution) the reg property is an array with 1 element per thread.
|
|
242
|
+
The #address-cells on the /cpus node specifies how many cells each element of the array takes. Software can determine the number of threads by dividing the size of reg by the parent node's #address-cells.
|
|
243
|
+
If a CPU/thread can be the target of an external interrupt the reg property value must be a unique CPU/thread id that is addressable by the interrupt controller.
|
|
244
|
+
If a CPU/thread cannot be the target of an external interrupt, then reg must be unique and out of bounds of the range addressed by the interrupt controller
|
|
245
|
+
If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
|
|
246
|
+
If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],r}function Ks(r){switch(r?.name){case"/":return sk();case"aliases":return ik();case"memory":return ok();case"reserved-memory":return lk();case"chosen":return dk();case"cpus":return fk();case"cpu":return pk()}return Pr()}var we=class r{constructor(e,t,n,s=null){this.bindingLoader=e;this.name=t;this.address=n;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];s?.addNode(this)}static toJson(e){let t={};return e.property.forEach(n=>t[n.name]=n.ast.values?.toJson()??!0),e.nodes.forEach(n=>t[n.fullName]=r.toJson(n)),t}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[Ks(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}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 Ki([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let n=[...this.definitions,...this.referencedBy].find(s=>mr(s,e,t));if(n){let s=this.deletes.map(c=>({item:this,ast:ln(c,e,t),beforeAst:pa(c,e,t),afterAst:ha(c,e,t)})).find(c=>mr(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=>mr(c.ast,e,t)||c.ast.lastToken.value!==";"&&pw(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=ln(n,e,t);return{item:this,ast:a,beforeAst:pa(a,e,t),afterAst:ha(a,e,t)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Pe).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(t=>t.issues),...this._nodes.flatMap(t=>t.issues),...this._deletedNodes.flatMap(t=>t.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&(this._nodes.some(t=>t.name==="cpus")||e.push(D(9,this.definitions.at(-1),zr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:zr.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[zr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:zr.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[zr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof Pe),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:zr.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[zr.DiagnosticTag.Deprecated],templateStrings:[t instanceof Pe?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(n=>n.name===e&&(n.address===t||n.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,n){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===n||n?.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 pt){let n=t.values[0].value;if(n instanceof wt&&n.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(n=>n.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof pt){let n=t.values[0].value;if(n instanceof wt&&n.value===e)return this}return this._nodes.flatMap(n=>n.getPhandle(e)).find(n=>!!n)}getNode(e,t,n=!0){let s=n||!!t||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 n=this._properties.findIndex(s=>s.name===e);n!==-1&&(this._deletedProperties.push({property:this._properties[n],by:t}),this._properties.splice(n,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(n=>n.name===e.name);if(t===-1)this._properties.push(e);else{let n=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=n,n.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(n=>this._nodeTypes=n):this._nodeTypes=[Ks(this)])}getChild(e,t=!0){let n=[...e];n.splice(0,1);let s=n[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 n.length===1||!a?a:a.getChild(n)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let n=[...e];return n.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!t(i.by)).map(i=>i.node)].find(i=>i.fullName===n[0])?.getChildFromScope(n,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
247
|
`:""}${this.property.map(e=>e.toString()).join(`
|
|
227
248
|
`)}${this.nodes.length?`
|
|
228
249
|
${this.nodes.map(e=>`${e.fullName}{ /* ... */ };`).join(`
|
|
229
250
|
`)}`:""}
|
|
230
|
-
};`}toMarkupContent(){return{kind:
|
|
231
|
-
`)}}};var
|
|
251
|
+
};`}toMarkupContent(){return{kind:zr.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(`
|
|
252
|
+
`)}}};var ju=K(Y());var gm=K(Y());var cs=class extends B{constructor(t,n){super(n);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:gm.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},It=class extends B{constructor(t,n){super(n);this.value=t;this.docSymbolsMeta={name:this.value,kind:gm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let n=this.parentNode;if(!(n instanceof ve&&n.linksTo)){super.buildSemanticTokens(t);return}t(Vs("type"),Ws("declaration"),{start:this.firstToken,end:this.lastToken})}};var et=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){let n=ln(this.ast,e,t);return this.ast.assignOperatorToken&&fm(this.ast.assignOperatorToken,e,t)?{item:this,ast:n,beforeAst:pa(this.ast,e,t),afterAst:ha(this.ast,e,t)}:{item:this,ast:n}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof cs)}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:ju.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[ju.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var _k=K(Y());var Ju=require("fs");var Fu=class r{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
|
|
232
253
|
`,`
|
|
233
|
-
`).split(/\n/).map(
|
|
254
|
+
`).split(/\n/).map(n=>`${n}
|
|
234
255
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
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 Hk,sm=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}needsRenew(e,t){return this.fileMap.get(e)?.text!==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??[])}reset(e){this.fileMap.delete(e)}};function Vn(){return Hk??=new sm,Hk}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 Ee(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)||tk(Vn().requestTokens(e,!1),i,t));if(s instanceof kt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:sr(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:sr(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 Ee);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,Kk.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 nk([...e.definitions,...e.referencedBy])}};var mt=class extends B{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var zk=G(X()),Du=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:zk.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 Gk=G(X()),Cu=class extends B{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:Gk.SymbolKind.Function}}};var ur=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 im=G(X());var Ou=class extends or{constructor(t,r,s){super(r);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:im.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Au=class extends or{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:im.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 Yk=G(X());var Xi=class extends or{constructor(t,r){super(r);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:Yk.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(x(e,40)?(r="&",x(this.currentToken,40)&&(r="&&",t=this.moveToNextToken)):x(e,10)?(r="!",x(this.currentToken,0)&&(r="==",t=this.moveToNextToken)):x(e,8)?(r="|",x(this.currentToken,8)&&(r="||",t=this.moveToNextToken)):x(e,9)?r="^":x(e,4)?(r=">",x(this.currentToken,4)?(r="<<",t=this.moveToNextToken):x(this.currentToken,0)&&(r=">=",t=this.moveToNextToken)):x(e,5)?(r=">",x(this.currentToken,5)?(r=">>",t=this.moveToNextToken):x(this.currentToken,0)&&(r="<=",t=this.moveToNextToken)):x(e,15)?r="+":x(e,16)?r="-":x(e,17)?r="*":x(e,13)?r="/":x(e,18)?r="%":x(e,46)&&x(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 om=require("fs"),Qi=require("path");var $u=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=Vn().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||!x(c,13)||(l=i(),!x(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!x(a(),17)||!x(o(),13)||!pn(a(),o())),d=l.pos.line,f=c,m=[];l=i();do{if(o()?.pos.line!==d){let g=new cr(J(f,a()));m.push(g),d=o().pos.line??0,f=o()}l=i()}while(r<t.length&&!u());let T=new cr(J(f,o()));return m.push(T),i(),{comments:m,tokenUsed:s,index:r-1}}static processLineComments(t,r){let s=[];if(!x(t[r],13)||t.length===r+1||!x(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 cr(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=>!x(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("")}},xu=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 Jk=G(X());var qu=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:Jk.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 Xk=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 $u(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||!x(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 xu(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(;ir(r,this.currentToken)||r&&x(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(!x(r,42)){this.popStack();return}let s=[],i=this.processCIdentifier()||this.processVariadic();for(;i;)s.push(i),!x(this.currentToken,24)&&!x(this.currentToken,43)?this._issues.push(A(28,i)):x(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier()||this.processVariadic();let o=new ju(t,s);return x(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 qu(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=>x(s,o))&&!ir(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[37].some(o=>x(s,o))&&!ir(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[36].some(o=>x(s,o))&&!ir(this.tokens.at(i),s)});if(r&&(x(r.startToken,33)||x(r.startToken,34))){let s;x(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,om.existsSync)(r)):this.incudes.map(r=>(0,Qi.resolve)(r,t.path.path)).find(r=>(0,om.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(x(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=!!x(r,21);if(!c||!l&&!x(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&&!x(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Vi(u,l,J(c,r)),f=new es(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!x(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,Xk.DiagnosticSeverity.Warning)),T&&!T.endsWith(".h")){Vn().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 Qk=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:Qk.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var Zk=G(X()),Ku=class extends B{constructor(t,r){super();this.keyword=t;this.bitsSize=r;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:Zk.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var eE=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||!x(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!x(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(x(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 x(this.currentToken,3)||x(this.currentToken,1)}endStatement(t=!0){let r=this.currentToken;if(!x(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(;x(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 kt(i):new we(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!x(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 kt?(c.labelReference=a,l=!0):o&&c instanceof we&&(l=o.address!==void 0,c.name=o),x(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()),x(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 Ie(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&&x(i,50),a=new rs(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(x(this.currentToken,2)||x(this.currentToken,49))return this.popStack(),!1;let i=new Qe(s,r),o;x(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),x(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];x(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];x(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,eE.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&&!x(this.currentToken,2)){this._issues.push(A(25,a)),a.lastToken=s.at(-1);let d=new kn(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)):x(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(A(21,a));let l=new kn(a);if(ir(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&&!x(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)):x(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(A(21,o));let c=new He(o);if(ir(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(;!x(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=x(this.currentToken,24);if(d)this.moveToNextToken;else if(!ir(this.prevToken,this.currentToken))break;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(!x(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(x(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);x(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(!x(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 Zr(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(A(14,a)));let c=new Bn(t,a,o);x(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 ur(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 ur(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 ur(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 ur(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;x(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()}x(this.currentToken,43)?s=this.moveToNextToken:this._issues.push(A(26,o??i))}return this.mergeStack(),i}processMacroCallParams(){return x(this.currentToken,42)?this.parseScopedBlock(s=>!!x(s,42),s=>!!x(s,43),s=>!!x(s,24))?.splitTokens.map((s,i)=>{if(s.length===0||x(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(x(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new ke(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 ke(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(!x(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new ur(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 ur(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new ur(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,r=new Cr){this.enqueueToStack();let s;if(x(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(!x(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!x(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))))}),x(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 es)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Zi=G(X());var tE=require("fs"),nE=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(tE.existsSync),this.parser=new ua(e,t),this.name=i??(0,nE.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 ke){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 Cr){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 cr),(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 kn?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 kn&&o.nodeNameOrRef instanceof Ie){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 kt&&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 Ee(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 Ee(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 Ie&&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 ke&&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 Et=G(X());var rE=require("fs"),to=require("path");function pM(n){if(!n||!(n.ast instanceof Vi))return[];let e=r=>r.flatMap(s=>(0,rE.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:Et.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))],am=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>am(t.node,e)),...n.nodes.flatMap(t=>am(t,e))];function mM(n,e){if(!n||!(n.item instanceof pt)||!(n.ast instanceof ke))return[];let t=r=>am(r,e);return Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Method}))}function gM(n,e){if(!n||n.item!==null||!(n.ast instanceof ke)||!(n.ast.parentNode instanceof kt))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} {
|
|
256
|
+
`)&&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&&!r.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&r.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 n=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,n===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 n=this._tokens.at(-1);return t&&!n?.tokens.some(s=>s===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},n=this._tokens.at(-1);t.prevToken=n,n&&(n.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 n=this.lineNumber,s=this.columnNumber,i=this.getString(t[0]);return this.pushToken({tokens:[21],value:i,pos:{col:s-1,line:n,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 lt=class extends B{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var ym=require("fs"),ro=require("path");var mk=K(Y());var Rr=class extends un{constructor(t,n){super(n);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:mk.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Bu=class extends B{constructor(t,n){super(n);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var ls=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let n=e.pos.line;if(this.currentToken?.pos.line!==n||this.currentToken?.uri!==e.uri)return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===n;)i=this.moveToNextToken;if(t){let o=new B(X(s,i));this._issues.push(D(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(n=>{let s=this.currentToken,i=n(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=Kt(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],n,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),n=this.currentToken,this.moveToNextToken,s=Kt(n,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 n=[],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;n.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)}),n.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,t){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ne));if(!n.length){this.popStack();return}let s=n.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Rr(s,X(n[0],n.at(-1)));return t||e.get(i.name)||this._issues.push(D(42,i)),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,n;if(x(e,40)?(n="&",x(this.currentToken,40)&&(n="&&",t=this.moveToNextToken)):x(e,10)?(n="!",x(this.currentToken,0)&&(n="==",t=this.moveToNextToken)):x(e,8)?(n="|",x(this.currentToken,8)&&(n="||",t=this.moveToNextToken)):x(e,9)?n="^":x(e,4)?(n=">",x(this.currentToken,4)?(n="<<",t=this.moveToNextToken):x(this.currentToken,0)&&(n=">=",t=this.moveToNextToken)):x(e,5)?(n=">",x(this.currentToken,5)?(n=">>",t=this.moveToNextToken):x(this.currentToken,0)&&(n="<=",t=this.moveToNextToken)):x(e,15)?n="+":x(e,16)?n="-":x(e,17)?n="*":x(e,13)?n="/":x(e,18)?n="%":x(e,46)&&x(this.currentToken,46)&&(n="##",t=this.moveToNextToken),n){let s=new Bu(n,X(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,n){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(n?.(l)&&(o[o.length]=[]),l&&(i.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,n);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 Vu=class r extends ls{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let n=0;n<this.tokens.length;n++){let s=r.processBlockComments(this.tokens,n)||r.processLineComments(this.tokens,n);s&&(n=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.reverse().forEach(n=>this.tokens.splice(n,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=Kr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,n){let s=[],i=()=>(s.push(n++),t[n]),o=()=>t[n],a=()=>t[n-1],c=o(),l=c;if(!c||!x(c,13)||(l=i(),!x(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!x(a(),17)||!x(o(),13)||!Kt(a(),o())),d=l.pos.line,f=c,m=[];l=i();do{if(o()?.pos.line!==d){let g=new dn(X(f,a()));m.push(g),d=o().pos.line??0,f=o()}l=i()}while(n<t.length&&!u());let T=new dn(X(f,o()));return m.push(T),i(),{comments:m,tokenUsed:s,index:n-1}}static processLineComments(t,n){let s=[];if(!x(t[n],13)||t.length===n+1||!x(t[n+1],13)||!Kt(t[n],t[n+1]))return;let i=[];for(;t[n].pos.line===t.at(n+1)?.pos.line;)s.push(n++);s.push(n++);let o=t[s.at(-1)],a=new dn(X(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:n-1}}};var gk=K(Y()),Wu=class extends B{constructor(t,n){super(t);this.content=n}toString(){let t=this.content.filter(n=>!x(n,14));return t.map((n,s)=>{let i=n.value;return n.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-n.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},ba=class extends B{constructor(t,n,s){super();this.keyword=t;this.identifier=n;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Rr?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}toMarkupContent(){return{kind:gk.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
257
|
+
`)}}};var yk=K(Y());var Hu=class extends lt{toString(){return"..."}},to=class extends B{constructor(t,n){super();this.functionName=t;this.params=n;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:yk.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(n=>n.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var va=class extends B{constructor(e){super(e)}},zu=class extends B{constructor(t,n){super();this.keyword=t;this.content=n;this.active=!1;this.addChild(t)}},Ta=class extends zu{constructor(t,n,s){super(t,s);this.identifier=n;this.addChild(n),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Ku=class extends Ta{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Gu=class extends zu{};var Yu=class extends B{constructor(t,n,s){super();this.ifDef=t;this.endIf=n;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(n)}getInValidTokenRange(t,n){let s=[],i=a=>n.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.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var bk=K(Y());var no=class extends ls{constructor(t,n,s){super();this.uri=t;this.incudes=n;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}reset(t){super.reset(),this.macros.clear(),t?(this.macroSnapShot.clear(),Array.from(t).forEach(([n,s])=>this.macroSnapShot.set(n,s)),Array.from(t).forEach(([n,s])=>this.macros.set(n,s))):Array.from(this.macroSnapShot).forEach(([n,s])=>this.macros.set(n,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(t){let n=this.stable;return this.parsing=new Promise(s=>{n.then(()=>{if(t&&t.size===this.macroSnapShot.size){let i=Array.from(t);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.toString()===a.toString()})){console.log("header file cache hit",this.uri),s();return}}console.log("header file cache miss",this.uri),this.reset(t),this.parse().then(s)})}),this.parsing}async parse(){let t=new Vu(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 n=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();n&&this.moveEndOfLine(n,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),n=this.moveToNextToken;if(!n||!x(n,25))return this.popStack(),!1;let s=new lt(X(n)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(D(30,s)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Wu(X(o[0],o.at(-1)),o));let c=new ba(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}processUndef(){this.enqueueToStack();let t=this.peekIndex(),n=this.moveToNextToken;if(!n||!x(n,28))return this.popStack(),!1;let s=new lt(X(n)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(D(30,s)),this.mergeStack(),!0;let o=new ba(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(t,a-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],n=this.prevToken;for(;Nr(n,this.currentToken)||n&&x(n,14)&&n.pos.line+1===this.currentToken?.pos.line;)n=this.moveToNextToken,n&&t.push(n);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier(this.macros,!0);if(!t){this.popStack();return}let n=this.moveToNextToken;if(!x(n,42)||!Kt(t.lastToken,n)){this.popStack();return}this.currentToken&&x(this.currentToken,14)&&Nr(n,this.currentToken)&&(n=this.moveToNextToken);let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!x(this.currentToken,24)&&!x(this.currentToken,43)?this._issues.push(D(28,i)):x(this.currentToken,43)||(n=this.moveToNextToken),this.currentToken&&x(this.currentToken,14)&&Nr(n,this.currentToken)&&(n=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new to(t,s);return x(this.currentToken,43)?(n=this.moveToNextToken,o.lastToken=n):(o.lastToken=this.prevToken,this._issues.push(D(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ne(45),Ne(45),Ne(45)]);if(t.length!==3){this.popStack();return}let n=new Hu(X(t[0],t.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let t=this.peekIndex(),n=this.parseScopedBlock(s=>!!s&&[33,34].some(i=>x(s,i))&&!Nr(s.prevToken,s),s=>!!s&&[37].some(i=>x(s,i))&&!Nr(s.prevToken,s),s=>!!s&&[36].some(i=>x(s,i))&&!Nr(s.prevToken,s));if(n&&(x(n.startToken,33)||x(n.startToken,34))){let s;x(n.startToken,33)?s=this.processIfDefBlock(n,(o,a,c)=>new Ta(o,a??null,c)):s=this.processIfDefBlock(n,(o,a,c)=>new Ku(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,n){this.enqueueToStack();let s=new lt(X(t.startToken)),i=new lt(X(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier(this.macros,!0);o||this._issues.push(D(31,s));let a=new va(X(this.currentToken,t.splitTokens[0].at(-1))),c=n(s,o??null,a),l;if(t.splitTokens.length>1){let d=t.splitTokens[1][0],f=new lt(X(d)),m=new va(X(d.nextToken,t.splitTokens[1].at(-1)));l=new Gu(f,m)}let u=new Yu(c,i,l);return this.mergeStack(),u}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,ro.resolve)((0,ro.dirname)(t.uri),t.path.path),...this.incudes.map(n=>(0,ro.resolve)(n,t.path.path))].find(n=>(0,ym.existsSync)(n)):this.incudes.map(n=>(0,ro.resolve)(n,t.path.path)).find(n=>(0,ym.existsSync)(n))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let s=n,i=n;if(x(n,26))this.moveToNextToken;else{let g=this.checkConcurrentTokens([Ne(13),Ze("include"),Ne(13)]);if(g.length!==3)return this.popStack(),!1;s=g[0],i=g.at(-1)}let o=s,a=new lt(X(s,i));n=this.moveToNextToken;let c=n,l=!!x(n,21);if(!c||!l&&!x(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!x(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new Gi(u,l,X(c,n)),f=new is(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!x(this.currentToken,4)?this._issues.push(D(12,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let m=this.peekIndex(),T=this.resolveInclude(f);if(f.resolvedPath=T,T||this._issues.push(D(36,f.path,bk.DiagnosticSeverity.Warning)),T){Kr().requestTokens(T,!0);let g=await _a().getCPreprocessorParser(T,this.incudes,this.macros,this.uri);await g.stable,this.macros.clear(),Array.from(g.macros).forEach(([S,w])=>this.macros.set(S,w)),T.endsWith(".h")?this.tokens.splice(t,m-t):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 vk,bm=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,t,n,s){let i=this.headerFiles.get(e);if(i)return i.reparse(n),i;console.log("No cpreprocess cache",e);let o=new no(e,t,n),a=this.includeOwners.get(o)??new Set;return a.add(s),this.includeOwners.set(o,a),this.headerFiles.set(e,o),o}reset(e){let t=this.headerFiles.get(e);t&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(t)??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))}};function _a(){return vk??=new bm,vk}var Tk,vm=class r{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(n=>({...n}));return t.forEach((n,s)=>{n.prevToken=t[s-1],n.nextToken=t[s+1]}),t}needsRenew(e,t){return this.fileMap.get(e)?.text!==t}renewLexer(e,t){if(_a().reset(e),!e||!(0,Ju.existsSync)(e))return[];try{t??=(0,Ju.readFileSync)(e).toString();let n=new Fu(t,e);return this.fileMap.set(e,n),r.clone(n.tokens)}catch{}return[]}requestTokens(e,t){let n=this.fileMap.get(e)?.tokens;return!n&&t?[...this.renewLexer(e)]:r.clone(n??[])}reset(e){_a().reset(e),this.fileMap.delete(e)}};function Kr(){return Tk??=new vm,Tk}var Xu=class r{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new we(this.context.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(n=>r.getFileTopMostAst(n,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>r.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let s=this.fileTopMostAst(e).find(i=>mr(i,e,t)||mw(Kr().requestTokens(e,!1),i,t));if(s instanceof kt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:ln(s,e,t)}}else if(s instanceof ct&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof Pe&&s.path){let i=r.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:ln(s,e,t)}}static getNodeFromPath(e,t,n=!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,n);return l?r.getNodeFromPath(c,l,n):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof ze)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{t.has(n.label.label.value)?t.get(n.label.label.value)?.push(n):t.set(n.label.label.value,[n])}),Array.from(t).forEach(n=>{let s=n[1];if(s.length>1){let i=s.find(a=>a.owner instanceof we);if(!s.every(a=>a&&a.owner===i?.owner)||!i){let a=s.filter(c=>!(c&&c.owner===i?.owner));e.push(D(4,s.at(0).label,_k.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(n=>e(n))];return e(this.rootNode)}getOrderedNodeAst(e){return gw([...e.definitions,...e.referencedBy])}};var Sk=K(Y()),Qu=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:Sk.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}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 Ek=K(Y()),Zu=class extends B{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:Ek.SymbolKind.Function}}};var hn=class extends B{constructor(t,n){super();this.value=t;this.labels=n;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 Tm=K(Y());var ed=class extends un{constructor(t,n,s){super(n);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:Tm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},so=class extends un{constructor(t,n){super();this.functionName=t;this.params=n;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:Tm.SymbolKind.Function,range:Q(this),selectionRange:Q(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var wk=K(Y()),td=class extends B{constructor(t,n,s){super();this.keyword=t;this.startAddress=n;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:wk.SymbolKind.Function},this.addChild(n),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var kk=K(Y()),rd=class extends B{constructor(t,n){super();this.keyword=t;this.bitsSize=n;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:kk.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var Nk=K(Y());var Sa=class extends ls{constructor(t,n,s){super();this.uri=t;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new ze;this.unhandledStatements=new ct;this.cPreprocessorParser=new no(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.resolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new ze,this._issues=[],this.unhandledStatements=new ct}async reparse(){let t=performance.now(),n=this.stable;return this.parsing=new Promise(s=>{n.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 n=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(X(s));this._issues.push(D(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await n();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(D(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(D(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let n=this.moveToNextToken,s=n,i=13;if(!n||!x(n,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!x(s,i))return this.popStack(),!1;let o=new ct;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let n=this.currentToken;if(x(n,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new B(X(s));this._issues.push(D(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return x(this.currentToken,3)||x(this.currentToken,1)}endStatement(t=!0){let n=this.currentToken;if(!x(n,1)){let s=this.prevToken;if(s&&t){let i=new B(X(this.prevToken));return this._issues.push(D(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),n}reportExtraEndStatements(){for(;x(this.currentToken,1);){let t=this.moveToNextToken;if(t){let n=new B(X(t));this._issues.push(D(23,n))}}}processNode(t,n){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,n)||this.isProperty(t)||this.isDeleteNode(t,n)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new B(X(o));this._issues.push(D(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let n=[],s=this.isLabelAssign(t);for(;s;)n.push(s),s=this.isLabelAssign(t);return n}isChildNode(t,n){this.enqueueToStack();let s;n==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new kt(i):new Pe(i,s);if(n==="Ref"?a=this.isLabelRef():n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!x(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(D(n==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof kt?(c.labelReference=a,l=!0):o&&c instanceof Pe&&(l=o.address!==void 0,c.name=o),x(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(D(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let t=this.prevToken,n=this.consumeAnyConcurrentTokens([19,20].map(Ne)),s=n.length?Number.parseInt(n.map(o=>o.value).join(""),16):NaN;if(t){if(Number.isNaN(s)){let o=new B(X(t));this._issues.push(D(8,o))}else if(!Number.isNaN(s)&&!Kt(t,n[0])){let o=new B(X(t,n.at(0)));this._issues.push(D(29,o))}}return new Ou(s,X(n[0]??this.prevToken,n.at(-1)))}processNodeAddresse(t){this.enqueueToStack();let n=this.checkConcurrentTokens([Ne(49)]);if(n.length){if(!Kt(t.lastToken,n[0])){let o=new B(X(t.lastToken,n[0]));this._issues.push(D(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),x(this.currentToken,24)){if(this.prevToken&&!Kt(this.prevToken,this.currentToken)){let o=new B(X(this.prevToken,this.currentToken));this._issues.push(D(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(Ne));if(!t.length){this.popStack();return}let n=t.map(o=>o.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let s=new Le(n,X(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(Ne));if(!t.length){this.popStack();return}let n=new He(t.map(s=>s.value).join(""),X(t[0],t.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Ne));if(!t.length){this.popStack();return}let n=t.map(i=>i.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let s=new It(n,X(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ne));if(!n.length){this.popStack();return}let s=n.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&x(i,50),a=new cs(new It(s,X(n[0],n.at(-1))),X(n[0],o?i:n.at(-1)));if(o){let c=n.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.col+c.pos.len)&&this._issues.push(D(29,new B(X(c,i)))),this.moveToNextToken}else if(t)this._issues.push(D(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(x(this.currentToken,2)||x(this.currentToken,49))return this.popStack(),!1;let i=new je(s,n),o;x(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(D(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([Ne(13),Ze("d"),Ze("ts"),Ne(16),Ze("v"),Ze("1")]);if(t.length!==6)return this.popStack(),!1;let n=t[0],s=n,i=new lt;i.firstToken=n;let o=new Zu(i);if(this.others.push(o),x(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(D(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ne(13),Ze("memreserve")]);if(t.length!==2)return this.popStack(),!1;let n=new lt;n.firstToken=t[0];let i=t[0];x(this.currentToken,13)?(i=this.moveToNextToken,n.lastToken=i):(n.lastToken=t.at(-1),this._issues.push(D(21,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new td(n,o,a);return this.others.push(c),o||this._issues.push(D(37,n)),a||this._issues.push(D(38,o??n)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ne(13),Ze("b"),Ze("its")]);if(t.length!==3){this.popStack();return}let n=new lt;n.firstToken=t[0];let i=t[0];x(this.currentToken,13)?(i=this.moveToNextToken,n.lastToken=i):(n.lastToken=t.at(-1),this._issues.push(D(21,n)));let o=this.processDec(),a=new rd(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(D(40,o)):this._issues.push(D(39,n)),this._issues.push(D(41,a,Nk.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ne(13),Ze("omit"),Ne(16),Ze("if"),Ne(16),Ze("no"),Ne(16),Ze("ref"),Ne(13)]);if(t.length!==9){this.popStack();return}let n=new lt(X(t[0],t.at(-1)));return this.mergeStack(),n}isDeleteNode(t,n){this.enqueueToStack();let s=this.checkConcurrentTokens([Ne(13),Ze("d"),Ze("e"),Ze("lete"),Ne(16),Ze("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new lt;if(a.firstToken=i,s.length===1&&!x(this.currentToken,2)){this._issues.push(D(25,a)),a.lastToken=s.at(-1);let d=new ir(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(D(c.startsWith("/delete-n")?34:25,a)):x(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(D(21,a));let l=new ir(a);if(Nr(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&n==="Name"&&this._issues.push(D(7,d));let f=d?void 0:this.isLabelRef();f&&n==="Name"&&this._issues.push(D(7,f));let m=d||f?void 0:this.isNodeName();m&&n==="Ref"&&this._issues.push(D(10,m)),!d&&!m&&!f&&this._issues.push(D([7,10],l)),l.nodeNameOrRef=d??f??m??null}else n==="Name"?this._issues.push(D(7,a)):n==="Ref"&&this._issues.push(D(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let n=this.checkConcurrentTokens([Ne(13),Ze("d"),Ze("e"),Ze("lete"),Ne(16),Ze("property")]);if(!n.length)return this.popStack(),!1;let s=n[0],i=s,o=new lt;if(o.firstToken=s,n.length===1&&!x(this.currentToken,2)){this._issues.push(D(25,o)),o.lastToken=n.at(-1);let u=new Fe(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(D(a.startsWith("/delete-p")?35:25,o)):x(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(D(21,o));let c=new Fe(o);if(Nr(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(D(6,c)),c.propertyName=u??null}else this._issues.push(D(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),n=this.processNodePathRef();if(!n){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new gr(t,n,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(;!x(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=x(this.currentToken,24);if(d)this.moveToNextToken;else if(!Nr(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let m=new B(X(u,this.currentToken));this._issues.push(D(0,m))}if(!d&&f===null)break;if(l&&!d&&f){let m=new B(X(l));this._issues.push(D(28,m))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new Qu(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),n=this.moveToNextToken;if(!x(n,21)){this.popStack();return}if(!n?.value)throw new Error("Token must have value");let s=n.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new Ce(s,X(n));n.value.match(/["']$/)||this._issues.push(D(n.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 gr(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(x(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new gr(n,o,a,s);x(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(D(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),n=this.moveToNextToken,s=n;if(!x(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(D(15,u))});let a=new ss(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=n,this._issues.push(D(14,a)));let c=new gr(t,a,o);x(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(D(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=n,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let n=t(),s=[];if(!n)return this.popStack(),[];for(;n;)s=[...s,n],n=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new pt(n);return n.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new hn(s,n);return this.mergeStack(),i}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Ze("0"),Ze("x")]);if(t.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(Ne));if(!n.length){this.popStack();return}let s=Number.parseInt(n.map(o=>o.value).join(""),16),i=new wt(s,X(t[0],n.at(-1)));return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),n=this.checkConcurrentTokens([20,20].map(Ne));if(!n.length){this.popStack();return}let s=Number.parseInt(n.map(a=>a.value).join(""),16),i=new wt(s,X(n[0],n.at(-1))),o=new hn(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let n=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new hn(s,n);return this.mergeStack(),i}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(Ne));if(!t.length){this.popStack();return}let n=Number.parseInt(t.map(i=>i.value).join(""),10),s=new wt(n,X(t[0],t.at(-1)));return this.mergeStack(),s}processLabeledExpression(t=!0,n=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(n));let i=this.processExpression();if(!i){this.popStack();return}let o=new hn(i,s);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier(this.cPreprocessorParser.macros,!1);if(!t){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}let s=this.cPreprocessorParser.macros.get(t.name);s?.identifier instanceof to?n.length>s?.identifier.params.length?this._issues.push(D(44,t,void 0,[s])):n.length<s?.identifier.params.length&&this._issues.push(D(45,t,void 0,[s])):this._issues.push(D(43,t));let i=new so(t,n);return this.mergeStack(),i}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),n=this.processExpression();if(!n){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new gr(t,n,s);return this.mergeStack(),i}processExpression(){this.enqueueToStack();let t=!1,n,s;x(this.currentToken,42)&&(t=!0,n=this.moveToNextToken,s=n);let i=this.isFunctionCall()||this.processCIdentifier(this.cPreprocessorParser.macros,!1)||this.processHex()||this.processDec();if(!i){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?i instanceof ma?i.addExpression(o,a):i=new ma(i,{operator:o,expression:a}):this._issues.push(D(27,o)),o=this.isOperator()}x(this.currentToken,43)?s=this.moveToNextToken:this._issues.push(D(26,o??i))}return this.mergeStack(),i}processMacroCallParams(){if(!x(this.currentToken,42))return;let n=this.parseScopedBlock(s=>!!x(s,42),s=>!!x(s,43),s=>!!x(s,24))?.splitTokens.map((s,i)=>{if(s.length===0||x(s[0],24)&&s.length===1)return null;let o=i?s.slice(1):s;return new ed(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(""),X(o[0],o.at(-1)),i)});return n?.length===1&&n[0]===null?[]:n}isLabelRef(t){this.enqueueToStack();let n=this.currentToken;if(x(n,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new ve(null);return this._issues.push(D(18,t??o)),o.firstToken=n,this.mergeStack(),o}n&&(s.firstToken.pos.line!==n.pos.line||s.firstToken.pos.col!==n.pos.col+n.pos.len)&&this._issues.push(D(29,new B(X(n,s.firstToken))));let i=new ve(s);return i.firstToken=n,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let n=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 gr(n,s,i);return this.mergeStack(),o}processRefValue(t,n){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!x(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new hn(o,s);return this.mergeStack(),l}let a=this.isLabelRef(n);if(a===void 0){this._issues.push(D([18,9],n));let l=new hn(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new hn(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,n=new Mn){this.enqueueToStack();let s;if(x(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(D(19,new B(X(this.prevToken))))}let i=this.isNodeName();return i||this._issues.push(D(7,new B(X(s??this.prevToken)))),n.addPath(i??null,s?new B(X(s)):void 0),this.processNodePath(!1,n),this.mergeStack(),n}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,n=t;if(!x(n,40)){this.popStack();return}let s=this.moveToNextToken;if(n=s,!x(n,2)){this.popStack();return}let i=this.processNodePath(),o=new Wr(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!Kt(l.lastToken,c)){this._issues.push(D(29,new B(X(l.lastToken,c))));return}if(u===0&&s&&!Kt(s,l?.firstToken)){this._issues.push(D(29,new B(X(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!Kt(l.lastToken,d.firstToken)&&this._issues.push(D(29,new B(X(l.lastToken,d?.firstToken))))}),x(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(D(3,new B(X(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof is)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var io=K(Y());var Pk=require("fs"),Rk=require("path");var oo=class r{constructor(e,t,n,s=[],i){this.includePaths=t;this.bindingLoader=n;this._issues=[];this.overlays=[];this.macros=new Map;this.overlays=Array.isArray(s)?s:[s],this.overlays.filter(Pk.existsSync),this.parser=new Sa(e,t),this.name=i??(0,Rk.basename)(e),this.overlayParsers=this.overlays?.map(o=>new Sa(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.resolvedPath).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||mr(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof Ce&&l.compatible===o.value.value);return c?{range:Q(o.value),target:`file://${c.bindingsPath}`}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>i.uri===e&&(!t||mr(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:Q(i.path),target:`file://${o}`}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],n=t(e.rootNode),s=e.rootNode.allDescendantsLabels;n.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof ve){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(D(3,o,io.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof Mn){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(D(8,d,io.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 Xu(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let n=0;n<this.overlayParsers.length;n++)this.processRoot(this.overlayParsers[n].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof dn),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,s)=>n.sortKey=s),[this.parser,...this.overlayParsers].forEach(n=>Array.from(n.cPreprocessorParser.macros).forEach(([s,i])=>{let o=r.parseMacros(i.toString());o&&this.macros.set(s,o)})),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}static parseMacros(e){let t=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,s=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;if(i=s.exec(e)){let[,,o,a]=i,c=o.split(",").map(l=>l.trim());return(...l)=>{let u=a;return c.forEach((d,f)=>{let m=new RegExp(`\\b${d}\\b`,"g");u=u.replace(m,l[f])}),u=u.replace(/__VA_ARGS__/g,l.slice(c.length).join(", ")),u}}else if(i=n.exec(e)){let[,,o,a]=i,c=o.split(",").map(l=>l.trim());return(...l)=>{let u=a;return c.forEach((d,f)=>{let m=new RegExp(`\\b${d}\\b`,"g");u=u.replace(m,l[f])}),u}}else if(i=t.exec(e)){let[,,o]=i;return o.trim()}}expandMacros(e){let t=e,n;do n=t,t=n.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(s,i,o,a)=>{if(i&&typeof this.macros.get(i)=="function"){let c=o.split(",").map(l=>l.trim());return this.macros.get(i)(...c)}else if(a&&typeof this.macros.get(a)=="string")return this.macros.get(a);return s});while(t!==n);return t}processRoot(e,t){for(let n=0;n<e.children.length;n++){let s=e.children[n];this.processChild(s,t.rootNode,t)}}processChild(e,t,n){e instanceof ze?this.processDtcBaseNode(e,t,n):e instanceof je?this.processDtcProperty(e,t,n):e instanceof ir?this.processDeleteNode(e,t,n):e instanceof Fe&&this.processDeleteProperty(e,t,n)}checkNodeUniqueNames(e,t){let n=(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 Pe&&o.name)n(i.map(a=>({name:a.name,address:a.address?.map(c=>c.address)})),o.name)&&this._issues.push(D(2,o.name)),i.push(o.name);else if(o instanceof ir&&o.nodeNameOrRef instanceof Le){let a=o.nodeNameOrRef;n(s,a)&&(i=i.filter(c=>n(i.map(l=>({name:l.name,address:l.address?.map(u=>u.address)})),c)))}})}processDtcBaseNode(e,t,n){e instanceof ct?this.processDtcRootNode(e,n):e instanceof Pe?this.processDtcChildNode(e,t,n):e instanceof kt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((n,s)=>n instanceof je&&s instanceof Fe||s instanceof je&&n instanceof Fe?0:s instanceof je?1:0).forEach(n=>this.processChild(n,t.rootNode,t))}processDtcChildNode(e,t,n){if(e.name?.name){let s=e.path?n.resolvePath(e.path):void 0,o=(s?n.rootNode.getChild(s):void 0)??new we(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 ze&&i instanceof ze?0:s instanceof ze?-1:0).forEach(s=>this.processChild(s,t,n))}processDtcRefNode(e,t){let n;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],n=t.rootNode.getChild(s),e.labelReference.linksTo=n,e.labels.forEach(i=>i.lastLinkedTo=n),n?.linkedRefLabels.push(e.labelReference),n?.referencedBy.push(e),e.labels.forEach(i=>{t.labelsUsedCache.set(i.label.value,s)}),n?(t.references.push(e),this.checkNodeUniqueNames(e,n)):t.unlinkedRefNodes.push(e)):(this._issues.push(D(3,e.labelReference,io.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof ze&&i instanceof ze?0:s instanceof ze?-1:0).forEach(s=>this.processChild(s,n??new we(this.bindingLoader,""),t))}processDtcProperty(e,t,n){e.propertyName?.name&&t.addProperty(new et(e,t)),e.children.forEach(s=>this.processChild(s,t,n))}processDeleteNode(e,t,n){if(e.nodeNameOrRef instanceof Le&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(s=>s.address)))this._issues.push(D(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=>{n.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof ve&&e.nodeNameOrRef.value){let s=n.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=n.rootNode.getChild(s),t.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof ze&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(D(3,e.nodeNameOrRef,io.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Wr&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=n.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||(n.unlinkedDeletes.push(e),c&&this._issues.push(D(8,c,io.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=>{n.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof ze&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,n))}processDeleteProperty(e,t,n){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(D(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,t,n))}};var Nt=K(Y());var Dk=require("fs"),ao=require("path");function WM(r){if(!r||!(r.ast instanceof Gi))return[];let e=n=>n.flatMap(s=>(0,Dk.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,ao.join)((0,ao.relative)(s,i.parentPath),i.name)}`,kind:Nt.CompletionItemKind.File})));if(r.ast.relative)return e([(0,ao.dirname)(r.ast.uri)]);let t=r.runtime.context.includePaths;return e(t)}var nd=(r,e)=>[...r.labels.filter(e),...r.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>nd(t.node,e)),...r.nodes.flatMap(t=>nd(t,e))],_m=(r,e)=>[...r.labels,...r.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>_m(t.node,e)),...r.nodes.flatMap(t=>_m(t,e))];function HM(r,e){if(!r||!(r.item instanceof et)||!(r.ast instanceof ve))return[];let t=n=>_m(n,e);return Array.from(new Set(t(r.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:`${n}`,kind:Nt.CompletionItemKind.Method}))}function zM(r,e){if(!r||r.item!==null||!(r.ast instanceof ve)||!(r.ast.parentNode instanceof kt))return[];let t=n=>nd(n,e).filter(s=>e(s));return[...Array.from(new Set(t(r.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:n,insertText:`${n} {
|
|
236
258
|
$1
|
|
237
|
-
};`,kind:Et.CompletionItemKind.Value,insertTextFormat:Et.InsertTextFormat.Snippet}))]}function yM(n,e){let t=s=>s?s.parentNode instanceof kt||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:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(n.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:`${s}`,kind:Et.CompletionItemKind.Variable}))}function bM(n,e){if(!n||!(n.item instanceof Ee)||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 Ie||n.ast instanceof kn?Array.from(new Set(t(n.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]}function vM(n,e){if(!n||!(n.item instanceof Ee))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:Et.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Et.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Et.InsertTextFormat.Snippet}]:[]}function TM(n,e){let t=n?.ast instanceof Cr?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof Cr))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:Et.CompletionItemKind.Variable}))}async function sE(n,e,t){return Ot(n,e,(r,s)=>[...vM(r,s),...bM(r,s),...yM(r,s),...TM(r,s),...gM(r,s),...mM(r,s),...pM(r)],t)}var Us=G(X());function _M(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 Ee&&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 SM(n){if(!n||!(n.ast instanceof Ie)&&!(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 Ie)return Us.Location.create(`file://${r.uri}`,oe(r));if(r instanceof ke)return Us.Location.create(`file://${r.uri}`,oe(r.label??r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&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 iE(n,e,t){return Ot(n,e,r=>[...SM(r),..._M(r)],t)}var is=G(X());function oE(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 Ee&&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 aE(n,e){if(!e||!(e.ast instanceof ht))return[];"newName"in n&&(e.ast.parentNode instanceof ke&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof rs&&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 Ee&&!bt(e.ast)?r(e.item):e.ast instanceof ht&&e.ast.parentNode instanceof ke&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function cE(n){if(!n||!(n.ast instanceof Ie))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 Ie)return is.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof Ie&&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 lE(n,e,t){let r={};return(await Ot(n,e,i=>[...cE(i),...aE(n,i),...oE(i)],t)).forEach(i=>{r[i.uri]??=[],r[i.uri].push(is.TextEdit.replace(i.range,n.newName))}),{changes:r}}async function uE(n,e,t,r){let s=await Ot(n,e,i=>[...cE(i),...aE(n,i),...oE(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 wM(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 Ee&&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 kM(n){if(!n||!(n.ast instanceof Ie)&&!(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 kt)return Gu.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?e(n.ast.linksTo):[]}async function dE(n,e,t){return Ot(n,e,r=>[...kM(r),...wM(r)],t)}var cm=G(X());function EM(n){if(!n||n.item===null||!(n.ast instanceof Fe))return;let e=r=>r.replaces?e(r.replaces):r,t=r=>cm.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 Ee&&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 NM(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof ht))return;let e=t=>{let r=t.definitions.at(0);return r?cm.Location.create(`file://${r.uri}`,oe(r)):void 0};if(n.item instanceof Ee&&!bt(n.ast))return e(n.item);if(n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Ie&&n.ast.linksTo)return e(n.ast.linksTo)}async function fE(n,e,t){return(await Ot(n,e,r=>[NM(r)||EM(r)],t)).at(0)}var ee=G(X());var PM=(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}},RM=(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 hE(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>PM(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>RM(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 DM(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 CM(n){if(!n||!(n.item instanceof pt&&n.ast instanceof Fe&&n.item.ast.values==null||n.item instanceof Ee)||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 pE(n,e,t){return Ot(n,e,r=>[...DM(r),...CM(r)],t)}function OM(n){if(n?.item instanceof Ee)return{contents:n.item.toMarkupContent(),range:oe(n.ast)};if(n?.ast instanceof Ie){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}if(n?.ast.parentNode instanceof ke){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}}function AM(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 mE(n,e,t){return Ot(n,e,r=>[OM(r)||AM(r)],t)}var cv=G(Vg());var w0=G(m0(),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 uq={"[: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,"\\$&"),dq=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),g0=n=>n.join(""),y0=(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,[k,v,b]]of Object.entries(uq))if(n.startsWith(S,i)){if(d)return["$.",!1,n.length-t,!0];i+=S.length,b?s.push(k):r.push(k),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[dq(g),!1,u-t,!1]}let f="["+(l?"^":"")+g0(r)+"]",m="["+(l?"":"^")+g0(s)+"]";return[r.length&&s.length?"("+f+"|"+m+")":r.length?f:m,a,u-t,!0]};var Kn=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var fq=new Set(["!","?","+","*","@"]),b0=n=>fq.has(n),hq="(?!(?:^|/)\\.\\.?(?:$|/))",Kd="(?!\\.)",pq=new Set(["[","."]),mq=new Set(["..","."]),gq=new Set("().*{}+?[]^$\\!"),yq=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kg="[^/]",v0=Kg+"*?",T0=Kg+"+?",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&&b0(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(b0(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,k]=typeof m=="string"?n.#f(m,this.#t,c):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||k,T}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&mq.has(this.#r[0]))){let T=pq,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?hq:S?Kd:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Kn(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,Kn(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:"")+T0;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Kd:"")+v0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,Kn(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+=(gq.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=y0(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){r&&e==="*"?i+=T0:i+=v0,t=!0;continue}if(c==="?"){i+=Kg,t=!0;continue}i+=yq(c)}return[i,Kn(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)),bq=/^\*+([^+@!?\*\[\(]*)$/,vq=n=>e=>!e.startsWith(".")&&e.endsWith(n),Tq=n=>e=>e.endsWith(n),_q=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),Sq=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),wq=/^\*+\.\*+$/,kq=n=>!n.startsWith(".")&&n.includes("."),Eq=n=>n!=="."&&n!==".."&&n.includes("."),Nq=/^\.\*+$/,Pq=n=>n!=="."&&n!==".."&&n.startsWith("."),Rq=/^\*+$/,Dq=n=>n.length!==0&&!n.startsWith("."),Cq=n=>n.length!==0&&n!=="."&&n!=="..",Oq=/^\?+([^+@!?\*\[\(]*)?$/,Aq=([n,e=""])=>{let t=k0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Iq=([n,e=""])=>{let t=E0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Mq=([n,e=""])=>{let t=E0([n]);return e?r=>t(r)&&r.endsWith(e):t},$q=([n,e=""])=>{let t=k0([n]);return e?r=>t(r)&&r.endsWith(e):t},k0=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},E0=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},N0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",_0={win32:{sep:"\\"},posix:{sep:"/"}},Lq=N0==="win32"?_0.win32.sep:_0.posix.sep;zt.sep=Lq;var It=Symbol("globstar **");zt.GLOBSTAR=It;var xq="[^/]",qq=xq+"*?",jq="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Fq="(?:(?!(?:\\/|^)\\.).)*?",Bq=(n,e={})=>t=>zt(t,n,e);zt.filter=Bq;var Nn=(n,e={})=>Object.assign({},n,e),Uq=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=Uq;var P0=(n,e={})=>(Ua(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,w0.default)(n));zt.braceExpand=P0;var Vq=(n,e={})=>new mn(n,e).makeRe();zt.makeRe=Vq;var Wq=(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=Wq;var S0=/[?*]|[+@!]\(.*?\)|\[|\]/,Hq=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||N0,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]==="?"||!S0.test(i[2]))&&!S0.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]),k=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!k&&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:k?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
|
-
|
|
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 P0(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(Rq))?s=t.dot?Cq:Dq:(r=e.match(bq))?s=(t.nocase?t.dot?Sq:_q:t.dot?Tq:vq)(r[1]):(r=e.match(Oq))?s=(t.nocase?t.dot?Iq:Aq:t.dot?Mq:$q)(r):(r=e.match(wq))?s=t.dot?Eq:kq:(r=e.match(Nq))&&(s=Pq);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?qq:t.dot?jq:Fq,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"?Hq(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=Kn;var X0=require("node:url");var mo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,D0=new Set,zg=typeof process=="object"&&process?process:{},C0=(n,e,t,r)=>{typeof zg.emitWarning=="function"?zg.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},zd=globalThis.AbortController,R0=globalThis.AbortSignal;if(typeof zd>"u"){R0=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},zd=class{constructor(){e()}signal=new R0;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=zg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,C0("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 Kq=n=>!D0.has(n),e8=Symbol("type"),ms=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),O0=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)}},Gg=class n{heap;length;static#e=!1;static create(e){let t=O0(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;#k;#E;#v;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#v,sizes:e.#k,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.#q(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:k,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?O0(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(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=k,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=Gg.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";Kq(j)&&(D0.add(j),C0("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.#E=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.#k=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#$=(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.#M=(t,r,s)=>{if(e[t]=r,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#x(!0)}this.#d+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,t,r)=>{};#$=(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.#E){let o=this.#v[t],a=this.#E[t];if(o&&a){let c=o-(mo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#k&&(i.size=this.#k[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.#E){o.ttl=this.#v[t];let a=mo.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[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.#$(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.#x(!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.#M(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.#M(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.#x(!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)}}}#x(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}#q(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:k}=o.signal,v=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(k&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),k&&!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,k=S&&r.allowStaleOnFetchAbort,v=k||r.allowStaleOnFetchRejection,b=v||r.noDeleteOnFetchRejection,R=m;if(this.#s[t]===m&&(!b||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):k||(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 k=this.#o?.(e,i,c);k&&k instanceof Promise&&k.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:k,signal:v}=t;if(!this.#S)return k&&(k.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:k});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:k,signal:v},R=this.#a.get(e);if(R===void 0){k&&(k.fetch="miss");let O=this.#q(e,R,b,g);return O.__returned=O}else{let O=this.#s[R];if(this.#u(O)){let Oe=r&&O.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",Oe&&(k.returnedStale=!0)),Oe?O.__staleWhileFetching:O.__returned=O}let L=this.#b(R);if(!S&&!L)return k&&(k.fetch="hit"),this.#F(R),s&&this.#N(R),k&&this.#n(k,R),O;let V=this.#q(e,R,b,g),re=V.__staleWhileFetching!==void 0&&r;return k&&(k.fetch=L?"stale":"refresh",re&&L&&(k.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.#E&&(this.#v.fill(0),this.#E.fill(0)),this.#k&&this.#k.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"),B0=require("node:url"),mr=require("fs"),nj=G(require("node:fs"),1),bs=require("node:fs/promises");var ef=require("node:events"),ty=G(require("node:stream"),1),L0=require("node:string_decoder"),A0=typeof process=="object"&&process?process:{stdout:null,stderr:null},zq=n=>!!n&&typeof n=="object"&&(n instanceof ys||n instanceof ty.default||Gq(n)||Yq(n)),Gq=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ty.default.Writable.prototype.pipe,Yq=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Ir=Symbol("EOF"),Mr=Symbol("maybeEmitEnd"),gs=Symbol("emittedEnd"),Gd=Symbol("emittingEnd"),Ha=Symbol("emittedError"),Yd=Symbol("closed"),I0=Symbol("read"),Jd=Symbol("flush"),M0=Symbol("flushChunk"),zn=Symbol("encoding"),yo=Symbol("decoder"),Nt=Symbol("flowing"),Ka=Symbol("paused"),bo=Symbol("resume"),Pt=Symbol("buffer"),Gt=Symbol("pipes"),Rt=Symbol("bufferLength"),Yg=Symbol("bufferPush"),Xd=Symbol("bufferShift"),Ft=Symbol("objectMode"),it=Symbol("destroyed"),Jg=Symbol("error"),Xg=Symbol("emitData"),$0=Symbol("emitEnd"),Qg=Symbol("emitEnd2"),hr=Symbol("async"),Zg=Symbol("abort"),Qd=Symbol("aborted"),za=Symbol("signal"),Js=Symbol("dataListeners"),gn=Symbol("discarded"),Ga=n=>Promise.resolve().then(n),Jq=n=>n(),Xq=n=>n==="end"||n==="finish"||n==="prefinish",Qq=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,Zq=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()}},ey=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)}},ej=n=>!!n.objectMode,tj=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",ys=class extends ef.EventEmitter{[Nt]=!1;[Ka]=!1;[Gt]=[];[Pt]=[];[Ft];[zn];[hr];[yo];[Ir]=!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");ej(t)?(this[Ft]=!0,this[zn]=null):tj(t)?(this[zn]=t.encoding,this[Ft]=!1):(this[Ft]=!1,this[zn]=null),this[hr]=!!t.async,this[yo]=this[zn]?new L0.StringDecoder(this[zn]):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[Zg]():r.addEventListener("abort",()=>this[Zg]()))}get bufferLength(){return this[Rt]}get encoding(){return this[zn]}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[hr]}set async(e){this[hr]=this[hr]||!!e}[Zg](){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[Ir])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[hr]?Ga:Jq;if(!this[Ft]&&!Buffer.isBuffer(e)){if(Zq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Qq(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[Yg](e),this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt]):e.length?(typeof e=="string"&&!(t===this[zn]&&!this[yo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zn]&&(e=this[yo].write(e)),this[Nt]&&this[Rt]!==0&&this[Jd](!0),this[Nt]?this.emit("data",e):this[Yg](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[Mr](),null;this[Ft]&&(e=null),this[Pt].length>1&&!this[Ft]&&(this[Pt]=[this[zn]?this[Pt].join(""):Buffer.concat(this[Pt],this[Rt])]);let t=this[I0](e||null,this[Pt][0]);return this[Mr](),t}[I0](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[Ir]&&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[Ir]=!0,this.writable=!1,(this[Nt]||!this[Ka])&&this[Mr](),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[Ir]?this[Mr]():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]}[Yg](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[M0](this[Xd]())&&this[Pt].length);!e&&!this[Pt].length&&!this[Ir]&&this.emit("drain")}[M0](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===A0.stdout||e===A0.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[Gt].push(t.proxyErrors?new ey(this,e,t):new Zd(this,e,t)),this[hr]?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(Xq(e)&&this[gs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ha]){let s=t;this[hr]?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]}[Mr](){!this[Gd]&&!this[gs]&&!this[it]&&this[Pt].length===0&&this[Ir]&&(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[hr]?(Ga(()=>this[Xg](r)),!0):this[Xg](r);if(e==="end")return this[$0]();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(Jg,r);let i=!this[za]||this.listeners("error").length?super.emit("error",r):!1;return this[Mr](),i}else if(e==="resume"){let i=super.emit("resume");return this[Mr](),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[Mr](),s}[Xg](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[Mr](),t}[$0](){return this[gs]?!1:(this[gs]=!0,this.readable=!1,this[hr]?(Ga(()=>this[Qg]()),!0):this[Qg]())}[Qg](){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[zn]?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[Ir])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[Ir]})},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(Jg,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(Jg,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 zq}};var rj=mr.realpathSync.native,Ja={lstatSync:mr.lstatSync,readdir:mr.readdir,readdirSync:mr.readdirSync,readlinkSync:mr.readlinkSync,realpathSync:rj,promises:{lstat:bs.lstat,readdir:bs.readdir,readlink:bs.readlink,realpath:bs.realpath}},U0=n=>!n||n===Ja||n===nj?Ja:{...Ja,...n,promises:{...Ja.promises,...n.promises||{}}},V0=/^\\\\\?\\([a-z]:)\\?$/i,sj=n=>n.replace(/\//g,"\\").replace(V0,"$1\\"),ij=/[\\\/]/,Rn=0,W0=1,H0=2,pr=4,K0=6,z0=8,Xs=10,G0=12,Pn=15,Ya=~Pn,ny=16,x0=32,Xa=64,Gn=128,tf=256,rf=512,q0=Xa|Gn|rf,oj=1023,ry=n=>n.isFile()?z0:n.isDirectory()?pr:n.isSymbolicLink()?Xs:n.isCharacterDevice()?H0:n.isBlockDevice()?K0:n.isSocket()?G0:n.isFIFO()?W0:Rn,j0=new Map,Qa=n=>{let e=j0.get(n);if(e)return e;let t=n.normalize("NFKD");return j0.set(n,t),t},F0=new Map,nf=n=>{let e=F0.get(n);if(e)return e;let t=Qa(n.toLowerCase());return F0.set(n,t),t},sf=class extends Wa{constructor(){super({max:256})}},sy=class extends Wa{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},Y0=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}#k;get ctime(){return this.#k}#E;get birthtime(){return this.#E}#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&oj,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=U0(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&=~ny,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|=Gn),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)===z0}isDirectory(){return(this.#n&Pn)===pr}isCharacterDevice(){return(this.#n&Pn)===H0}isBlockDevice(){return(this.#n&Pn)===K0}isFIFO(){return(this.#n&Pn)===W0}isSocket(){return(this.#n&Pn)===G0}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&x0?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&Gn)}calledReaddir(){return!!(this.#n&ny)}isENOENT(){return!!(this.#n&Gn)}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}}#M(e){this.#n|=ny;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#n&Gn||(this.#n=(this.#n|Gn)&Ya,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#R(){this.#n|=rf,this.#L()}#L(){if(this.#n&Xa)return;let e=this.#n;(e&Pn)===pr&&(e&=Ya),this.#n=e|Xa,this.#P()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#$():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#$()}#u(e=""){let t=this.#n;t|=tf,e==="ENOENT"&&(t|=Gn),(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=ry(e),s=this.newChild(e.name,r,{parent:this}),i=s.#n&Pn;return i!==pr&&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|ry(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&Gn)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#n&Gn)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(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:k,size:v,uid:b}=e;this.#w=t,this.#g=r,this.#E=s,this.#f=i,this.#d=o,this.#s=a,this.#k=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=k,this.#c=v,this.#o=b;let R=ry(e);this.#n=this.#n&Ya|R|x0,R!==Rn&&R!==pr&&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.#x(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#M(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.#M(e)}catch(s){this.#x(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.#M(e)}catch(r){this.#x(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&q0)return!1;let e=Pn&this.#n;return e===Rn||e===pr||e===Xs}shouldWalk(e,t){return(this.#n&pr)===pr&&!(this.#n&q0)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((rf|tf|Gn)&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|Gn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[Y0](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=ij;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=sj(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(V0,"$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=U0(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,B0.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 sy(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 k of T)(!i||i(k))&&a.push(r?k:k.fullpath()),s&&k.isSymbolicLink()?k.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,S):S()):k.shouldWalk(c,o)?l(k,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,k,v=!1)=>{if(S)return a.emit("error",S);if(s&&!v){let b=[];for(let R of k)R.isSymbolicLink()&&b.push(R.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>T(null,k,!0));return}}for(let b of k)b&&(!i||i(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of k){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[Y0](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,pr,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,pr,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})}},i8=process.platform==="win32"?of:af,J0=process.platform==="win32"?To:process.platform==="darwin"?Za:_o;var aj=n=>n.length>=1,cj=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(!aj(e))throw new TypeError("empty pattern list");if(!cj(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 lj=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=lj}){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 iy=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()]))}},oy=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)])}},ay=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 oy;subwalks=new ay;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new iy}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 uj=(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=uj(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 dj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Yn=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,X0.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||dj,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:J0;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 cy=(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 Yn(n,e).streamSync()}function Z0(n,e={}){return new Yn(n,e).stream()}function eR(n,e={}){return new Yn(n,e).walkSync()}async function Q0(n,e={}){return new Yn(n,e).walk()}function df(n,e={}){return new Yn(n,e).iterateSync()}function tR(n,e={}){return new Yn(n,e).iterate()}var fj=uf,hj=Object.assign(Z0,{sync:uf}),pj=df,mj=Object.assign(tR,{sync:df}),gj=Object.assign(eR,{stream:uf,iterate:df}),Qs=Object.assign(Q0,{glob:Q0,globSync:eR,sync:gj,globStream:Z0,stream:hj,globStreamSync:uf,streamSync:fj,globIterate:tR,iterate:mj,globIterateSync:df,iterateSync:pj,Glob:Yn,hasMagic:cy,escape:po,unescape:Kn});Qs.glob=Qs;var lv=require("path"),uv=require("fs");var iO=G(nO());var av={};LO(av,{$id:()=>jW,$schema:()=>qW,default:()=>WW,definitions:()=>BW,properties:()=>VW,title:()=>FW,type:()=>UW});var qW="http://json-schema.org/draft-07/schema#",jW="http://json-schema.org/draft-07/schema#",FW="Core schema meta-schema",BW={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:[]}},UW=["object","boolean"],VW={$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:"#"}},WW={$schema:qW,$id:jW,title:FW,definitions:BW,type:UW,properties:VW,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=Ee.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...HW(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&&typeof r=="object"&&"description"in r)return{kind:Tt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
|
|
259
|
+
};`,kind:Nt.CompletionItemKind.Value,insertTextFormat:Nt.InsertTextFormat.Snippet}))]}function KM(r,e){let t=s=>s?s.parentNode instanceof kt||s.parentNode instanceof ct||s.parentNode instanceof Pe?!1:t(s.parentNode):!0;if(!r||r.item!==null||!bt(r.ast)||!t(r.ast))return[];let n=s=>nd(s,e).filter(i=>e(i));return r.ast instanceof lt?n(r.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:Nt.CompletionItemKind.Keyword,insertTextFormat:Nt.InsertTextFormat.Snippet,sortText:"~"}]:r.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Nt.CompletionItemKind.Keyword,insertTextFormat:Nt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(n(r.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:r.ast instanceof ve?`${s}`:`&${s}`,kind:Nt.CompletionItemKind.Variable}))}function GM(r,e){if(!r||!(r.item instanceof we)||r.item===null||r.beforeAst&&(!(r.beforeAst?.parentNode instanceof Gt)||r.beforeAst?.parentNode instanceof Fe))return[];let t=n=>[...n.nodes,...n.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Pe)).filter(s=>e(s));return r.ast instanceof Le||r.ast instanceof ir||r.beforeAst?.parentNode instanceof ir?Array.from(new Set(t(r.item).map(n=>n.name?.toString()))).map(n=>({label:`${n}`,kind:Nt.CompletionItemKind.Variable})):t(r.item).length?[{label:"/delete-node/",kind:Nt.CompletionItemKind.Keyword,insertTextFormat:Nt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function YM(r,e){if(!r||!(r.item instanceof we)||r.beforeAst&&(!(r.beforeAst?.parentNode instanceof Gt)||r.beforeAst?.parentNode instanceof ir))return[];let t=n=>[...n.property,...n.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return r.ast instanceof He||r.ast instanceof Fe||r.beforeAst?.parentNode instanceof Fe?Array.from(new Set(t(r.item).map(n=>n.name))).map(n=>({label:`${n}`,kind:Nt.CompletionItemKind.Variable})):t(r.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Nt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Nt.InsertTextFormat.Snippet}]:[]}function JM(r,e){let t=r?.ast instanceof Mn?r.ast:r?.ast.parentNode;if(!r||!t||!(t instanceof Mn))return[];let n=t.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let s=n.map(o=>o.toString());return(()=>{let o=r.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!bt(r.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:Nt.CompletionItemKind.Variable}))}async function Ck(r,e,t){return At(r,e,(n,s)=>[...YM(n,s),...GM(n,s),...KM(n,s),...JM(n,s),...zM(n,s),...HM(n,s),...WM(n)],t)}var pn=K(Y());function XM(r){if(!r||r.item===null||!(r.ast instanceof He))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast),n.parent.deletedProperties.find(s=>s.property=n)?.by??[]].map(s=>{if(s instanceof je)return pn.Location.create(`file://${s.uri}`,Q(s.propertyName??s));if(s instanceof Fe)return pn.Location.create(`file://${s.uri}`,Q(s.propertyName??s))}).filter(s=>s);if(r.item instanceof et&&r.ast instanceof He)return t(e(r.item));if(r.item instanceof we&&r.ast instanceof He&&r.ast.parentNode instanceof Fe){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function QM(r){if(!r)return[];let e=t=>{let s=r.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&r.runtime.rootNode.getChild(a[0].split("/"))===t)return!0}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&(o.by.nodeNameOrRef instanceof Le?o.by.nodeNameOrRef!==r.ast:!t.linkedRefLabels.some(a=>a!==r.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof ct)return pn.Location.create(`file://${o.uri}`,Q(o.name??o));if(o instanceof Pe)return pn.Location.create(`file://${o.uri}`,Q(o.name??o));if(o instanceof Le)return pn.Location.create(`file://${o.uri}`,Q(o));if(o instanceof Le)return pn.Location.create(`file://${o.uri}`,Q(o));if(o instanceof ve)return pn.Location.create(`file://${o.uri}`,Q(o.label??o));if(o instanceof je)return pn.Location.create(`file://${(o.values??o)?.uri}`,Q(o.values??o))}).filter(o=>o)};if(r.item instanceof we&&!bt(r.ast))return e(r.item);if(r.ast instanceof It&&r.ast.parentNode instanceof ve&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof Le&&r.ast.linksTo)return bt(r.ast)?[...e(r.ast.linksTo),pn.Location.create(`file://${r.ast.uri}`,Q(r.ast))]:e(r.ast.linksTo);if(r?.ast instanceof Ce&&r.item instanceof et&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}return[]}async function Ok(r,e,t){return At(r,e,n=>[...QM(n),...XM(n)],t)}var $n=K(Y());function Ak(r){if(!r||r.item===null||!(r.ast instanceof He))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast),n.parent.deletedProperties.find(s=>s.property=n)?.by??[]].map(s=>{if((s instanceof je||s instanceof Fe)&&s.propertyName)return $n.Location.create(`file://${s.uri}`,Q(s.propertyName))}).filter(s=>s);if(r.item instanceof et&&r.ast instanceof He)return t(e(r.item));if(r.item instanceof we&&r.ast instanceof He&&r.ast.parentNode instanceof Fe){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function Ik(r,e){if(!e||!(e.ast instanceof It))return[];"newName"in r&&(e.ast.parentNode instanceof ve&&r.newName.startsWith("&")?r.newName=r.newName.slice(1):e.ast.parentNode instanceof cs&&r.newName.endsWith(":")&&(r.newName=r.newName.slice(0,-1)));let t=e.ast.value,n=s=>[...s.definitions.filter(i=>i instanceof Pe).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return $n.Location.create(`file://${i.uri}`,Q(i))}).filter(i=>i);return e.item instanceof we&&!bt(e.ast)?n(e.item):e.ast instanceof It&&e.ast.parentNode instanceof ve&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function Mk(r){if(!r||!(r.ast instanceof Le))return[];let e=t=>{let s=r.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=r.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(t)||c===t)return!0}}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&o.by.nodeNameOrRef!==r.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof Pe&&o.name)return $n.Location.create(`file://${o.uri}`,Q(o.name));if(o instanceof Le)return $n.Location.create(`file://${o.uri}`,Q(o));if(o instanceof je&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Ce){let a=o.values.values[0].value,c=Q(a),l=a.value.split("/"),u=t.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,$n.Location.create(`file://${o.values.values[0].uri}`,c)}}).filter(o=>o)};return r.item instanceof we&&!bt(r.ast)?e(r.item):r.ast instanceof Le&&r.ast.linksTo?bt(r.ast)?[...e(r.ast.linksTo),$n.Location.create(`file://${r.ast.uri}`,Q(r.ast))]:e(r.ast.linksTo):[]}async function $k(r,e,t){let n={};return(await At(r,e,i=>[...Mk(i),...Ik(r,i),...Ak(i)],t)).forEach(i=>{n[i.uri]??=[],n[i.uri].push($n.TextEdit.replace(i.range,r.newName))}),{changes:n}}async function Lk(r,e,t,n){let s=await At(r,e,i=>[...Mk(i),...Ik(r,i),...Ak(i)],n);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 co=K(Y());function ZM(r){if(!r||r.item===null||!(r.ast instanceof He))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,t=n=>[n.ast,...n.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof je)return co.Location.create(`file://${s.uri}`,Q(s.propertyName??s))}).filter(s=>s);if(r.item instanceof et&&r.ast instanceof He)return t(e(r.item));if(r.item instanceof we&&r.ast instanceof He&&r.ast.parentNode instanceof Fe){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(n)}return[]}function e$(r){if(!r)return[];let e=t=>[...t.definitions,...t.referencedBy].map(n=>{if(n instanceof ct)return co.Location.create(`file://${n.uri}`,Q(n));if(n instanceof Pe)return co.Location.create(`file://${n.uri}`,Q(n));if(n instanceof kt)return co.Location.create(`file://${n.uri}`,Q(n))}).filter(n=>n);if(r.item instanceof we&&!bt(r.ast))return e(r.item);if(r.ast instanceof It&&r.ast.parentNode instanceof ve&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof Le&&r.ast.linksTo)return e(r.ast.linksTo);if(r?.ast instanceof Ce&&r.item instanceof et&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}return[]}function t$(r){if(r?.ast instanceof Rr){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r.ast.name);if(e)return[co.Location.create(`file://${e.uri}`,Q(e.identifier))]}return[]}async function xk(r,e,t){return At(r,e,n=>[...e$(n),...ZM(n),...t$(n)],t)}var sd=K(Y());function r$(r){if(!r||r.item===null||!(r.ast instanceof He))return;let e=n=>n.replaces?e(n.replaces):n,t=n=>sd.Location.create(`file://${n.ast.uri}`,Q(n.ast.propertyName??n.ast));if(r.item instanceof et&&r.ast instanceof He)return t(e(r.item));if(r.item instanceof we&&r.ast instanceof He&&r.ast.parentNode instanceof Fe){let n=r.item.deletedProperties.find(s=>s.by===r.ast.parentNode)?.property;if(n)return t(e(n))}}function n$(r){if(!r)return;let e=t=>{let n=t.definitions.at(0);return n?sd.Location.create(`file://${n.uri}`,Q(n)):void 0};if(r.item instanceof we&&!bt(r.ast))return e(r.item);if(r.ast instanceof It&&r.ast.parentNode instanceof ve&&r.ast.parentNode.linksTo)return e(r.ast.parentNode.linksTo);if(r.ast instanceof Le&&r.ast.linksTo)return e(r.ast.linksTo);if(r?.ast instanceof Ce&&r.item instanceof et&&r.item.parent.name==="aliases"){let t=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(t)return e(t)}}function s$(r){if(r?.ast instanceof Rr){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r.ast.name);if(e)return sd.Location.create(`file://${e.uri}`,Q(e.identifier))}}async function qk(r,e,t){return(await At(r,e,n=>[n$(n)||r$(n)||s$(n)],t)).at(0)}var ee=K(Y());var i$=(r,e,t,n,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(ee.Range.create(ee.Position.create(n.range.start.line,r.pos.col+r.pos.len),ee.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},o$=(r,e,t,n,s,i,o)=>{if(!i)return[];switch(t){case 0:return[{title:o??`Add Property "${i.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 28:return[{title:o??"Remove Property",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 27:return[{title:o??"TODO",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 26:return i?[{title:o??"TODO",diagnostics:[n],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}]:[];default:return}};function jk(r){let e=r.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>i$(c.firstToken,c.lastToken,l,a,r.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>o$(c.firstToken,c.lastToken,l,a,r.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===ee.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==ee.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[r.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[r.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:{[r.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:{[r.textDocument.uri]:a}}}:[])]}var id=r=>!r||r instanceof je?!1:r instanceof gr||id(r.parentNode);function a$(r){if(!r||!(r.item instanceof et&&r.item.ast.assignOperatorToken))return[];let e=id(r?.ast);if(!e&&!(r.ast instanceof je&&r.item.ast.values===null)&&!id(r.beforeAst)&&!id(r.afterAst))return[];let t=-1;r.item.ast.values===null?t=0:t=(r.item.ast.values?.values.findIndex(s=>s&&hm(s,r.beforeAst))??-1)+1,t===-1&&(t=0);let n=r.item.parent.nodeType;return n instanceof fn?n.properties.find(s=>s.name===r.item?.name)?.getPropertyCompletionItems(r.item,t,e)??[]:[]}function c$(r){if(!r||!(r.item instanceof et&&r.ast instanceof He&&r.item.ast.values==null||r.item instanceof we)||bt(r.ast)||r.beforeAst?.parentNode instanceof Gt)return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return r.item instanceof et?e(r.item.parent):e(r.item)}async function Fk(r,e,t){return At(r,e,n=>[...a$(n),...c$(n)],t)}var Sm=K(Y());function Bk(r){return!r||r instanceof so?r:Bk(r.parentNode)}function l$(r){if(r?.ast instanceof Rr){let e=r.runtime.context.parser.cPreprocessorParser.macros.get(r.ast.name);if(e){let t=Bk(r.ast);return t?{contents:{kind:Sm.MarkupKind.Markdown,value:["```cpp",`#define ${e.toString()} // = ${t?.evaluate(r.runtime.context)}`,"```"].join(`
|
|
260
|
+
`)},range:Q(r.ast)}:{contents:{kind:Sm.MarkupKind.Markdown,value:["```cpp",`#define ${e.toString()} // = ${r.ast?.evaluate(r.runtime.context)}`,"```"].join(`
|
|
261
|
+
`)},range:Q(r.ast)}}}}function u$(r){if(r?.item instanceof we)return{contents:r.item.toMarkupContent(),range:Q(r.ast)};if(r?.ast instanceof Le){let e=r.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}if(r?.ast.parentNode instanceof ve){let e=r.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}if(r?.ast instanceof Ce&&r.item instanceof et&&r.item.parent.name==="aliases"){let e=r.runtime.rootNode.getChild(r.ast.value.split("/"));if(e)return{contents:e.toMarkupContent(),range:Q(r.ast)}}}function d$(r){if(r?.item instanceof et&&r.ast instanceof He){let e=r.item.parent.nodeType?.getOnPropertyHover(r.item.name);if(e)return{contents:e,range:Q(r.ast)}}}function Uk(r,e,t){return At(r,e,n=>[u$(n)||d$(n)||l$(n)],t)}var Sv=K(ny());var J0=K(U0(),1);var ec=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Vq={"[: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]},tc=r=>r.replace(/[[\]\\-]/g,"\\$&"),Wq=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V0=r=>r.join(""),W0=(r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<r.length;){let g=r.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,[w,v,b]]of Object.entries(Vq))if(r.startsWith(S,i)){if(d)return["$.",!1,r.length-t,!0];i+=S.length,b?s.push(w):n.push(w),a=a||v;continue e}}if(c=!1,d){g>d?n.push(tc(d)+"-"+tc(g)):g===d&&n.push(tc(g)),d="",i++;continue}if(r.startsWith("-]",i+1)){n.push(tc(g+"-")),i+=2;continue}if(r.startsWith("-",i+1)){d=g,i+=2;continue}n.push(tc(g)),i++}if(u<i)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,r.length-t,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let g=n[0].length===2?n[0].slice(-1):n[0];return[Wq(g),!1,u-t,!1]}let f="["+(l?"^":"")+V0(n)+"]",m="["+(l?"":"^")+V0(s)+"]";return[n.length&&s.length?"("+f+"|"+m+")":n.length?f:m,a,u-t,!0]};var Jr=(r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Hq=new Set(["!","?","+","*","@"]),H0=r=>Hq.has(r),zq="(?!(?:^|/)\\.\\.?(?:$|/))",nf="(?!\\.)",Kq=new Set(["[","."]),Gq=new Set(["..","."]),Yq=new Set("().*{}+?[]^$\\!"),Jq=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),oy="[^/]",z0=oy+"*?",K0=oy+"+?",To=class r{type;#e;#t;#i=!1;#n=[];#o;#T;#l;#d=!1;#a;#c;#s=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n: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.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#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,n=t.#o;for(;n;){for(let s=t.#T+1;!n.type&&s<n.#n.length;s++)for(let i of e.#n){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(n.#n[s])}t=n,n=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#o===this))throw new Error("invalid part: "+t);this.#n.push(t)}}toJSON(){let e=this.type===null?this.#n.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#n.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 n=e.#n[t];if(!(n instanceof r&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.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 r(this.type,e);for(let n of this.#n)t.copyIn(n);return t}static#y(e,t,n,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let m=n,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&&H0(g)&&e.charAt(m)==="("){t.push(T),T="";let S=new r(g,t);m=r.#y(e,S,m,s),t.push(S);continue}T+=g}return t.push(T),m}let l=n+1,u=new r(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(H0(m)&&e.charAt(l)==="("){u.push(f),f="";let T=new r(m,u);u.push(T),l=r.#y(e,T,l,s);continue}if(m==="|"){u.push(f),f="",d.push(u),u=new r(null,t);continue}if(m===")")return f===""&&t.#n.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.#n=[e.substring(n-1)],l}static fromGlob(e,t={}){let n=new r(null,void 0,t);return r.#y(e,n,0,t),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;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.#n.map(m=>{let[T,g,S,w]=typeof m=="string"?r.#f(m,this.#t,c):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||w,T}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&Gq.has(this.#n[0]))){let T=Kq,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?zq:S?nf:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Jr(l),this.#t=!!this.#t,this.#i]}let n=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.#n=[c],this.type=null,this.#t=void 0,[c,Jr(this.toString()),!1,!1]}let o=!n||e||t||!nf?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!t?nf:"")+K0;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?nf:"")+z0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,Jr(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#n.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,n=!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+=(Yq.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=W0(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){n&&e==="*"?i+=K0:i+=z0,t=!0;continue}if(c==="?"){i+=oy,t=!0;continue}i+=Jq(c)}return[i,Jr(e),!!t,o]}};var _o=(r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var Jt=(r,e,t={})=>(ec(e),!t.nocomment&&e.charAt(0)==="#"?!1:new yr(e,t).match(r)),Xq=/^\*+([^+@!?\*\[\(]*)$/,Qq=r=>e=>!e.startsWith(".")&&e.endsWith(r),Zq=r=>e=>e.endsWith(r),ej=r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),tj=r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),rj=/^\*+\.\*+$/,nj=r=>!r.startsWith(".")&&r.includes("."),sj=r=>r!=="."&&r!==".."&&r.includes("."),ij=/^\.\*+$/,oj=r=>r!=="."&&r!==".."&&r.startsWith("."),aj=/^\*+$/,cj=r=>r.length!==0&&!r.startsWith("."),lj=r=>r.length!==0&&r!=="."&&r!=="..",uj=/^\?+([^+@!?\*\[\(]*)?$/,dj=([r,e=""])=>{let t=X0([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},fj=([r,e=""])=>{let t=Q0([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},hj=([r,e=""])=>{let t=Q0([r]);return e?n=>t(n)&&n.endsWith(e):t},pj=([r,e=""])=>{let t=X0([r]);return e?n=>t(n)&&n.endsWith(e):t},X0=([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},Q0=([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},Z0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",G0={win32:{sep:"\\"},posix:{sep:"/"}},mj=Z0==="win32"?G0.win32.sep:G0.posix.sep;Jt.sep=mj;var $t=Symbol("globstar **");Jt.GLOBSTAR=$t;var gj="[^/]",yj=gj+"*?",bj="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",vj="(?:(?!(?:\\/|^)\\.).)*?",Tj=(r,e={})=>t=>Jt(t,r,e);Jt.filter=Tj;var Cr=(r,e={})=>Object.assign({},r,e),_j=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Jt;let e=Jt;return Object.assign((n,s,i={})=>e(n,s,Cr(r,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Cr(r,i))}static defaults(s){return e.defaults(Cr(r,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Cr(r,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Cr(r,i))}},unescape:(n,s={})=>e.unescape(n,Cr(r,s)),escape:(n,s={})=>e.escape(n,Cr(r,s)),filter:(n,s={})=>e.filter(n,Cr(r,s)),defaults:n=>e.defaults(Cr(r,n)),makeRe:(n,s={})=>e.makeRe(n,Cr(r,s)),braceExpand:(n,s={})=>e.braceExpand(n,Cr(r,s)),match:(n,s,i={})=>e.match(n,s,Cr(r,i)),sep:e.sep,GLOBSTAR:$t})};Jt.defaults=_j;var eR=(r,e={})=>(ec(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,J0.default)(r));Jt.braceExpand=eR;var Sj=(r,e={})=>new yr(r,e).makeRe();Jt.makeRe=Sj;var Ej=(r,e,t={})=>{let n=new yr(e,t);return r=r.filter(s=>n.match(s)),n.options.nonull&&!r.length&&r.push(e),r};Jt.match=Ej;var Y0=/[?*]|[+@!]\(.*?\)|\[|\]/,wj=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){ec(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Z0,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 n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),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]==="?"||!Y0.test(i[2]))&&!Y0.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 n=0;n<e.length;n++)for(let s=0;s<e[n].length;s++)e[n][s]==="**"&&(e[n][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 n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let s=n;for(;t[s+1]==="**";)s++;s!==n&&t.splice(n,s-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,s)=>{let i=n[n.length-1];return s==="**"&&i==="**"?n:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(s),n)},[]),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 n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let o=s;for(;n[o+1]==="**";)o++;o>s&&n.splice(s+1,o-s);let a=n[s+1],c=n[s+2],l=n[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(s,1);let u=n.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){let o=n[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...c),n.length===0&&n.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let s=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(s){e[t]=[],e[n]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!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(n&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(n&&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,n=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!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]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!w&&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:w?0:void 0;if(typeof b=="number"&&typeof R=="number"){let[A,L]=[e[b],t[R]];A.toLowerCase()===L.toLowerCase()&&(t[R]=A,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===$t){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(`
|
|
262
|
+
globstar while`,e,f,t,m,T),this.matchOne(e.slice(f),t.slice(m),n))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!!(n&&(this.debug(`
|
|
263
|
+
>>> 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 n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return eR(this.pattern,this.options)}parse(e){ec(e);let t=this.options;if(e==="**")return $t;if(e==="")return"";let n,s=null;(n=e.match(aj))?s=t.dot?lj:cj:(n=e.match(Xq))?s=(t.nocase?t.dot?tj:ej:t.dot?Zq:Qq)(n[1]):(n=e.match(uj))?s=(t.nocase?t.dot?fj:dj:t.dot?hj:pj)(n):(n=e.match(rj))?s=t.dot?sj:nj:(n=e.match(ij))&&(s=oj);let i=To.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,n=t.noglobstar?yj:t.dot?bj:vj,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"?wj(u):u===$t?$t:u._src});return l.forEach((u,d)=>{let f=l[d+1],m=l[d-1];u!==$t||m===$t||(m===void 0?f!==void 0&&f!==$t?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=m+"(?:\\/|"+n+")?":f!==$t&&(l[d-1]=m+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=$t))}),l.filter(u=>u!==$t).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 n=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(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Jt.defaults(e).Minimatch}};Jt.AST=To;Jt.Minimatch=yr;Jt.escape=_o;Jt.unescape=Jr;var wR=require("node:url");var So=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,rR=new Set,ay=typeof process=="object"&&process?process:{},nR=(r,e,t,n)=>{typeof ay.emitWarning=="function"?ay.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},sf=globalThis.AbortController,tR=globalThis.AbortSignal;if(typeof sf>"u"){tR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},sf=class{constructor(){e()}signal=new tR;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let r=ay.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=!1,nR("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 kj=r=>!rR.has(r),QZ=Symbol("type"),vs=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),sR=r=>vs(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Eo:null:null,Eo=class extends Array{constructor(e){super(e),this.fill(0)}},cy=class r{heap;length;static#e=!1;static create(e){let t=sR(e);if(!t)return[];r.#e=!0;let n=new r(e,t);return r.#e=!1,n}constructor(e,t){if(!r.#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]}},rc=class r{#e;#t;#i;#n;#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;#E;#m;#w;#k;#v;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#v,sizes:e.#w,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.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,n,s,i)=>e.#q(t,n,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.#n}constructor(e){let{max:t=0,ttl:n,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:w,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:L}=e;if(t!==0&&!vs(t))throw new TypeError("max option must be a nonnegative integer");let W=t?sR(t):Array;if(!W)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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=w,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 W(t),this.#y=new W(t),this.#h=0,this.#f=0,this.#E=cy.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#_=!!this.#i,this.#p=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!vs(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!vs(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=vs(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!vs(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";kj(j)&&(rR.add(j),nR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,r))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#D(){let e=new Eo(this.#e),t=new Eo(this.#e);this.#v=e,this.#k=t,this.#A=(i,o,a=So.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?So.now():0},this.#r=(i,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=n||s();let l=i.now-c;i.remainingTTL=a-l}};let n=0,s=()=>{let i=So.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=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=(n||s())-c;return a-l},this.#b=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(n||s())-o>a}}#N=()=>{};#r=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Eo(this.#e);this.#d=0,this.#w=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#$=(t,n,s,i)=>{if(this.#u(n))return 0;if(!vs(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,t),!vs(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.#M=(t,n,s)=>{if(e[t]=n,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#x(!0)}this.#d+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,t,n)=>{};#$=(e,t,n,s)=>{if(n||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 n of this.#P()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#P()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#R()){let s=this.#s[n],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[n],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 n=this.#s[t],s=this.#u(n)?n.__staleWhileFetching:n;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-(So.now()-a);i.ttl=c,i.start=Date.now()}}return this.#w&&(i.size=this.#w[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#c[t],s=this.#s[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#v&&this.#k){o.ttl=this.#v[t];let a=So.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=So.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){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}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#$(e,t,n.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.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#x(!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.#M(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.#M(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.#r(c,d)),!o&&this.#p&&this.#m){let f=this.#m,m;for(;m=f?.shift();)this.#n?.(...m)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#x(!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.#n?.(...t)}}}#x(e){let t=this.#h,n=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,n,"evict"),this.#p&&this.#m?.push([s,n,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#s[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#f=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(n),this.#l--,t}has(e,t={}){let{updateAgeOnHas:n=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.#r(s,i));else return n&&this.#N(i),s&&(s.has="hit",this.#r(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!n&&this.#b(s))return;let i=this.#s[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,t,n,s){let i=t===void 0?void 0:this.#s[t];if(this.#u(i))return i;let o=new sf,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,S=!1)=>{let{aborted:w}=o.signal,v=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(w&&!S?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!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"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:S}=o.signal,w=S&&n.allowStaleOnFetchAbort,v=w||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,R=m;if(this.#s[t]===m&&(!b||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):w||(this.#s[t]=R.__staleWhileFetching)),v)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},f=(g,S)=>{let w=this.#o?.(e,i,c);w&&w instanceof Promise&&w.then(v=>g(v===void 0?void 0:v),S),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=v=>l(v,!0)))})};n.status&&(n.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 sf}async fetch(e,t={}){let{allowStale:n=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:w,signal:v}=t;if(!this.#S)return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:w});let b={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:T,ignoreFetchAbort:m,status:w,signal:v},R=this.#a.get(e);if(R===void 0){w&&(w.fetch="miss");let A=this.#q(e,R,b,g);return A.__returned=A}else{let A=this.#s[R];if(this.#u(A)){let Me=n&&A.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Me&&(w.returnedStale=!0)),Me?A.__staleWhileFetching:A.__returned=A}let L=this.#b(R);if(!S&&!L)return w&&(w.fetch="hit"),this.#F(R),s&&this.#N(R),w&&this.#r(w,R),A;let W=this.#q(e,R,b,g),se=W.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=L?"stale":"refresh",se&&L&&(w.returnedStale=!0)),se?W.__staleWhileFetching:W.__returned=W}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#T;if(!n)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=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=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.#r(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.#O(e,"expire"),o&&n&&(o.returnedStale=!0),n?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 n=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(n=!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.#E.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#n?.(...i)}return n}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let n=this.#s[t];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#_&&this.#i?.(n,s,e),this.#p&&this.#m?.push([n,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.#w&&this.#w.fill(0),this.#h=0,this.#f=0,this.#E.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,n;for(;n=t?.shift();)this.#n?.(...n)}}};var No=require("node:path"),pR=require("node:url"),vn=require("fs"),$j=K(require("node:fs"),1),Ss=require("node:fs/promises");var ff=require("node:events"),my=K(require("node:stream"),1),lR=require("node:string_decoder"),iR=typeof process=="object"&&process?process:{stdout:null,stderr:null},Nj=r=>!!r&&typeof r=="object"&&(r instanceof _s||r instanceof my.default||Pj(r)||Rj(r)),Pj=r=>!!r&&typeof r=="object"&&r instanceof ff.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==my.default.Writable.prototype.pipe,Rj=r=>!!r&&typeof r=="object"&&r instanceof ff.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",qn=Symbol("EOF"),jn=Symbol("maybeEmitEnd"),Ts=Symbol("emittedEnd"),of=Symbol("emittingEnd"),nc=Symbol("emittedError"),af=Symbol("closed"),oR=Symbol("read"),cf=Symbol("flush"),aR=Symbol("flushChunk"),Xr=Symbol("encoding"),wo=Symbol("decoder"),Pt=Symbol("flowing"),sc=Symbol("paused"),ko=Symbol("resume"),Rt=Symbol("buffer"),Xt=Symbol("pipes"),Dt=Symbol("bufferLength"),ly=Symbol("bufferPush"),lf=Symbol("bufferShift"),Ut=Symbol("objectMode"),ut=Symbol("destroyed"),uy=Symbol("error"),dy=Symbol("emitData"),cR=Symbol("emitEnd"),fy=Symbol("emitEnd2"),yn=Symbol("async"),hy=Symbol("abort"),uf=Symbol("aborted"),ic=Symbol("signal"),ti=Symbol("dataListeners"),br=Symbol("discarded"),oc=r=>Promise.resolve().then(r),Dj=r=>r(),Cj=r=>r==="end"||r==="finish"||r==="prefinish",Oj=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Aj=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),df=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[ko](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},py=class extends df{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},Ij=r=>!!r.objectMode,Mj=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",_s=class extends ff.EventEmitter{[Pt]=!1;[sc]=!1;[Xt]=[];[Rt]=[];[Ut];[Xr];[yn];[wo];[qn]=!1;[Ts]=!1;[of]=!1;[af]=!1;[nc]=null;[Dt]=0;[ut]=!1;[ic];[uf]=!1;[ti]=0;[br]=!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");Ij(t)?(this[Ut]=!0,this[Xr]=null):Mj(t)?(this[Xr]=t.encoding,this[Ut]=!1):(this[Ut]=!1,this[Xr]=null),this[yn]=!!t.async,this[wo]=this[Xr]?new lR.StringDecoder(this[Xr]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Rt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Xt]});let{signal:n}=t;n&&(this[ic]=n,n.aborted?this[hy]():n.addEventListener("abort",()=>this[hy]()))}get bufferLength(){return this[Dt]}get encoding(){return this[Xr]}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[Ut]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[yn]}set async(e){this[yn]=this[yn]||!!e}[hy](){this[uf]=!0,this.emit("abort",this[ic]?.reason),this.destroy(this[ic]?.reason)}get aborted(){return this[uf]}set aborted(e){}write(e,t,n){if(this[uf])return!1;if(this[qn])throw new Error("write after end");if(this[ut])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let s=this[yn]?oc:Dj;if(!this[Ut]&&!Buffer.isBuffer(e)){if(Aj(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Oj(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ut]?(this[Pt]&&this[Dt]!==0&&this[cf](!0),this[Pt]?this.emit("data",e):this[ly](e),this[Dt]!==0&&this.emit("readable"),n&&s(n),this[Pt]):e.length?(typeof e=="string"&&!(t===this[Xr]&&!this[wo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Xr]&&(e=this[wo].write(e)),this[Pt]&&this[Dt]!==0&&this[cf](!0),this[Pt]?this.emit("data",e):this[ly](e),this[Dt]!==0&&this.emit("readable"),n&&s(n),this[Pt]):(this[Dt]!==0&&this.emit("readable"),n&&s(n),this[Pt])}read(e){if(this[ut])return null;if(this[br]=!1,this[Dt]===0||e===0||e&&e>this[Dt])return this[jn](),null;this[Ut]&&(e=null),this[Rt].length>1&&!this[Ut]&&(this[Rt]=[this[Xr]?this[Rt].join(""):Buffer.concat(this[Rt],this[Dt])]);let t=this[oR](e||null,this[Rt][0]);return this[jn](),t}[oR](e,t){if(this[Ut])this[lf]();else{let n=t;e===n.length||e===null?this[lf]():typeof n=="string"?(this[Rt][0]=n.slice(e),t=n.slice(0,e),this[Dt]-=e):(this[Rt][0]=n.subarray(e),t=n.subarray(0,e),this[Dt]-=e)}return this.emit("data",t),!this[Rt].length&&!this[qn]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[qn]=!0,this.writable=!1,(this[Pt]||!this[sc])&&this[jn](),this}[ko](){this[ut]||(!this[ti]&&!this[Xt].length&&(this[br]=!0),this[sc]=!1,this[Pt]=!0,this.emit("resume"),this[Rt].length?this[cf]():this[qn]?this[jn]():this.emit("drain"))}resume(){return this[ko]()}pause(){this[Pt]=!1,this[sc]=!0,this[br]=!1}get destroyed(){return this[ut]}get flowing(){return this[Pt]}get paused(){return this[sc]}[ly](e){this[Ut]?this[Dt]+=1:this[Dt]+=e.length,this[Rt].push(e)}[lf](){return this[Ut]?this[Dt]-=1:this[Dt]-=this[Rt][0].length,this[Rt].shift()}[cf](e=!1){do;while(this[aR](this[lf]())&&this[Rt].length);!e&&!this[Rt].length&&!this[qn]&&this.emit("drain")}[aR](e){return this.emit("data",e),this[Pt]}pipe(e,t){if(this[ut])return e;this[br]=!1;let n=this[Ts];return t=t||{},e===iR.stdout||e===iR.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[Xt].push(t.proxyErrors?new py(this,e,t):new df(this,e,t)),this[yn]?oc(()=>this[ko]()):this[ko]()),e}unpipe(e){let t=this[Xt].find(n=>n.dest===e);t&&(this[Xt].length===1?(this[Pt]&&this[ti]===0&&(this[Pt]=!1),this[Xt]=[]):this[Xt].splice(this[Xt].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[br]=!1,this[ti]++,!this[Xt].length&&!this[Pt]&&this[ko]();else if(e==="readable"&&this[Dt]!==0)super.emit("readable");else if(Cj(e)&&this[Ts])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[nc]){let s=t;this[yn]?oc(()=>s.call(this,this[nc])):s.call(this,this[nc])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[ti]=this.listeners("data").length,this[ti]===0&&!this[br]&&!this[Xt].length&&(this[Pt]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ti]=0,!this[br]&&!this[Xt].length&&(this[Pt]=!1)),t}get emittedEnd(){return this[Ts]}[jn](){!this[of]&&!this[Ts]&&!this[ut]&&this[Rt].length===0&&this[qn]&&(this[of]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[af]&&this.emit("close"),this[of]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==ut&&this[ut])return!1;if(e==="data")return!this[Ut]&&!n?!1:this[yn]?(oc(()=>this[dy](n)),!0):this[dy](n);if(e==="end")return this[cR]();if(e==="close"){if(this[af]=!0,!this[Ts]&&!this[ut])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[nc]=n,super.emit(uy,n);let i=!this[ic]||this.listeners("error").length?super.emit("error",n):!1;return this[jn](),i}else if(e==="resume"){let i=super.emit("resume");return this[jn](),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[jn](),s}[dy](e){for(let n of this[Xt])n.dest.write(e)===!1&&this.pause();let t=this[br]?!1:super.emit("data",e);return this[jn](),t}[cR](){return this[Ts]?!1:(this[Ts]=!0,this.readable=!1,this[yn]?(oc(()=>this[fy]()),!0):this[fy]())}[fy](){if(this[wo]){let t=this[wo].end();if(t){for(let n of this[Xt])n.dest.write(t);this[br]||super.emit("data",t)}}for(let t of this[Xt])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ut]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Ut]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Ut])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Xr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ut,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[br]=!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[qn])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(ut,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(ut,u),this.pause(),i({value:d,done:!!this[qn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(ut,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(ut,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[br]=!1;let e=!1,t=()=>(this.pause(),this.off(uy,t),this.off(ut,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(uy,t),this.once(ut,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[ut])return e?this.emit("error",e):this.emit(ut),this;this[ut]=!0,this[br]=!0,this[Rt].length=0,this[Dt]=0;let t=this;return typeof t.close=="function"&&!this[af]&&t.close(),e?this.emit("error",e):this.emit(ut),this}static get isStream(){return Nj}};var Lj=vn.realpathSync.native,cc={lstatSync:vn.lstatSync,readdir:vn.readdir,readdirSync:vn.readdirSync,readlinkSync:vn.readlinkSync,realpathSync:Lj,promises:{lstat:Ss.lstat,readdir:Ss.readdir,readlink:Ss.readlink,realpath:Ss.realpath}},mR=r=>!r||r===cc||r===$j?cc:{...cc,...r,promises:{...cc.promises,...r.promises||{}}},gR=/^\\\\\?\\([a-z]:)\\?$/i,xj=r=>r.replace(/\//g,"\\").replace(gR,"$1\\"),qj=/[\\\/]/,Ar=0,yR=1,bR=2,bn=4,vR=6,TR=8,ri=10,_R=12,Or=15,ac=~Or,gy=16,uR=32,lc=64,Qr=128,hf=256,mf=512,dR=lc|Qr|mf,jj=1023,yy=r=>r.isFile()?TR:r.isDirectory()?bn:r.isSymbolicLink()?ri:r.isCharacterDevice()?bR:r.isBlockDevice()?vR:r.isSocket()?_R:r.isFIFO()?yR:Ar,fR=new Map,uc=r=>{let e=fR.get(r);if(e)return e;let t=r.normalize("NFKD");return fR.set(r,t),t},hR=new Map,pf=r=>{let e=hR.get(r);if(e)return e;let t=uc(r.toLowerCase());return hR.set(r,t),t},gf=class extends rc{constructor(){super({max:256})}},by=class extends rc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},SR=Symbol("PathScurry setAsCwd"),Vt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#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}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#v;#_;#S;#p;#D;#N;#r;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ar,n,s,i,o,a){this.name=e,this.#v=i?pf(e):uc(e),this.#r=t&jj,this.nocase=i,this.roots=s,this.root=n||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=mR(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 n of e)t=t.child(n);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.#r&=~gy,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?pf(e):uc(e);for(let c of n)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,Ar,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Qr),n.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 n=t.relative();return n+(!n||!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 n=t.relativePosix();return n+(!n||!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(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#p=n}isUnknown(){return(this.#r&Or)===Ar}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&Or)===TR}isDirectory(){return(this.#r&Or)===bn}isCharacterDevice(){return(this.#r&Or)===bR}isBlockDevice(){return(this.#r&Or)===vR}isFIFO(){return(this.#r&Or)===yR}isSocket(){return(this.#r&Or)===_R}isSymbolicLink(){return(this.#r&ri)===ri}lstatCached(){return this.#r&uR?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.#r⩔return!(e!==Ar&&e!==ri||this.#r&hf||this.#r&Qr)}calledReaddir(){return!!(this.#r&gy)}isENOENT(){return!!(this.#r&Qr)}isNamed(e){return this.nocase?this.#v===pf(e):this.#v===uc(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()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#b=n}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()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#b=n}catch(t){this.#u(t.code);return}}#M(e){this.#r|=gy;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#$()}}#$(){this.#r&Qr||(this.#r=(this.#r|Qr)&ac,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#R(){this.#r|=mf,this.#L()}#L(){if(this.#r&lc)return;let e=this.#r;(e&Or)===bn&&(e&=ac),this.#r=e|lc,this.#P()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#$():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#$()}#u(e=""){let t=this.#r;t|=hf,e==="ENOENT"&&(t|=Qr),(e==="EINVAL"||e==="UNKNOWN")&&(t&=ac),this.#r=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,t){return this.#O(e,t)||this.#F(e,t)}#F(e,t){let n=yy(e),s=this.newChild(e.name,n,{parent:this}),i=s.#r⩔return i!==bn&&i!==ri&&i!==Ar&&(s.#r|=lc),t.unshift(s),t.provisional++,s}#O(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?pf(e.name):uc(e.name))===s.#v)return this.#B(e,s,n,t)}}#B(e,t,n,s){let i=t.name;return t.#r=t.#r&ac|yy(e),i!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#r&Qr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&Qr)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#H(e){let{atime:t,atimeMs:n,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:w,size:v,uid:b}=e;this.#E=t,this.#g=n,this.#k=s,this.#f=i,this.#d=o,this.#s=a,this.#w=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=m,this.#m=T,this.#y=g,this.#n=S,this.#l=w,this.#c=v,this.#o=b;let R=yy(e);this.#r=this.#r&ac|R|uR,R!==Ar&&R!==bn&&R!==ri&&(this.#r|=lc)}#V=[];#W=!1;#z(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let i=n.slice(0,n.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.#x(i.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#M(n)}this.#z(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#M(e)}catch(s){this.#x(s.code),e.provisional=0}this.#U=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(n,e);this.#M(e)}catch(n){this.#x(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&dR)return!1;let e=Or&this.#r;return e===Ar||e===bn||e===ri}shouldWalk(e,t){return(this.#r&bn)===bn&&!(this.#r&dR)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((mf|hf|Qr)&this.#r))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(!((mf|hf|Qr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[SR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#D=n.join(this.sep),s.#N=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#D=void 0,s.#N=void 0,s=s.parent}},yf=class r extends Vt{sep="\\";splitSep=qj;constructor(e,t=Ar,n,s,i,o,a){super(e,t,n,s,i,o,a)}newChild(e,t=Ar,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return No.win32.parse(e).root}getRoot(e){if(e=xj(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Po(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(gR,"$1\\"),e===t}},bf=class r extends Vt{splitSep="/";sep="/";constructor(e,t=Ar,n,s,i,o,a){super(e,t,n,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ar,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},vf=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:i=16*1024,fs:o=cc}={}){this.#n=mR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,pR.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new gf,this.#t=new gf,this.#i=new by(i);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=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 n=this.#e.get(t);if(n!==void 0)return n;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 n=this.#t.get(t);if(n!==void 0)return n;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 Vt||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?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 Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?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 Vt||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vt||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vt||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vt||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(n?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 w of T)(!i||i(w))&&a.push(n?w:w.fullpath()),s&&w.isSymbolicLink()?w.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,S):S()):w.shouldWalk(c,o)?l(w,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 Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(n?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 Vt||(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 Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!i||i(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield n?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 Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new _s({objectMode:!0});(!i||i(e))&&a.write(n?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,w,v=!1)=>{if(S)return a.emit("error",S);if(s&&!v){let b=[];for(let R of w)R.isSymbolicLink()&&b.push(R.realpath().then(A=>A?.isUnknown()?A.lstat():A));if(b.length){Promise.all(b).then(()=>T(null,w,!0));return}}for(let b of w)b&&(!i||i(b))&&(a.write(n?b:b.fullpath())||(f=!0));u--;for(let b of w){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 Vt||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new _s({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(n?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(n?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[SR](t)}},Po=class extends vf{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,No.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return No.win32.parse(e).root.toUpperCase()}newRoot(e){return new yf(this.rootPath,bn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Ro=class extends vf{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,No.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new bf(this.rootPath,bn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},dc=class extends Ro{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},n5=process.platform==="win32"?yf:bf,ER=process.platform==="win32"?Po:process.platform==="darwin"?dc:Ro;var Fj=r=>r.length>=1,Bj=r=>r.length>=1,Do=class r{#e;#t;#i;length;#n;#o;#T;#l;#d;#a;#c=!0;constructor(e,t,n,s){if(!Fj(e))throw new TypeError("empty pattern list");if(!Bj(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,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=n,this.#n=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]===$t}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 r(this.#e,this.#t,this.#i+1,this.#n),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#n==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var Uj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Co=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:i,platform:o=Uj}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,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 yr(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],i=t.globParts[n];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new Do(s,i,0,this.platform),a=new yr(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(),n=`${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(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var vy=class r{store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Ty=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?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)])}},_y=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.globString()===t.globString())||n.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())}},fc=class r{hasWalkedCache;matches=new Ty;subwalks=new _y;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new vy}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,i]of n){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===$t){(!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 r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===$t?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,n,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()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let i=n.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,n.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,n)}else i instanceof RegExp&&this.testRegExp(e,i,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var Vj=(r,e)=>typeof r=="string"?new Co([r],e):Array.isArray(r)?new Co(r,e):r,Tf=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#i=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=Vj(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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.#n(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let n=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(n){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,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new fc(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())i++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new fc(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of n.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())i++,this.walkCB2Sync(a,c,n.child(),o);o()}},hc=class extends Tf{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,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}},pc=class extends Tf{results;constructor(e,t,n){super(e,t,n),this.results=new _s({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 Wj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Zr=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,wR.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||Wj,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"?Po:t.platform==="darwin"?dc:t.platform?Ro:ER;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new yr(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 Do(c,u,0,this.platform)})}async walk(){return[...await new hc(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 hc(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 pc(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 pc(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 Sy=(r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new yr(t,e).hasMagic())return!0;return!1};function _f(r,e={}){return new Zr(r,e).streamSync()}function NR(r,e={}){return new Zr(r,e).stream()}function PR(r,e={}){return new Zr(r,e).walkSync()}async function kR(r,e={}){return new Zr(r,e).walk()}function Sf(r,e={}){return new Zr(r,e).iterateSync()}function RR(r,e={}){return new Zr(r,e).iterate()}var Hj=_f,zj=Object.assign(NR,{sync:_f}),Kj=Sf,Gj=Object.assign(RR,{sync:Sf}),Yj=Object.assign(PR,{stream:_f,iterate:Sf}),ni=Object.assign(kR,{glob:kR,globSync:PR,sync:Yj,globStream:NR,stream:zj,globStreamSync:_f,streamSync:Hj,globIterate:RR,iterate:Gj,globIterateSync:Sf,iterateSync:Kj,Glob:Zr,hasMagic:Sy,escape:_o,unescape:Jr});ni.glob=ni;var Ev=require("path"),wv=require("fs");var AO=K(DO());var _v={};lA(_v,{$id:()=>bH,$schema:()=>yH,default:()=>EH,definitions:()=>TH,properties:()=>SH,title:()=>vH,type:()=>_H});var yH="http://json-schema.org/draft-07/schema#",bH="http://json-schema.org/draft-07/schema#",vH="Core schema meta-schema",TH={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:[]}},_H=["object","boolean"],SH={$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:"#"}},EH={$schema:yH,$id:bH,title:vH,definitions:TH,type:_H,properties:SH,default:!0};var _t=K(Y());var nh=class extends ga{constructor(t,n){super();this.ajv=t;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,n){let s=[],i=n.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Ce&&o.value==="disabled")return[...n.definitions,...n.referencedBy].forEach(c=>s.push(D(22,c,_t.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[_t.DiagnosticTag.Unnecessary]))),s;let a=we.toJson(n);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...wH(t,c,n,this.schemaKey))),console.log(this.schemaKey,`${n.path.join("/")}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${n.path.join("/")}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let n=(this.validate?.schema).properties?.[t];if(n&&typeof n=="object"&&"description"in n)return{kind:_t.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
|
|
240
264
|
|
|
241
|
-
`):
|
|
242
|
-
`)}}getPropertyListCompletionItems(t){let
|
|
243
|
-
${"".padEnd(
|
|
265
|
+
`):n.description]:[]].join(`
|
|
266
|
+
`)}}getPropertyListCompletionItems(t){let n=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return n.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:_t.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},wH=(r,e,t,n)=>{let s=kH(t,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[D(26,o.ast,_t.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],_t.TextEdit.del(Us(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?[D(26,o.ast,_t.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=r.getOrderedNodeAst(i),c=Ki(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return D(0,c[u],_t.DiagnosticSeverity.Error,[],[],[o],_t.TextEdit.insert(_t.Position.create(d.pos.line,d.pos.col+1),`
|
|
267
|
+
${"".padEnd(Ji(c[u].uri,l)*Wi().length,Wi())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[D(26,o.ast,_t.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[D(26,o.ast,_t.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
|
|
244
268
|
${e.params.allowedValues.join(`
|
|
245
269
|
`)}
|
|
246
|
-
${
|
|
270
|
+
${n}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[D(26,o.ast,_t.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[D(26,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
247
271
|
${JSON.stringify(e)}
|
|
248
|
-
${
|
|
272
|
+
${n}`])]:[D(26,s.node.definitions[0]instanceof ct?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
|
|
249
273
|
${JSON.stringify(e)}
|
|
250
|
-
${r}`])]},KW=(n,e)=>rO(n,e.split("/").filter(t=>t)),rO=(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?rO(i,e.slice(1)):{node:n,property:n.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var dv=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,lv.resolve)(e,s);try{let i=cv.default.parse((0,uv.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,lv.resolve)(e,s);try{let i=cv.default.parse((0,uv.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 iO.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(av),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)??[]}},sO,oO=()=>(sO??=new dv,sO);var uO=G(Vg());var Mc=require("path"),dO=require("fs");var Tr=G(X()),zW=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)}},aO=(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,Mc.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return t.include=t.include.filter(o=>o!==r),GW(n,s,t,i)??t}return console.warn(`Unable to find ${r}`),t},e),e["child-binding"]&&(e["child-binding"].include=fO(e["child-binding"].include),e["child-binding"]=zf(n,e["child-binding"])),!e.include.length)return e},GW=(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},fO=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],fv=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[ns()];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:[ns()]}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,Mc.resolve)(t,o);try{let a=uO.default.parse((0,dO.readFileSync)(o,"utf-8"));return{...a,include:fO(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(...YW(i))})}},cO,hO=()=>(cO??=new fv,cO),YW=n=>n.map(pO),pO=n=>{let e=ns();e.compatible=n.compatible??(n.filePath?(0,Mc.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];JW(e,s,i),e.cellsValues=r}),n["child-binding"]&&(e.childNodeType=pO(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},JW=(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=aO(t.type,t.const);let s=r.additionalTypeCheck;r.additionalTypeCheck=i=>[...lO(t,e)(i),...s?.(i)??[]]}else{let s=new Y(e,zW(t.type),t.required?"required":"optional",void 0,t.enum,lO(t,e));s.description=t.description?[t.description]:void 0,s.constValue=aO(t.type,t.const),n.addProperty(s)}},lO=(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,Tr.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&i.push(A(14,r.ast,Tr.DiagnosticSeverity.Warning,[],[Tr.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,Tr.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,Tr.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,Tr.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,Tr.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,Tr.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 hO().getNodeTypes(n.zephyrBindings,t);case"DevicetreeOrg":return oO().getNodeTypes(n.deviceOrgBindingsMetaSchema,n.deviceOrgTreeBindings,t)}}});var mO=G(X()),hv=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(hv):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:mO.FoldingRangeKind.Region},...n.nodes.flatMap(hv)];function gO(n){return n.rootDocument.nodes.flatMap(hv)}var di=G(X());function XW(n){if(!n||!(n.ast instanceof Ie)&&!(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 Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?e(n.ast.linksTo):[]}async function yO(n,e,t){return Ot(n,e,r=>[...XW(r)],t)}var _r=require("path");var Jf=require("fs");var QW=(n,e)=>{Vn().reset(n),Vn().requestTokens(n,!0),e(n)},Yf=class{constructor(e,t,r){this.file=e;this.cb=t;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),QW(e,t)},(0,Jf.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Jf.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var xe=[],Sr,pv,$c=new WeakMap,Xf=new Map,mv=n=>{xe.some(e=>e===n)||(xe.push(n),bO(n))},bO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>{e.endsWith(".h")||(Xf.has(e)||Xf.set(e,new Yf(e,vv,t=>!!wr.get(`file://${t}`))),Xf.get(e)?.watch())})},yv=async n=>{let e=xe.indexOf(n);e!==-1&&(Zf(n),$c.delete(n),console.log(`cleaning up context with ID ${n.name} and uri ${n.parser.uri}`),xe.splice(e,1),vO(n))},vO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>Xf.get(e)?.unwatch())},ZW=n=>{let e=$c.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},Dt=async()=>{await PO,await Promise.all(xe.map(ZW))},Qf=n=>{let e=TO(n);return xe.filter(t=>!e.some(r=>r===t))},TO=n=>xe.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))}),eH=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)},_O=n=>Qf(Z).indexOf(n)!==-1,SO=async n=>{if(!_O(n))return;let e=Qf(Z),t=await TO(Z),r=await vu(e),s=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(xe.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 eH(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(yv)},Te=(0,Ce.createConnection)(Ce.ProposedFeatures.all),wr=new Ce.TextDocuments(gu),bv=!0,gv=!1,wO=!1;Te.onInitialize(n=>{let e=n.capabilities;bv=!!(e.workspace&&e.workspace.configuration),gv=!!(e.workspace&&e.workspace.workspaceFolders),wO=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Ce.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Ce.CodeActionKind.QuickFix,Ce.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 gv&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});Te.onInitialized(()=>{bv&&Te.client.register(Ce.DidChangeConfigurationNotification.type,{}),gv&&Te.workspace.onDidChangeWorkspaceFolders(n=>{Te.console.log("Workspace folder change event received")})});var kO={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},Z=kO,EO=new Map,NO=!1,PO=new Promise(n=>{let e=setInterval(()=>{NO&&(n(),clearInterval(e))},100)});Te.onDidChangeConfiguration(n=>{if(NO=!0,!n.settings)return;console.log("Configuration changed",n),bv&&EO.clear();let e=Z;Z={...kO,...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,_r.resolve)(o,a)),s.deviceOrgTreeBindings=s.deviceOrgTreeBindings?.map(a=>(0,_r.resolve)(o,a)),s.deviceOrgBindingsMetaSchema=s.deviceOrgBindingsMetaSchema?.map(a=>(0,_r.resolve)(o,a)),s.includePaths=s.includePaths?.map(a=>(0,_r.resolve)(o,a)),s.dtsFile=(0,_r.resolve)(o,s.dtsFile)}});let t=Qf(e);xe.forEach(yv),$c=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);mv(a),console.log(`New context with ID ${a.name} for ${s.dtsFile}`)});let r=RO();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}).forEach(mv),t=Qf(Z),t.forEach(SO),pv&&Lc(pv,!0),wO&&Te.languages.diagnostics.refresh()});var RO=()=>{let n=(Z.defaultIncludePaths??[]).map(s=>Z.cwd?(0,_r.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,_r.resolve)(Z.cwd,s):s),t=(Z.defaultDeviceOrgBindingsMetaSchema??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s),r=(Z.defaultDeviceOrgTreeBindings??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s);return{defaultIncludePaths:n,defaultZephyrBindings:e,defaultDeviceOrgBindingsMetaSchema:t,defaultDeviceOrgTreeBindings:r}};wr.onDidClose(n=>{let e=n.document.uri.replace("file://",""),t=Sr;if(!t)return;(t?.getContextFiles()??[]).filter(i=>i!==e).some(i=>wr.get(`file://${i}`))||(_O(t)?yv(t):Zf(t),Sr=void 0),EO.delete(n.document.uri)});wr.onDidOpen(async n=>{await Dt();let e=Sr,t=n.document.uri.replace("file://","");e||Te.sendDiagnostics({uri:n.document.uri,version:wr.get(n.document.uri)?.version,diagnostics:[{severity:Ce.DiagnosticSeverity.Warning,range:Ce.Range.create(Ce.Position.create(0,0),Ce.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}),vv(t)});var tH=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"}},nH=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 "),rH=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"}},sH=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 ",""),iH=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"}},vv=async n=>{await PO;let e=rk(xe,n);if(e.length)e.forEach(t=>{$c.get(t.context)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=DO(t.context);vO(t.context),await t.context.reevaluate(n),bO(t.context),Zf(t.context,a),Tv(t.context).then(c=>{c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{Te.sendDiagnostics(l)})}),i(),console.log("reevaluate",performance.now()-o)},50)});$c.set(t.context,{abort:r,promise:s})});else{if(Z.allowAdhocContexts===!1)return;let t=Z.defaultBindingType,r=RO(),s=new eo(n,r.defaultIncludePaths,t?Gf({zephyrBindings:r.defaultZephyrBindings,deviceOrgBindingsMetaSchema:r.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:r.defaultDeviceOrgTreeBindings},t):void 0);console.log(`New ad hoc context with ID ${s.name} for ${n}`),mv(s),Lc(n),await s.parser.stable,SO(s)}};wr.onDidChangeContent(async n=>{let e=n.document.uri.replace("file://",""),t=n.document.getText(),r=Vn();r.needsRenew(e,t)&&(console.log("Content changed"),r.renewLexer(e,t),vv(e))});var DO=n=>n.getContextFiles().map(e=>({uri:`file://${e}`,version:wr.get(`file://${e}`)?.version,diagnostics:[]})),Zf=(n,e=DO(n))=>{e.forEach(t=>{Te.sendDiagnostics({uri:t.uri,version:wr.get(t.uri)?.version,diagnostics:[]})})},Tv=async n=>(await n.stable(),{items:[...await Promise.all(n.getContextFiles().map(async t=>{let r=await oH(n,t);return{uri:`file://${t}`,kind:Ce.DocumentDiagnosticReportKind.Full,items:r,version:wr.get(`file://${t}`)?.version??null}}))]});Te.languages.diagnostics.onWorkspace(async()=>{await Dt();let n=Sr;return n?Tv(n):{items:[]}});async function oH(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(tH).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:nH(o),source:"devicetree",tags:o.tags,relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(rH).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:sH(o),relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(iH).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:Ce.DiagnosticSeverity.Warning,range:Ce.Range.create(Ce.Position.create(0,0),Ce.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}Te.onDidChangeWatchedFiles(n=>{Te.console.log("We received a file change event")});Te.onCompletion(async n=>(await Dt(),xe?[...await sE(n,xe,Z.preferredContext),...await pE(n,xe,Z.preferredContext)]:[]));Te.onCompletionResolve(n=>n);wr.listen(Te);Te.listen();var Lc=async(n,e=!1)=>{if(!e&&Z.autoChangeContext===!1)return;pv=n,await Dt();let t=Sr;Sr=Fs(xe,n,Z.preferredContext)?.context;let r=Sr;t!==r&&(t&&Zf(t),r&&Tv(r).then(s=>{s.items.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(i=>{Te.sendDiagnostics(i)})}),console.log(`(ID: ${r?.name??-1}) activeContext:`,r?.parser.uri),xe.forEach((s,i)=>{console.log(`Context with ID ${s.name} for ${s.parser.uri}`)}))};Te.onDocumentSymbol(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let r=await Sr?.parser;return r?r.getDocumentSymbols(e):[]});Te.onWorkspaceSymbol(async()=>{await Dt();let n=Sr;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});Te.languages.semanticTokens.on(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=new Ce.SemanticTokensBuilder,r=await Fs(xe,e,Z.preferredContext),s=r?.context.isInContext(e);return!r||!s?{data:[]}:(r.context.parser.buildSemanticTokens(t,e),t.build())});Te.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await Dt(),(await Fs(xe,e,Z.preferredContext))?.context.getDocumentLinks(e)});Te.onPrepareRename(async n=>(await Dt(),uE(n,xe,Z.lockRenameEdits??[],Z.preferredContext)));Te.onRenameRequest(async n=>(await Dt(),lE(n,xe,Z.preferredContext)));Te.onReferences(async n=>(await Dt(),iE(n,xe,Z.preferredContext)));Te.onDefinition(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let r=(await(await Fs(xe,e,Z.preferredContext))?.context.getDocumentLinks(e,n.position))?.filter(s=>s.target).map(s=>Ce.Location.create(s.target,s.range))??[];return r.length?r:dE(n,xe,Z.preferredContext)});Te.onDeclaration(async n=>(await Dt(),fE(n,xe,Z.preferredContext)));Te.onCodeAction(async n=>hE(n));Te.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let t=await Fs(xe,e,Z.preferredContext);return t?hk(n,t.context):[]});Te.onHover(async n=>(await Dt(),(await mE(n,xe,Z.preferredContext)).at(0)));Te.onRequest("devicetree/contexts",async()=>(await Dt(),xe.map(n=>n.parser.uri)));Te.onFoldingRanges(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=Sr,r=t?.isInContext(e);return!t||!r?[]:gO(t.parser)});Te.onTypeDefinition(async n=>(await Dt(),yO(n,xe)));
|
|
274
|
+
${n}`])]},kH=(r,e)=>CO(r,e.split("/").filter(t=>t)),CO=(r,e)=>{if(e.length===0)return{node:r,remainingInstancePath:""};let t=e[0].split("@"),n=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=r.getNode(n,s);return i?CO(i,e.slice(1)):{node:r,property:r.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var kv=class r{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(s=>!(s?.value instanceof Ce)))return n?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){ni.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Ev.resolve)(e,s);try{let i=Sv.default.parse((0,wv.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){ni.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,Ev.resolve)(e,s);try{let i=Sv.default.parse((0,wv.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,n){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new AO.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(_v),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),r.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new nh(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)??[]}},OO,IO=()=>(OO??=new kv,OO);var xO=K(ny());var Ho=require("path"),qO=require("fs");var wn=K(Y()),NH=r=>{switch(r){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)}},MO=(r,e)=>{switch(r){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}},sh=(r,e)=>{if(e=e.include.reduce((t,n)=>{let s=r.find(i=>(0,Ho.basename)(i.filePath)===n.name);if(s){let i=n["property-blocklist"];return t.include=t.include.filter(o=>o!==n),PH(r,s,t,i)??t}return console.warn(`Unable to find ${n}`),t},e),e["child-binding"]&&(e["child-binding"].include=jO(e["child-binding"].include),e["child-binding"]=sh(r,e["child-binding"])),!e.include.length)return e},PH=(r,e,t,n=[])=>{let s=sh(r,e),i=sh(r,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=n?.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},jO=r=>r?typeof r=="string"?[{name:r}]:r.map(e=>typeof e!="string"?e:{name:e}):[],Nv=class r{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(s=>!(s?.value instanceof Ce)))return n?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let n=r.getNodeCompatible(t);if(!n)return[Ks(t)];let s=n.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=n.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);return i.length?i:[Ks(t)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=ni.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,Ho.resolve)(t,o);try{let a=xO.default.parse((0,qO.readFileSync)(o,"utf-8"));return{...a,include:jO(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>sh(s,o)).filter(o=>!!o&&!o.include.length);RH(i,this.typeCache)})}},$O,FO=()=>($O??=new Nv,$O),RH=(r,e)=>r.forEach(t=>{let n=t.compatible??(t.filePath?(0,Ho.basename)(t.filePath,"yaml"):void 0);n&&e.set(n,s=>BO(t,s))}),BO=(r,e)=>{let t=Ks(e);t.compatible=r.compatible??(r.filePath?(0,Ho.basename)(r.filePath,"yaml"):void 0),t.description=r.description,t.bindingsPath=r.filePath,t.bus=typeof r.bus=="string"?[r.bus]:r.bus,t.onBus=r["on-bus"];let s=Object.keys(r).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:r[i]}));if(r.properties&&Object.keys(r.properties).forEach(i=>{let o=r.properties[i];DH(t,i,o),t.cellsValues=s}),r["child-binding"]){let i=r["child-binding"];t.childNodeType=o=>BO(i,o)}return t},DH=(r,e,t)=>{let n=r.properties.find(s=>typeof s.name=="string"&&s.getNameMatch(e));if(n){n.required=()=>t.required?"required":"optional",n.values=()=>t.enum??[],n.constValue=MO(t.type,t.const);let s=n.additionalTypeCheck;n.additionalTypeCheck=i=>[...LO(t,e)(i),...s?.(i)??[]]}else{let s=new H(e,NH(t.type),t.required?"required":"optional",void 0,t.enum,LO(t,e));s.description=t.description?[t.description]:void 0,s.constValue=MO(t.type,t.const),r.addProperty(s)}},LO=(r,e)=>{let t=r;return n=>{let s=n.parent.root,i=[];if(t.const){let o=n.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(D(25,n.ast.values??n.ast,wn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&i.push(D(14,n.ast,wn.DiagnosticSeverity.Warning,[],[wn.DiagnosticTag.Deprecated],[n.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&Yt(n.ast.values)?.forEach(a=>{Hr(a,s)||i.push(D(23,a,wn.DiagnosticSeverity.Error))}),t.type==="path"&&n.ast.values?.values.at(0)?.value instanceof Ce){let o=n.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=s.getNode(c);return l?a.push(c):i.push(D(24,o,wn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=Yt(n.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=Hr(c,s);if(!l){i.push(D(23,c??n.ast,wn.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(D(16,n.ast,wn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[n.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let f=d?Re(d,0,0)??0:0;if(1+f>o.length-a){let m=l.nodeType?.cellsValues?.find(T=>T.specifier===u)?.values;i.push(D(20,c??n.ast,wn.DiagnosticSeverity.Error,[],[],[n.name,`<${["phandel",...m??[],...Array.from({length:f-(m?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+f}}return i}};var ih=(r,e)=>({getNodeTypes:async t=>{switch(e){case"Zephyr":return FO().getNodeTypes(r.zephyrBindings,t);case"DevicetreeOrg":return IO().getNodeTypes(r.deviceOrgBindingsMetaSchema,r.deviceOrgTreeBindings,t)}}});var UO=K(Y()),Pv=r=>!r.openScope||!r.closeScope?.prevToken?r.nodes.flatMap(Pv):[{startLine:r.openScope.pos.line,startCharacter:r.openScope.pos.col,endLine:r.closeScope.prevToken.pos.line,endCharacter:r.closeScope.prevToken.pos.col,kind:UO.FoldingRangeKind.Region},...r.nodes.flatMap(Pv)];function VO(r){return r.rootDocument.nodes.flatMap(Pv)}var gi=K(Y());function CH(r){if(!r||!(r.ast instanceof Le)&&!(r.ast instanceof It))return[];let e=t=>t.nodeType?.bindingsPath?[gi.Location.create(`file://${t.nodeType.bindingsPath}`,gi.Range.create(gi.Position.create(0,0),gi.Position.create(0,0)))]:[];return r.item instanceof we&&!bt(r.ast)?e(r.item):r.ast instanceof It&&r.ast.parentNode instanceof ve&&r.ast.parentNode.linksTo?e(r.ast.parentNode.linksTo):r.ast instanceof Le&&r.ast.linksTo?e(r.ast.linksTo):[]}async function WO(r,e,t){return At(r,e,n=>[...CH(n)],t)}var kn=require("path");var ah=require("fs");var OH=(r,e)=>{Kr().reset(r),Kr().requestTokens(r,!0),e(r)},oh=class{constructor(e,t,n){this.file=e;this.cb=t;this.hasDocumentOpen=n;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),OH(e,t)},(0,ah.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,ah.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var Ue=[],Nn,Rv,zc=new WeakMap,ch=new Map,Dv=r=>{Ue.some(e=>e===r)||(Ue.push(r),HO(r))},HO=async r=>{await r.stable(),r.getContextFiles().forEach(e=>{ch.has(e)||ch.set(e,new oh(e,Iv,t=>!!Pn.get(`file://${t}`))),ch.get(e)?.watch()})},Ov=async r=>{let e=Ue.indexOf(r);e!==-1&&(uh(r),zc.delete(r),console.log(`cleaning up context with ID ${r.name} and uri ${r.parser.uri}`),Ue.splice(e,1),zO(r))},zO=async r=>{await r.stable(),r.getContextFiles().forEach(e=>ch.get(e)?.unwatch())},AH=r=>{let e=zc.get(r);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,r.getRuntime()])},Ct=async()=>{await eA,await Promise.all(Ue.map(AH))},lh=r=>{let e=KO(r);return Ue.filter(t=>!e.some(n=>n===t))},KO=r=>Ue.filter(e=>{let t=r.contexts?.find(n=>n.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(n=>e.overlays.some(s=>s===n))}),IH=async(r,e)=>{if(r===e)return!0;let t=(await r.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes),n=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes);return t.length?t.every(s=>n.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>s===r.parser.uri)},GO=r=>lh(te).indexOf(r)!==-1,YO=async r=>{if(!GO(r))return;let e=lh(te),t=await KO(te),n=await Cu(e),s=[...r.overlayParsers.map(a=>a.uri),r.parser.uri,...r.parser.includes.map(a=>a.resolvedPath)];if(Ue.indexOf(r)===-1)return;let i=await Promise.all(n.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await IH(a.context,c)})))),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==r&&a.context.parser.uri===r.parser.uri&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(Ov)},_e=(0,Ie.createConnection)(Ie.ProposedFeatures.all),Pn=new Ie.TextDocuments(Pu),Av=!0,Cv=!1,JO=!1;_e.onInitialize(r=>{let e=r.capabilities;Av=!!(e.workspace&&e.workspace.configuration),Cv=!!(e.workspace&&e.workspace.workspaceFolders),JO=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Ie.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Ie.CodeActionKind.QuickFix,Ie.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:Ru,tokenModifiers:Du},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return Cv&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});_e.onInitialized(()=>{Av&&_e.client.register(Ie.DidChangeConfigurationNotification.type,{}),Cv&&_e.workspace.onDidChangeWorkspaceFolders(r=>{_e.console.log("Workspace folder change event received")})});var XO={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},te=XO,QO=new Map,ZO=!1,eA=new Promise(r=>{let e=setInterval(()=>{ZO&&(r(),clearInterval(e))},100)});_e.onDidChangeConfiguration(r=>{if(ZO=!0,!r.settings)return;console.log("Configuration changed",r),Av&&QO.clear();let e=te;te={...XO,...r.settings?.devicetree},te.contexts?.forEach((s,i)=>{if(s.cwd||te.cwd){let o=s.cwd??te.cwd;s.includePaths??=te.defaultIncludePaths,s.zephyrBindings??=te.defaultIncludePaths,s.bindingType??=te.defaultBindingType,s.deviceOrgTreeBindings??=te.defaultDeviceOrgTreeBindings,s.deviceOrgBindingsMetaSchema??=te.defaultDeviceOrgBindingsMetaSchema,o&&s.bindingType==="Zephyr"&&(!s.zephyrBindings||s.zephyrBindings.length===0)&&(s.zephyrBindings=["./zephyr/dts/bindings"]),s.zephyrBindings=s.zephyrBindings?.map(a=>(0,kn.resolve)(o,a)),s.deviceOrgTreeBindings=s.deviceOrgTreeBindings?.map(a=>(0,kn.resolve)(o,a)),s.deviceOrgBindingsMetaSchema=s.deviceOrgBindingsMetaSchema?.map(a=>(0,kn.resolve)(o,a)),s.includePaths=s.includePaths?.map(a=>(0,kn.resolve)(o,a)),s.dtsFile=(0,kn.resolve)(o,s.dtsFile)}});let t=lh(e);Ue.forEach(Ov),zc=new WeakMap,te.contexts?.forEach((s,i)=>{let o=s.bindingType,a=new oo(s.dtsFile,s.includePaths??[],o?ih({zephyrBindings:s.zephyrBindings??[],deviceOrgBindingsMetaSchema:s.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:s.deviceOrgTreeBindings??[]},o):void 0,s.overlays,s.ctxName);Dv(a),console.log(`New context with ID ${a.name} for ${s.dtsFile}`)});let n=tA();t.map(s=>{let i=te.defaultBindingType,o=new oo(s.parser.uri,n.defaultIncludePaths,i?ih({zephyrBindings:n.defaultZephyrBindings,deviceOrgBindingsMetaSchema:n.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:n.defaultDeviceOrgTreeBindings},i):void 0);return console.log(`New context with ID ${o.name} for ${s.parser.uri}`),o}).forEach(Dv),t=lh(te),t.forEach(YO),Rv&&Kc(Rv,!0),JO&&_e.languages.diagnostics.refresh()});var tA=()=>{let r=(te.defaultIncludePaths??[]).map(s=>te.cwd?(0,kn.resolve)(te.cwd,s):s);te.cwd&&te.defaultBindingType==="Zephyr"&&!te.defaultZephyrBindings&&(te.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(te.defaultZephyrBindings??[]).map(s=>te.cwd?(0,kn.resolve)(te.cwd,s):s),t=(te.defaultDeviceOrgBindingsMetaSchema??[]).map(s=>te.cwd?(0,kn.resolve)(te.cwd,s):s),n=(te.defaultDeviceOrgTreeBindings??[]).map(s=>te.cwd?(0,kn.resolve)(te.cwd,s):s);return{defaultIncludePaths:r,defaultZephyrBindings:e,defaultDeviceOrgBindingsMetaSchema:t,defaultDeviceOrgTreeBindings:n}};Pn.onDidClose(r=>{let e=r.document.uri.replace("file://",""),t=Nn;if(!t)return;(t?.getContextFiles()??[]).filter(i=>i!==e).some(i=>Pn.get(`file://${i}`))||(GO(t)?Ov(t):uh(t),Nn=void 0),QO.delete(r.document.uri)});Pn.onDidOpen(async r=>{await Ct();let e=Nn,t=r.document.uri.replace("file://","");e||_e.sendDiagnostics({uri:r.document.uri,version:Pn.get(r.document.uri)?.version,diagnostics:[{severity:Ie.DiagnosticSeverity.Warning,range:Ie.Range.create(Ie.Position.create(0,0),Ie.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}),Iv(t)});var MH=r=>{switch(r){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 42:return"Unkown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},$H=r=>r.issues.map(e=>{switch(e){case 0:return`Property "${r.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 "${r.templateStrings[0]}" has been defined`;case 8:return`No node with name "${r.templateStrings[0]}" could be found in "/${r.templateStrings[1]}".`;case 4:return`Label name "${r.templateStrings[0]}" already defined`;case 6:return`Property "${r.templateStrings[0]}" was deleted`;case 7:return`Node "${r.templateStrings[0]}" was deleted`;case 9:return`The following node "${r.templateStrings[1]}" shall be present in "${r.templateStrings[0]}" node.`}}).join(" or "),LH=r=>{switch(r){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";default:return"TODO"}},xH=r=>r.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${r.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 ${r.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 28:return"INTRO name is not permited under this node";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 ${r.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${r.templateStrings[1]}`;case 16:return`INTRO requires property "${r.templateStrings[1]}" in node path "${r.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${r.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${r.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${r.templateStrings[0]}" in ${r.templateStrings[1]}`;case 25:return r.templateStrings[0];case 26:return r.templateStrings[0];case 27:return r.templateStrings[0];case 29:return r.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${r.templateStrings[0]}"`).replaceAll("INTRO ",""),qH=r=>{switch(r){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"}},Iv=async r=>{await eA;let e=yw(Ue,r);if(e.length)e.forEach(t=>{zc.get(t.context)?.abort.abort();let n=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(n.signal.aborted){i();return}let o=performance.now(),a=rA(t.context);zO(t.context),await t.context.reevaluate(r),HO(t.context),Mv(t.context).then(c=>{uh(t.context,a),c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{_e.sendDiagnostics(l)})}),i(),console.log("reevaluate",performance.now()-o)},50)});zc.set(t.context,{abort:n,promise:s})});else{if(te.allowAdhocContexts===!1)return;let t=te.defaultBindingType,n=tA(),s=new oo(r,n.defaultIncludePaths,t?ih({zephyrBindings:n.defaultZephyrBindings,deviceOrgBindingsMetaSchema:n.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:n.defaultDeviceOrgTreeBindings},t):void 0);console.log(`New ad hoc context with ID ${s.name} for ${r}`),Dv(s),Kc(r),await s.parser.stable,YO(s)}};Pn.onDidChangeContent(async r=>{let e=r.document.uri.replace("file://",""),t=r.document.getText(),n=Kr();n.needsRenew(e,t)&&(console.log("Content changed"),n.renewLexer(e,t),Iv(e))});var rA=r=>r.getContextFiles().map(e=>({uri:`file://${e}`,version:Pn.get(`file://${e}`)?.version,diagnostics:[]})),uh=(r,e=rA(r))=>{e.forEach(t=>{_e.sendDiagnostics({uri:t.uri,version:Pn.get(t.uri)?.version,diagnostics:[]})})},Mv=async r=>{await r.stable();let e=performance.now(),t=await Promise.all(r.getContextFiles().map(async n=>{let s=await jH(r,n);return{uri:`file://${n}`,kind:Ie.DocumentDiagnosticReportKind.Full,items:s,version:Pn.get(`file://${n}`)?.version??null}}));return console.log("workspace diagnostics",r.name,performance.now()-e),{items:[...t]}};_e.languages.diagnostics.onWorkspace(async()=>{await Ct();let r=Nn;return r?Mv(r):{items:[]}});async function jH(r,e){try{let t=[];return r.isInContext(e)?(r.parser.issues.filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:i.issues?i.issues.map(MH).join(" or "):"",source:"devicetree",data:{firstToken:{pos:i.astElement.firstToken.pos,tokens:i.astElement.firstToken.tokens,value:i.astElement.firstToken.value},lastToken:{pos:i.astElement.lastToken.pos,tokens:i.astElement.lastToken.tokens,value:i.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:i.issues,edit:i.edit,codeActionTitle:i.codeActionTitle}}};t.push(o)}),(await r.getContextIssues()??[]).filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:$H(i),source:"devicetree",tags:i.tags,relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(LH).join(" or "),location:{uri:`file://${a.uri}`,range:Q(a)}}))]};t.push(o)}),(await r.getRuntime())?.typesIssues.filter(i=>i.astElement.uri===e).forEach(i=>{let o={severity:i.severity,range:Q(i.astElement),message:xH(i),relatedInformation:[...i.linkedTo.map(a=>({message:i.issues.map(qH).join(" or "),location:{uri:`file://${a.uri}`,range:Q(a)}}))],source:"devicetree",tags:i.tags,data:{firstToken:{pos:i.astElement.firstToken.pos,tokens:i.astElement.firstToken.tokens,value:i.astElement.firstToken.value},lastToken:{pos:i.astElement.lastToken.pos,tokens:i.astElement.lastToken.tokens,value:i.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:i.issues,edit:i.edit,codeActionTitle:i.codeActionTitle}}};t.push(o)}),t):[{severity:Ie.DiagnosticSeverity.Warning,range:Ie.Range.create(Ie.Position.create(0,0),Ie.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(t){throw console.error(t),t}}_e.onDidChangeWatchedFiles(r=>{_e.console.log("We received a file change event")});_e.onCompletion(async r=>(await Ct(),Ue?[...await Ck(r,Ue,te.preferredContext),...await Fk(r,Ue,te.preferredContext)]:[]));_e.onCompletionResolve(r=>r);Pn.listen(_e);_e.listen();var Kc=async(r,e=!1)=>{if(!e&&te.autoChangeContext===!1)return;Rv=r,await Ct();let t=Nn;Nn=Hs(Ue,r,te.preferredContext)?.context;let n=Nn;t!==n&&(t&&uh(t),n&&Mv(n).then(s=>{s.items.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(i=>{_e.sendDiagnostics(i)})}),console.log(`(ID: ${n?.name??-1}) activeContext:`,n?.parser.uri),Ue.forEach((s,i)=>{console.log(`Context with ID ${s.name} for ${s.parser.uri}`)}))};_e.onDocumentSymbol(async r=>{await Ct();let e=r.textDocument.uri.replace("file://","");await Kc(e);let n=await Nn?.parser;return n?n.getDocumentSymbols(e):[]});_e.onWorkspaceSymbol(async()=>{await Ct();let r=Nn;return r?(await r.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});_e.languages.semanticTokens.on(async r=>{await Ct();let e=r.textDocument.uri.replace("file://","");await Kc(e);let t=new Ie.SemanticTokensBuilder,n=await Hs(Ue,e,te.preferredContext),s=n?.context.isInContext(e);return!n||!s?{data:[]}:(n.context.parser.buildSemanticTokens(t,e),t.build())});_e.onDocumentLinks(async r=>{let e=r.textDocument.uri.replace("file://","");return await Ct(),(await Hs(Ue,e,te.preferredContext))?.context.getDocumentLinks(e)});_e.onPrepareRename(async r=>(await Ct(),Lk(r,Ue,te.lockRenameEdits??[],te.preferredContext)));_e.onRenameRequest(async r=>(await Ct(),$k(r,Ue,te.preferredContext)));_e.onReferences(async r=>(await Ct(),Ok(r,Ue,te.preferredContext)));_e.onDefinition(async r=>{let e=r.textDocument.uri.replace("file://","");await Ct();let n=(await(await Hs(Ue,e,te.preferredContext))?.context.getDocumentLinks(e,r.position))?.filter(s=>s.target).map(s=>Ie.Location.create(s.target,s.range))??[];return n.length?n:xk(r,Ue,te.preferredContext)});_e.onDeclaration(async r=>(await Ct(),qk(r,Ue,te.preferredContext)));_e.onCodeAction(async r=>jk(r));_e.onDocumentFormatting(async r=>{let e=r.textDocument.uri.replace("file://","");await Ct();let t=await Hs(Ue,e,te.preferredContext);return t?Pw(r,t.context):[]});_e.onHover(async r=>(await Ct(),(await Uk(r,Ue,te.preferredContext)).at(0)));_e.onRequest("devicetree/contexts",async()=>(await Ct(),Ue.map(r=>r.parser.uri)));_e.onFoldingRanges(async r=>{await Ct();let e=r.textDocument.uri.replace("file://","");await Kc(e);let t=Nn,n=t?.isInContext(e);return!t||!n?[]:VO(t.parser)});_e.onTypeDefinition(async r=>(await Ct(),WO(r,Ue)));
|