miniscript-languageserver 2.1.0 → 2.1.1
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/index.js +51 -50
- package/package.json +2 -2
package/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
"use strict";var fm=Object.defineProperty;var CM=Object.getOwnPropertyDescriptor;var MM=Object.getOwnPropertyNames;var LM=Object.prototype.hasOwnProperty;var NM=(t,e)=>()=>(t&&(e=t(t=0)),e);var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qM=(t,e)=>{for(var n in e)fm(t,n,{get:e[n],enumerable:!0})},jM=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of MM(e))!LM.call(t,i)&&i!==n&&fm(t,i,{get:()=>e[i],enumerable:!(r=CM(e,i))||r.enumerable});return t};var FM=t=>jM(fm({},"__esModule",{value:!0}),t);var Kl=f(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.thenable=Rt.typedArray=Rt.stringArray=Rt.array=Rt.func=Rt.error=Rt.number=Rt.string=Rt.boolean=void 0;function BM(t){return t===!0||t===!1}Rt.boolean=BM;function j0(t){return typeof t=="string"||t instanceof String}Rt.string=j0;function $M(t){return typeof t=="number"||t instanceof Number}Rt.number=$M;function UM(t){return t instanceof Error}Rt.error=UM;function F0(t){return typeof t=="function"}Rt.func=F0;function B0(t){return Array.isArray(t)}Rt.array=B0;function KM(t){return B0(t)&&t.every(e=>j0(e))}Rt.stringArray=KM;function WM(t,e){return Array.isArray(t)&&t.every(e)}Rt.typedArray=WM;function GM(t){return t&&F0(t.then)}Rt.thenable=GM});var Bo=f(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.stringArray=on.array=on.func=on.error=on.number=on.string=on.boolean=void 0;function HM(t){return t===!0||t===!1}on.boolean=HM;function $0(t){return typeof t=="string"||t instanceof String}on.string=$0;function VM(t){return typeof t=="number"||t instanceof Number}on.number=VM;function zM(t){return t instanceof Error}on.error=zM;function XM(t){return typeof t=="function"}on.func=XM;function U0(t){return Array.isArray(t)}on.array=U0;function YM(t){return U0(t)&&t.every(e=>$0(e))}on.stringArray=YM});var Fm=f(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.Message=ne.NotificationType9=ne.NotificationType8=ne.NotificationType7=ne.NotificationType6=ne.NotificationType5=ne.NotificationType4=ne.NotificationType3=ne.NotificationType2=ne.NotificationType1=ne.NotificationType0=ne.NotificationType=ne.RequestType9=ne.RequestType8=ne.RequestType7=ne.RequestType6=ne.RequestType5=ne.RequestType4=ne.RequestType3=ne.RequestType2=ne.RequestType1=ne.RequestType=ne.RequestType0=ne.AbstractMessageSignature=ne.ParameterStructures=ne.ResponseError=ne.ErrorCodes=void 0;var $s=Bo(),gm;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(gm||(ne.ErrorCodes=gm={}));var mm=class t extends Error{constructor(e,n,r){super(n),this.code=$s.number(e)?e:gm.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ne.ResponseError=mm;var In=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ne.ParameterStructures=In;In.auto=new In("auto");In.byPosition=new In("byPosition");In.byName=new In("byName");var Qe=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return In.auto}};ne.AbstractMessageSignature=Qe;var ym=class extends Qe{constructor(e){super(e,0)}};ne.RequestType0=ym;var bm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType=bm;var _m=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType1=_m;var vm=class extends Qe{constructor(e){super(e,2)}};ne.RequestType2=vm;var Sm=class extends Qe{constructor(e){super(e,3)}};ne.RequestType3=Sm;var Tm=class extends Qe{constructor(e){super(e,4)}};ne.RequestType4=Tm;var wm=class extends Qe{constructor(e){super(e,5)}};ne.RequestType5=wm;var xm=class extends Qe{constructor(e){super(e,6)}};ne.RequestType6=xm;var Em=class extends Qe{constructor(e){super(e,7)}};ne.RequestType7=Em;var km=class extends Qe{constructor(e){super(e,8)}};ne.RequestType8=km;var Am=class extends Qe{constructor(e){super(e,9)}};ne.RequestType9=Am;var Pm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType=Pm;var Om=class extends Qe{constructor(e){super(e,0)}};ne.NotificationType0=Om;var Dm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType1=Dm;var Rm=class extends Qe{constructor(e){super(e,2)}};ne.NotificationType2=Rm;var Im=class extends Qe{constructor(e){super(e,3)}};ne.NotificationType3=Im;var Cm=class extends Qe{constructor(e){super(e,4)}};ne.NotificationType4=Cm;var Mm=class extends Qe{constructor(e){super(e,5)}};ne.NotificationType5=Mm;var Lm=class extends Qe{constructor(e){super(e,6)}};ne.NotificationType6=Lm;var Nm=class extends Qe{constructor(e){super(e,7)}};ne.NotificationType7=Nm;var qm=class extends Qe{constructor(e){super(e,8)}};ne.NotificationType8=qm;var jm=class extends Qe{constructor(e){super(e,9)}};ne.NotificationType9=jm;var K0;(function(t){function e(i){let s=i;return s&&$s.string(s.method)&&($s.string(s.id)||$s.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&$s.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&($s.string(s.id)||$s.number(s.id)||s.id===null)}t.isResponse=r})(K0||(ne.Message=K0={}))});var $m=f(Zi=>{"use strict";var W0;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.LRUCache=Zi.LinkedMap=Zi.Touch=void 0;var an;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(an||(Zi.Touch=an={}));var Wl=class{constructor(){this[W0]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=an.None){let r=this._map.get(e);if(r)return n!==an.None&&this.touch(r,n),r.value}set(e,n,r=an.None){let i=this._map.get(e);if(i)i.value=n,r!==an.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case an.None:this.addItemLast(i);break;case an.First:this.addItemFirst(i);break;case an.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(W0=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==an.First&&n!==an.Last)){if(n===an.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===an.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Zi.LinkedMap=Wl;var Bm=class extends Wl{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=an.AsNew){return super.get(e,n)}peek(e){return super.get(e,an.None)}set(e,n){return super.set(e,n,an.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Zi.LRUCache=Bm});var H0=f(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.Disposable=void 0;var G0;(function(t){function e(n){return{dispose:n}}t.create=e})(G0||(Gl.Disposable=G0={}))});var es=f(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Um;function Km(){if(Um===void 0)throw new Error("No runtime abstraction layer installed");return Um}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Um=n}t.install=e})(Km||(Km={}));Wm.default=Km});var Uo=f($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.Emitter=$o.Event=void 0;var JM=es(),V0;(function(t){let e={dispose(){}};t.None=function(){return e}})(V0||($o.Event=V0={}));var Gm=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,JM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Hl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Gm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};$o.Emitter=Hl;Hl._noop=function(){}});var Xl=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.CancellationTokenSource=Ko.CancellationToken=void 0;var QM=es(),ZM=Bo(),Hm=Uo(),Vl;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Hm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Hm.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||ZM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Vl||(Ko.CancellationToken=Vl={}));var eL=Object.freeze(function(t,e){let n=(0,QM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),zl=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?eL:(this._emitter||(this._emitter=new Hm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Vm=class{get token(){return this._token||(this._token=new zl),this._token}cancel(){this._token?this._token.cancel():this._token=Vl.Cancelled}dispose(){this._token?this._token instanceof zl&&this._token.dispose():this._token=Vl.None}};Ko.CancellationTokenSource=Vm});var z0=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.SharedArrayReceiverStrategy=Wo.SharedArraySenderStrategy=void 0;var tL=Xl(),Tu;(function(t){t.Continue=0,t.Cancelled=1})(Tu||(Tu={}));var zm=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Tu.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Tu.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Wo.SharedArraySenderStrategy=zm;var Xm=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Tu.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ym=class{constructor(e){this.token=new Xm(e)}cancel(){}dispose(){}},Jm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new tL.CancellationTokenSource:new Ym(n)}};Wo.SharedArrayReceiverStrategy=Jm});var Zm=f(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.Semaphore=void 0;var nL=es(),Qm=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,nL.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};Yl.Semaphore=Qm});var Y0=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.ReadableStreamMessageReader=ts.AbstractMessageReader=ts.MessageReader=void 0;var ty=es(),Go=Bo(),ey=Uo(),rL=Zm(),X0;(function(t){function e(n){let r=n;return r&&Go.func(r.listen)&&Go.func(r.dispose)&&Go.func(r.onError)&&Go.func(r.onClose)&&Go.func(r.onPartialMessage)}t.is=e})(X0||(ts.MessageReader=X0={}));var Jl=class{constructor(){this.errorEmitter=new ey.Emitter,this.closeEmitter=new ey.Emitter,this.partialMessageEmitter=new ey.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: ${Go.string(e.message)?e.message:"unknown"}`)}};ts.AbstractMessageReader=Jl;var ny;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,ty.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(ny||(ny={}));var ry=class extends Jl{constructor(e,n){super(),this.readable=e,this.options=ny.fromOptions(n),this.buffer=(0,ty.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new rL.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
1
|
+
"use strict";var fm=Object.defineProperty;var CM=Object.getOwnPropertyDescriptor;var MM=Object.getOwnPropertyNames;var LM=Object.prototype.hasOwnProperty;var NM=(t,e)=>()=>(t&&(e=t(t=0)),e);var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qM=(t,e)=>{for(var n in e)fm(t,n,{get:e[n],enumerable:!0})},jM=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of MM(e))!LM.call(t,i)&&i!==n&&fm(t,i,{get:()=>e[i],enumerable:!(r=CM(e,i))||r.enumerable});return t};var FM=t=>jM(fm({},"__esModule",{value:!0}),t);var Kl=f(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.thenable=Dt.typedArray=Dt.stringArray=Dt.array=Dt.func=Dt.error=Dt.number=Dt.string=Dt.boolean=void 0;function BM(t){return t===!0||t===!1}Dt.boolean=BM;function j0(t){return typeof t=="string"||t instanceof String}Dt.string=j0;function $M(t){return typeof t=="number"||t instanceof Number}Dt.number=$M;function UM(t){return t instanceof Error}Dt.error=UM;function F0(t){return typeof t=="function"}Dt.func=F0;function B0(t){return Array.isArray(t)}Dt.array=B0;function KM(t){return B0(t)&&t.every(e=>j0(e))}Dt.stringArray=KM;function WM(t,e){return Array.isArray(t)&&t.every(e)}Dt.typedArray=WM;function GM(t){return t&&F0(t.then)}Dt.thenable=GM});var Bo=f(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.stringArray=on.array=on.func=on.error=on.number=on.string=on.boolean=void 0;function HM(t){return t===!0||t===!1}on.boolean=HM;function $0(t){return typeof t=="string"||t instanceof String}on.string=$0;function VM(t){return typeof t=="number"||t instanceof Number}on.number=VM;function zM(t){return t instanceof Error}on.error=zM;function XM(t){return typeof t=="function"}on.func=XM;function U0(t){return Array.isArray(t)}on.array=U0;function YM(t){return U0(t)&&t.every(e=>$0(e))}on.stringArray=YM});var Fm=f(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.Message=ne.NotificationType9=ne.NotificationType8=ne.NotificationType7=ne.NotificationType6=ne.NotificationType5=ne.NotificationType4=ne.NotificationType3=ne.NotificationType2=ne.NotificationType1=ne.NotificationType0=ne.NotificationType=ne.RequestType9=ne.RequestType8=ne.RequestType7=ne.RequestType6=ne.RequestType5=ne.RequestType4=ne.RequestType3=ne.RequestType2=ne.RequestType1=ne.RequestType=ne.RequestType0=ne.AbstractMessageSignature=ne.ParameterStructures=ne.ResponseError=ne.ErrorCodes=void 0;var $s=Bo(),gm;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(gm||(ne.ErrorCodes=gm={}));var mm=class t extends Error{constructor(e,n,r){super(n),this.code=$s.number(e)?e:gm.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ne.ResponseError=mm;var In=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ne.ParameterStructures=In;In.auto=new In("auto");In.byPosition=new In("byPosition");In.byName=new In("byName");var Qe=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return In.auto}};ne.AbstractMessageSignature=Qe;var ym=class extends Qe{constructor(e){super(e,0)}};ne.RequestType0=ym;var bm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType=bm;var _m=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.RequestType1=_m;var vm=class extends Qe{constructor(e){super(e,2)}};ne.RequestType2=vm;var Sm=class extends Qe{constructor(e){super(e,3)}};ne.RequestType3=Sm;var Tm=class extends Qe{constructor(e){super(e,4)}};ne.RequestType4=Tm;var wm=class extends Qe{constructor(e){super(e,5)}};ne.RequestType5=wm;var xm=class extends Qe{constructor(e){super(e,6)}};ne.RequestType6=xm;var Em=class extends Qe{constructor(e){super(e,7)}};ne.RequestType7=Em;var km=class extends Qe{constructor(e){super(e,8)}};ne.RequestType8=km;var Am=class extends Qe{constructor(e){super(e,9)}};ne.RequestType9=Am;var Pm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType=Pm;var Om=class extends Qe{constructor(e){super(e,0)}};ne.NotificationType0=Om;var Rm=class extends Qe{constructor(e,n=In.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ne.NotificationType1=Rm;var Dm=class extends Qe{constructor(e){super(e,2)}};ne.NotificationType2=Dm;var Im=class extends Qe{constructor(e){super(e,3)}};ne.NotificationType3=Im;var Cm=class extends Qe{constructor(e){super(e,4)}};ne.NotificationType4=Cm;var Mm=class extends Qe{constructor(e){super(e,5)}};ne.NotificationType5=Mm;var Lm=class extends Qe{constructor(e){super(e,6)}};ne.NotificationType6=Lm;var Nm=class extends Qe{constructor(e){super(e,7)}};ne.NotificationType7=Nm;var qm=class extends Qe{constructor(e){super(e,8)}};ne.NotificationType8=qm;var jm=class extends Qe{constructor(e){super(e,9)}};ne.NotificationType9=jm;var K0;(function(t){function e(i){let s=i;return s&&$s.string(s.method)&&($s.string(s.id)||$s.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&$s.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&($s.string(s.id)||$s.number(s.id)||s.id===null)}t.isResponse=r})(K0||(ne.Message=K0={}))});var $m=f(Zi=>{"use strict";var W0;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.LRUCache=Zi.LinkedMap=Zi.Touch=void 0;var an;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(an||(Zi.Touch=an={}));var Wl=class{constructor(){this[W0]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=an.None){let r=this._map.get(e);if(r)return n!==an.None&&this.touch(r,n),r.value}set(e,n,r=an.None){let i=this._map.get(e);if(i)i.value=n,r!==an.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case an.None:this.addItemLast(i);break;case an.First:this.addItemFirst(i);break;case an.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(W0=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==an.First&&n!==an.Last)){if(n===an.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===an.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Zi.LinkedMap=Wl;var Bm=class extends Wl{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=an.AsNew){return super.get(e,n)}peek(e){return super.get(e,an.None)}set(e,n){return super.set(e,n,an.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Zi.LRUCache=Bm});var H0=f(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.Disposable=void 0;var G0;(function(t){function e(n){return{dispose:n}}t.create=e})(G0||(Gl.Disposable=G0={}))});var es=f(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Um;function Km(){if(Um===void 0)throw new Error("No runtime abstraction layer installed");return Um}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Um=n}t.install=e})(Km||(Km={}));Wm.default=Km});var Uo=f($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.Emitter=$o.Event=void 0;var JM=es(),V0;(function(t){let e={dispose(){}};t.None=function(){return e}})(V0||($o.Event=V0={}));var Gm=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,JM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Hl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Gm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};$o.Emitter=Hl;Hl._noop=function(){}});var Xl=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.CancellationTokenSource=Ko.CancellationToken=void 0;var QM=es(),ZM=Bo(),Hm=Uo(),Vl;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Hm.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Hm.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||ZM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Vl||(Ko.CancellationToken=Vl={}));var eL=Object.freeze(function(t,e){let n=(0,QM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),zl=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?eL:(this._emitter||(this._emitter=new Hm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Vm=class{get token(){return this._token||(this._token=new zl),this._token}cancel(){this._token?this._token.cancel():this._token=Vl.Cancelled}dispose(){this._token?this._token instanceof zl&&this._token.dispose():this._token=Vl.None}};Ko.CancellationTokenSource=Vm});var z0=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.SharedArrayReceiverStrategy=Wo.SharedArraySenderStrategy=void 0;var tL=Xl(),Tu;(function(t){t.Continue=0,t.Cancelled=1})(Tu||(Tu={}));var zm=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Tu.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Tu.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Wo.SharedArraySenderStrategy=zm;var Xm=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Tu.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ym=class{constructor(e){this.token=new Xm(e)}cancel(){}dispose(){}},Jm=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new tL.CancellationTokenSource:new Ym(n)}};Wo.SharedArrayReceiverStrategy=Jm});var Zm=f(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.Semaphore=void 0;var nL=es(),Qm=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,nL.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};Yl.Semaphore=Qm});var Y0=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.ReadableStreamMessageReader=ts.AbstractMessageReader=ts.MessageReader=void 0;var ty=es(),Go=Bo(),ey=Uo(),rL=Zm(),X0;(function(t){function e(n){let r=n;return r&&Go.func(r.listen)&&Go.func(r.dispose)&&Go.func(r.onError)&&Go.func(r.onClose)&&Go.func(r.onPartialMessage)}t.is=e})(X0||(ts.MessageReader=X0={}));var Jl=class{constructor(){this.errorEmitter=new ey.Emitter,this.closeEmitter=new ey.Emitter,this.partialMessageEmitter=new ey.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: ${Go.string(e.message)?e.message:"unknown"}`)}};ts.AbstractMessageReader=Jl;var ny;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,ty.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(ny||(ny={}));var ry=class extends Jl{constructor(e,n){super(),this.readable=e,this.options=ny.fromOptions(n),this.buffer=(0,ty.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new rL.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
2
2
|
${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ty.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ts.ReadableStreamMessageReader=ry});var tx=f(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.WriteableStreamMessageWriter=ns.AbstractMessageWriter=ns.MessageWriter=void 0;var J0=es(),wu=Bo(),iL=Zm(),Q0=Uo(),sL="Content-Length: ",Z0=`\r
|
3
3
|
`,ex;(function(t){function e(n){let r=n;return r&&wu.func(r.dispose)&&wu.func(r.onClose)&&wu.func(r.onError)&&wu.func(r.write)}t.is=e})(ex||(ns.MessageWriter=ex={}));var Ql=class{constructor(){this.errorEmitter=new Q0.Emitter,this.closeEmitter=new Q0.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${wu.string(e.message)?e.message:"unknown"}`)}};ns.AbstractMessageWriter=Ql;var iy;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,J0.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,J0.default)().applicationJson.encoder}}t.fromOptions=e})(iy||(iy={}));var sy=class extends Ql{constructor(e,n){super(),this.writable=e,this.options=iy.fromOptions(n),this.errorCount=0,this.writeSemaphore=new iL.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(sL,r.byteLength.toString(),Z0),i.push(Z0),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};ns.WriteableStreamMessageWriter=sy});var nx=f(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.AbstractMessageBuffer=void 0;var oL=13,aL=10,uL=`\r
|
4
4
|
`,oy=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case oL:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case aL:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=c.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,u=this.toString(o,"ascii").split(uL);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],p=l.indexOf(":");if(p===-1)throw new Error(`Message header must separate key and value using ':'
|
5
|
-
${l}`);let h=l.substr(0,p),m=l.substr(p+1).trim();a.set(e?h.toLowerCase():h,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 s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};Zl.AbstractMessageBuffer=oy});var ax=f(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.createMessageConnection=me.ConnectionOptions=me.MessageStrategy=me.CancellationStrategy=me.CancellationSenderStrategy=me.CancellationReceiverStrategy=me.RequestCancellationReceiverStrategy=me.IdCancellationReceiverStrategy=me.ConnectionStrategy=me.ConnectionError=me.ConnectionErrors=me.LogTraceNotification=me.SetTraceNotification=me.TraceFormat=me.TraceValues=me.Trace=me.NullLogger=me.ProgressType=me.ProgressToken=void 0;var rx=es(),pt=Bo(),ue=Fm(),ix=$m(),xu=Uo(),ay=Xl(),Au;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(Au||(Au={}));var uy;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(uy||(me.ProgressToken=uy={}));var Eu;(function(t){t.type=new ue.NotificationType("$/progress")})(Eu||(Eu={}));var cy=class{constructor(){}};me.ProgressType=cy;var ly;(function(t){function e(n){return pt.func(n)}t.is=e})(ly||(ly={}));me.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Me;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Me||(me.Trace=Me={}));var sx;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sx||(me.TraceValues=sx={}));(function(t){function e(r){if(!pt.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Me||(me.Trace=Me={}));var Kn;(function(t){t.Text="text",t.JSON="json"})(Kn||(me.TraceFormat=Kn={}));(function(t){function e(n){return pt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Kn||(me.TraceFormat=Kn={}));var py;(function(t){t.type=new ue.NotificationType("$/setTrace")})(py||(me.SetTraceNotification=py={}));var ep;(function(t){t.type=new ue.NotificationType("$/logTrace")})(ep||(me.LogTraceNotification=ep={}));var ku;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ku||(me.ConnectionErrors=ku={}));var Ho=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};me.ConnectionError=Ho;var hy;(function(t){function e(n){let r=n;return r&&pt.func(r.cancelUndispatched)}t.is=e})(hy||(me.ConnectionStrategy=hy={}));var tp;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(tp||(me.IdCancellationReceiverStrategy=tp={}));var dy;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(dy||(me.RequestCancellationReceiverStrategy=dy={}));var np;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new ay.CancellationTokenSource}});function e(n){return tp.is(n)||dy.is(n)}t.is=e})(np||(me.CancellationReceiverStrategy=np={}));var rp;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Au.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&pt.func(r.sendCancellation)&&pt.func(r.cleanup)}t.is=e})(rp||(me.CancellationSenderStrategy=rp={}));var ip;(function(t){t.Message=Object.freeze({receiver:np.Message,sender:rp.Message});function e(n){let r=n;return r&&np.is(r.receiver)&&rp.is(r.sender)}t.is=e})(ip||(me.CancellationStrategy=ip={}));var sp;(function(t){function e(n){let r=n;return r&&pt.func(r.handleMessage)}t.is=e})(sp||(me.MessageStrategy=sp={}));var ox;(function(t){function e(n){let r=n;return r&&(ip.is(r.cancellationStrategy)||hy.is(r.connectionStrategy)||sp.is(r.messageStrategy))}t.is=e})(ox||(me.ConnectionOptions=ox={}));var Ir;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Ir||(Ir={}));function cL(t,e,n,r){let i=n!==void 0?n:me.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,p,h=new Map,m=new Map,b,v=new ix.LinkedMap,
|
6
|
-
${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let B=x.id,V=
|
7
|
-
${JSON.stringify(x,null,4)}`);let B=x;if(pt.string(B.id)||pt.number(B.id)){let V=B.id,J=
|
5
|
+
${l}`);let h=l.substr(0,p),m=l.substr(p+1).trim();a.set(e?h.toLowerCase():h,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 s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};Zl.AbstractMessageBuffer=oy});var ax=f(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.createMessageConnection=me.ConnectionOptions=me.MessageStrategy=me.CancellationStrategy=me.CancellationSenderStrategy=me.CancellationReceiverStrategy=me.RequestCancellationReceiverStrategy=me.IdCancellationReceiverStrategy=me.ConnectionStrategy=me.ConnectionError=me.ConnectionErrors=me.LogTraceNotification=me.SetTraceNotification=me.TraceFormat=me.TraceValues=me.Trace=me.NullLogger=me.ProgressType=me.ProgressToken=void 0;var rx=es(),pt=Bo(),ue=Fm(),ix=$m(),xu=Uo(),ay=Xl(),Au;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(Au||(Au={}));var uy;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(uy||(me.ProgressToken=uy={}));var Eu;(function(t){t.type=new ue.NotificationType("$/progress")})(Eu||(Eu={}));var cy=class{constructor(){}};me.ProgressType=cy;var ly;(function(t){function e(n){return pt.func(n)}t.is=e})(ly||(ly={}));me.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Me;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Me||(me.Trace=Me={}));var sx;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sx||(me.TraceValues=sx={}));(function(t){function e(r){if(!pt.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Me||(me.Trace=Me={}));var Kn;(function(t){t.Text="text",t.JSON="json"})(Kn||(me.TraceFormat=Kn={}));(function(t){function e(n){return pt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Kn||(me.TraceFormat=Kn={}));var py;(function(t){t.type=new ue.NotificationType("$/setTrace")})(py||(me.SetTraceNotification=py={}));var ep;(function(t){t.type=new ue.NotificationType("$/logTrace")})(ep||(me.LogTraceNotification=ep={}));var ku;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ku||(me.ConnectionErrors=ku={}));var Ho=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};me.ConnectionError=Ho;var hy;(function(t){function e(n){let r=n;return r&&pt.func(r.cancelUndispatched)}t.is=e})(hy||(me.ConnectionStrategy=hy={}));var tp;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(tp||(me.IdCancellationReceiverStrategy=tp={}));var dy;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&pt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||pt.func(r.dispose))}t.is=e})(dy||(me.RequestCancellationReceiverStrategy=dy={}));var np;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new ay.CancellationTokenSource}});function e(n){return tp.is(n)||dy.is(n)}t.is=e})(np||(me.CancellationReceiverStrategy=np={}));var rp;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Au.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&pt.func(r.sendCancellation)&&pt.func(r.cleanup)}t.is=e})(rp||(me.CancellationSenderStrategy=rp={}));var ip;(function(t){t.Message=Object.freeze({receiver:np.Message,sender:rp.Message});function e(n){let r=n;return r&&np.is(r.receiver)&&rp.is(r.sender)}t.is=e})(ip||(me.CancellationStrategy=ip={}));var sp;(function(t){function e(n){let r=n;return r&&pt.func(r.handleMessage)}t.is=e})(sp||(me.MessageStrategy=sp={}));var ox;(function(t){function e(n){let r=n;return r&&(ip.is(r.cancellationStrategy)||hy.is(r.connectionStrategy)||sp.is(r.messageStrategy))}t.is=e})(ox||(me.ConnectionOptions=ox={}));var Ir;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Ir||(Ir={}));function cL(t,e,n,r){let i=n!==void 0?n:me.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,p,h=new Map,m=new Map,b,v=new ix.LinkedMap,D=new Map,A=new Set,T=new Map,w=Me.Off,_=Kn.Text,N,O=Ir.New,G=new xu.Emitter,re=new xu.Emitter,ae=new xu.Emitter,K=new xu.Emitter,P=new xu.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:ip.Message;function L(x){if(x===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+x.toString()}function F(x){return x===null?"res-unknown-"+(++a).toString():"res-"+x.toString()}function he(){return"not-"+(++o).toString()}function ce(x,B){ue.Message.isRequest(B)?x.set(L(B.id),B):ue.Message.isResponse(B)?x.set(F(B.id),B):x.set(he(),B)}function $t(x){}function Et(){return O===Ir.Listening}function je(){return O===Ir.Closed}function Dn(){return O===Ir.Disposed}function Lo(){(O===Ir.New||O===Ir.Listening)&&(O=Ir.Closed,re.fire(void 0))}function Fs(x){G.fire([x,void 0,void 0])}function Ol(x){G.fire(x)}t.onClose(Lo),t.onError(Fs),e.onClose(Lo),e.onError(Ol);function yu(){b||v.size===0||(b=(0,rx.default)().timer.setImmediate(()=>{b=void 0,Rl()}))}function bu(x){ue.Message.isRequest(x)?Il(x):ue.Message.isNotification(x)?Ml(x):ue.Message.isResponse(x)?Cl(x):No(x)}function Rl(){if(v.size===0)return;let x=v.shift();try{let B=r?.messageStrategy;sp.is(B)?B.handleMessage(x,bu):bu(x)}finally{yu()}}let Dl=x=>{try{if(ue.Message.isNotification(x)&&x.method===Au.type.method){let B=x.params.id,V=L(B),J=v.get(V);if(ue.Message.isRequest(J)){let Le=r?.connectionStrategy,Je=Le&&Le.cancelUndispatched?Le.cancelUndispatched(J,$t):void 0;if(Je&&(Je.error!==void 0||Je.result!==void 0)){v.delete(V),T.delete(B),Je.id=J.id,Bs(Je,x.method,Date.now()),e.write(Je).catch(()=>i.error("Sending response for canceled message failed."));return}}let We=T.get(B);if(We!==void 0){We.cancel(),qo(x);return}else A.add(B)}ce(v,x)}finally{yu()}};function Il(x){if(Dn())return;function B(xe,He,De){let mt={jsonrpc:u,id:x.id};xe instanceof ue.ResponseError?mt.error=xe.toJson():mt.result=xe===void 0?null:xe,Bs(mt,He,De),e.write(mt).catch(()=>i.error("Sending response failed."))}function V(xe,He,De){let mt={jsonrpc:u,id:x.id,error:xe.toJson()};Bs(mt,He,De),e.write(mt).catch(()=>i.error("Sending response failed."))}function J(xe,He,De){xe===void 0&&(xe=null);let mt={jsonrpc:u,id:x.id,result:xe};Bs(mt,He,De),e.write(mt).catch(()=>i.error("Sending response failed."))}ql(x);let We=l.get(x.method),Le,Je;We&&(Le=We.type,Je=We.handler);let rt=Date.now();if(Je||c){let xe=x.id??String(Date.now()),He=tp.is(M.receiver)?M.receiver.createCancellationTokenSource(xe):M.receiver.createCancellationTokenSource(x);x.id!==null&&A.has(x.id)&&He.cancel(),x.id!==null&&T.set(xe,He);try{let De;if(Je)if(x.params===void 0){if(Le!==void 0&&Le.numberOfParams!==0){V(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${x.method} defines ${Le.numberOfParams} params but received none.`),x.method,rt);return}De=Je(He.token)}else if(Array.isArray(x.params)){if(Le!==void 0&&Le.parameterStructures===ue.ParameterStructures.byName){V(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by name but received parameters by position`),x.method,rt);return}De=Je(...x.params,He.token)}else{if(Le!==void 0&&Le.parameterStructures===ue.ParameterStructures.byPosition){V(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${x.method} defines parameters by position but received parameters by name`),x.method,rt);return}De=Je(x.params,He.token)}else c&&(De=c(x.method,x.params,He.token));let mt=De;De?mt.then?mt.then(Ut=>{T.delete(xe),B(Ut,x.method,rt)},Ut=>{T.delete(xe),Ut instanceof ue.ResponseError?V(Ut,x.method,rt):Ut&&pt.string(Ut.message)?V(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${Ut.message}`),x.method,rt):V(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,rt)}):(T.delete(xe),B(De,x.method,rt)):(T.delete(xe),J(De,x.method,rt))}catch(De){T.delete(xe),De instanceof ue.ResponseError?B(De,x.method,rt):De&&pt.string(De.message)?V(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${x.method} failed with message: ${De.message}`),x.method,rt):V(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${x.method} failed unexpectedly without providing any details.`),x.method,rt)}}else V(new ue.ResponseError(ue.ErrorCodes.MethodNotFound,`Unhandled method ${x.method}`),x.method,rt)}function Cl(x){if(!Dn())if(x.id===null)x.error?i.error(`Received response message without id: Error is:
|
6
|
+
${JSON.stringify(x.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let B=x.id,V=D.get(B);if(jl(x,V),V!==void 0){D.delete(B);try{if(x.error){let J=x.error;V.reject(new ue.ResponseError(J.code,J.message,J.data))}else if(x.result!==void 0)V.resolve(x.result);else throw new Error("Should never happen.")}catch(J){J.message?i.error(`Response handler '${V.method}' failed with message: ${J.message}`):i.error(`Response handler '${V.method}' failed unexpectedly.`)}}}}function Ml(x){if(Dn())return;let B,V;if(x.method===Au.type.method){let J=x.params.id;A.delete(J),qo(x);return}else{let J=h.get(x.method);J&&(V=J.handler,B=J.type)}if(V||p)try{if(qo(x),V)if(x.params===void 0)B!==void 0&&B.numberOfParams!==0&&B.parameterStructures!==ue.ParameterStructures.byName&&i.error(`Notification ${x.method} defines ${B.numberOfParams} params but received none.`),V();else if(Array.isArray(x.params)){let J=x.params;x.method===Eu.type.method&&J.length===2&&uy.is(J[0])?V({token:J[0],value:J[1]}):(B!==void 0&&(B.parameterStructures===ue.ParameterStructures.byName&&i.error(`Notification ${x.method} defines parameters by name but received parameters by position`),B.numberOfParams!==x.params.length&&i.error(`Notification ${x.method} defines ${B.numberOfParams} params but received ${J.length} arguments`)),V(...J))}else B!==void 0&&B.parameterStructures===ue.ParameterStructures.byPosition&&i.error(`Notification ${x.method} defines parameters by position but received parameters by name`),V(x.params);else p&&p(x.method,x.params)}catch(J){J.message?i.error(`Notification handler '${x.method}' failed with message: ${J.message}`):i.error(`Notification handler '${x.method}' failed unexpectedly.`)}else ae.fire(x)}function No(x){if(!x){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
7
|
+
${JSON.stringify(x,null,4)}`);let B=x;if(pt.string(B.id)||pt.number(B.id)){let V=B.id,J=D.get(V);J&&J.reject(new Error("The received response has neither a result nor an error property."))}}function Or(x){if(x!=null)switch(w){case Me.Verbose:return JSON.stringify(x,null,4);case Me.Compact:return JSON.stringify(x);default:return}}function Ll(x){if(!(w===Me.Off||!N))if(_===Kn.Text){let B;(w===Me.Verbose||w===Me.Compact)&&x.params&&(B=`Params: ${Or(x.params)}
|
8
8
|
|
9
9
|
`),N.log(`Sending request '${x.method} - (${x.id})'.`,B)}else xi("send-request",x)}function Nl(x){if(!(w===Me.Off||!N))if(_===Kn.Text){let B;(w===Me.Verbose||w===Me.Compact)&&(x.params?B=`Params: ${Or(x.params)}
|
10
10
|
|
@@ -28,12 +28,12 @@ ${JSON.stringify(x,null,4)}`);let B=x;if(pt.string(B.id)||pt.number(B.id)){let V
|
|
28
28
|
|
29
29
|
`:x.error===void 0&&(V=`No result returned.
|
30
30
|
|
31
|
-
`)),B){let J=x.error?` Request failed: ${x.error.message} (${x.error.code}).`:"";N.log(`Received response '${B.method} - (${x.id})' in ${Date.now()-B.timerStart}ms.${J}`,V)}else N.log(`Received response ${x.id} without active response promise.`,V)}else xi("receive-response",x)}function xi(x,B){if(!N||w===Me.Off)return;let V={isLSPMessage:!0,type:x,message:B,timestamp:Date.now()};N.log(V)}function Qi(){if(je())throw new Ho(ku.Closed,"Connection is closed.");if(Rn())throw new Ho(ku.Disposed,"Connection is disposed.")}function Fl(){if(Et())throw new Ho(ku.AlreadyListening,"Connection is already listening")}function Bl(){if(!Et())throw new Error("Call listen() first.")}function Qr(x){return x===void 0?null:x}function _u(x){if(x!==null)return x}function vu(x){return x!=null&&!Array.isArray(x)&&typeof x=="object"}function jo(x,B){switch(x){case ue.ParameterStructures.auto:return vu(B)?_u(B):[Qr(B)];case ue.ParameterStructures.byName:if(!vu(B))throw new Error("Received parameters by name but param is not an object literal.");return _u(B);case ue.ParameterStructures.byPosition:return[Qr(B)];default:throw new Error(`Unknown parameter structure ${x.toString()}`)}}function Su(x,B){let V,J=x.numberOfParams;switch(J){case 0:V=void 0;break;case 1:V=jo(x.parameterStructures,B[0]);break;default:V=[];for(let We=0;We<B.length&&We<J;We++)V.push(Qr(B[We]));if(B.length<J)for(let We=B.length;We<J;We++)V.push(null);break}return V}let Ei={sendNotification:(x,...B)=>{Qi();let V,J;if(pt.string(x)){V=x;let Le=B[0],Je=0,rt=ue.ParameterStructures.auto;ue.ParameterStructures.is(Le)&&(Je=1,rt=Le);let xe=B.length,He=xe-Je;switch(He){case 0:J=void 0;break;case 1:J=jo(rt,B[Je]);break;default:if(rt===ue.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);J=B.slice(Je,xe).map(Re=>Qr(Re));break}}else{let Le=B;V=x.method,J=Su(x,Le)}let We={jsonrpc:u,method:V,params:J};return Nl(We),e.write(We).catch(Le=>{throw i.error("Sending notification failed."),Le})},onNotification:(x,B)=>{Qi();let V;return pt.func(x)?p=x:B&&(pt.string(x)?(V=x,h.set(x,{type:void 0,handler:B})):(V=x.method,h.set(x.method,{type:x,handler:B}))),{dispose:()=>{V!==void 0?h.delete(V):p=void 0}}},onProgress:(x,B,V)=>{if(m.has(B))throw new Error(`Progress handler for token ${B} already registered`);return m.set(B,V),{dispose:()=>{m.delete(B)}}},sendProgress:(x,B,V)=>Ei.sendNotification(Eu.type,{token:B,value:V}),onUnhandledProgress:K.event,sendRequest:(x,...B)=>{Qi(),Bl();let V,J,We;if(pt.string(x)){V=x;let xe=B[0],He=B[B.length-1],Re=0,mt=ue.ParameterStructures.auto;ue.ParameterStructures.is(xe)&&(Re=1,mt=xe);let Ut=B.length;ay.CancellationToken.is(He)&&(Ut=Ut-1,We=He);let Un=Ut-Re;switch(Un){case 0:J=void 0;break;case 1:J=jo(mt,B[Re]);break;default:if(mt===ue.ParameterStructures.byName)throw new Error(`Received ${Un} parameters for 'by Name' request parameter structure.`);J=B.slice(Re,Ut).map($l=>Qr($l));break}}else{let xe=B;V=x.method,J=Su(x,xe);let He=x.numberOfParams;We=ay.CancellationToken.is(xe[He])?xe[He]:void 0}let Le=s++,Je;We&&(Je=We.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(Ei,Le);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Le}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${Le} failed`)})}));let rt={jsonrpc:u,id:Le,method:V,params:J};return Ll(rt),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(rt),new Promise(async(xe,He)=>{let Re=Un=>{xe(Un),M.sender.cleanup(Le),Je?.dispose()},mt=Un=>{He(Un),M.sender.cleanup(Le),Je?.dispose()},Ut={method:V,timerStart:Date.now(),resolve:Re,reject:mt};try{await e.write(rt),R.set(Le,Ut)}catch(Un){throw i.error("Sending request failed."),Ut.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,Un.message?Un.message:"Unknown reason")),Un}})},onRequest:(x,B)=>{Qi();let V=null;return ly.is(x)?(V=void 0,c=x):pt.string(x)?(V=null,B!==void 0&&(V=x,l.set(x,{handler:B,type:void 0}))):B!==void 0&&(V=x.method,l.set(x.method,{type:x,handler:B})),{dispose:()=>{V!==null&&(V!==void 0?l.delete(V):c=void 0)}}},hasPendingResponse:()=>R.size>0,trace:async(x,B,V)=>{let J=!1,We=Kn.Text;V!==void 0&&(pt.boolean(V)?J=V:(J=V.sendNotification||!1,We=V.traceFormat||Kn.Text)),w=x,_=We,w===Me.Off?N=void 0:N=B,J&&!je()&&!Rn()&&await Ei.sendNotification(py.type,{value:Me.toString(x)})},onError:G.event,onClose:re.event,onUnhandledNotification:ae.event,onDispose:P.event,end:()=>{e.end()},dispose:()=>{if(Rn())return;O=Ir.Disposed,P.fire(void 0);let x=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let B of R.values())B.reject(x);R=new Map,T=new Map,A=new Set,v=new ix.LinkedMap,pt.func(e.dispose)&&e.dispose(),pt.func(t.dispose)&&t.dispose()},listen:()=>{Qi(),Fl(),O=Ir.Listening,t.listen(Rl)},inspect:()=>{(0,rx.default)().console.log("inspect")}};return Ei.onNotification(ep.type,x=>{if(w===Me.Off||!N)return;let B=w===Me.Verbose||w===Me.Compact;N.log(x.message,B?x.verbose:void 0)}),Ei.onNotification(Eu.type,x=>{let B=m.get(x.token);B?B(x.value):K.fire(x)}),Ei}me.createMessageConnection=cL});var op=f(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ye=Fm();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var fy=$m();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return fy.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return fy.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return fy.Touch}});var lL=H0();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return lL.Disposable}});var ux=Uo();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return ux.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return ux.Emitter}});var cx=Xl();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return cx.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return cx.CancellationToken}});var lx=z0();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return lx.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return lx.SharedArrayReceiverStrategy}});var gy=Y0();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return gy.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return gy.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return gy.ReadableStreamMessageReader}});var my=tx();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return my.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return my.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return my.WriteableStreamMessageWriter}});var pL=nx();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return pL.AbstractMessageBuffer}});var Qt=ax();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Qt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Qt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Qt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Qt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Qt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Qt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Qt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Qt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Qt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Qt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Qt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Qt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Qt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Qt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Qt.MessageStrategy}});var hL=es();q.RAL=hL.default});var dx=f(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var px=require("util"),Ai=op(),ap=class t extends Ai.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new px.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};ap.emptyBuffer=Buffer.allocUnsafe(0);var yy=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ai.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ai.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ai.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Ai.Disposable.create(()=>this.stream.off("data",e))}},by=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ai.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ai.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ai.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},hx=Object.freeze({messageBuffer:Object.freeze({create:t=>new ap(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new px.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new yy(t),asWritableStream:t=>new by(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function _y(){return hx}(function(t){function e(){Ai.RAL.install(hx)}t.install=e})(_y||(_y={}));vy.default=_y});var Ws=f(Ae=>{"use strict";var dL=Ae&&Ae.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),fL=Ae&&Ae.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&dL(e,t,n)};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createMessageConnection=Ae.createServerSocketTransport=Ae.createClientSocketTransport=Ae.createServerPipeTransport=Ae.createClientPipeTransport=Ae.generateRandomPipeName=Ae.StreamMessageWriter=Ae.StreamMessageReader=Ae.SocketMessageWriter=Ae.SocketMessageReader=Ae.PortMessageWriter=Ae.PortMessageReader=Ae.IPCMessageWriter=Ae.IPCMessageReader=void 0;var Vo=dx();Vo.default.install();var fx=require("path"),gL=require("os"),mL=require("crypto"),lp=require("net"),Wn=op();fL(op(),Ae);var Sy=class extends Wn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Wn.Disposable.create(()=>this.process.off("message",e))}};Ae.IPCMessageReader=Sy;var Ty=class extends Wn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ae.IPCMessageWriter=Ty;var wy=class extends Wn.AbstractMessageReader{constructor(e){super(),this.onData=new Wn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};Ae.PortMessageReader=wy;var xy=class extends Wn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ae.PortMessageWriter=xy;var Us=class extends Wn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Vo.default)().stream.asReadableStream(e),n)}};Ae.SocketMessageReader=Us;var Ks=class extends Wn.WriteableStreamMessageWriter{constructor(e,n){super((0,Vo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=Ks;var up=class extends Wn.ReadableStreamMessageReader{constructor(e,n){super((0,Vo.default)().stream.asReadableStream(e),n)}};Ae.StreamMessageReader=up;var cp=class extends Wn.WriteableStreamMessageWriter{constructor(e,n){super((0,Vo.default)().stream.asWritableStream(e),n)}};Ae.StreamMessageWriter=cp;var gx=process.env.XDG_RUNTIME_DIR,yL=new Map([["linux",107],["darwin",103]]);function bL(){let t=(0,mL.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gx?e=fx.join(gx,`vscode-ipc-${t}.sock`):e=fx.join(gL.tmpdir(),`vscode-${t}.sock`);let n=yL.get(process.platform);return n!==void 0&&e.length>n&&(0,Vo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ae.generateRandomPipeName=bL;function _L(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,lp.createServer)(a=>{o.close(),n([new Us(a,e),new Ks(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientPipeTransport=_L;function vL(t,e="utf-8"){let n=(0,lp.createConnection)(t);return[new Us(n,e),new Ks(n,e)]}Ae.createServerPipeTransport=vL;function SL(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,lp.createServer)(a=>{o.close(),n([new Us(a,e),new Ks(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientSocketTransport=SL;function TL(t,e="utf-8"){let n=(0,lp.createConnection)(t,"127.0.0.1");return[new Us(n,e),new Ks(n,e)]}Ae.createServerSocketTransport=TL;function wL(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function xL(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function EL(t,e,n,r){n||(n=Wn.NullLogger);let i=wL(t)?new up(t):t,s=xL(e)?new cp(e):e;return Wn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Wn.createMessageConnection)(i,s,n,r)}Ae.createMessageConnection=EL});var Ey=f((Az,mx)=>{"use strict";mx.exports=Ws()});var hp=f((yx,pp)=>{(function(t){if(typeof pp=="object"&&typeof pp.exports=="object"){var e=t(require,yx);e!==void 0&&(pp.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(g){function E(k){return typeof k=="string"}g.is=E})(n||(e.DocumentUri=n={}));var r;(function(g){function E(k){return typeof k=="string"}g.is=E})(r||(e.URI=r={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function E(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=E})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function E(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=E})(s||(e.uinteger=s={}));var o;(function(g){function E(y,d){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),d===Number.MAX_VALUE&&(d=s.MAX_VALUE),{line:y,character:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.uinteger(d.line)&&C.uinteger(d.character)}g.is=k})(o||(e.Position=o={}));var a;(function(g){function E(y,d,I,$){if(C.uinteger(y)&&C.uinteger(d)&&C.uinteger(I)&&C.uinteger($))return{start:o.create(y,d),end:o.create(I,$)};if(o.is(y)&&o.is(d))return{start:y,end:d};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(d,", ").concat(I,", ").concat($,"]"))}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&o.is(d.start)&&o.is(d.end)}g.is=k})(a||(e.Range=a={}));var u;(function(g){function E(y,d){return{uri:y,range:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&(C.string(d.uri)||C.undefined(d.uri))}g.is=k})(u||(e.Location=u={}));var c;(function(g){function E(y,d,I,$){return{targetUri:y,targetRange:d,targetSelectionRange:I,originSelectionRange:$}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.targetRange)&&C.string(d.targetUri)&&a.is(d.targetSelectionRange)&&(a.is(d.originSelectionRange)||C.undefined(d.originSelectionRange))}g.is=k})(c||(e.LocationLink=c={}));var l;(function(g){function E(y,d,I,$){return{red:y,green:d,blue:I,alpha:$}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.numberRange(d.red,0,1)&&C.numberRange(d.green,0,1)&&C.numberRange(d.blue,0,1)&&C.numberRange(d.alpha,0,1)}g.is=k})(l||(e.Color=l={}));var p;(function(g){function E(y,d){return{range:y,color:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&l.is(d.color)}g.is=k})(p||(e.ColorInformation=p={}));var h;(function(g){function E(y,d,I){return{label:y,textEdit:d,additionalTextEdits:I}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.string(d.label)&&(C.undefined(d.textEdit)||N.is(d))&&(C.undefined(d.additionalTextEdits)||C.typedArray(d.additionalTextEdits,N.is))}g.is=k})(h||(e.ColorPresentation=h={}));var m;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(m||(e.FoldingRangeKind=m={}));var b;(function(g){function E(y,d,I,$,ge,yt){var Xe={startLine:y,endLine:d};return C.defined(I)&&(Xe.startCharacter=I),C.defined($)&&(Xe.endCharacter=$),C.defined(ge)&&(Xe.kind=ge),C.defined(yt)&&(Xe.collapsedText=yt),Xe}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.uinteger(d.startLine)&&C.uinteger(d.startLine)&&(C.undefined(d.startCharacter)||C.uinteger(d.startCharacter))&&(C.undefined(d.endCharacter)||C.uinteger(d.endCharacter))&&(C.undefined(d.kind)||C.string(d.kind))}g.is=k})(b||(e.FoldingRange=b={}));var v;(function(g){function E(y,d){return{location:y,message:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&u.is(d.location)&&C.string(d.message)}g.is=k})(v||(e.DiagnosticRelatedInformation=v={}));var R;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(R||(e.DiagnosticSeverity=R={}));var A;(function(g){g.Unnecessary=1,g.Deprecated=2})(A||(e.DiagnosticTag=A={}));var T;(function(g){function E(k){var y=k;return C.objectLiteral(y)&&C.string(y.href)}g.is=E})(T||(e.CodeDescription=T={}));var w;(function(g){function E(y,d,I,$,ge,yt){var Xe={range:y,message:d};return C.defined(I)&&(Xe.severity=I),C.defined($)&&(Xe.code=$),C.defined(ge)&&(Xe.source=ge),C.defined(yt)&&(Xe.relatedInformation=yt),Xe}g.create=E;function k(y){var d,I=y;return C.defined(I)&&a.is(I.range)&&C.string(I.message)&&(C.number(I.severity)||C.undefined(I.severity))&&(C.integer(I.code)||C.string(I.code)||C.undefined(I.code))&&(C.undefined(I.codeDescription)||C.string((d=I.codeDescription)===null||d===void 0?void 0:d.href))&&(C.string(I.source)||C.undefined(I.source))&&(C.undefined(I.relatedInformation)||C.typedArray(I.relatedInformation,v.is))}g.is=k})(w||(e.Diagnostic=w={}));var _;(function(g){function E(y,d){for(var I=[],$=2;$<arguments.length;$++)I[$-2]=arguments[$];var ge={title:y,command:d};return C.defined(I)&&I.length>0&&(ge.arguments=I),ge}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.title)&&C.string(d.command)}g.is=k})(_||(e.Command=_={}));var N;(function(g){function E(I,$){return{range:I,newText:$}}g.replace=E;function k(I,$){return{range:{start:I,end:I},newText:$}}g.insert=k;function y(I){return{range:I,newText:""}}g.del=y;function d(I){var $=I;return C.objectLiteral($)&&C.string($.newText)&&a.is($.range)}g.is=d})(N||(e.TextEdit=N={}));var O;(function(g){function E(y,d,I){var $={label:y};return d!==void 0&&($.needsConfirmation=d),I!==void 0&&($.description=I),$}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.string(d.label)&&(C.boolean(d.needsConfirmation)||d.needsConfirmation===void 0)&&(C.string(d.description)||d.description===void 0)}g.is=k})(O||(e.ChangeAnnotation=O={}));var G;(function(g){function E(k){var y=k;return C.string(y)}g.is=E})(G||(e.ChangeAnnotationIdentifier=G={}));var re;(function(g){function E(I,$,ge){return{range:I,newText:$,annotationId:ge}}g.replace=E;function k(I,$,ge){return{range:{start:I,end:I},newText:$,annotationId:ge}}g.insert=k;function y(I,$){return{range:I,newText:"",annotationId:$}}g.del=y;function d(I){var $=I;return N.is($)&&(O.is($.annotationId)||G.is($.annotationId))}g.is=d})(re||(e.AnnotatedTextEdit=re={}));var ae;(function(g){function E(y,d){return{textDocument:y,edits:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&je.is(d.textDocument)&&Array.isArray(d.edits)}g.is=k})(ae||(e.TextDocumentEdit=ae={}));var K;(function(g){function E(y,d,I){var $={kind:"create",uri:y};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&($.options=d),I!==void 0&&($.annotationId=I),$}g.create=E;function k(y){var d=y;return d&&d.kind==="create"&&C.string(d.uri)&&(d.options===void 0||(d.options.overwrite===void 0||C.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||C.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(K||(e.CreateFile=K={}));var P;(function(g){function E(y,d,I,$){var ge={kind:"rename",oldUri:y,newUri:d};return I!==void 0&&(I.overwrite!==void 0||I.ignoreIfExists!==void 0)&&(ge.options=I),$!==void 0&&(ge.annotationId=$),ge}g.create=E;function k(y){var d=y;return d&&d.kind==="rename"&&C.string(d.oldUri)&&C.string(d.newUri)&&(d.options===void 0||(d.options.overwrite===void 0||C.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||C.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(P||(e.RenameFile=P={}));var M;(function(g){function E(y,d,I){var $={kind:"delete",uri:y};return d!==void 0&&(d.recursive!==void 0||d.ignoreIfNotExists!==void 0)&&($.options=d),I!==void 0&&($.annotationId=I),$}g.create=E;function k(y){var d=y;return d&&d.kind==="delete"&&C.string(d.uri)&&(d.options===void 0||(d.options.recursive===void 0||C.boolean(d.options.recursive))&&(d.options.ignoreIfNotExists===void 0||C.boolean(d.options.ignoreIfNotExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(M||(e.DeleteFile=M={}));var L;(function(g){function E(k){var y=k;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(d){return C.string(d.kind)?K.is(d)||P.is(d)||M.is(d):ae.is(d)}))}g.is=E})(L||(e.WorkspaceEdit=L={}));var F=function(){function g(E,k){this.edits=E,this.changeAnnotations=k}return g.prototype.insert=function(E,k,y){var d,I;if(y===void 0?d=N.insert(E,k):G.is(y)?(I=y,d=re.insert(E,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(y),d=re.insert(E,k,I)),this.edits.push(d),I!==void 0)return I},g.prototype.replace=function(E,k,y){var d,I;if(y===void 0?d=N.replace(E,k):G.is(y)?(I=y,d=re.replace(E,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(y),d=re.replace(E,k,I)),this.edits.push(d),I!==void 0)return I},g.prototype.delete=function(E,k){var y,d;if(k===void 0?y=N.del(E):G.is(k)?(d=k,y=re.del(E,k)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(k),y=re.del(E,d)),this.edits.push(y),d!==void 0)return d},g.prototype.add=function(E){this.edits.push(E)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(E){if(E===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),he=function(){function g(E){this._annotations=E===void 0?Object.create(null):E,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(E,k){var y;if(G.is(E)?y=E:(y=this.nextId(),k=E),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(k===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=k,this._size++,y},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),ce=function(){function g(E){var k=this;this._textEditChanges=Object.create(null),E!==void 0?(this._workspaceEdit=E,E.documentChanges?(this._changeAnnotations=new he(E.changeAnnotations),E.changeAnnotations=this._changeAnnotations.all(),E.documentChanges.forEach(function(y){if(ae.is(y)){var d=new F(y.edits,k._changeAnnotations);k._textEditChanges[y.textDocument.uri]=d}})):E.changes&&Object.keys(E.changes).forEach(function(y){var d=new F(E.changes[y]);k._textEditChanges[y]=d})):this._workspaceEdit={}}return Object.defineProperty(g.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),g.prototype.getTextEditChange=function(E){if(je.is(E)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var k={uri:E.uri,version:E.version},y=this._textEditChanges[k.uri];if(!y){var d=[],I={textDocument:k,edits:d};this._workspaceEdit.documentChanges.push(I),y=new F(d,this._changeAnnotations),this._textEditChanges[k.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[E];if(!y){var d=[];this._workspaceEdit.changes[E]=d,y=new F(d),this._textEditChanges[E]=y}return y}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new he,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(E,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;O.is(k)||G.is(k)?d=k:y=k;var I,$;if(d===void 0?I=K.create(E,y):($=G.is(d)?d:this._changeAnnotations.manage(d),I=K.create(E,y,$)),this._workspaceEdit.documentChanges.push(I),$!==void 0)return $},g.prototype.renameFile=function(E,k,y,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var I;O.is(y)||G.is(y)?I=y:d=y;var $,ge;if(I===void 0?$=P.create(E,k,d):(ge=G.is(I)?I:this._changeAnnotations.manage(I),$=P.create(E,k,d,ge)),this._workspaceEdit.documentChanges.push($),ge!==void 0)return ge},g.prototype.deleteFile=function(E,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;O.is(k)||G.is(k)?d=k:y=k;var I,$;if(d===void 0?I=M.create(E,y):($=G.is(d)?d:this._changeAnnotations.manage(d),I=M.create(E,y,$)),this._workspaceEdit.documentChanges.push(I),$!==void 0)return $},g}();e.WorkspaceChange=ce;var $t;(function(g){function E(y){return{uri:y}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)}g.is=k})($t||(e.TextDocumentIdentifier=$t={}));var Et;(function(g){function E(y,d){return{uri:y,version:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&C.integer(d.version)}g.is=k})(Et||(e.VersionedTextDocumentIdentifier=Et={}));var je;(function(g){function E(y,d){return{uri:y,version:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&(d.version===null||C.integer(d.version))}g.is=k})(je||(e.OptionalVersionedTextDocumentIdentifier=je={}));var Rn;(function(g){function E(y,d,I,$){return{uri:y,languageId:d,version:I,text:$}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&C.string(d.languageId)&&C.integer(d.version)&&C.string(d.text)}g.is=k})(Rn||(e.TextDocumentItem=Rn={}));var Lo;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function E(k){var y=k;return y===g.PlainText||y===g.Markdown}g.is=E})(Lo||(e.MarkupKind=Lo={}));var Fs;(function(g){function E(k){var y=k;return C.objectLiteral(k)&&Lo.is(y.kind)&&C.string(y.value)}g.is=E})(Fs||(e.MarkupContent=Fs={}));var Ol;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(Ol||(e.CompletionItemKind=Ol={}));var yu;(function(g){g.PlainText=1,g.Snippet=2})(yu||(e.InsertTextFormat=yu={}));var bu;(function(g){g.Deprecated=1})(bu||(e.CompletionItemTag=bu={}));var Dl;(function(g){function E(y,d,I){return{newText:y,insert:d,replace:I}}g.create=E;function k(y){var d=y;return d&&C.string(d.newText)&&a.is(d.insert)&&a.is(d.replace)}g.is=k})(Dl||(e.InsertReplaceEdit=Dl={}));var Rl;(function(g){g.asIs=1,g.adjustIndentation=2})(Rl||(e.InsertTextMode=Rl={}));var Il;(function(g){function E(k){var y=k;return y&&(C.string(y.detail)||y.detail===void 0)&&(C.string(y.description)||y.description===void 0)}g.is=E})(Il||(e.CompletionItemLabelDetails=Il={}));var Cl;(function(g){function E(k){return{label:k}}g.create=E})(Cl||(e.CompletionItem=Cl={}));var Ml;(function(g){function E(k,y){return{items:k||[],isIncomplete:!!y}}g.create=E})(Ml||(e.CompletionList=Ml={}));var No;(function(g){function E(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=E;function k(y){var d=y;return C.string(d)||C.objectLiteral(d)&&C.string(d.language)&&C.string(d.value)}g.is=k})(No||(e.MarkedString=No={}));var Or;(function(g){function E(k){var y=k;return!!y&&C.objectLiteral(y)&&(Fs.is(y.contents)||No.is(y.contents)||C.typedArray(y.contents,No.is))&&(k.range===void 0||a.is(k.range))}g.is=E})(Or||(e.Hover=Or={}));var Ll;(function(g){function E(k,y){return y?{label:k,documentation:y}:{label:k}}g.create=E})(Ll||(e.ParameterInformation=Ll={}));var Nl;(function(g){function E(k,y){for(var d=[],I=2;I<arguments.length;I++)d[I-2]=arguments[I];var $={label:k};return C.defined(y)&&($.documentation=y),C.defined(d)?$.parameters=d:$.parameters=[],$}g.create=E})(Nl||(e.SignatureInformation=Nl={}));var Bs;(function(g){g.Text=1,g.Read=2,g.Write=3})(Bs||(e.DocumentHighlightKind=Bs={}));var ql;(function(g){function E(k,y){var d={range:k};return C.number(y)&&(d.kind=y),d}g.create=E})(ql||(e.DocumentHighlight=ql={}));var qo;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(qo||(e.SymbolKind=qo={}));var jl;(function(g){g.Deprecated=1})(jl||(e.SymbolTag=jl={}));var xi;(function(g){function E(k,y,d,I,$){var ge={name:k,kind:y,location:{uri:I,range:d}};return $&&(ge.containerName=$),ge}g.create=E})(xi||(e.SymbolInformation=xi={}));var Qi;(function(g){function E(k,y,d,I){return I!==void 0?{name:k,kind:y,location:{uri:d,range:I}}:{name:k,kind:y,location:{uri:d}}}g.create=E})(Qi||(e.WorkspaceSymbol=Qi={}));var Fl;(function(g){function E(y,d,I,$,ge,yt){var Xe={name:y,detail:d,kind:I,range:$,selectionRange:ge};return yt!==void 0&&(Xe.children=yt),Xe}g.create=E;function k(y){var d=y;return d&&C.string(d.name)&&C.number(d.kind)&&a.is(d.range)&&a.is(d.selectionRange)&&(d.detail===void 0||C.string(d.detail))&&(d.deprecated===void 0||C.boolean(d.deprecated))&&(d.children===void 0||Array.isArray(d.children))&&(d.tags===void 0||Array.isArray(d.tags))}g.is=k})(Fl||(e.DocumentSymbol=Fl={}));var Bl;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(Bl||(e.CodeActionKind=Bl={}));var Qr;(function(g){g.Invoked=1,g.Automatic=2})(Qr||(e.CodeActionTriggerKind=Qr={}));var _u;(function(g){function E(y,d,I){var $={diagnostics:y};return d!=null&&($.only=d),I!=null&&($.triggerKind=I),$}g.create=E;function k(y){var d=y;return C.defined(d)&&C.typedArray(d.diagnostics,w.is)&&(d.only===void 0||C.typedArray(d.only,C.string))&&(d.triggerKind===void 0||d.triggerKind===Qr.Invoked||d.triggerKind===Qr.Automatic)}g.is=k})(_u||(e.CodeActionContext=_u={}));var vu;(function(g){function E(y,d,I){var $={title:y},ge=!0;return typeof d=="string"?(ge=!1,$.kind=d):_.is(d)?$.command=d:$.edit=d,ge&&I!==void 0&&($.kind=I),$}g.create=E;function k(y){var d=y;return d&&C.string(d.title)&&(d.diagnostics===void 0||C.typedArray(d.diagnostics,w.is))&&(d.kind===void 0||C.string(d.kind))&&(d.edit!==void 0||d.command!==void 0)&&(d.command===void 0||_.is(d.command))&&(d.isPreferred===void 0||C.boolean(d.isPreferred))&&(d.edit===void 0||L.is(d.edit))}g.is=k})(vu||(e.CodeAction=vu={}));var jo;(function(g){function E(y,d){var I={range:y};return C.defined(d)&&(I.data=d),I}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(d.range)&&(C.undefined(d.command)||_.is(d.command))}g.is=k})(jo||(e.CodeLens=jo={}));var Su;(function(g){function E(y,d){return{tabSize:y,insertSpaces:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.uinteger(d.tabSize)&&C.boolean(d.insertSpaces)}g.is=k})(Su||(e.FormattingOptions=Su={}));var Ei;(function(g){function E(y,d,I){return{range:y,target:d,data:I}}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(d.range)&&(C.undefined(d.target)||C.string(d.target))}g.is=k})(Ei||(e.DocumentLink=Ei={}));var x;(function(g){function E(y,d){return{range:y,parent:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&(d.parent===void 0||g.is(d.parent))}g.is=k})(x||(e.SelectionRange=x={}));var B;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(B||(e.SemanticTokenTypes=B={}));var V;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var J;(function(g){function E(k){var y=k;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")}g.is=E})(J||(e.SemanticTokens=J={}));var We;(function(g){function E(y,d){return{range:y,text:d}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&C.string(d.text)}g.is=k})(We||(e.InlineValueText=We={}));var Le;(function(g){function E(y,d,I){return{range:y,variableName:d,caseSensitiveLookup:I}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&C.boolean(d.caseSensitiveLookup)&&(C.string(d.variableName)||d.variableName===void 0)}g.is=k})(Le||(e.InlineValueVariableLookup=Le={}));var Je;(function(g){function E(y,d){return{range:y,expression:d}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&(C.string(d.expression)||d.expression===void 0)}g.is=k})(Je||(e.InlineValueEvaluatableExpression=Je={}));var rt;(function(g){function E(y,d){return{frameId:y,stoppedLocation:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(y.stoppedLocation)}g.is=k})(rt||(e.InlineValueContext=rt={}));var xe;(function(g){g.Type=1,g.Parameter=2;function E(k){return k===1||k===2}g.is=E})(xe||(e.InlayHintKind=xe={}));var He;(function(g){function E(y){return{value:y}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&(d.tooltip===void 0||C.string(d.tooltip)||Fs.is(d.tooltip))&&(d.location===void 0||u.is(d.location))&&(d.command===void 0||_.is(d.command))}g.is=k})(He||(e.InlayHintLabelPart=He={}));var Re;(function(g){function E(y,d,I){var $={position:y,label:d};return I!==void 0&&($.kind=I),$}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&o.is(d.position)&&(C.string(d.label)||C.typedArray(d.label,He.is))&&(d.kind===void 0||xe.is(d.kind))&&d.textEdits===void 0||C.typedArray(d.textEdits,N.is)&&(d.tooltip===void 0||C.string(d.tooltip)||Fs.is(d.tooltip))&&(d.paddingLeft===void 0||C.boolean(d.paddingLeft))&&(d.paddingRight===void 0||C.boolean(d.paddingRight))}g.is=k})(Re||(e.InlayHint=Re={}));var mt;(function(g){function E(k){return{kind:"snippet",value:k}}g.createSnippet=E})(mt||(e.StringValue=mt={}));var Ut;(function(g){function E(k,y,d,I){return{insertText:k,filterText:y,range:d,command:I}}g.create=E})(Ut||(e.InlineCompletionItem=Ut={}));var Un;(function(g){function E(k){return{items:k}}g.create=E})(Un||(e.InlineCompletionList=Un={}));var $l;(function(g){g.Invoked=0,g.Automatic=1})($l||(e.InlineCompletionTriggerKind=$l={}));var C0;(function(g){function E(k,y){return{range:k,text:y}}g.create=E})(C0||(e.SelectedCompletionInfo=C0={}));var M0;(function(g){function E(k,y){return{triggerKind:k,selectedCompletionInfo:y}}g.create=E})(M0||(e.InlineCompletionContext=M0={}));var L0;(function(g){function E(k){var y=k;return C.objectLiteral(y)&&r.is(y.uri)&&C.string(y.name)}g.is=E})(L0||(e.WorkspaceFolder=L0={})),e.EOL=[`
|
31
|
+
`)),B){let J=x.error?` Request failed: ${x.error.message} (${x.error.code}).`:"";N.log(`Received response '${B.method} - (${x.id})' in ${Date.now()-B.timerStart}ms.${J}`,V)}else N.log(`Received response ${x.id} without active response promise.`,V)}else xi("receive-response",x)}function xi(x,B){if(!N||w===Me.Off)return;let V={isLSPMessage:!0,type:x,message:B,timestamp:Date.now()};N.log(V)}function Qi(){if(je())throw new Ho(ku.Closed,"Connection is closed.");if(Dn())throw new Ho(ku.Disposed,"Connection is disposed.")}function Fl(){if(Et())throw new Ho(ku.AlreadyListening,"Connection is already listening")}function Bl(){if(!Et())throw new Error("Call listen() first.")}function Qr(x){return x===void 0?null:x}function _u(x){if(x!==null)return x}function vu(x){return x!=null&&!Array.isArray(x)&&typeof x=="object"}function jo(x,B){switch(x){case ue.ParameterStructures.auto:return vu(B)?_u(B):[Qr(B)];case ue.ParameterStructures.byName:if(!vu(B))throw new Error("Received parameters by name but param is not an object literal.");return _u(B);case ue.ParameterStructures.byPosition:return[Qr(B)];default:throw new Error(`Unknown parameter structure ${x.toString()}`)}}function Su(x,B){let V,J=x.numberOfParams;switch(J){case 0:V=void 0;break;case 1:V=jo(x.parameterStructures,B[0]);break;default:V=[];for(let We=0;We<B.length&&We<J;We++)V.push(Qr(B[We]));if(B.length<J)for(let We=B.length;We<J;We++)V.push(null);break}return V}let Ei={sendNotification:(x,...B)=>{Qi();let V,J;if(pt.string(x)){V=x;let Le=B[0],Je=0,rt=ue.ParameterStructures.auto;ue.ParameterStructures.is(Le)&&(Je=1,rt=Le);let xe=B.length,He=xe-Je;switch(He){case 0:J=void 0;break;case 1:J=jo(rt,B[Je]);break;default:if(rt===ue.ParameterStructures.byName)throw new Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);J=B.slice(Je,xe).map(De=>Qr(De));break}}else{let Le=B;V=x.method,J=Su(x,Le)}let We={jsonrpc:u,method:V,params:J};return Nl(We),e.write(We).catch(Le=>{throw i.error("Sending notification failed."),Le})},onNotification:(x,B)=>{Qi();let V;return pt.func(x)?p=x:B&&(pt.string(x)?(V=x,h.set(x,{type:void 0,handler:B})):(V=x.method,h.set(x.method,{type:x,handler:B}))),{dispose:()=>{V!==void 0?h.delete(V):p=void 0}}},onProgress:(x,B,V)=>{if(m.has(B))throw new Error(`Progress handler for token ${B} already registered`);return m.set(B,V),{dispose:()=>{m.delete(B)}}},sendProgress:(x,B,V)=>Ei.sendNotification(Eu.type,{token:B,value:V}),onUnhandledProgress:K.event,sendRequest:(x,...B)=>{Qi(),Bl();let V,J,We;if(pt.string(x)){V=x;let xe=B[0],He=B[B.length-1],De=0,mt=ue.ParameterStructures.auto;ue.ParameterStructures.is(xe)&&(De=1,mt=xe);let Ut=B.length;ay.CancellationToken.is(He)&&(Ut=Ut-1,We=He);let Un=Ut-De;switch(Un){case 0:J=void 0;break;case 1:J=jo(mt,B[De]);break;default:if(mt===ue.ParameterStructures.byName)throw new Error(`Received ${Un} parameters for 'by Name' request parameter structure.`);J=B.slice(De,Ut).map($l=>Qr($l));break}}else{let xe=B;V=x.method,J=Su(x,xe);let He=x.numberOfParams;We=ay.CancellationToken.is(xe[He])?xe[He]:void 0}let Le=s++,Je;We&&(Je=We.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(Ei,Le);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Le}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${Le} failed`)})}));let rt={jsonrpc:u,id:Le,method:V,params:J};return Ll(rt),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(rt),new Promise(async(xe,He)=>{let De=Un=>{xe(Un),M.sender.cleanup(Le),Je?.dispose()},mt=Un=>{He(Un),M.sender.cleanup(Le),Je?.dispose()},Ut={method:V,timerStart:Date.now(),resolve:De,reject:mt};try{await e.write(rt),D.set(Le,Ut)}catch(Un){throw i.error("Sending request failed."),Ut.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,Un.message?Un.message:"Unknown reason")),Un}})},onRequest:(x,B)=>{Qi();let V=null;return ly.is(x)?(V=void 0,c=x):pt.string(x)?(V=null,B!==void 0&&(V=x,l.set(x,{handler:B,type:void 0}))):B!==void 0&&(V=x.method,l.set(x.method,{type:x,handler:B})),{dispose:()=>{V!==null&&(V!==void 0?l.delete(V):c=void 0)}}},hasPendingResponse:()=>D.size>0,trace:async(x,B,V)=>{let J=!1,We=Kn.Text;V!==void 0&&(pt.boolean(V)?J=V:(J=V.sendNotification||!1,We=V.traceFormat||Kn.Text)),w=x,_=We,w===Me.Off?N=void 0:N=B,J&&!je()&&!Dn()&&await Ei.sendNotification(py.type,{value:Me.toString(x)})},onError:G.event,onClose:re.event,onUnhandledNotification:ae.event,onDispose:P.event,end:()=>{e.end()},dispose:()=>{if(Dn())return;O=Ir.Disposed,P.fire(void 0);let x=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let B of D.values())B.reject(x);D=new Map,T=new Map,A=new Set,v=new ix.LinkedMap,pt.func(e.dispose)&&e.dispose(),pt.func(t.dispose)&&t.dispose()},listen:()=>{Qi(),Fl(),O=Ir.Listening,t.listen(Dl)},inspect:()=>{(0,rx.default)().console.log("inspect")}};return Ei.onNotification(ep.type,x=>{if(w===Me.Off||!N)return;let B=w===Me.Verbose||w===Me.Compact;N.log(x.message,B?x.verbose:void 0)}),Ei.onNotification(Eu.type,x=>{let B=m.get(x.token);B?B(x.value):K.fire(x)}),Ei}me.createMessageConnection=cL});var op=f(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ye=Fm();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var fy=$m();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return fy.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return fy.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return fy.Touch}});var lL=H0();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return lL.Disposable}});var ux=Uo();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return ux.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return ux.Emitter}});var cx=Xl();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return cx.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return cx.CancellationToken}});var lx=z0();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return lx.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return lx.SharedArrayReceiverStrategy}});var gy=Y0();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return gy.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return gy.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return gy.ReadableStreamMessageReader}});var my=tx();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return my.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return my.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return my.WriteableStreamMessageWriter}});var pL=nx();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return pL.AbstractMessageBuffer}});var Qt=ax();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Qt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Qt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Qt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Qt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Qt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Qt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Qt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Qt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Qt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Qt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Qt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Qt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Qt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Qt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Qt.MessageStrategy}});var hL=es();q.RAL=hL.default});var dx=f(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var px=require("util"),Ai=op(),ap=class t extends Ai.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new px.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};ap.emptyBuffer=Buffer.allocUnsafe(0);var yy=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ai.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ai.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ai.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Ai.Disposable.create(()=>this.stream.off("data",e))}},by=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ai.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ai.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ai.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},hx=Object.freeze({messageBuffer:Object.freeze({create:t=>new ap(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new px.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new yy(t),asWritableStream:t=>new by(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function _y(){return hx}(function(t){function e(){Ai.RAL.install(hx)}t.install=e})(_y||(_y={}));vy.default=_y});var Ws=f(Ae=>{"use strict";var dL=Ae&&Ae.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),fL=Ae&&Ae.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&dL(e,t,n)};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createMessageConnection=Ae.createServerSocketTransport=Ae.createClientSocketTransport=Ae.createServerPipeTransport=Ae.createClientPipeTransport=Ae.generateRandomPipeName=Ae.StreamMessageWriter=Ae.StreamMessageReader=Ae.SocketMessageWriter=Ae.SocketMessageReader=Ae.PortMessageWriter=Ae.PortMessageReader=Ae.IPCMessageWriter=Ae.IPCMessageReader=void 0;var Vo=dx();Vo.default.install();var fx=require("path"),gL=require("os"),mL=require("crypto"),lp=require("net"),Wn=op();fL(op(),Ae);var Sy=class extends Wn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Wn.Disposable.create(()=>this.process.off("message",e))}};Ae.IPCMessageReader=Sy;var Ty=class extends Wn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ae.IPCMessageWriter=Ty;var wy=class extends Wn.AbstractMessageReader{constructor(e){super(),this.onData=new Wn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};Ae.PortMessageReader=wy;var xy=class extends Wn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ae.PortMessageWriter=xy;var Us=class extends Wn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Vo.default)().stream.asReadableStream(e),n)}};Ae.SocketMessageReader=Us;var Ks=class extends Wn.WriteableStreamMessageWriter{constructor(e,n){super((0,Vo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ae.SocketMessageWriter=Ks;var up=class extends Wn.ReadableStreamMessageReader{constructor(e,n){super((0,Vo.default)().stream.asReadableStream(e),n)}};Ae.StreamMessageReader=up;var cp=class extends Wn.WriteableStreamMessageWriter{constructor(e,n){super((0,Vo.default)().stream.asWritableStream(e),n)}};Ae.StreamMessageWriter=cp;var gx=process.env.XDG_RUNTIME_DIR,yL=new Map([["linux",107],["darwin",103]]);function bL(){let t=(0,mL.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gx?e=fx.join(gx,`vscode-ipc-${t}.sock`):e=fx.join(gL.tmpdir(),`vscode-${t}.sock`);let n=yL.get(process.platform);return n!==void 0&&e.length>n&&(0,Vo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ae.generateRandomPipeName=bL;function _L(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,lp.createServer)(a=>{o.close(),n([new Us(a,e),new Ks(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientPipeTransport=_L;function vL(t,e="utf-8"){let n=(0,lp.createConnection)(t);return[new Us(n,e),new Ks(n,e)]}Ae.createServerPipeTransport=vL;function SL(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,lp.createServer)(a=>{o.close(),n([new Us(a,e),new Ks(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ae.createClientSocketTransport=SL;function TL(t,e="utf-8"){let n=(0,lp.createConnection)(t,"127.0.0.1");return[new Us(n,e),new Ks(n,e)]}Ae.createServerSocketTransport=TL;function wL(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function xL(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function EL(t,e,n,r){n||(n=Wn.NullLogger);let i=wL(t)?new up(t):t,s=xL(e)?new cp(e):e;return Wn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Wn.createMessageConnection)(i,s,n,r)}Ae.createMessageConnection=EL});var Ey=f((Az,mx)=>{"use strict";mx.exports=Ws()});var hp=f((yx,pp)=>{(function(t){if(typeof pp=="object"&&typeof pp.exports=="object"){var e=t(require,yx);e!==void 0&&(pp.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(g){function E(k){return typeof k=="string"}g.is=E})(n||(e.DocumentUri=n={}));var r;(function(g){function E(k){return typeof k=="string"}g.is=E})(r||(e.URI=r={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function E(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=E})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function E(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=E})(s||(e.uinteger=s={}));var o;(function(g){function E(y,d){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),d===Number.MAX_VALUE&&(d=s.MAX_VALUE),{line:y,character:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.uinteger(d.line)&&C.uinteger(d.character)}g.is=k})(o||(e.Position=o={}));var a;(function(g){function E(y,d,I,$){if(C.uinteger(y)&&C.uinteger(d)&&C.uinteger(I)&&C.uinteger($))return{start:o.create(y,d),end:o.create(I,$)};if(o.is(y)&&o.is(d))return{start:y,end:d};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(d,", ").concat(I,", ").concat($,"]"))}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&o.is(d.start)&&o.is(d.end)}g.is=k})(a||(e.Range=a={}));var u;(function(g){function E(y,d){return{uri:y,range:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&(C.string(d.uri)||C.undefined(d.uri))}g.is=k})(u||(e.Location=u={}));var c;(function(g){function E(y,d,I,$){return{targetUri:y,targetRange:d,targetSelectionRange:I,originSelectionRange:$}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.targetRange)&&C.string(d.targetUri)&&a.is(d.targetSelectionRange)&&(a.is(d.originSelectionRange)||C.undefined(d.originSelectionRange))}g.is=k})(c||(e.LocationLink=c={}));var l;(function(g){function E(y,d,I,$){return{red:y,green:d,blue:I,alpha:$}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.numberRange(d.red,0,1)&&C.numberRange(d.green,0,1)&&C.numberRange(d.blue,0,1)&&C.numberRange(d.alpha,0,1)}g.is=k})(l||(e.Color=l={}));var p;(function(g){function E(y,d){return{range:y,color:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&l.is(d.color)}g.is=k})(p||(e.ColorInformation=p={}));var h;(function(g){function E(y,d,I){return{label:y,textEdit:d,additionalTextEdits:I}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.string(d.label)&&(C.undefined(d.textEdit)||N.is(d))&&(C.undefined(d.additionalTextEdits)||C.typedArray(d.additionalTextEdits,N.is))}g.is=k})(h||(e.ColorPresentation=h={}));var m;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(m||(e.FoldingRangeKind=m={}));var b;(function(g){function E(y,d,I,$,ge,yt){var Xe={startLine:y,endLine:d};return C.defined(I)&&(Xe.startCharacter=I),C.defined($)&&(Xe.endCharacter=$),C.defined(ge)&&(Xe.kind=ge),C.defined(yt)&&(Xe.collapsedText=yt),Xe}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.uinteger(d.startLine)&&C.uinteger(d.startLine)&&(C.undefined(d.startCharacter)||C.uinteger(d.startCharacter))&&(C.undefined(d.endCharacter)||C.uinteger(d.endCharacter))&&(C.undefined(d.kind)||C.string(d.kind))}g.is=k})(b||(e.FoldingRange=b={}));var v;(function(g){function E(y,d){return{location:y,message:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&u.is(d.location)&&C.string(d.message)}g.is=k})(v||(e.DiagnosticRelatedInformation=v={}));var D;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(D||(e.DiagnosticSeverity=D={}));var A;(function(g){g.Unnecessary=1,g.Deprecated=2})(A||(e.DiagnosticTag=A={}));var T;(function(g){function E(k){var y=k;return C.objectLiteral(y)&&C.string(y.href)}g.is=E})(T||(e.CodeDescription=T={}));var w;(function(g){function E(y,d,I,$,ge,yt){var Xe={range:y,message:d};return C.defined(I)&&(Xe.severity=I),C.defined($)&&(Xe.code=$),C.defined(ge)&&(Xe.source=ge),C.defined(yt)&&(Xe.relatedInformation=yt),Xe}g.create=E;function k(y){var d,I=y;return C.defined(I)&&a.is(I.range)&&C.string(I.message)&&(C.number(I.severity)||C.undefined(I.severity))&&(C.integer(I.code)||C.string(I.code)||C.undefined(I.code))&&(C.undefined(I.codeDescription)||C.string((d=I.codeDescription)===null||d===void 0?void 0:d.href))&&(C.string(I.source)||C.undefined(I.source))&&(C.undefined(I.relatedInformation)||C.typedArray(I.relatedInformation,v.is))}g.is=k})(w||(e.Diagnostic=w={}));var _;(function(g){function E(y,d){for(var I=[],$=2;$<arguments.length;$++)I[$-2]=arguments[$];var ge={title:y,command:d};return C.defined(I)&&I.length>0&&(ge.arguments=I),ge}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.title)&&C.string(d.command)}g.is=k})(_||(e.Command=_={}));var N;(function(g){function E(I,$){return{range:I,newText:$}}g.replace=E;function k(I,$){return{range:{start:I,end:I},newText:$}}g.insert=k;function y(I){return{range:I,newText:""}}g.del=y;function d(I){var $=I;return C.objectLiteral($)&&C.string($.newText)&&a.is($.range)}g.is=d})(N||(e.TextEdit=N={}));var O;(function(g){function E(y,d,I){var $={label:y};return d!==void 0&&($.needsConfirmation=d),I!==void 0&&($.description=I),$}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&C.string(d.label)&&(C.boolean(d.needsConfirmation)||d.needsConfirmation===void 0)&&(C.string(d.description)||d.description===void 0)}g.is=k})(O||(e.ChangeAnnotation=O={}));var G;(function(g){function E(k){var y=k;return C.string(y)}g.is=E})(G||(e.ChangeAnnotationIdentifier=G={}));var re;(function(g){function E(I,$,ge){return{range:I,newText:$,annotationId:ge}}g.replace=E;function k(I,$,ge){return{range:{start:I,end:I},newText:$,annotationId:ge}}g.insert=k;function y(I,$){return{range:I,newText:"",annotationId:$}}g.del=y;function d(I){var $=I;return N.is($)&&(O.is($.annotationId)||G.is($.annotationId))}g.is=d})(re||(e.AnnotatedTextEdit=re={}));var ae;(function(g){function E(y,d){return{textDocument:y,edits:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&je.is(d.textDocument)&&Array.isArray(d.edits)}g.is=k})(ae||(e.TextDocumentEdit=ae={}));var K;(function(g){function E(y,d,I){var $={kind:"create",uri:y};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&($.options=d),I!==void 0&&($.annotationId=I),$}g.create=E;function k(y){var d=y;return d&&d.kind==="create"&&C.string(d.uri)&&(d.options===void 0||(d.options.overwrite===void 0||C.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||C.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(K||(e.CreateFile=K={}));var P;(function(g){function E(y,d,I,$){var ge={kind:"rename",oldUri:y,newUri:d};return I!==void 0&&(I.overwrite!==void 0||I.ignoreIfExists!==void 0)&&(ge.options=I),$!==void 0&&(ge.annotationId=$),ge}g.create=E;function k(y){var d=y;return d&&d.kind==="rename"&&C.string(d.oldUri)&&C.string(d.newUri)&&(d.options===void 0||(d.options.overwrite===void 0||C.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||C.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(P||(e.RenameFile=P={}));var M;(function(g){function E(y,d,I){var $={kind:"delete",uri:y};return d!==void 0&&(d.recursive!==void 0||d.ignoreIfNotExists!==void 0)&&($.options=d),I!==void 0&&($.annotationId=I),$}g.create=E;function k(y){var d=y;return d&&d.kind==="delete"&&C.string(d.uri)&&(d.options===void 0||(d.options.recursive===void 0||C.boolean(d.options.recursive))&&(d.options.ignoreIfNotExists===void 0||C.boolean(d.options.ignoreIfNotExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}g.is=k})(M||(e.DeleteFile=M={}));var L;(function(g){function E(k){var y=k;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(d){return C.string(d.kind)?K.is(d)||P.is(d)||M.is(d):ae.is(d)}))}g.is=E})(L||(e.WorkspaceEdit=L={}));var F=function(){function g(E,k){this.edits=E,this.changeAnnotations=k}return g.prototype.insert=function(E,k,y){var d,I;if(y===void 0?d=N.insert(E,k):G.is(y)?(I=y,d=re.insert(E,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(y),d=re.insert(E,k,I)),this.edits.push(d),I!==void 0)return I},g.prototype.replace=function(E,k,y){var d,I;if(y===void 0?d=N.replace(E,k):G.is(y)?(I=y,d=re.replace(E,k,y)):(this.assertChangeAnnotations(this.changeAnnotations),I=this.changeAnnotations.manage(y),d=re.replace(E,k,I)),this.edits.push(d),I!==void 0)return I},g.prototype.delete=function(E,k){var y,d;if(k===void 0?y=N.del(E):G.is(k)?(d=k,y=re.del(E,k)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(k),y=re.del(E,d)),this.edits.push(y),d!==void 0)return d},g.prototype.add=function(E){this.edits.push(E)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(E){if(E===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),he=function(){function g(E){this._annotations=E===void 0?Object.create(null):E,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(E,k){var y;if(G.is(E)?y=E:(y=this.nextId(),k=E),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(k===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=k,this._size++,y},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),ce=function(){function g(E){var k=this;this._textEditChanges=Object.create(null),E!==void 0?(this._workspaceEdit=E,E.documentChanges?(this._changeAnnotations=new he(E.changeAnnotations),E.changeAnnotations=this._changeAnnotations.all(),E.documentChanges.forEach(function(y){if(ae.is(y)){var d=new F(y.edits,k._changeAnnotations);k._textEditChanges[y.textDocument.uri]=d}})):E.changes&&Object.keys(E.changes).forEach(function(y){var d=new F(E.changes[y]);k._textEditChanges[y]=d})):this._workspaceEdit={}}return Object.defineProperty(g.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),g.prototype.getTextEditChange=function(E){if(je.is(E)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var k={uri:E.uri,version:E.version},y=this._textEditChanges[k.uri];if(!y){var d=[],I={textDocument:k,edits:d};this._workspaceEdit.documentChanges.push(I),y=new F(d,this._changeAnnotations),this._textEditChanges[k.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[E];if(!y){var d=[];this._workspaceEdit.changes[E]=d,y=new F(d),this._textEditChanges[E]=y}return y}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new he,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(E,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;O.is(k)||G.is(k)?d=k:y=k;var I,$;if(d===void 0?I=K.create(E,y):($=G.is(d)?d:this._changeAnnotations.manage(d),I=K.create(E,y,$)),this._workspaceEdit.documentChanges.push(I),$!==void 0)return $},g.prototype.renameFile=function(E,k,y,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var I;O.is(y)||G.is(y)?I=y:d=y;var $,ge;if(I===void 0?$=P.create(E,k,d):(ge=G.is(I)?I:this._changeAnnotations.manage(I),$=P.create(E,k,d,ge)),this._workspaceEdit.documentChanges.push($),ge!==void 0)return ge},g.prototype.deleteFile=function(E,k,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;O.is(k)||G.is(k)?d=k:y=k;var I,$;if(d===void 0?I=M.create(E,y):($=G.is(d)?d:this._changeAnnotations.manage(d),I=M.create(E,y,$)),this._workspaceEdit.documentChanges.push(I),$!==void 0)return $},g}();e.WorkspaceChange=ce;var $t;(function(g){function E(y){return{uri:y}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)}g.is=k})($t||(e.TextDocumentIdentifier=$t={}));var Et;(function(g){function E(y,d){return{uri:y,version:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&C.integer(d.version)}g.is=k})(Et||(e.VersionedTextDocumentIdentifier=Et={}));var je;(function(g){function E(y,d){return{uri:y,version:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&(d.version===null||C.integer(d.version))}g.is=k})(je||(e.OptionalVersionedTextDocumentIdentifier=je={}));var Dn;(function(g){function E(y,d,I,$){return{uri:y,languageId:d,version:I,text:$}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.string(d.uri)&&C.string(d.languageId)&&C.integer(d.version)&&C.string(d.text)}g.is=k})(Dn||(e.TextDocumentItem=Dn={}));var Lo;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function E(k){var y=k;return y===g.PlainText||y===g.Markdown}g.is=E})(Lo||(e.MarkupKind=Lo={}));var Fs;(function(g){function E(k){var y=k;return C.objectLiteral(k)&&Lo.is(y.kind)&&C.string(y.value)}g.is=E})(Fs||(e.MarkupContent=Fs={}));var Ol;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(Ol||(e.CompletionItemKind=Ol={}));var yu;(function(g){g.PlainText=1,g.Snippet=2})(yu||(e.InsertTextFormat=yu={}));var bu;(function(g){g.Deprecated=1})(bu||(e.CompletionItemTag=bu={}));var Rl;(function(g){function E(y,d,I){return{newText:y,insert:d,replace:I}}g.create=E;function k(y){var d=y;return d&&C.string(d.newText)&&a.is(d.insert)&&a.is(d.replace)}g.is=k})(Rl||(e.InsertReplaceEdit=Rl={}));var Dl;(function(g){g.asIs=1,g.adjustIndentation=2})(Dl||(e.InsertTextMode=Dl={}));var Il;(function(g){function E(k){var y=k;return y&&(C.string(y.detail)||y.detail===void 0)&&(C.string(y.description)||y.description===void 0)}g.is=E})(Il||(e.CompletionItemLabelDetails=Il={}));var Cl;(function(g){function E(k){return{label:k}}g.create=E})(Cl||(e.CompletionItem=Cl={}));var Ml;(function(g){function E(k,y){return{items:k||[],isIncomplete:!!y}}g.create=E})(Ml||(e.CompletionList=Ml={}));var No;(function(g){function E(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=E;function k(y){var d=y;return C.string(d)||C.objectLiteral(d)&&C.string(d.language)&&C.string(d.value)}g.is=k})(No||(e.MarkedString=No={}));var Or;(function(g){function E(k){var y=k;return!!y&&C.objectLiteral(y)&&(Fs.is(y.contents)||No.is(y.contents)||C.typedArray(y.contents,No.is))&&(k.range===void 0||a.is(k.range))}g.is=E})(Or||(e.Hover=Or={}));var Ll;(function(g){function E(k,y){return y?{label:k,documentation:y}:{label:k}}g.create=E})(Ll||(e.ParameterInformation=Ll={}));var Nl;(function(g){function E(k,y){for(var d=[],I=2;I<arguments.length;I++)d[I-2]=arguments[I];var $={label:k};return C.defined(y)&&($.documentation=y),C.defined(d)?$.parameters=d:$.parameters=[],$}g.create=E})(Nl||(e.SignatureInformation=Nl={}));var Bs;(function(g){g.Text=1,g.Read=2,g.Write=3})(Bs||(e.DocumentHighlightKind=Bs={}));var ql;(function(g){function E(k,y){var d={range:k};return C.number(y)&&(d.kind=y),d}g.create=E})(ql||(e.DocumentHighlight=ql={}));var qo;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(qo||(e.SymbolKind=qo={}));var jl;(function(g){g.Deprecated=1})(jl||(e.SymbolTag=jl={}));var xi;(function(g){function E(k,y,d,I,$){var ge={name:k,kind:y,location:{uri:I,range:d}};return $&&(ge.containerName=$),ge}g.create=E})(xi||(e.SymbolInformation=xi={}));var Qi;(function(g){function E(k,y,d,I){return I!==void 0?{name:k,kind:y,location:{uri:d,range:I}}:{name:k,kind:y,location:{uri:d}}}g.create=E})(Qi||(e.WorkspaceSymbol=Qi={}));var Fl;(function(g){function E(y,d,I,$,ge,yt){var Xe={name:y,detail:d,kind:I,range:$,selectionRange:ge};return yt!==void 0&&(Xe.children=yt),Xe}g.create=E;function k(y){var d=y;return d&&C.string(d.name)&&C.number(d.kind)&&a.is(d.range)&&a.is(d.selectionRange)&&(d.detail===void 0||C.string(d.detail))&&(d.deprecated===void 0||C.boolean(d.deprecated))&&(d.children===void 0||Array.isArray(d.children))&&(d.tags===void 0||Array.isArray(d.tags))}g.is=k})(Fl||(e.DocumentSymbol=Fl={}));var Bl;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(Bl||(e.CodeActionKind=Bl={}));var Qr;(function(g){g.Invoked=1,g.Automatic=2})(Qr||(e.CodeActionTriggerKind=Qr={}));var _u;(function(g){function E(y,d,I){var $={diagnostics:y};return d!=null&&($.only=d),I!=null&&($.triggerKind=I),$}g.create=E;function k(y){var d=y;return C.defined(d)&&C.typedArray(d.diagnostics,w.is)&&(d.only===void 0||C.typedArray(d.only,C.string))&&(d.triggerKind===void 0||d.triggerKind===Qr.Invoked||d.triggerKind===Qr.Automatic)}g.is=k})(_u||(e.CodeActionContext=_u={}));var vu;(function(g){function E(y,d,I){var $={title:y},ge=!0;return typeof d=="string"?(ge=!1,$.kind=d):_.is(d)?$.command=d:$.edit=d,ge&&I!==void 0&&($.kind=I),$}g.create=E;function k(y){var d=y;return d&&C.string(d.title)&&(d.diagnostics===void 0||C.typedArray(d.diagnostics,w.is))&&(d.kind===void 0||C.string(d.kind))&&(d.edit!==void 0||d.command!==void 0)&&(d.command===void 0||_.is(d.command))&&(d.isPreferred===void 0||C.boolean(d.isPreferred))&&(d.edit===void 0||L.is(d.edit))}g.is=k})(vu||(e.CodeAction=vu={}));var jo;(function(g){function E(y,d){var I={range:y};return C.defined(d)&&(I.data=d),I}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(d.range)&&(C.undefined(d.command)||_.is(d.command))}g.is=k})(jo||(e.CodeLens=jo={}));var Su;(function(g){function E(y,d){return{tabSize:y,insertSpaces:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&C.uinteger(d.tabSize)&&C.boolean(d.insertSpaces)}g.is=k})(Su||(e.FormattingOptions=Su={}));var Ei;(function(g){function E(y,d,I){return{range:y,target:d,data:I}}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(d.range)&&(C.undefined(d.target)||C.string(d.target))}g.is=k})(Ei||(e.DocumentLink=Ei={}));var x;(function(g){function E(y,d){return{range:y,parent:d}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&a.is(d.range)&&(d.parent===void 0||g.is(d.parent))}g.is=k})(x||(e.SelectionRange=x={}));var B;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(B||(e.SemanticTokenTypes=B={}));var V;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var J;(function(g){function E(k){var y=k;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")}g.is=E})(J||(e.SemanticTokens=J={}));var We;(function(g){function E(y,d){return{range:y,text:d}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&C.string(d.text)}g.is=k})(We||(e.InlineValueText=We={}));var Le;(function(g){function E(y,d,I){return{range:y,variableName:d,caseSensitiveLookup:I}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&C.boolean(d.caseSensitiveLookup)&&(C.string(d.variableName)||d.variableName===void 0)}g.is=k})(Le||(e.InlineValueVariableLookup=Le={}));var Je;(function(g){function E(y,d){return{range:y,expression:d}}g.create=E;function k(y){var d=y;return d!=null&&a.is(d.range)&&(C.string(d.expression)||d.expression===void 0)}g.is=k})(Je||(e.InlineValueEvaluatableExpression=Je={}));var rt;(function(g){function E(y,d){return{frameId:y,stoppedLocation:d}}g.create=E;function k(y){var d=y;return C.defined(d)&&a.is(y.stoppedLocation)}g.is=k})(rt||(e.InlineValueContext=rt={}));var xe;(function(g){g.Type=1,g.Parameter=2;function E(k){return k===1||k===2}g.is=E})(xe||(e.InlayHintKind=xe={}));var He;(function(g){function E(y){return{value:y}}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&(d.tooltip===void 0||C.string(d.tooltip)||Fs.is(d.tooltip))&&(d.location===void 0||u.is(d.location))&&(d.command===void 0||_.is(d.command))}g.is=k})(He||(e.InlayHintLabelPart=He={}));var De;(function(g){function E(y,d,I){var $={position:y,label:d};return I!==void 0&&($.kind=I),$}g.create=E;function k(y){var d=y;return C.objectLiteral(d)&&o.is(d.position)&&(C.string(d.label)||C.typedArray(d.label,He.is))&&(d.kind===void 0||xe.is(d.kind))&&d.textEdits===void 0||C.typedArray(d.textEdits,N.is)&&(d.tooltip===void 0||C.string(d.tooltip)||Fs.is(d.tooltip))&&(d.paddingLeft===void 0||C.boolean(d.paddingLeft))&&(d.paddingRight===void 0||C.boolean(d.paddingRight))}g.is=k})(De||(e.InlayHint=De={}));var mt;(function(g){function E(k){return{kind:"snippet",value:k}}g.createSnippet=E})(mt||(e.StringValue=mt={}));var Ut;(function(g){function E(k,y,d,I){return{insertText:k,filterText:y,range:d,command:I}}g.create=E})(Ut||(e.InlineCompletionItem=Ut={}));var Un;(function(g){function E(k){return{items:k}}g.create=E})(Un||(e.InlineCompletionList=Un={}));var $l;(function(g){g.Invoked=0,g.Automatic=1})($l||(e.InlineCompletionTriggerKind=$l={}));var C0;(function(g){function E(k,y){return{range:k,text:y}}g.create=E})(C0||(e.SelectedCompletionInfo=C0={}));var M0;(function(g){function E(k,y){return{triggerKind:k,selectedCompletionInfo:y}}g.create=E})(M0||(e.InlineCompletionContext=M0={}));var L0;(function(g){function E(k){var y=k;return C.objectLiteral(y)&&r.is(y.uri)&&C.string(y.name)}g.is=E})(L0||(e.WorkspaceFolder=L0={})),e.EOL=[`
|
32
32
|
`,`\r
|
33
|
-
`,"\r"];var N0;(function(g){function E(I,$,ge,yt){return new IM(I,$,ge,yt)}g.create=E;function k(I){var $=I;return!!(C.defined($)&&C.string($.uri)&&(C.undefined($.languageId)||C.string($.languageId))&&C.uinteger($.lineCount)&&C.func($.getText)&&C.func($.positionAt)&&C.func($.offsetAt))}g.is=k;function y(I,$){for(var ge=I.getText(),yt=d($,function(Fo,Ul){var q0=Fo.range.start.line-Ul.range.start.line;return q0===0?Fo.range.start.character-Ul.range.start.character:q0}),Xe=ge.length,
|
33
|
+
`,"\r"];var N0;(function(g){function E(I,$,ge,yt){return new IM(I,$,ge,yt)}g.create=E;function k(I){var $=I;return!!(C.defined($)&&C.string($.uri)&&(C.undefined($.languageId)||C.string($.languageId))&&C.uinteger($.lineCount)&&C.func($.getText)&&C.func($.positionAt)&&C.func($.offsetAt))}g.is=k;function y(I,$){for(var ge=I.getText(),yt=d($,function(Fo,Ul){var q0=Fo.range.start.line-Ul.range.start.line;return q0===0?Fo.range.start.character-Ul.range.start.character:q0}),Xe=ge.length,Rr=yt.length-1;Rr>=0;Rr--){var Dr=yt[Rr],ki=I.offsetAt(Dr.range.start),ke=I.offsetAt(Dr.range.end);if(ke<=Xe)ge=ge.substring(0,ki)+Dr.newText+ge.substring(ke,ge.length);else throw new Error("Overlapping edit");Xe=ki}return ge}g.applyEdits=y;function d(I,$){if(I.length<=1)return I;var ge=I.length/2|0,yt=I.slice(0,ge),Xe=I.slice(ge);d(yt,$),d(Xe,$);for(var Rr=0,Dr=0,ki=0;Rr<yt.length&&Dr<Xe.length;){var ke=$(yt[Rr],Xe[Dr]);ke<=0?I[ki++]=yt[Rr++]:I[ki++]=Xe[Dr++]}for(;Rr<yt.length;)I[ki++]=yt[Rr++];for(;Dr<Xe.length;)I[ki++]=Xe[Dr++];return I}})(N0||(e.TextDocument=N0={}));var IM=function(){function g(E,k,y,d){this._uri=E,this._languageId=k,this._version=y,this._content=d,this._lineOffsets=void 0}return Object.defineProperty(g.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),g.prototype.getText=function(E){if(E){var k=this.offsetAt(E.start),y=this.offsetAt(E.end);return this._content.substring(k,y)}return this._content},g.prototype.update=function(E,k){this._content=E.text,this._version=k,this._lineOffsets=void 0},g.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var E=[],k=this._content,y=!0,d=0;d<k.length;d++){y&&(E.push(d),y=!1);var I=k.charAt(d);y=I==="\r"||I===`
|
34
34
|
`,I==="\r"&&d+1<k.length&&k.charAt(d+1)===`
|
35
|
-
`&&d++}y&&k.length>0&&E.push(k.length),this._lineOffsets=E}return this._lineOffsets},g.prototype.positionAt=function(E){E=Math.max(Math.min(E,this._content.length),0);var k=this.getLineOffsets(),y=0,d=k.length;if(d===0)return o.create(0,E);for(;y<d;){var I=Math.floor((y+d)/2);k[I]>E?d=I:y=I+1}var $=y-1;return o.create($,E-k[$])},g.prototype.offsetAt=function(E){var k=this.getLineOffsets();if(E.line>=k.length)return this._content.length;if(E.line<0)return 0;var y=k[E.line],d=E.line+1<k.length?k[E.line+1]:this._content.length;return Math.max(Math.min(y+E.character,d),y)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),C;(function(g){var E=Object.prototype.toString;function k(ke){return typeof ke<"u"}g.defined=k;function y(ke){return typeof ke>"u"}g.undefined=y;function d(ke){return ke===!0||ke===!1}g.boolean=d;function I(ke){return E.call(ke)==="[object String]"}g.string=I;function $(ke){return E.call(ke)==="[object Number]"}g.number=$;function ge(ke,Fo,Ul){return E.call(ke)==="[object Number]"&&Fo<=ke&&ke<=Ul}g.numberRange=ge;function yt(ke){return E.call(ke)==="[object Number]"&&-2147483648<=ke&&ke<=2147483647}g.integer=yt;function Xe(ke){return E.call(ke)==="[object Number]"&&0<=ke&&ke<=2147483647}g.uinteger=Xe;function Dr(ke){return E.call(ke)==="[object Function]"}g.func=Dr;function Rr(ke){return ke!==null&&typeof ke=="object"}g.objectLiteral=Rr;function ki(ke,Fo){return Array.isArray(ke)&&ke.every(Fo)}g.typedArray=ki})(C||(C={}))})});var it=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ProtocolNotificationType=Cn.ProtocolNotificationType0=Cn.ProtocolRequestType=Cn.ProtocolRequestType0=Cn.RegistrationType=Cn.MessageDirection=void 0;var zo=Ws(),bx;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(bx||(Cn.MessageDirection=bx={}));var ky=class{constructor(e){this.method=e}};Cn.RegistrationType=ky;var Ay=class extends zo.RequestType0{constructor(e){super(e)}};Cn.ProtocolRequestType0=Ay;var Py=class extends zo.RequestType{constructor(e){super(e,zo.ParameterStructures.byName)}};Cn.ProtocolRequestType=Py;var Oy=class extends zo.NotificationType0{constructor(e){super(e)}};Cn.ProtocolNotificationType0=Oy;var Dy=class extends zo.NotificationType{constructor(e){super(e,zo.ParameterStructures.byName)}};Cn.ProtocolNotificationType=Dy});var dp=f(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.objectLiteral=It.typedArray=It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function kL(t){return t===!0||t===!1}It.boolean=kL;function _x(t){return typeof t=="string"||t instanceof String}It.string=_x;function AL(t){return typeof t=="number"||t instanceof Number}It.number=AL;function PL(t){return t instanceof Error}It.error=PL;function OL(t){return typeof t=="function"}It.func=OL;function vx(t){return Array.isArray(t)}It.array=vx;function DL(t){return vx(t)&&t.every(e=>_x(e))}It.stringArray=DL;function RL(t,e){return Array.isArray(t)&&t.every(e)}It.typedArray=RL;function IL(t){return t!==null&&typeof t=="object"}It.objectLiteral=IL});var wx=f(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ImplementationRequest=void 0;var Sx=it(),Tx;(function(t){t.method="textDocument/implementation",t.messageDirection=Sx.MessageDirection.clientToServer,t.type=new Sx.ProtocolRequestType(t.method)})(Tx||(fp.ImplementationRequest=Tx={}))});var kx=f(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.TypeDefinitionRequest=void 0;var xx=it(),Ex;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=xx.MessageDirection.clientToServer,t.type=new xx.ProtocolRequestType(t.method)})(Ex||(gp.TypeDefinitionRequest=Ex={}))});var Ox=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.DidChangeWorkspaceFoldersNotification=Xo.WorkspaceFoldersRequest=void 0;var mp=it(),Ax;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=mp.MessageDirection.serverToClient,t.type=new mp.ProtocolRequestType0(t.method)})(Ax||(Xo.WorkspaceFoldersRequest=Ax={}));var Px;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=mp.MessageDirection.clientToServer,t.type=new mp.ProtocolNotificationType(t.method)})(Px||(Xo.DidChangeWorkspaceFoldersNotification=Px={}))});var Ix=f(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.ConfigurationRequest=void 0;var Dx=it(),Rx;(function(t){t.method="workspace/configuration",t.messageDirection=Dx.MessageDirection.serverToClient,t.type=new Dx.ProtocolRequestType(t.method)})(Rx||(yp.ConfigurationRequest=Rx={}))});var Lx=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ColorPresentationRequest=Yo.DocumentColorRequest=void 0;var bp=it(),Cx;(function(t){t.method="textDocument/documentColor",t.messageDirection=bp.MessageDirection.clientToServer,t.type=new bp.ProtocolRequestType(t.method)})(Cx||(Yo.DocumentColorRequest=Cx={}));var Mx;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=bp.MessageDirection.clientToServer,t.type=new bp.ProtocolRequestType(t.method)})(Mx||(Yo.ColorPresentationRequest=Mx={}))});var jx=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.FoldingRangeRefreshRequest=Jo.FoldingRangeRequest=void 0;var _p=it(),Nx;(function(t){t.method="textDocument/foldingRange",t.messageDirection=_p.MessageDirection.clientToServer,t.type=new _p.ProtocolRequestType(t.method)})(Nx||(Jo.FoldingRangeRequest=Nx={}));var qx;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=_p.MessageDirection.serverToClient,t.type=new _p.ProtocolRequestType0(t.method)})(qx||(Jo.FoldingRangeRefreshRequest=qx={}))});var $x=f(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.DeclarationRequest=void 0;var Fx=it(),Bx;(function(t){t.method="textDocument/declaration",t.messageDirection=Fx.MessageDirection.clientToServer,t.type=new Fx.ProtocolRequestType(t.method)})(Bx||(vp.DeclarationRequest=Bx={}))});var Wx=f(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.SelectionRangeRequest=void 0;var Ux=it(),Kx;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Ux.MessageDirection.clientToServer,t.type=new Ux.ProtocolRequestType(t.method)})(Kx||(Sp.SelectionRangeRequest=Kx={}))});var zx=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.WorkDoneProgressCancelNotification=rs.WorkDoneProgressCreateRequest=rs.WorkDoneProgress=void 0;var CL=Ws(),Tp=it(),Gx;(function(t){t.type=new CL.ProgressType;function e(n){return n===t.type}t.is=e})(Gx||(rs.WorkDoneProgress=Gx={}));var Hx;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Tp.MessageDirection.serverToClient,t.type=new Tp.ProtocolRequestType(t.method)})(Hx||(rs.WorkDoneProgressCreateRequest=Hx={}));var Vx;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Tp.MessageDirection.clientToServer,t.type=new Tp.ProtocolNotificationType(t.method)})(Vx||(rs.WorkDoneProgressCancelNotification=Vx={}))});var Qx=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.CallHierarchyOutgoingCallsRequest=is.CallHierarchyIncomingCallsRequest=is.CallHierarchyPrepareRequest=void 0;var Qo=it(),Xx;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Xx||(is.CallHierarchyPrepareRequest=Xx={}));var Yx;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Yx||(is.CallHierarchyIncomingCallsRequest=Yx={}));var Jx;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Jx||(is.CallHierarchyOutgoingCallsRequest=Jx={}))});var iE=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.SemanticTokensRefreshRequest=Mn.SemanticTokensRangeRequest=Mn.SemanticTokensDeltaRequest=Mn.SemanticTokensRequest=Mn.SemanticTokensRegistrationType=Mn.TokenFormat=void 0;var Pi=it(),Zx;(function(t){t.Relative="relative"})(Zx||(Mn.TokenFormat=Zx={}));var Pu;(function(t){t.method="textDocument/semanticTokens",t.type=new Pi.RegistrationType(t.method)})(Pu||(Mn.SemanticTokensRegistrationType=Pu={}));var eE;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(eE||(Mn.SemanticTokensRequest=eE={}));var tE;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(tE||(Mn.SemanticTokensDeltaRequest=tE={}));var nE;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(nE||(Mn.SemanticTokensRangeRequest=nE={}));var rE;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Pi.MessageDirection.serverToClient,t.type=new Pi.ProtocolRequestType0(t.method)})(rE||(Mn.SemanticTokensRefreshRequest=rE={}))});var aE=f(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.ShowDocumentRequest=void 0;var sE=it(),oE;(function(t){t.method="window/showDocument",t.messageDirection=sE.MessageDirection.serverToClient,t.type=new sE.ProtocolRequestType(t.method)})(oE||(wp.ShowDocumentRequest=oE={}))});var lE=f(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.LinkedEditingRangeRequest=void 0;var uE=it(),cE;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=uE.MessageDirection.clientToServer,t.type=new uE.ProtocolRequestType(t.method)})(cE||(xp.LinkedEditingRangeRequest=cE={}))});var bE=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.WillDeleteFilesRequest=un.DidDeleteFilesNotification=un.DidRenameFilesNotification=un.WillRenameFilesRequest=un.DidCreateFilesNotification=un.WillCreateFilesRequest=un.FileOperationPatternKind=void 0;var rr=it(),pE;(function(t){t.file="file",t.folder="folder"})(pE||(un.FileOperationPatternKind=pE={}));var hE;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(hE||(un.WillCreateFilesRequest=hE={}));var dE;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(dE||(un.DidCreateFilesNotification=dE={}));var fE;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(fE||(un.WillRenameFilesRequest=fE={}));var gE;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(gE||(un.DidRenameFilesNotification=gE={}));var mE;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(mE||(un.DidDeleteFilesNotification=mE={}));var yE;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(yE||(un.WillDeleteFilesRequest=yE={}))});var wE=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MonikerRequest=ss.MonikerKind=ss.UniquenessLevel=void 0;var _E=it(),vE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vE||(ss.UniquenessLevel=vE={}));var SE;(function(t){t.$import="import",t.$export="export",t.local="local"})(SE||(ss.MonikerKind=SE={}));var TE;(function(t){t.method="textDocument/moniker",t.messageDirection=_E.MessageDirection.clientToServer,t.type=new _E.ProtocolRequestType(t.method)})(TE||(ss.MonikerRequest=TE={}))});var AE=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.TypeHierarchySubtypesRequest=os.TypeHierarchySupertypesRequest=os.TypeHierarchyPrepareRequest=void 0;var Zo=it(),xE;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(xE||(os.TypeHierarchyPrepareRequest=xE={}));var EE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(EE||(os.TypeHierarchySupertypesRequest=EE={}));var kE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(kE||(os.TypeHierarchySubtypesRequest=kE={}))});var DE=f(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.InlineValueRefreshRequest=ea.InlineValueRequest=void 0;var Ep=it(),PE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Ep.MessageDirection.clientToServer,t.type=new Ep.ProtocolRequestType(t.method)})(PE||(ea.InlineValueRequest=PE={}));var OE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Ep.MessageDirection.serverToClient,t.type=new Ep.ProtocolRequestType0(t.method)})(OE||(ea.InlineValueRefreshRequest=OE={}))});var ME=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.InlayHintRefreshRequest=as.InlayHintResolveRequest=as.InlayHintRequest=void 0;var ta=it(),RE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ta.MessageDirection.clientToServer,t.type=new ta.ProtocolRequestType(t.method)})(RE||(as.InlayHintRequest=RE={}));var IE;(function(t){t.method="inlayHint/resolve",t.messageDirection=ta.MessageDirection.clientToServer,t.type=new ta.ProtocolRequestType(t.method)})(IE||(as.InlayHintResolveRequest=IE={}));var CE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ta.MessageDirection.serverToClient,t.type=new ta.ProtocolRequestType0(t.method)})(CE||(as.InlayHintRefreshRequest=CE={}))});var $E=f(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DiagnosticRefreshRequest=ir.WorkspaceDiagnosticRequest=ir.DocumentDiagnosticRequest=ir.DocumentDiagnosticReportKind=ir.DiagnosticServerCancellationData=void 0;var BE=Ws(),ML=dp(),na=it(),LE;(function(t){function e(n){let r=n;return r&&ML.boolean(r.retriggerRequest)}t.is=e})(LE||(ir.DiagnosticServerCancellationData=LE={}));var NE;(function(t){t.Full="full",t.Unchanged="unchanged"})(NE||(ir.DocumentDiagnosticReportKind=NE={}));var qE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=na.MessageDirection.clientToServer,t.type=new na.ProtocolRequestType(t.method),t.partialResult=new BE.ProgressType})(qE||(ir.DocumentDiagnosticRequest=qE={}));var jE;(function(t){t.method="workspace/diagnostic",t.messageDirection=na.MessageDirection.clientToServer,t.type=new na.ProtocolRequestType(t.method),t.partialResult=new BE.ProgressType})(jE||(ir.WorkspaceDiagnosticRequest=jE={}));var FE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=na.MessageDirection.serverToClient,t.type=new na.ProtocolRequestType0(t.method)})(FE||(ir.DiagnosticRefreshRequest=FE={}))});var zE=f(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.DidCloseNotebookDocumentNotification=bt.DidSaveNotebookDocumentNotification=bt.DidChangeNotebookDocumentNotification=bt.NotebookCellArrayChange=bt.DidOpenNotebookDocumentNotification=bt.NotebookDocumentSyncRegistrationType=bt.NotebookDocument=bt.NotebookCell=bt.ExecutionSummary=bt.NotebookCellKind=void 0;var Ou=hp(),Cr=dp(),Zr=it(),Ry;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ry||(bt.NotebookCellKind=Ry={}));var Iy;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return Cr.objectLiteral(s)&&Ou.uinteger.is(s.executionOrder)&&(s.success===void 0||Cr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Iy||(bt.ExecutionSummary=Iy={}));var kp;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return Cr.objectLiteral(o)&&Ry.is(o.kind)&&Ou.DocumentUri.is(o.document)&&(o.metadata===void 0||Cr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Iy.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(Cr.objectLiteral(s)&&Cr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let p=0;p<c.length;p++){let h=c[p];if(!i(s[h],o[h]))return!1}}return!0}})(kp||(bt.NotebookCell=kp={}));var UE;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return Cr.objectLiteral(i)&&Cr.string(i.uri)&&Ou.integer.is(i.version)&&Cr.typedArray(i.cells,kp.is)}t.is=n})(UE||(bt.NotebookDocument=UE={}));var ra;(function(t){t.method="notebookDocument/sync",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.RegistrationType(t.method)})(ra||(bt.NotebookDocumentSyncRegistrationType=ra={}));var KE;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(KE||(bt.DidOpenNotebookDocumentNotification=KE={}));var WE;(function(t){function e(r){let i=r;return Cr.objectLiteral(i)&&Ou.uinteger.is(i.start)&&Ou.uinteger.is(i.deleteCount)&&(i.cells===void 0||Cr.typedArray(i.cells,kp.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(WE||(bt.NotebookCellArrayChange=WE={}));var GE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(GE||(bt.DidChangeNotebookDocumentNotification=GE={}));var HE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(HE||(bt.DidSaveNotebookDocumentNotification=HE={}));var VE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(VE||(bt.DidCloseNotebookDocumentNotification=VE={}))});var JE=f(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.InlineCompletionRequest=void 0;var XE=it(),YE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=XE.MessageDirection.clientToServer,t.type=new XE.ProtocolRequestType(t.method)})(YE||(Ap.InlineCompletionRequest=YE={}))});var lA=f(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var U=it(),QE=hp(),Kt=dp(),LL=wx();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return LL.ImplementationRequest}});var NL=kx();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return NL.TypeDefinitionRequest}});var oA=Ox();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return oA.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return oA.DidChangeWorkspaceFoldersNotification}});var qL=Ix();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return qL.ConfigurationRequest}});var aA=Lx();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return aA.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return aA.ColorPresentationRequest}});var uA=jx();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return uA.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return uA.FoldingRangeRefreshRequest}});var jL=$x();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return jL.DeclarationRequest}});var FL=Wx();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return FL.SelectionRangeRequest}});var qy=zx();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return qy.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return qy.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return qy.WorkDoneProgressCancelNotification}});var jy=Qx();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jy.CallHierarchyPrepareRequest}});var ia=iE();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return ia.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ia.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ia.SemanticTokensRegistrationType}});var BL=aE();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return BL.ShowDocumentRequest}});var $L=lE();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $L.LinkedEditingRangeRequest}});var Gs=bE();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return Gs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Gs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Gs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Gs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Gs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Gs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Gs.WillDeleteFilesRequest}});var Fy=wE();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Fy.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Fy.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Fy.MonikerRequest}});var By=AE();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return By.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return By.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return By.TypeHierarchySupertypesRequest}});var cA=DE();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return cA.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return cA.InlineValueRefreshRequest}});var $y=ME();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return $y.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return $y.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return $y.InlayHintRefreshRequest}});var Du=$E();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Du.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Du.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Du.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Du.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Du.DiagnosticRefreshRequest}});var ei=zE();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return ei.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return ei.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return ei.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return ei.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ei.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ei.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidCloseNotebookDocumentNotification}});var UL=JE();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return UL.InlineCompletionRequest}});var Cy;(function(t){function e(n){let r=n;return Kt.string(r)||Kt.string(r.language)||Kt.string(r.scheme)||Kt.string(r.pattern)}t.is=e})(Cy||(S.TextDocumentFilter=Cy={}));var My;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(Kt.string(r.notebookType)||Kt.string(r.scheme)||Kt.string(r.pattern))}t.is=e})(My||(S.NotebookDocumentFilter=My={}));var Ly;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(Kt.string(r.notebook)||My.is(r.notebook))&&(r.language===void 0||Kt.string(r.language))}t.is=e})(Ly||(S.NotebookCellTextDocumentFilter=Ly={}));var Ny;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Kt.string(r)&&!Cy.is(r)&&!Ly.is(r))return!1;return!0}t.is=e})(Ny||(S.DocumentSelector=Ny={}));var ZE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(ZE||(S.RegistrationRequest=ZE={}));var ek;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(ek||(S.UnregistrationRequest=ek={}));var tk;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(tk||(S.ResourceOperationKind=tk={}));var nk;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nk||(S.FailureHandlingKind=nk={}));var rk;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(rk||(S.PositionEncodingKind=rk={}));var ik;(function(t){function e(n){let r=n;return r&&Kt.string(r.id)&&r.id.length>0}t.hasId=e})(ik||(S.StaticRegistrationOptions=ik={}));var sk;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Ny.is(r.documentSelector))}t.is=e})(sk||(S.TextDocumentRegistrationOptions=sk={}));var ok;(function(t){function e(r){let i=r;return Kt.objectLiteral(i)&&(i.workDoneProgress===void 0||Kt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Kt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(ok||(S.WorkDoneProgressOptions=ok={}));var ak;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ak||(S.InitializeRequest=ak={}));var uk;(function(t){t.unknownProtocolVersion=1})(uk||(S.InitializeErrorCodes=uk={}));var ck;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ck||(S.InitializedNotification=ck={}));var lk;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(lk||(S.ShutdownRequest=lk={}));var pk;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(pk||(S.ExitNotification=pk={}));var hk;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(hk||(S.DidChangeConfigurationNotification=hk={}));var dk;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(dk||(S.MessageType=dk={}));var fk;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(fk||(S.ShowMessageNotification=fk={}));var gk;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(gk||(S.ShowMessageRequest=gk={}));var mk;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(mk||(S.LogMessageNotification=mk={}));var yk;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(yk||(S.TelemetryEventNotification=yk={}));var bk;(function(t){t.None=0,t.Full=1,t.Incremental=2})(bk||(S.TextDocumentSyncKind=bk={}));var _k;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(_k||(S.DidOpenTextDocumentNotification=_k={}));var vk;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(vk||(S.TextDocumentContentChangeEvent=vk={}));var Sk;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Sk||(S.DidChangeTextDocumentNotification=Sk={}));var Tk;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Tk||(S.DidCloseTextDocumentNotification=Tk={}));var wk;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(wk||(S.DidSaveTextDocumentNotification=wk={}));var xk;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(xk||(S.TextDocumentSaveReason=xk={}));var Ek;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Ek||(S.WillSaveTextDocumentNotification=Ek={}));var kk;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(kk||(S.WillSaveTextDocumentWaitUntilRequest=kk={}));var Ak;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Ak||(S.DidChangeWatchedFilesNotification=Ak={}));var Pk;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Pk||(S.FileChangeType=Pk={}));var Ok;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(QE.URI.is(r.baseUri)||QE.WorkspaceFolder.is(r.baseUri))&&Kt.string(r.pattern)}t.is=e})(Ok||(S.RelativePattern=Ok={}));var Dk;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Dk||(S.WatchKind=Dk={}));var Rk;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(Rk||(S.PublishDiagnosticsNotification=Rk={}));var Ik;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Ik||(S.CompletionTriggerKind=Ik={}));var Ck;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ck||(S.CompletionRequest=Ck={}));var Mk;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mk||(S.CompletionResolveRequest=Mk={}));var Lk;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Lk||(S.HoverRequest=Lk={}));var Nk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Nk||(S.SignatureHelpTriggerKind=Nk={}));var qk;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qk||(S.SignatureHelpRequest=qk={}));var jk;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jk||(S.DefinitionRequest=jk={}));var Fk;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Fk||(S.ReferencesRequest=Fk={}));var Bk;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Bk||(S.DocumentHighlightRequest=Bk={}));var $k;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($k||(S.DocumentSymbolRequest=$k={}));var Uk;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Uk||(S.CodeActionRequest=Uk={}));var Kk;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Kk||(S.CodeActionResolveRequest=Kk={}));var Wk;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Wk||(S.WorkspaceSymbolRequest=Wk={}));var Gk;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Gk||(S.WorkspaceSymbolResolveRequest=Gk={}));var Hk;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Hk||(S.CodeLensRequest=Hk={}));var Vk;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Vk||(S.CodeLensResolveRequest=Vk={}));var zk;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(zk||(S.CodeLensRefreshRequest=zk={}));var Xk;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Xk||(S.DocumentLinkRequest=Xk={}));var Yk;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Yk||(S.DocumentLinkResolveRequest=Yk={}));var Jk;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Jk||(S.DocumentFormattingRequest=Jk={}));var Qk;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Qk||(S.DocumentRangeFormattingRequest=Qk={}));var Zk;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Zk||(S.DocumentRangesFormattingRequest=Zk={}));var eA;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(eA||(S.DocumentOnTypeFormattingRequest=eA={}));var tA;(function(t){t.Identifier=1})(tA||(S.PrepareSupportDefaultBehavior=tA={}));var nA;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(nA||(S.RenameRequest=nA={}));var rA;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(rA||(S.PrepareRenameRequest=rA={}));var iA;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(iA||(S.ExecuteCommandRequest=iA={}));var sA;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(sA||(S.ApplyWorkspaceEditRequest=sA={}))});var hA=f(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.createProtocolConnection=void 0;var pA=Ws();function KL(t,e,n,r){return pA.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,pA.createMessageConnection)(t,e,n,r)}Pp.createProtocolConnection=KL});var fA=f(Ln=>{"use strict";var WL=Ln&&Ln.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Op=Ln&&Ln.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WL(e,t,n)};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LSPErrorCodes=Ln.createProtocolConnection=void 0;Op(Ws(),Ln);Op(hp(),Ln);Op(it(),Ln);Op(lA(),Ln);var GL=hA();Object.defineProperty(Ln,"createProtocolConnection",{enumerable:!0,get:function(){return GL.createProtocolConnection}});var dA;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(dA||(Ln.LSPErrorCodes=dA={}))});var kt=f(ti=>{"use strict";var HL=ti&&ti.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),gA=ti&&ti.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HL(e,t,n)};Object.defineProperty(ti,"__esModule",{value:!0});ti.createProtocolConnection=void 0;var VL=Ey();gA(Ey(),ti);gA(fA(),ti);function zL(t,e,n,r){return(0,VL.createMessageConnection)(t,e,n,r)}ti.createProtocolConnection=zL});var Uy=f(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.generateUuid=sr.parse=sr.isUUID=sr.v4=sr.empty=void 0;var Ru=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Iu=class t extends Ru{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Iu._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Iu._timeHighBits=["8","9","a","b"];sr.empty=new Ru("00000000-0000-0000-0000-000000000000");function mA(){return new Iu}sr.v4=mA;var XL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yA(t){return XL.test(t)}sr.isUUID=yA;function YL(t){if(!yA(t))throw new Error("invalid uuid");return new Ru(t)}sr.parse=YL;function JL(){return mA().asHex()}sr.generateUuid=JL});var bA=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.attachPartialResult=cs.ProgressFeature=cs.attachWorkDone=void 0;var us=kt(),QL=Uy(),Hs=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(us.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(us.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(us.WorkDoneProgress.type,this._token,{kind:"end"})}};Hs.Instances=new Map;var Dp=class extends Hs{constructor(e,n){super(e,n),this._source=new us.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Cu=class{constructor(){}begin(){}report(){}done(){}},Rp=class extends Cu{constructor(){super(),this._source=new us.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function ZL(t,e){if(e===void 0||e.workDoneToken===void 0)return new Cu;let n=e.workDoneToken;return delete e.workDoneToken,new Hs(t,n)}cs.attachWorkDone=ZL;var eN=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(us.WorkDoneProgressCancelNotification.type,n=>{let r=Hs.Instances.get(n.token);(r instanceof Dp||r instanceof Rp)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Cu:new Hs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,QL.generateUuid)();return this.connection.sendRequest(us.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Dp(this.connection,e))}else return Promise.resolve(new Rp)}};cs.ProgressFeature=eN;var Ky;(function(t){t.type=new us.ProgressType})(Ky||(Ky={}));var Wy=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Ky.type,this._token,e)}};function tN(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Wy(t,n)}cs.attachPartialResult=tN});var _A=f(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.ConfigurationFeature=void 0;var nN=kt(),rN=Kl(),iN=t=>class extends t{getConfiguration(e){return e?rN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(nN.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ip.ConfigurationFeature=iN});var vA=f(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.WorkspaceFoldersFeature=void 0;var Cp=kt(),sN=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Cp.Emitter,this.connection.onNotification(Cp.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Cp.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(Cp.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Mp.WorkspaceFoldersFeature=sN});var SA=f(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.CallHierarchyFeature=void 0;var Gy=kt(),oN=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Gy.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Gy.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Gy.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Lp.CallHierarchyFeature=oN});var Vy=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.SemanticTokensBuilder=ls.SemanticTokensDiff=ls.SemanticTokensFeature=void 0;var Np=kt(),aN=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Np.SemanticTokensRefreshRequest.type),on:e=>{let n=Np.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Np.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Np.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ls.SemanticTokensFeature=aN;var qp=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};ls.SemanticTokensDiff=qp;var Hy=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new qp(this._prevData,this._data).computeDiff()}:this.build()}};ls.SemanticTokensBuilder=Hy});var TA=f(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.ShowDocumentFeature=void 0;var uN=kt(),cN=t=>class extends t{showDocument(e){return this.connection.sendRequest(uN.ShowDocumentRequest.type,e)}};jp.ShowDocumentFeature=cN});var wA=f(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.FileOperationsFeature=void 0;var sa=kt(),lN=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(sa.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(sa.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(sa.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(sa.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(sa.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(sa.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Fp.FileOperationsFeature=lN});var xA=f(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.LinkedEditingRangeFeature=void 0;var pN=kt(),hN=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(pN.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Bp.LinkedEditingRangeFeature=hN});var EA=f($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.TypeHierarchyFeature=void 0;var zy=kt(),dN=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(zy.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=zy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=zy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$p.TypeHierarchyFeature=dN});var AA=f(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.InlineValueFeature=void 0;var kA=kt(),fN=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(kA.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(kA.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Up.InlineValueFeature=fN});var OA=f(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.FoldingRangeFeature=void 0;var PA=kt(),gN=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(PA.FoldingRangeRefreshRequest.type),on:e=>{let n=PA.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Kp.FoldingRangeFeature=gN});var DA=f(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.InlayHintFeature=void 0;var Xy=kt(),mN=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Xy.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Xy.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Xy.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Wp.InlayHintFeature=mN});var RA=f(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.DiagnosticFeature=void 0;var Mu=kt(),yN=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Mu.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Mu.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Mu.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Mu.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Mu.WorkspaceDiagnosticRequest.partialResult,n)))}}};Gp.DiagnosticFeature=yN});var Jy=f(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.TextDocuments=void 0;var Vs=kt(),Yy=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Vs.Emitter,this._onDidOpen=new Vs.Emitter,this._onDidClose=new Vs.Emitter,this._onDidSave=new Vs.Emitter,this._onWillSave=new Vs.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=Vs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Vs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Hp.TextDocuments=Yy});var Zy=f(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.NotebookDocuments=oa.NotebookSyncFeature=void 0;var or=kt(),IA=Jy(),bN=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(or.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(or.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(or.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(or.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};oa.NotebookSyncFeature=bN;var Vp=class t{onDidOpenTextDocument(e){return this.openHandler=e,or.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,or.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,or.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Vp.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Qy=class{constructor(e){e instanceof IA.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new IA.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new or.Emitter,this._onDidChange=new or.Emitter,this._onDidSave=new or.Emitter,this._onDidClose=new or.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new Vp,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],p=[],h=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let T=A.structure.array;if(s.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),A.structure.didOpen!==void 0)for(let w of A.structure.didOpen)n.openTextDocument({textDocument:w}),c.push(w.uri);if(A.structure.didClose)for(let w of A.structure.didClose)n.closeTextDocument({textDocument:w}),l.push(w.uri)}if(A.data!==void 0){let T=new Map(A.data.map(w=>[w.document,w]));for(let w=0;w<=s.cells.length;w++){let _=T.get(s.cells[w].document);if(_!==void 0){let N=s.cells.splice(w,1,_);if(p.push({old:N[0],new:_}),T.delete(_.document),T.size===0)break}}}if(A.textContent!==void 0)for(let T of A.textContent)n.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),h.push(T.document.uri)}this.updateCellMap(s);let m={notebookDocument:s};a&&(m.metadata={old:o,new:s.metadata});let b=[];for(let A of c)b.push(this.getNotebookCell(A));let v=[];for(let A of l)v.push(this.getNotebookCell(A));let R=[];for(let A of h)R.push(this.getNotebookCell(A));(b.length>0||v.length>0||p.length>0||R.length>0)&&(m.cells={added:b,removed:v,changed:{data:p,textContent:R}}),(m.metadata!==void 0||m.cells!==void 0)&&this._onDidChange.fire(m)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),or.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};oa.NotebookDocuments=Qy});var CA=f(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.MonikerFeature=void 0;var _N=kt(),vN=t=>class extends t{get moniker(){return{on:e=>{let n=_N.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};zp.MonikerFeature=vN});var sb=f(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var z=kt(),ar=Kl(),tb=Uy(),de=bA(),SN=_A(),TN=vA(),wN=SA(),xN=Vy(),EN=TA(),kN=wA(),AN=xA(),PN=EA(),ON=AA(),DN=OA(),RN=DA(),IN=RA(),CN=Zy(),MN=CA();function eb(t){if(t!==null)return t}var nb=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ie.ErrorMessageTracker=nb;var Xp=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(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}debug(e){this.send(z.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,z.RAL)().console.error("Sending log message failed")})}},rb=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}},MA=(0,EN.ShowDocumentFeature)((0,de.ProgressFeature)(rb)),LA;(function(t){function e(){return new Yp}t.create=e})(LA||(Ie.BulkRegistration=LA={}));var Yp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=ar.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=tb.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},NA;(function(t){function e(){return new Lu(void 0,[])}t.create=e})(NA||(Ie.BulkUnregistration=NA={}));var Lu=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(z.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=ar.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Jp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Yp?this.registerMany(e):e instanceof Lu?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=ar.string(n)?n:n.method,s=tb.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=ar.string(e)?e:e.method,i=tb.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,s).then(o=>z.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(z.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(z.RegistrationRequest.type,n).then(()=>new Lu(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ib=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(z.ApplyWorkspaceEditRequest.type,r)}},qA=(0,kN.FileOperationsFeature)((0,TN.WorkspaceFoldersFeature)((0,SN.ConfigurationFeature)(ib))),Qp=class{constructor(){this._trace=z.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0}).catch(()=>{})}},Zp=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(z.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},eh=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,de.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,de.attachPartialResult)(this.connection,n)}};Ie._LanguagesImpl=eh;var jA=(0,DN.FoldingRangeFeature)((0,MN.MonikerFeature)((0,IN.DiagnosticFeature)((0,RN.InlayHintFeature)((0,ON.InlineValueFeature)((0,PN.TypeHierarchyFeature)((0,AN.LinkedEditingRangeFeature)((0,xN.SemanticTokensFeature)((0,wN.CallHierarchyFeature)(eh))))))))),th=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,de.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,de.attachPartialResult)(this.connection,n)}};Ie._NotebooksImpl=th;var FA=(0,CN.NotebookSyncFeature)(th);function BA(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=BA;function $A(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=$A;function UA(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=UA;function KA(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=KA;function WA(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=WA;function GA(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=GA;function HA(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=HA;function VA(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=VA;function LN(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,BA),tracer:n(t.tracer,e.tracer,UA),telemetry:n(t.telemetry,e.telemetry,$A),client:n(t.client,e.client,KA),window:n(t.window,e.window,WA),workspace:n(t.workspace,e.workspace,GA),languages:n(t.languages,e.languages,HA),notebooks:n(t.notebooks,e.notebooks,VA)}}Ie.combineFeatures=LN;function NN(t,e,n){let r=n&&n.console?new(n.console(Xp)):new Xp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Qp)):new Qp,o=n&&n.telemetry?new(n.telemetry(Zp)):new Zp,a=n&&n.client?new(n.client(Jp)):new Jp,u=n&&n.window?new(n.window(MA)):new MA,c=n&&n.workspace?new(n.workspace(qA)):new qA,l=n&&n.languages?new(n.languages(jA)):new jA,p=n&&n.notebooks?new(n.notebooks(FA)):new FA,h=[r,s,o,a,u,c,l,p];function m(T){return T instanceof Promise?T:ar.thenable(T)?new Promise((w,_)=>{T.then(N=>w(N),N=>_(N))}):Promise.resolve(T)}let b,v,R,A={listen:()=>i.listen(),sendRequest:(T,...w)=>i.sendRequest(ar.string(T)?T:T.method,...w),onRequest:(T,w)=>i.onRequest(T,w),sendNotification:(T,w)=>{let _=ar.string(T)?T:T.method;return i.sendNotification(_,w)},onNotification:(T,w)=>i.onNotification(T,w),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(v=T,{dispose:()=>{v=void 0}}),onInitialized:T=>i.onNotification(z.InitializedNotification.type,T),onShutdown:T=>(b=T,{dispose:()=>{b=void 0}}),onExit:T=>(R=T,{dispose:()=>{R=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return p},onDidChangeConfiguration:T=>i.onNotification(z.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(z.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(z.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(z.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(z.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(z.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(z.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(z.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(z.HoverRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onCompletion:T=>i.onRequest(z.CompletionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCompletionResolve:T=>i.onRequest(z.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(z.SignatureHelpRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDeclaration:T=>i.onRequest(z.DeclarationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDefinition:T=>i.onRequest(z.DefinitionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onTypeDefinition:T=>i.onRequest(z.TypeDefinitionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onImplementation:T=>i.onRequest(z.ImplementationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onReferences:T=>i.onRequest(z.ReferencesRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentHighlight:T=>i.onRequest(z.DocumentHighlightRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentSymbol:T=>i.onRequest(z.DocumentSymbolRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onWorkspaceSymbol:T=>i.onRequest(z.WorkspaceSymbolRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onWorkspaceSymbolResolve:T=>i.onRequest(z.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(z.CodeActionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCodeActionResolve:T=>i.onRequest(z.CodeActionResolveRequest.type,(w,_)=>T(w,_)),onCodeLens:T=>i.onRequest(z.CodeLensRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCodeLensResolve:T=>i.onRequest(z.CodeLensResolveRequest.type,(w,_)=>T(w,_)),onDocumentFormatting:T=>i.onRequest(z.DocumentFormattingRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDocumentRangeFormatting:T=>i.onRequest(z.DocumentRangeFormattingRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(z.DocumentOnTypeFormattingRequest.type,(w,_)=>T(w,_)),onRenameRequest:T=>i.onRequest(z.RenameRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onPrepareRename:T=>i.onRequest(z.PrepareRenameRequest.type,(w,_)=>T(w,_)),onDocumentLinks:T=>i.onRequest(z.DocumentLinkRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentLinkResolve:T=>i.onRequest(z.DocumentLinkResolveRequest.type,(w,_)=>T(w,_)),onDocumentColor:T=>i.onRequest(z.DocumentColorRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onColorPresentation:T=>i.onRequest(z.ColorPresentationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onFoldingRanges:T=>i.onRequest(z.FoldingRangeRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onSelectionRanges:T=>i.onRequest(z.SelectionRangeRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onExecuteCommand:T=>i.onRequest(z.ExecuteCommandRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),dispose:()=>i.dispose()};for(let T of h)T.attach(A);return i.onRequest(z.InitializeRequest.type,T=>{e.initialize(T),ar.string(T.trace)&&(s.trace=z.Trace.fromString(T.trace));for(let w of h)w.initialize(T.capabilities);if(v){let w=v(T,new z.CancellationTokenSource().token,(0,de.attachWorkDone)(i,T),void 0);return m(w).then(_=>{if(_ instanceof z.ResponseError)return _;let N=_;N||(N={capabilities:{}});let O=N.capabilities;O||(O={},N.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=ar.number(A.__textDocumentSync)?A.__textDocumentSync:z.TextDocumentSyncKind.None:!ar.number(O.textDocumentSync)&&!ar.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=ar.number(A.__textDocumentSync)?A.__textDocumentSync:z.TextDocumentSyncKind.None);for(let G of h)G.fillServerCapabilities(O);return N})}else{let w={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let _ of h)_.fillServerCapabilities(w.capabilities);return w}}),i.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,b)return b(new z.CancellationTokenSource().token)}),i.onNotification(z.ExitNotification.type,()=>{try{R&&R()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(z.SetTraceNotification.type,T=>{s.trace=z.Trace.fromString(T.value)}),A}Ie.createConnection=NN});var zA=f(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.resolveModulePath=Nn.FileSystem=Nn.resolveGlobalYarnPath=Nn.resolveGlobalNodePath=Nn.resolve=Nn.uriToFilePath=void 0;var qN=require("url"),Mr=require("path"),ob=require("fs"),lb=require("child_process");function jN(t){let e=qN.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return Mr.normalize(n.join("/"))}Nn.uriToFilePath=jN;function ab(){return process.platform==="win32"}function nh(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&ob.existsSync(e)&&(c[i]?c[i]=e+Mr.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,lb.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",h=>{a(h)}),l.on("message",h=>{h.c==="r"&&(l.send({c:"e"}),h.s?o(h.r):a(new Error(`Failed to resolve module: ${t}`)))});let p={c:"rs",a:t};l.send(p)}catch(l){a(l)}})}Nn.resolve=nh;function ub(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};ab()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,lb.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?ab()?Mr.join(o,"node_modules"):Mr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Nn.resolveGlobalNodePath=ub;function FN(t){let e="yarn",n={encoding:"utf8"};ab()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,lb.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return Mr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Nn.resolveGlobalYarnPath=FN;var cb;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ob.existsSync(__filename.toUpperCase())||!ob.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Mr.normalize(s).indexOf(Mr.normalize(i))===0:Mr.normalize(s).toLowerCase().indexOf(Mr.normalize(i).toLowerCase())===0}t.isParent=r})(cb||(Nn.FileSystem=cb={}));function BN(t,e,n,r){return n?(Mr.isAbsolute(n)||(n=Mr.join(t,n)),nh(e,n,n,r).then(i=>cb.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>nh(e,ub(r),t,r))):nh(e,ub(r),t,r)}Nn.resolveModulePath=BN});var pb=f((L6,XA)=>{"use strict";XA.exports=kt()});var YA=f(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.InlineCompletionFeature=void 0;var $N=kt(),UN=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest($N.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};rh.InlineCompletionFeature=UN});var ZA=f(cn=>{"use strict";var KN=cn&&cn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),QA=cn&&cn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KN(e,t,n)};Object.defineProperty(cn,"__esModule",{value:!0});cn.ProposedFeatures=cn.NotebookDocuments=cn.TextDocuments=cn.SemanticTokensBuilder=void 0;var WN=Vy();Object.defineProperty(cn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return WN.SemanticTokensBuilder}});var GN=YA();QA(kt(),cn);var HN=Jy();Object.defineProperty(cn,"TextDocuments",{enumerable:!0,get:function(){return HN.TextDocuments}});var VN=Zy();Object.defineProperty(cn,"NotebookDocuments",{enumerable:!0,get:function(){return VN.NotebookDocuments}});QA(sb(),cn);var JA;(function(t){t.all={__brand:"features",languages:GN.InlineCompletionFeature}})(JA||(cn.ProposedFeatures=JA={}))});var db=f(ur=>{"use strict";var zN=ur&&ur.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),r1=ur&&ur.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zN(e,t,n)};Object.defineProperty(ur,"__esModule",{value:!0});ur.createConnection=ur.Files=void 0;var e1=require("node:util"),hb=Kl(),XN=sb(),Nu=zA(),zs=pb();r1(pb(),ur);r1(ZA(),ur);var t1;(function(t){t.uriToFilePath=Nu.uriToFilePath,t.resolveGlobalNodePath=Nu.resolveGlobalNodePath,t.resolveGlobalYarnPath=Nu.resolveGlobalYarnPath,t.resolve=Nu.resolve,t.resolveModulePath=Nu.resolveModulePath})(t1||(ur.Files=t1={}));var n1;function ih(){if(n1!==void 0)try{n1.end()}catch{}}var aa=!1,i1;function YN(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(i1=setInterval(()=>{try{process.kill(r,0)}catch{ih(),process.exit(aa?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}YN();var JN={initialize:t=>{let e=t.processId;hb.number(e)&&i1===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(aa?0:1)}},3e3)},get shutdownReceived(){return aa},set shutdownReceived(t){aa=t},exit:t=>{ih(),process.exit(t)}};function QN(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),zs.ConnectionStrategy.is(t)||zs.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),ZN(s,o,a,i)}ur.createConnection=QN;function ZN(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let p=0;p<l.length;p++){let h=l[p];if(h==="--node-ipc"){t=new zs.IPCMessageReader(process),e=new zs.IPCMessageWriter(process);break}else if(h==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(h==="--socket"){u=parseInt(l[p+1]);break}else if(h==="--pipe"){c=l[p+1];break}else{var s=h.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let p=(0,zs.createServerSocketTransport)(u);t=p[0],e=p[1]}else if(c){let p=(0,zs.createServerPipeTransport)(c);t=p[0],e=p[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(hb.func(t.read)&&hb.func(t.on)){let u=t;u.on("end",()=>{ih(),process.exit(aa?0:1)}),u.on("close",()=>{ih(),process.exit(aa?0:1)})}let a=u=>{let c=(0,zs.createProtocolConnection)(t,e,u,n);return i&&eq(u),c};return(0,XN.createConnection)(a,JN,r)}function eq(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,e1.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,e1.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
36
|
-
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var fb=f((B6,s1)=>{"use strict";s1.exports=db()});var Lr=f(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.getAllDependencyLocationsFromGraph=ht.parseDependencyRawLocation=ht.parseDependencyLocation=ht.DependencyType=ht.TypeAnalyzerStrategy=ht.IndentationType=ht.DefaultFileExtensions=ht.ConfigurationNamespace=ht.LanguageId=void 0;ht.LanguageId="miniscript";ht.ConfigurationNamespace="miniscript";ht.DefaultFileExtensions=["ms"];var tq;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(tq=ht.IndentationType||(ht.IndentationType={}));var nq;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(nq=ht.TypeAnalyzerStrategy||(ht.TypeAnalyzerStrategy={}));var rq;(function(t){t.Root="root",t.Include="include",t.Import="import"})(rq=ht.DependencyType||(ht.DependencyType={}));function iq(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}ht.parseDependencyLocation=iq;function sq(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}ht.parseDependencyRawLocation=sq;function oq(t,e=new Set){let n=[],r=[...t.children];for(;r.length>0;){let i=r.pop();e.has(i.item.document.textDocument.uri)||(e.add(i.item.document.textDocument.uri),n.push(i.item.document),r.push(...i.children))}return n}ht.getAllDependencyLocationsFromGraph=oq});var qu=f(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.Position=void 0;var gb=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};sh.Position=gb});var ps=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.LiteralToken=Gn.Token=Gn.BaseToken=Gn.BaseTokenOptions=Gn.TokenType=void 0;var o1=qu(),aq;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(aq=Gn.TokenType||(Gn.TokenType={}));var mb=class{};Gn.BaseTokenOptions=mb;var ju=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new o1.Position(this.line,r[0]-n[0]+1),this.end=new o1.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Gn.BaseToken=ju;var yb=class extends ju{};Gn.Token=yb;var bb=class extends ju{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Gn.LiteralToken=bb});var oh=f(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.CharacterCode=void 0;var uq;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(uq=Fu.CharacterCode||(Fu.CharacterCode={}))});var ua=f(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Keyword=void 0;var cq;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(cq=Bu.Keyword||(Bu.Keyword={}))});var Sb=f(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var cr=oh(),lq=ua(),_b=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(lq.Keyword)))}isWhitespace(e){return cr.CharacterCode.WHITESPACE===e||cr.CharacterCode.TAB===e}isEndOfLine(e){return cr.CharacterCode.NEW_LINE===e||cr.CharacterCode.RETURN_LINE===e}isComment(e,n){return cr.CharacterCode.SLASH===e&&cr.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=cr.CharacterCode.NUMBER_0&&e<=cr.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case cr.CharacterCode.RETURN_LINE:return cr.CharacterCode.NEW_LINE===n;case cr.CharacterCode.NEW_LINE:return cr.CharacterCode.RETURN_LINE===n}return!1}};vb.default=_b});var ah=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.ParserException=ca.LexerException=void 0;var Tb=class extends Error{constructor(e,n){super(e),this.range=n}};ca.LexerException=Tb;var wb=class extends Error{constructor(e,n){super(e),this.range=n}};ca.ParserException=wb});var xb=f($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.Literal=void 0;var pq;(function(t){t.True="true",t.False="false",t.Null="null"})(pq=$u.Literal||($u.Literal={}))});var la=f(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.Operator=void 0;var hq;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(hq=Uu.Operator||(Uu.Operator={}))});var Ku=f(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.Range=void 0;var Eb=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};uh.Range=Eb});var Pb=f(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var kb=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};Ab.default=kb});var Rb=f(Gu=>{"use strict";var u1=Gu&&Gu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gu,"__esModule",{value:!0});var st=ps(),dq=u1(Sb()),be=oh(),fq=ah(),Ob=ua(),Wu=xb(),ot=la(),pa=qu(),Db=Ku(),a1=u1(Pb());function hs(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var ch=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new dq.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new a1.default,r.snapshot=new a1.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new st.Token({type:st.TokenType.EOL,value:ot.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new st.Token({type:st.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new st.Token({type:st.TokenType.EOF,value:ot.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new st.LiteralToken({type:st.TokenType.BooleanLiteral,value:e===Wu.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new st.LiteralToken({type:st.TokenType.NilLiteral,value:null,raw:Wu.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new st.Token({type:st.TokenType.SliceOperator,value:ot.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new st.Token({type:st.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new st.LiteralToken({type:st.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let m=n.codeAt();if(n.validator.isEndOfLine(m))r.isWinNewline(m,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(be.CharacterCode.QUOTE===m){if(be.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Db.Range(new pa.Position(i,o-a+1),new pa.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),p=l.slice(1,-1).replace(/""/g,ot.Operator.Escape),h=new st.LiteralToken({type:st.TokenType.StringLiteral,value:p,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(h),h}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new st.Token({type:st.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||be.CharacterCode.DOT===i||be.CharacterCode.LETTER_E===i||be.CharacterCode.LETTER_e===i||(be.CharacterCode.MINUS===i||be.CharacterCode.PLUS===i)&&(be.CharacterCode.LETTER_E===r||be.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Db.Range(new pa.Position(this.line,this.tokenStart-this.offset+1),new pa.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case Ob.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Ob.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Ob.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new st.Token({type:st.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case Wu.Literal.True:case Wu.Literal.False:return n.createBoolean(i,e);case Wu.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Db.Range(new pa.Position(s,e.tokenStart-e.offset+1),new pa.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new fq.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new st.Token({type:st.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Gu.default=ch;ch.scanHandlers={[be.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[be.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(ot.Operator.Member,e))},[be.CharacterCode.EQUAL]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.Equal,e):this.scanPunctuator(ot.Operator.Assign,e)},[be.CharacterCode.ARROW_LEFT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.LessThanOrEqual,e):this.scanPunctuator(ot.Operator.LessThan,e)},[be.CharacterCode.ARROW_RIGHT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.GreaterThanOrEqual,e):this.scanPunctuator(ot.Operator.GreaterThan,e)},[be.CharacterCode.EXCLAMATION_MARK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.NotEqual,e):(this.index++,null)},[be.CharacterCode.MINUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.SubtractShorthand,e):this.scanPunctuator(ot.Operator.Minus,e)},[be.CharacterCode.PLUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.AddShorthand,e):this.scanPunctuator(ot.Operator.Plus,e)},[be.CharacterCode.ASTERISK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.MultiplyShorthand,e):this.scanPunctuator(ot.Operator.Asterik,e)},[be.CharacterCode.SLASH]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.DivideShorthand,e):this.scanPunctuator(ot.Operator.Slash,e)},[be.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[be.CharacterCode.CARET]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.PowerShorthand,e):this.scanPunctuator(ot.Operator.Power,e)},[be.CharacterCode.PERCENT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.ModuloShorthand,e):this.scanPunctuator(ot.Operator.Modulo,e)},[be.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[be.CharacterCode.COMMA]:hs,[be.CharacterCode.CURLY_BRACKET_LEFT]:hs,[be.CharacterCode.CURLY_BRACKET_RIGHT]:hs,[be.CharacterCode.SQUARE_BRACKETS_LEFT]:hs,[be.CharacterCode.SQUARE_BRACKETS_RIGHT]:hs,[be.CharacterCode.PARENTHESIS_LEFT]:hs,[be.CharacterCode.PARENTHESIS_RIGHT]:hs,[be.CharacterCode.AT_SIGN]:hs}});var at=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ASTComment=Hn.ASTBaseBlockWithScope=Hn.ASTBaseBlock=Hn.ASTBase=Hn.ASTType=void 0;var c1;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(c1=Hn.ASTType||(Hn.ASTType={}));var Hu=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Hn.ASTBase=Hu;var lh=class t extends Hu{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
|
35
|
+
`&&d++}y&&k.length>0&&E.push(k.length),this._lineOffsets=E}return this._lineOffsets},g.prototype.positionAt=function(E){E=Math.max(Math.min(E,this._content.length),0);var k=this.getLineOffsets(),y=0,d=k.length;if(d===0)return o.create(0,E);for(;y<d;){var I=Math.floor((y+d)/2);k[I]>E?d=I:y=I+1}var $=y-1;return o.create($,E-k[$])},g.prototype.offsetAt=function(E){var k=this.getLineOffsets();if(E.line>=k.length)return this._content.length;if(E.line<0)return 0;var y=k[E.line],d=E.line+1<k.length?k[E.line+1]:this._content.length;return Math.max(Math.min(y+E.character,d),y)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),C;(function(g){var E=Object.prototype.toString;function k(ke){return typeof ke<"u"}g.defined=k;function y(ke){return typeof ke>"u"}g.undefined=y;function d(ke){return ke===!0||ke===!1}g.boolean=d;function I(ke){return E.call(ke)==="[object String]"}g.string=I;function $(ke){return E.call(ke)==="[object Number]"}g.number=$;function ge(ke,Fo,Ul){return E.call(ke)==="[object Number]"&&Fo<=ke&&ke<=Ul}g.numberRange=ge;function yt(ke){return E.call(ke)==="[object Number]"&&-2147483648<=ke&&ke<=2147483647}g.integer=yt;function Xe(ke){return E.call(ke)==="[object Number]"&&0<=ke&&ke<=2147483647}g.uinteger=Xe;function Rr(ke){return E.call(ke)==="[object Function]"}g.func=Rr;function Dr(ke){return ke!==null&&typeof ke=="object"}g.objectLiteral=Dr;function ki(ke,Fo){return Array.isArray(ke)&&ke.every(Fo)}g.typedArray=ki})(C||(C={}))})});var it=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ProtocolNotificationType=Cn.ProtocolNotificationType0=Cn.ProtocolRequestType=Cn.ProtocolRequestType0=Cn.RegistrationType=Cn.MessageDirection=void 0;var zo=Ws(),bx;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(bx||(Cn.MessageDirection=bx={}));var ky=class{constructor(e){this.method=e}};Cn.RegistrationType=ky;var Ay=class extends zo.RequestType0{constructor(e){super(e)}};Cn.ProtocolRequestType0=Ay;var Py=class extends zo.RequestType{constructor(e){super(e,zo.ParameterStructures.byName)}};Cn.ProtocolRequestType=Py;var Oy=class extends zo.NotificationType0{constructor(e){super(e)}};Cn.ProtocolNotificationType0=Oy;var Ry=class extends zo.NotificationType{constructor(e){super(e,zo.ParameterStructures.byName)}};Cn.ProtocolNotificationType=Ry});var dp=f(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.objectLiteral=It.typedArray=It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function kL(t){return t===!0||t===!1}It.boolean=kL;function _x(t){return typeof t=="string"||t instanceof String}It.string=_x;function AL(t){return typeof t=="number"||t instanceof Number}It.number=AL;function PL(t){return t instanceof Error}It.error=PL;function OL(t){return typeof t=="function"}It.func=OL;function vx(t){return Array.isArray(t)}It.array=vx;function RL(t){return vx(t)&&t.every(e=>_x(e))}It.stringArray=RL;function DL(t,e){return Array.isArray(t)&&t.every(e)}It.typedArray=DL;function IL(t){return t!==null&&typeof t=="object"}It.objectLiteral=IL});var wx=f(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ImplementationRequest=void 0;var Sx=it(),Tx;(function(t){t.method="textDocument/implementation",t.messageDirection=Sx.MessageDirection.clientToServer,t.type=new Sx.ProtocolRequestType(t.method)})(Tx||(fp.ImplementationRequest=Tx={}))});var kx=f(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.TypeDefinitionRequest=void 0;var xx=it(),Ex;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=xx.MessageDirection.clientToServer,t.type=new xx.ProtocolRequestType(t.method)})(Ex||(gp.TypeDefinitionRequest=Ex={}))});var Ox=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.DidChangeWorkspaceFoldersNotification=Xo.WorkspaceFoldersRequest=void 0;var mp=it(),Ax;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=mp.MessageDirection.serverToClient,t.type=new mp.ProtocolRequestType0(t.method)})(Ax||(Xo.WorkspaceFoldersRequest=Ax={}));var Px;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=mp.MessageDirection.clientToServer,t.type=new mp.ProtocolNotificationType(t.method)})(Px||(Xo.DidChangeWorkspaceFoldersNotification=Px={}))});var Ix=f(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.ConfigurationRequest=void 0;var Rx=it(),Dx;(function(t){t.method="workspace/configuration",t.messageDirection=Rx.MessageDirection.serverToClient,t.type=new Rx.ProtocolRequestType(t.method)})(Dx||(yp.ConfigurationRequest=Dx={}))});var Lx=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ColorPresentationRequest=Yo.DocumentColorRequest=void 0;var bp=it(),Cx;(function(t){t.method="textDocument/documentColor",t.messageDirection=bp.MessageDirection.clientToServer,t.type=new bp.ProtocolRequestType(t.method)})(Cx||(Yo.DocumentColorRequest=Cx={}));var Mx;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=bp.MessageDirection.clientToServer,t.type=new bp.ProtocolRequestType(t.method)})(Mx||(Yo.ColorPresentationRequest=Mx={}))});var jx=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.FoldingRangeRefreshRequest=Jo.FoldingRangeRequest=void 0;var _p=it(),Nx;(function(t){t.method="textDocument/foldingRange",t.messageDirection=_p.MessageDirection.clientToServer,t.type=new _p.ProtocolRequestType(t.method)})(Nx||(Jo.FoldingRangeRequest=Nx={}));var qx;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=_p.MessageDirection.serverToClient,t.type=new _p.ProtocolRequestType0(t.method)})(qx||(Jo.FoldingRangeRefreshRequest=qx={}))});var $x=f(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.DeclarationRequest=void 0;var Fx=it(),Bx;(function(t){t.method="textDocument/declaration",t.messageDirection=Fx.MessageDirection.clientToServer,t.type=new Fx.ProtocolRequestType(t.method)})(Bx||(vp.DeclarationRequest=Bx={}))});var Wx=f(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.SelectionRangeRequest=void 0;var Ux=it(),Kx;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Ux.MessageDirection.clientToServer,t.type=new Ux.ProtocolRequestType(t.method)})(Kx||(Sp.SelectionRangeRequest=Kx={}))});var zx=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.WorkDoneProgressCancelNotification=rs.WorkDoneProgressCreateRequest=rs.WorkDoneProgress=void 0;var CL=Ws(),Tp=it(),Gx;(function(t){t.type=new CL.ProgressType;function e(n){return n===t.type}t.is=e})(Gx||(rs.WorkDoneProgress=Gx={}));var Hx;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Tp.MessageDirection.serverToClient,t.type=new Tp.ProtocolRequestType(t.method)})(Hx||(rs.WorkDoneProgressCreateRequest=Hx={}));var Vx;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Tp.MessageDirection.clientToServer,t.type=new Tp.ProtocolNotificationType(t.method)})(Vx||(rs.WorkDoneProgressCancelNotification=Vx={}))});var Qx=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.CallHierarchyOutgoingCallsRequest=is.CallHierarchyIncomingCallsRequest=is.CallHierarchyPrepareRequest=void 0;var Qo=it(),Xx;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Xx||(is.CallHierarchyPrepareRequest=Xx={}));var Yx;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Yx||(is.CallHierarchyIncomingCallsRequest=Yx={}));var Jx;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Qo.MessageDirection.clientToServer,t.type=new Qo.ProtocolRequestType(t.method)})(Jx||(is.CallHierarchyOutgoingCallsRequest=Jx={}))});var iE=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.SemanticTokensRefreshRequest=Mn.SemanticTokensRangeRequest=Mn.SemanticTokensDeltaRequest=Mn.SemanticTokensRequest=Mn.SemanticTokensRegistrationType=Mn.TokenFormat=void 0;var Pi=it(),Zx;(function(t){t.Relative="relative"})(Zx||(Mn.TokenFormat=Zx={}));var Pu;(function(t){t.method="textDocument/semanticTokens",t.type=new Pi.RegistrationType(t.method)})(Pu||(Mn.SemanticTokensRegistrationType=Pu={}));var eE;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(eE||(Mn.SemanticTokensRequest=eE={}));var tE;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(tE||(Mn.SemanticTokensDeltaRequest=tE={}));var nE;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Pi.MessageDirection.clientToServer,t.type=new Pi.ProtocolRequestType(t.method),t.registrationMethod=Pu.method})(nE||(Mn.SemanticTokensRangeRequest=nE={}));var rE;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Pi.MessageDirection.serverToClient,t.type=new Pi.ProtocolRequestType0(t.method)})(rE||(Mn.SemanticTokensRefreshRequest=rE={}))});var aE=f(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.ShowDocumentRequest=void 0;var sE=it(),oE;(function(t){t.method="window/showDocument",t.messageDirection=sE.MessageDirection.serverToClient,t.type=new sE.ProtocolRequestType(t.method)})(oE||(wp.ShowDocumentRequest=oE={}))});var lE=f(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.LinkedEditingRangeRequest=void 0;var uE=it(),cE;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=uE.MessageDirection.clientToServer,t.type=new uE.ProtocolRequestType(t.method)})(cE||(xp.LinkedEditingRangeRequest=cE={}))});var bE=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.WillDeleteFilesRequest=un.DidDeleteFilesNotification=un.DidRenameFilesNotification=un.WillRenameFilesRequest=un.DidCreateFilesNotification=un.WillCreateFilesRequest=un.FileOperationPatternKind=void 0;var rr=it(),pE;(function(t){t.file="file",t.folder="folder"})(pE||(un.FileOperationPatternKind=pE={}));var hE;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(hE||(un.WillCreateFilesRequest=hE={}));var dE;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(dE||(un.DidCreateFilesNotification=dE={}));var fE;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(fE||(un.WillRenameFilesRequest=fE={}));var gE;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(gE||(un.DidRenameFilesNotification=gE={}));var mE;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolNotificationType(t.method)})(mE||(un.DidDeleteFilesNotification=mE={}));var yE;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=rr.MessageDirection.clientToServer,t.type=new rr.ProtocolRequestType(t.method)})(yE||(un.WillDeleteFilesRequest=yE={}))});var wE=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MonikerRequest=ss.MonikerKind=ss.UniquenessLevel=void 0;var _E=it(),vE;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vE||(ss.UniquenessLevel=vE={}));var SE;(function(t){t.$import="import",t.$export="export",t.local="local"})(SE||(ss.MonikerKind=SE={}));var TE;(function(t){t.method="textDocument/moniker",t.messageDirection=_E.MessageDirection.clientToServer,t.type=new _E.ProtocolRequestType(t.method)})(TE||(ss.MonikerRequest=TE={}))});var AE=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.TypeHierarchySubtypesRequest=os.TypeHierarchySupertypesRequest=os.TypeHierarchyPrepareRequest=void 0;var Zo=it(),xE;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(xE||(os.TypeHierarchyPrepareRequest=xE={}));var EE;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(EE||(os.TypeHierarchySupertypesRequest=EE={}));var kE;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Zo.MessageDirection.clientToServer,t.type=new Zo.ProtocolRequestType(t.method)})(kE||(os.TypeHierarchySubtypesRequest=kE={}))});var RE=f(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.InlineValueRefreshRequest=ea.InlineValueRequest=void 0;var Ep=it(),PE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Ep.MessageDirection.clientToServer,t.type=new Ep.ProtocolRequestType(t.method)})(PE||(ea.InlineValueRequest=PE={}));var OE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Ep.MessageDirection.serverToClient,t.type=new Ep.ProtocolRequestType0(t.method)})(OE||(ea.InlineValueRefreshRequest=OE={}))});var ME=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.InlayHintRefreshRequest=as.InlayHintResolveRequest=as.InlayHintRequest=void 0;var ta=it(),DE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ta.MessageDirection.clientToServer,t.type=new ta.ProtocolRequestType(t.method)})(DE||(as.InlayHintRequest=DE={}));var IE;(function(t){t.method="inlayHint/resolve",t.messageDirection=ta.MessageDirection.clientToServer,t.type=new ta.ProtocolRequestType(t.method)})(IE||(as.InlayHintResolveRequest=IE={}));var CE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ta.MessageDirection.serverToClient,t.type=new ta.ProtocolRequestType0(t.method)})(CE||(as.InlayHintRefreshRequest=CE={}))});var $E=f(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DiagnosticRefreshRequest=ir.WorkspaceDiagnosticRequest=ir.DocumentDiagnosticRequest=ir.DocumentDiagnosticReportKind=ir.DiagnosticServerCancellationData=void 0;var BE=Ws(),ML=dp(),na=it(),LE;(function(t){function e(n){let r=n;return r&&ML.boolean(r.retriggerRequest)}t.is=e})(LE||(ir.DiagnosticServerCancellationData=LE={}));var NE;(function(t){t.Full="full",t.Unchanged="unchanged"})(NE||(ir.DocumentDiagnosticReportKind=NE={}));var qE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=na.MessageDirection.clientToServer,t.type=new na.ProtocolRequestType(t.method),t.partialResult=new BE.ProgressType})(qE||(ir.DocumentDiagnosticRequest=qE={}));var jE;(function(t){t.method="workspace/diagnostic",t.messageDirection=na.MessageDirection.clientToServer,t.type=new na.ProtocolRequestType(t.method),t.partialResult=new BE.ProgressType})(jE||(ir.WorkspaceDiagnosticRequest=jE={}));var FE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=na.MessageDirection.serverToClient,t.type=new na.ProtocolRequestType0(t.method)})(FE||(ir.DiagnosticRefreshRequest=FE={}))});var zE=f(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.DidCloseNotebookDocumentNotification=bt.DidSaveNotebookDocumentNotification=bt.DidChangeNotebookDocumentNotification=bt.NotebookCellArrayChange=bt.DidOpenNotebookDocumentNotification=bt.NotebookDocumentSyncRegistrationType=bt.NotebookDocument=bt.NotebookCell=bt.ExecutionSummary=bt.NotebookCellKind=void 0;var Ou=hp(),Cr=dp(),Zr=it(),Dy;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Dy||(bt.NotebookCellKind=Dy={}));var Iy;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return Cr.objectLiteral(s)&&Ou.uinteger.is(s.executionOrder)&&(s.success===void 0||Cr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Iy||(bt.ExecutionSummary=Iy={}));var kp;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return Cr.objectLiteral(o)&&Dy.is(o.kind)&&Ou.DocumentUri.is(o.document)&&(o.metadata===void 0||Cr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Iy.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(Cr.objectLiteral(s)&&Cr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let p=0;p<c.length;p++){let h=c[p];if(!i(s[h],o[h]))return!1}}return!0}})(kp||(bt.NotebookCell=kp={}));var UE;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return Cr.objectLiteral(i)&&Cr.string(i.uri)&&Ou.integer.is(i.version)&&Cr.typedArray(i.cells,kp.is)}t.is=n})(UE||(bt.NotebookDocument=UE={}));var ra;(function(t){t.method="notebookDocument/sync",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.RegistrationType(t.method)})(ra||(bt.NotebookDocumentSyncRegistrationType=ra={}));var KE;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(KE||(bt.DidOpenNotebookDocumentNotification=KE={}));var WE;(function(t){function e(r){let i=r;return Cr.objectLiteral(i)&&Ou.uinteger.is(i.start)&&Ou.uinteger.is(i.deleteCount)&&(i.cells===void 0||Cr.typedArray(i.cells,kp.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(WE||(bt.NotebookCellArrayChange=WE={}));var GE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(GE||(bt.DidChangeNotebookDocumentNotification=GE={}));var HE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(HE||(bt.DidSaveNotebookDocumentNotification=HE={}));var VE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Zr.MessageDirection.clientToServer,t.type=new Zr.ProtocolNotificationType(t.method),t.registrationMethod=ra.method})(VE||(bt.DidCloseNotebookDocumentNotification=VE={}))});var JE=f(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.InlineCompletionRequest=void 0;var XE=it(),YE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=XE.MessageDirection.clientToServer,t.type=new XE.ProtocolRequestType(t.method)})(YE||(Ap.InlineCompletionRequest=YE={}))});var lA=f(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var U=it(),QE=hp(),Kt=dp(),LL=wx();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return LL.ImplementationRequest}});var NL=kx();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return NL.TypeDefinitionRequest}});var oA=Ox();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return oA.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return oA.DidChangeWorkspaceFoldersNotification}});var qL=Ix();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return qL.ConfigurationRequest}});var aA=Lx();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return aA.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return aA.ColorPresentationRequest}});var uA=jx();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return uA.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return uA.FoldingRangeRefreshRequest}});var jL=$x();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return jL.DeclarationRequest}});var FL=Wx();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return FL.SelectionRangeRequest}});var qy=zx();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return qy.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return qy.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return qy.WorkDoneProgressCancelNotification}});var jy=Qx();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jy.CallHierarchyPrepareRequest}});var ia=iE();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return ia.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ia.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ia.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ia.SemanticTokensRegistrationType}});var BL=aE();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return BL.ShowDocumentRequest}});var $L=lE();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $L.LinkedEditingRangeRequest}});var Gs=bE();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return Gs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Gs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Gs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Gs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Gs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Gs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Gs.WillDeleteFilesRequest}});var Fy=wE();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Fy.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Fy.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Fy.MonikerRequest}});var By=AE();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return By.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return By.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return By.TypeHierarchySupertypesRequest}});var cA=RE();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return cA.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return cA.InlineValueRefreshRequest}});var $y=ME();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return $y.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return $y.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return $y.InlayHintRefreshRequest}});var Ru=$E();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ru.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ru.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ru.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ru.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ru.DiagnosticRefreshRequest}});var ei=zE();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return ei.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return ei.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return ei.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return ei.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ei.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ei.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ei.DidCloseNotebookDocumentNotification}});var UL=JE();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return UL.InlineCompletionRequest}});var Cy;(function(t){function e(n){let r=n;return Kt.string(r)||Kt.string(r.language)||Kt.string(r.scheme)||Kt.string(r.pattern)}t.is=e})(Cy||(S.TextDocumentFilter=Cy={}));var My;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(Kt.string(r.notebookType)||Kt.string(r.scheme)||Kt.string(r.pattern))}t.is=e})(My||(S.NotebookDocumentFilter=My={}));var Ly;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(Kt.string(r.notebook)||My.is(r.notebook))&&(r.language===void 0||Kt.string(r.language))}t.is=e})(Ly||(S.NotebookCellTextDocumentFilter=Ly={}));var Ny;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Kt.string(r)&&!Cy.is(r)&&!Ly.is(r))return!1;return!0}t.is=e})(Ny||(S.DocumentSelector=Ny={}));var ZE;(function(t){t.method="client/registerCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(ZE||(S.RegistrationRequest=ZE={}));var ek;(function(t){t.method="client/unregisterCapability",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(ek||(S.UnregistrationRequest=ek={}));var tk;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(tk||(S.ResourceOperationKind=tk={}));var nk;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nk||(S.FailureHandlingKind=nk={}));var rk;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(rk||(S.PositionEncodingKind=rk={}));var ik;(function(t){function e(n){let r=n;return r&&Kt.string(r.id)&&r.id.length>0}t.hasId=e})(ik||(S.StaticRegistrationOptions=ik={}));var sk;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Ny.is(r.documentSelector))}t.is=e})(sk||(S.TextDocumentRegistrationOptions=sk={}));var ok;(function(t){function e(r){let i=r;return Kt.objectLiteral(i)&&(i.workDoneProgress===void 0||Kt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Kt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(ok||(S.WorkDoneProgressOptions=ok={}));var ak;(function(t){t.method="initialize",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(ak||(S.InitializeRequest=ak={}));var uk;(function(t){t.unknownProtocolVersion=1})(uk||(S.InitializeErrorCodes=uk={}));var ck;(function(t){t.method="initialized",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(ck||(S.InitializedNotification=ck={}));var lk;(function(t){t.method="shutdown",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType0(t.method)})(lk||(S.ShutdownRequest=lk={}));var pk;(function(t){t.method="exit",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType0(t.method)})(pk||(S.ExitNotification=pk={}));var hk;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(hk||(S.DidChangeConfigurationNotification=hk={}));var dk;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(dk||(S.MessageType=dk={}));var fk;(function(t){t.method="window/showMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(fk||(S.ShowMessageNotification=fk={}));var gk;(function(t){t.method="window/showMessageRequest",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType(t.method)})(gk||(S.ShowMessageRequest=gk={}));var mk;(function(t){t.method="window/logMessage",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(mk||(S.LogMessageNotification=mk={}));var yk;(function(t){t.method="telemetry/event",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(yk||(S.TelemetryEventNotification=yk={}));var bk;(function(t){t.None=0,t.Full=1,t.Incremental=2})(bk||(S.TextDocumentSyncKind=bk={}));var _k;(function(t){t.method="textDocument/didOpen",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(_k||(S.DidOpenTextDocumentNotification=_k={}));var vk;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(vk||(S.TextDocumentContentChangeEvent=vk={}));var Sk;(function(t){t.method="textDocument/didChange",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Sk||(S.DidChangeTextDocumentNotification=Sk={}));var Tk;(function(t){t.method="textDocument/didClose",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Tk||(S.DidCloseTextDocumentNotification=Tk={}));var wk;(function(t){t.method="textDocument/didSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(wk||(S.DidSaveTextDocumentNotification=wk={}));var xk;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(xk||(S.TextDocumentSaveReason=xk={}));var Ek;(function(t){t.method="textDocument/willSave",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Ek||(S.WillSaveTextDocumentNotification=Ek={}));var kk;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(kk||(S.WillSaveTextDocumentWaitUntilRequest=kk={}));var Ak;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolNotificationType(t.method)})(Ak||(S.DidChangeWatchedFilesNotification=Ak={}));var Pk;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Pk||(S.FileChangeType=Pk={}));var Ok;(function(t){function e(n){let r=n;return Kt.objectLiteral(r)&&(QE.URI.is(r.baseUri)||QE.WorkspaceFolder.is(r.baseUri))&&Kt.string(r.pattern)}t.is=e})(Ok||(S.RelativePattern=Ok={}));var Rk;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Rk||(S.WatchKind=Rk={}));var Dk;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolNotificationType(t.method)})(Dk||(S.PublishDiagnosticsNotification=Dk={}));var Ik;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Ik||(S.CompletionTriggerKind=Ik={}));var Ck;(function(t){t.method="textDocument/completion",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Ck||(S.CompletionRequest=Ck={}));var Mk;(function(t){t.method="completionItem/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Mk||(S.CompletionResolveRequest=Mk={}));var Lk;(function(t){t.method="textDocument/hover",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Lk||(S.HoverRequest=Lk={}));var Nk;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Nk||(S.SignatureHelpTriggerKind=Nk={}));var qk;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(qk||(S.SignatureHelpRequest=qk={}));var jk;(function(t){t.method="textDocument/definition",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(jk||(S.DefinitionRequest=jk={}));var Fk;(function(t){t.method="textDocument/references",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Fk||(S.ReferencesRequest=Fk={}));var Bk;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Bk||(S.DocumentHighlightRequest=Bk={}));var $k;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})($k||(S.DocumentSymbolRequest=$k={}));var Uk;(function(t){t.method="textDocument/codeAction",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Uk||(S.CodeActionRequest=Uk={}));var Kk;(function(t){t.method="codeAction/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Kk||(S.CodeActionResolveRequest=Kk={}));var Wk;(function(t){t.method="workspace/symbol",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Wk||(S.WorkspaceSymbolRequest=Wk={}));var Gk;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Gk||(S.WorkspaceSymbolResolveRequest=Gk={}));var Hk;(function(t){t.method="textDocument/codeLens",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Hk||(S.CodeLensRequest=Hk={}));var Vk;(function(t){t.method="codeLens/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Vk||(S.CodeLensResolveRequest=Vk={}));var zk;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType0(t.method)})(zk||(S.CodeLensRefreshRequest=zk={}));var Xk;(function(t){t.method="textDocument/documentLink",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Xk||(S.DocumentLinkRequest=Xk={}));var Yk;(function(t){t.method="documentLink/resolve",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Yk||(S.DocumentLinkResolveRequest=Yk={}));var Jk;(function(t){t.method="textDocument/formatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Jk||(S.DocumentFormattingRequest=Jk={}));var Qk;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Qk||(S.DocumentRangeFormattingRequest=Qk={}));var Zk;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(Zk||(S.DocumentRangesFormattingRequest=Zk={}));var eA;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(eA||(S.DocumentOnTypeFormattingRequest=eA={}));var tA;(function(t){t.Identifier=1})(tA||(S.PrepareSupportDefaultBehavior=tA={}));var nA;(function(t){t.method="textDocument/rename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(nA||(S.RenameRequest=nA={}));var rA;(function(t){t.method="textDocument/prepareRename",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(rA||(S.PrepareRenameRequest=rA={}));var iA;(function(t){t.method="workspace/executeCommand",t.messageDirection=U.MessageDirection.clientToServer,t.type=new U.ProtocolRequestType(t.method)})(iA||(S.ExecuteCommandRequest=iA={}));var sA;(function(t){t.method="workspace/applyEdit",t.messageDirection=U.MessageDirection.serverToClient,t.type=new U.ProtocolRequestType("workspace/applyEdit")})(sA||(S.ApplyWorkspaceEditRequest=sA={}))});var hA=f(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.createProtocolConnection=void 0;var pA=Ws();function KL(t,e,n,r){return pA.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,pA.createMessageConnection)(t,e,n,r)}Pp.createProtocolConnection=KL});var fA=f(Ln=>{"use strict";var WL=Ln&&Ln.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Op=Ln&&Ln.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WL(e,t,n)};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LSPErrorCodes=Ln.createProtocolConnection=void 0;Op(Ws(),Ln);Op(hp(),Ln);Op(it(),Ln);Op(lA(),Ln);var GL=hA();Object.defineProperty(Ln,"createProtocolConnection",{enumerable:!0,get:function(){return GL.createProtocolConnection}});var dA;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(dA||(Ln.LSPErrorCodes=dA={}))});var kt=f(ti=>{"use strict";var HL=ti&&ti.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),gA=ti&&ti.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HL(e,t,n)};Object.defineProperty(ti,"__esModule",{value:!0});ti.createProtocolConnection=void 0;var VL=Ey();gA(Ey(),ti);gA(fA(),ti);function zL(t,e,n,r){return(0,VL.createMessageConnection)(t,e,n,r)}ti.createProtocolConnection=zL});var Uy=f(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.generateUuid=sr.parse=sr.isUUID=sr.v4=sr.empty=void 0;var Du=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Iu=class t extends Du{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Iu._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Iu._timeHighBits=["8","9","a","b"];sr.empty=new Du("00000000-0000-0000-0000-000000000000");function mA(){return new Iu}sr.v4=mA;var XL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yA(t){return XL.test(t)}sr.isUUID=yA;function YL(t){if(!yA(t))throw new Error("invalid uuid");return new Du(t)}sr.parse=YL;function JL(){return mA().asHex()}sr.generateUuid=JL});var bA=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.attachPartialResult=cs.ProgressFeature=cs.attachWorkDone=void 0;var us=kt(),QL=Uy(),Hs=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(us.WorkDoneProgress.type,this._token,s)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(us.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(us.WorkDoneProgress.type,this._token,{kind:"end"})}};Hs.Instances=new Map;var Rp=class extends Hs{constructor(e,n){super(e,n),this._source=new us.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Cu=class{constructor(){}begin(){}report(){}done(){}},Dp=class extends Cu{constructor(){super(),this._source=new us.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function ZL(t,e){if(e===void 0||e.workDoneToken===void 0)return new Cu;let n=e.workDoneToken;return delete e.workDoneToken,new Hs(t,n)}cs.attachWorkDone=ZL;var eN=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(us.WorkDoneProgressCancelNotification.type,n=>{let r=Hs.Instances.get(n.token);(r instanceof Rp||r instanceof Dp)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Cu:new Hs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,QL.generateUuid)();return this.connection.sendRequest(us.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Rp(this.connection,e))}else return Promise.resolve(new Dp)}};cs.ProgressFeature=eN;var Ky;(function(t){t.type=new us.ProgressType})(Ky||(Ky={}));var Wy=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Ky.type,this._token,e)}};function tN(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Wy(t,n)}cs.attachPartialResult=tN});var _A=f(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.ConfigurationFeature=void 0;var nN=kt(),rN=Kl(),iN=t=>class extends t{getConfiguration(e){return e?rN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(nN.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ip.ConfigurationFeature=iN});var vA=f(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.WorkspaceFoldersFeature=void 0;var Cp=kt(),sN=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Cp.Emitter,this.connection.onNotification(Cp.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Cp.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(Cp.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Mp.WorkspaceFoldersFeature=sN});var SA=f(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.CallHierarchyFeature=void 0;var Gy=kt(),oN=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Gy.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Gy.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Gy.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Lp.CallHierarchyFeature=oN});var Vy=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.SemanticTokensBuilder=ls.SemanticTokensDiff=ls.SemanticTokensFeature=void 0;var Np=kt(),aN=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Np.SemanticTokensRefreshRequest.type),on:e=>{let n=Np.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Np.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Np.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ls.SemanticTokensFeature=aN;var qp=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};ls.SemanticTokensDiff=qp;var Hy=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,i,s){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new qp(this._prevData,this._data).computeDiff()}:this.build()}};ls.SemanticTokensBuilder=Hy});var TA=f(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.ShowDocumentFeature=void 0;var uN=kt(),cN=t=>class extends t{showDocument(e){return this.connection.sendRequest(uN.ShowDocumentRequest.type,e)}};jp.ShowDocumentFeature=cN});var wA=f(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.FileOperationsFeature=void 0;var sa=kt(),lN=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(sa.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(sa.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(sa.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(sa.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(sa.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(sa.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Fp.FileOperationsFeature=lN});var xA=f(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.LinkedEditingRangeFeature=void 0;var pN=kt(),hN=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(pN.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Bp.LinkedEditingRangeFeature=hN});var EA=f($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.TypeHierarchyFeature=void 0;var zy=kt(),dN=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(zy.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=zy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=zy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$p.TypeHierarchyFeature=dN});var AA=f(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.InlineValueFeature=void 0;var kA=kt(),fN=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(kA.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(kA.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Up.InlineValueFeature=fN});var OA=f(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.FoldingRangeFeature=void 0;var PA=kt(),gN=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(PA.FoldingRangeRefreshRequest.type),on:e=>{let n=PA.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Kp.FoldingRangeFeature=gN});var RA=f(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.InlayHintFeature=void 0;var Xy=kt(),mN=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Xy.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Xy.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Xy.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Wp.InlayHintFeature=mN});var DA=f(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.DiagnosticFeature=void 0;var Mu=kt(),yN=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Mu.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Mu.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Mu.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Mu.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Mu.WorkspaceDiagnosticRequest.partialResult,n)))}}};Gp.DiagnosticFeature=yN});var Jy=f(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.TextDocuments=void 0;var Vs=kt(),Yy=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Vs.Emitter,this._onDidOpen=new Vs.Emitter,this._onDidClose=new Vs.Emitter,this._onDidSave=new Vs.Emitter,this._onWillSave=new Vs.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=Vs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Vs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Hp.TextDocuments=Yy});var Zy=f(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.NotebookDocuments=oa.NotebookSyncFeature=void 0;var or=kt(),IA=Jy(),bN=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(or.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(or.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(or.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(or.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};oa.NotebookSyncFeature=bN;var Vp=class t{onDidOpenTextDocument(e){return this.openHandler=e,or.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,or.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,or.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Vp.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Qy=class{constructor(e){e instanceof IA.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new IA.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new or.Emitter,this._onDidChange=new or.Emitter,this._onDidSave=new or.Emitter,this._onDidClose=new or.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new Vp,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],p=[],h=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let T=A.structure.array;if(s.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),A.structure.didOpen!==void 0)for(let w of A.structure.didOpen)n.openTextDocument({textDocument:w}),c.push(w.uri);if(A.structure.didClose)for(let w of A.structure.didClose)n.closeTextDocument({textDocument:w}),l.push(w.uri)}if(A.data!==void 0){let T=new Map(A.data.map(w=>[w.document,w]));for(let w=0;w<=s.cells.length;w++){let _=T.get(s.cells[w].document);if(_!==void 0){let N=s.cells.splice(w,1,_);if(p.push({old:N[0],new:_}),T.delete(_.document),T.size===0)break}}}if(A.textContent!==void 0)for(let T of A.textContent)n.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),h.push(T.document.uri)}this.updateCellMap(s);let m={notebookDocument:s};a&&(m.metadata={old:o,new:s.metadata});let b=[];for(let A of c)b.push(this.getNotebookCell(A));let v=[];for(let A of l)v.push(this.getNotebookCell(A));let D=[];for(let A of h)D.push(this.getNotebookCell(A));(b.length>0||v.length>0||p.length>0||D.length>0)&&(m.cells={added:b,removed:v,changed:{data:p,textContent:D}}),(m.metadata!==void 0||m.cells!==void 0)&&this._onDidChange.fire(m)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),or.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};oa.NotebookDocuments=Qy});var CA=f(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.MonikerFeature=void 0;var _N=kt(),vN=t=>class extends t{get moniker(){return{on:e=>{let n=_N.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};zp.MonikerFeature=vN});var sb=f(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var z=kt(),ar=Kl(),tb=Uy(),de=bA(),SN=_A(),TN=vA(),wN=SA(),xN=Vy(),EN=TA(),kN=wA(),AN=xA(),PN=EA(),ON=AA(),RN=OA(),DN=RA(),IN=DA(),CN=Zy(),MN=CA();function eb(t){if(t!==null)return t}var nb=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ie.ErrorMessageTracker=nb;var Xp=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(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}debug(e){this.send(z.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,z.RAL)().console.error("Sending log message failed")})}},rb=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(eb)}},MA=(0,EN.ShowDocumentFeature)((0,de.ProgressFeature)(rb)),LA;(function(t){function e(){return new Yp}t.create=e})(LA||(Ie.BulkRegistration=LA={}));var Yp=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=ar.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=tb.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},NA;(function(t){function e(){return new Lu(void 0,[])}t.create=e})(NA||(Ie.BulkUnregistration=NA={}));var Lu=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(z.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=ar.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Jp=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof Yp?this.registerMany(e):e instanceof Lu?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=ar.string(n)?n:n.method,s=tb.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=ar.string(e)?e:e.method,i=tb.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,s).then(o=>z.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(z.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(z.RegistrationRequest.type,n).then(()=>new Lu(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ib=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(z.ApplyWorkspaceEditRequest.type,r)}},qA=(0,kN.FileOperationsFeature)((0,TN.WorkspaceFoldersFeature)((0,SN.ConfigurationFeature)(ib))),Qp=class{constructor(){this._trace=z.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0}).catch(()=>{})}},Zp=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(z.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},eh=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,de.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,de.attachPartialResult)(this.connection,n)}};Ie._LanguagesImpl=eh;var jA=(0,RN.FoldingRangeFeature)((0,MN.MonikerFeature)((0,IN.DiagnosticFeature)((0,DN.InlayHintFeature)((0,ON.InlineValueFeature)((0,PN.TypeHierarchyFeature)((0,AN.LinkedEditingRangeFeature)((0,xN.SemanticTokensFeature)((0,wN.CallHierarchyFeature)(eh))))))))),th=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,de.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,de.attachPartialResult)(this.connection,n)}};Ie._NotebooksImpl=th;var FA=(0,CN.NotebookSyncFeature)(th);function BA(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=BA;function $A(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=$A;function UA(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=UA;function KA(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=KA;function WA(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=WA;function GA(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=GA;function HA(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=HA;function VA(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=VA;function LN(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,BA),tracer:n(t.tracer,e.tracer,UA),telemetry:n(t.telemetry,e.telemetry,$A),client:n(t.client,e.client,KA),window:n(t.window,e.window,WA),workspace:n(t.workspace,e.workspace,GA),languages:n(t.languages,e.languages,HA),notebooks:n(t.notebooks,e.notebooks,VA)}}Ie.combineFeatures=LN;function NN(t,e,n){let r=n&&n.console?new(n.console(Xp)):new Xp,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Qp)):new Qp,o=n&&n.telemetry?new(n.telemetry(Zp)):new Zp,a=n&&n.client?new(n.client(Jp)):new Jp,u=n&&n.window?new(n.window(MA)):new MA,c=n&&n.workspace?new(n.workspace(qA)):new qA,l=n&&n.languages?new(n.languages(jA)):new jA,p=n&&n.notebooks?new(n.notebooks(FA)):new FA,h=[r,s,o,a,u,c,l,p];function m(T){return T instanceof Promise?T:ar.thenable(T)?new Promise((w,_)=>{T.then(N=>w(N),N=>_(N))}):Promise.resolve(T)}let b,v,D,A={listen:()=>i.listen(),sendRequest:(T,...w)=>i.sendRequest(ar.string(T)?T:T.method,...w),onRequest:(T,w)=>i.onRequest(T,w),sendNotification:(T,w)=>{let _=ar.string(T)?T:T.method;return i.sendNotification(_,w)},onNotification:(T,w)=>i.onNotification(T,w),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(v=T,{dispose:()=>{v=void 0}}),onInitialized:T=>i.onNotification(z.InitializedNotification.type,T),onShutdown:T=>(b=T,{dispose:()=>{b=void 0}}),onExit:T=>(D=T,{dispose:()=>{D=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return p},onDidChangeConfiguration:T=>i.onNotification(z.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(z.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(z.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(z.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(z.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(z.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(z.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(z.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(z.HoverRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onCompletion:T=>i.onRequest(z.CompletionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCompletionResolve:T=>i.onRequest(z.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(z.SignatureHelpRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDeclaration:T=>i.onRequest(z.DeclarationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDefinition:T=>i.onRequest(z.DefinitionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onTypeDefinition:T=>i.onRequest(z.TypeDefinitionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onImplementation:T=>i.onRequest(z.ImplementationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onReferences:T=>i.onRequest(z.ReferencesRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentHighlight:T=>i.onRequest(z.DocumentHighlightRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentSymbol:T=>i.onRequest(z.DocumentSymbolRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onWorkspaceSymbol:T=>i.onRequest(z.WorkspaceSymbolRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onWorkspaceSymbolResolve:T=>i.onRequest(z.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(z.CodeActionRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCodeActionResolve:T=>i.onRequest(z.CodeActionResolveRequest.type,(w,_)=>T(w,_)),onCodeLens:T=>i.onRequest(z.CodeLensRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onCodeLensResolve:T=>i.onRequest(z.CodeLensResolveRequest.type,(w,_)=>T(w,_)),onDocumentFormatting:T=>i.onRequest(z.DocumentFormattingRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDocumentRangeFormatting:T=>i.onRequest(z.DocumentRangeFormattingRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(z.DocumentOnTypeFormattingRequest.type,(w,_)=>T(w,_)),onRenameRequest:T=>i.onRequest(z.RenameRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),onPrepareRename:T=>i.onRequest(z.PrepareRenameRequest.type,(w,_)=>T(w,_)),onDocumentLinks:T=>i.onRequest(z.DocumentLinkRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onDocumentLinkResolve:T=>i.onRequest(z.DocumentLinkResolveRequest.type,(w,_)=>T(w,_)),onDocumentColor:T=>i.onRequest(z.DocumentColorRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onColorPresentation:T=>i.onRequest(z.ColorPresentationRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onFoldingRanges:T=>i.onRequest(z.FoldingRangeRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onSelectionRanges:T=>i.onRequest(z.SelectionRangeRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),(0,de.attachPartialResult)(i,w))),onExecuteCommand:T=>i.onRequest(z.ExecuteCommandRequest.type,(w,_)=>T(w,_,(0,de.attachWorkDone)(i,w),void 0)),dispose:()=>i.dispose()};for(let T of h)T.attach(A);return i.onRequest(z.InitializeRequest.type,T=>{e.initialize(T),ar.string(T.trace)&&(s.trace=z.Trace.fromString(T.trace));for(let w of h)w.initialize(T.capabilities);if(v){let w=v(T,new z.CancellationTokenSource().token,(0,de.attachWorkDone)(i,T),void 0);return m(w).then(_=>{if(_ instanceof z.ResponseError)return _;let N=_;N||(N={capabilities:{}});let O=N.capabilities;O||(O={},N.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=ar.number(A.__textDocumentSync)?A.__textDocumentSync:z.TextDocumentSyncKind.None:!ar.number(O.textDocumentSync)&&!ar.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=ar.number(A.__textDocumentSync)?A.__textDocumentSync:z.TextDocumentSyncKind.None);for(let G of h)G.fillServerCapabilities(O);return N})}else{let w={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let _ of h)_.fillServerCapabilities(w.capabilities);return w}}),i.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,b)return b(new z.CancellationTokenSource().token)}),i.onNotification(z.ExitNotification.type,()=>{try{D&&D()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(z.SetTraceNotification.type,T=>{s.trace=z.Trace.fromString(T.value)}),A}Ie.createConnection=NN});var zA=f(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.resolveModulePath=Nn.FileSystem=Nn.resolveGlobalYarnPath=Nn.resolveGlobalNodePath=Nn.resolve=Nn.uriToFilePath=void 0;var qN=require("url"),Mr=require("path"),ob=require("fs"),lb=require("child_process");function jN(t){let e=qN.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return Mr.normalize(n.join("/"))}Nn.uriToFilePath=jN;function ab(){return process.platform==="win32"}function nh(t,e,n,r){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&ob.existsSync(e)&&(c[i]?c[i]=e+Mr.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,lb.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",h=>{a(h)}),l.on("message",h=>{h.c==="r"&&(l.send({c:"e"}),h.s?o(h.r):a(new Error(`Failed to resolve module: ${t}`)))});let p={c:"rs",a:t};l.send(p)}catch(l){a(l)}})}Nn.resolve=nh;function ub(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};ab()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,lb.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?ab()?Mr.join(o,"node_modules"):Mr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Nn.resolveGlobalNodePath=ub;function FN(t){let e="yarn",n={encoding:"utf8"};ab()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,lb.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return Mr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Nn.resolveGlobalYarnPath=FN;var cb;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ob.existsSync(__filename.toUpperCase())||!ob.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Mr.normalize(s).indexOf(Mr.normalize(i))===0:Mr.normalize(s).toLowerCase().indexOf(Mr.normalize(i).toLowerCase())===0}t.isParent=r})(cb||(Nn.FileSystem=cb={}));function BN(t,e,n,r){return n?(Mr.isAbsolute(n)||(n=Mr.join(t,n)),nh(e,n,n,r).then(i=>cb.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>nh(e,ub(r),t,r))):nh(e,ub(r),t,r)}Nn.resolveModulePath=BN});var pb=f((L6,XA)=>{"use strict";XA.exports=kt()});var YA=f(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.InlineCompletionFeature=void 0;var $N=kt(),UN=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest($N.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};rh.InlineCompletionFeature=UN});var ZA=f(cn=>{"use strict";var KN=cn&&cn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),QA=cn&&cn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KN(e,t,n)};Object.defineProperty(cn,"__esModule",{value:!0});cn.ProposedFeatures=cn.NotebookDocuments=cn.TextDocuments=cn.SemanticTokensBuilder=void 0;var WN=Vy();Object.defineProperty(cn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return WN.SemanticTokensBuilder}});var GN=YA();QA(kt(),cn);var HN=Jy();Object.defineProperty(cn,"TextDocuments",{enumerable:!0,get:function(){return HN.TextDocuments}});var VN=Zy();Object.defineProperty(cn,"NotebookDocuments",{enumerable:!0,get:function(){return VN.NotebookDocuments}});QA(sb(),cn);var JA;(function(t){t.all={__brand:"features",languages:GN.InlineCompletionFeature}})(JA||(cn.ProposedFeatures=JA={}))});var db=f(ur=>{"use strict";var zN=ur&&ur.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),r1=ur&&ur.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zN(e,t,n)};Object.defineProperty(ur,"__esModule",{value:!0});ur.createConnection=ur.Files=void 0;var e1=require("node:util"),hb=Kl(),XN=sb(),Nu=zA(),zs=pb();r1(pb(),ur);r1(ZA(),ur);var t1;(function(t){t.uriToFilePath=Nu.uriToFilePath,t.resolveGlobalNodePath=Nu.resolveGlobalNodePath,t.resolveGlobalYarnPath=Nu.resolveGlobalYarnPath,t.resolve=Nu.resolve,t.resolveModulePath=Nu.resolveModulePath})(t1||(ur.Files=t1={}));var n1;function ih(){if(n1!==void 0)try{n1.end()}catch{}}var aa=!1,i1;function YN(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(i1=setInterval(()=>{try{process.kill(r,0)}catch{ih(),process.exit(aa?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}YN();var JN={initialize:t=>{let e=t.processId;hb.number(e)&&i1===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(aa?0:1)}},3e3)},get shutdownReceived(){return aa},set shutdownReceived(t){aa=t},exit:t=>{ih(),process.exit(t)}};function QN(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),zs.ConnectionStrategy.is(t)||zs.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),ZN(s,o,a,i)}ur.createConnection=QN;function ZN(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let p=0;p<l.length;p++){let h=l[p];if(h==="--node-ipc"){t=new zs.IPCMessageReader(process),e=new zs.IPCMessageWriter(process);break}else if(h==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(h==="--socket"){u=parseInt(l[p+1]);break}else if(h==="--pipe"){c=l[p+1];break}else{var s=h.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let p=(0,zs.createServerSocketTransport)(u);t=p[0],e=p[1]}else if(c){let p=(0,zs.createServerPipeTransport)(c);t=p[0],e=p[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(hb.func(t.read)&&hb.func(t.on)){let u=t;u.on("end",()=>{ih(),process.exit(aa?0:1)}),u.on("close",()=>{ih(),process.exit(aa?0:1)})}let a=u=>{let c=(0,zs.createProtocolConnection)(t,e,u,n);return i&&eq(u),c};return(0,XN.createConnection)(a,JN,r)}function eq(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,e1.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,e1.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
36
|
+
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var fb=f((B6,s1)=>{"use strict";s1.exports=db()});var Lr=f(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.getAllDependencyLocationsFromGraph=ht.parseDependencyRawLocation=ht.parseDependencyLocation=ht.DependencyType=ht.TypeAnalyzerStrategy=ht.IndentationType=ht.DefaultFileExtensions=ht.ConfigurationNamespace=ht.LanguageId=void 0;ht.LanguageId="miniscript";ht.ConfigurationNamespace="miniscript";ht.DefaultFileExtensions=["ms"];var tq;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(tq=ht.IndentationType||(ht.IndentationType={}));var nq;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(nq=ht.TypeAnalyzerStrategy||(ht.TypeAnalyzerStrategy={}));var rq;(function(t){t.Root="root",t.Include="include",t.Import="import"})(rq=ht.DependencyType||(ht.DependencyType={}));function iq(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}ht.parseDependencyLocation=iq;function sq(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}ht.parseDependencyRawLocation=sq;function oq(t,e=new Set){let n=[],r=[...t.children];for(;r.length>0;){let i=r.pop();e.has(i.item.document.textDocument.uri)||(e.add(i.item.document.textDocument.uri),n.push(i.item.document),r.push(...i.children))}return n}ht.getAllDependencyLocationsFromGraph=oq});var qu=f(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.Position=void 0;var gb=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};sh.Position=gb});var ps=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.LiteralToken=Gn.Token=Gn.BaseToken=Gn.BaseTokenOptions=Gn.TokenType=void 0;var o1=qu(),aq;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(aq=Gn.TokenType||(Gn.TokenType={}));var mb=class{};Gn.BaseTokenOptions=mb;var ju=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new o1.Position(this.line,r[0]-n[0]+1),this.end=new o1.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Gn.BaseToken=ju;var yb=class extends ju{};Gn.Token=yb;var bb=class extends ju{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Gn.LiteralToken=bb});var oh=f(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.CharacterCode=void 0;var uq;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(uq=Fu.CharacterCode||(Fu.CharacterCode={}))});var ua=f(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Keyword=void 0;var cq;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(cq=Bu.Keyword||(Bu.Keyword={}))});var Sb=f(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var cr=oh(),lq=ua(),_b=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(lq.Keyword)))}isWhitespace(e){return cr.CharacterCode.WHITESPACE===e||cr.CharacterCode.TAB===e}isEndOfLine(e){return cr.CharacterCode.NEW_LINE===e||cr.CharacterCode.RETURN_LINE===e}isComment(e,n){return cr.CharacterCode.SLASH===e&&cr.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=cr.CharacterCode.NUMBER_0&&e<=cr.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case cr.CharacterCode.RETURN_LINE:return cr.CharacterCode.NEW_LINE===n;case cr.CharacterCode.NEW_LINE:return cr.CharacterCode.RETURN_LINE===n}return!1}};vb.default=_b});var ah=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.ParserException=ca.LexerException=void 0;var Tb=class extends Error{constructor(e,n){super(e),this.range=n}};ca.LexerException=Tb;var wb=class extends Error{constructor(e,n){super(e),this.range=n}};ca.ParserException=wb});var xb=f($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.Literal=void 0;var pq;(function(t){t.True="true",t.False="false",t.Null="null"})(pq=$u.Literal||($u.Literal={}))});var la=f(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.Operator=void 0;var hq;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(hq=Uu.Operator||(Uu.Operator={}))});var Ku=f(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.Range=void 0;var Eb=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};uh.Range=Eb});var Pb=f(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var kb=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};Ab.default=kb});var Db=f(Gu=>{"use strict";var u1=Gu&&Gu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gu,"__esModule",{value:!0});var st=ps(),dq=u1(Sb()),be=oh(),fq=ah(),Ob=ua(),Wu=xb(),ot=la(),pa=qu(),Rb=Ku(),a1=u1(Pb());function hs(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var ch=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new dq.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new a1.default,r.snapshot=new a1.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new st.Token({type:st.TokenType.EOL,value:ot.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new st.Token({type:st.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new st.Token({type:st.TokenType.EOF,value:ot.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new st.LiteralToken({type:st.TokenType.BooleanLiteral,value:e===Wu.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new st.LiteralToken({type:st.TokenType.NilLiteral,value:null,raw:Wu.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new st.Token({type:st.TokenType.SliceOperator,value:ot.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new st.Token({type:st.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new st.LiteralToken({type:st.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let m=n.codeAt();if(n.validator.isEndOfLine(m))r.isWinNewline(m,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(be.CharacterCode.QUOTE===m){if(be.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Rb.Range(new pa.Position(i,o-a+1),new pa.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),p=l.slice(1,-1).replace(/""/g,ot.Operator.Escape),h=new st.LiteralToken({type:st.TokenType.StringLiteral,value:p,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(h),h}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new st.Token({type:st.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||be.CharacterCode.DOT===i||be.CharacterCode.LETTER_E===i||be.CharacterCode.LETTER_e===i||(be.CharacterCode.MINUS===i||be.CharacterCode.PLUS===i)&&(be.CharacterCode.LETTER_E===r||be.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Rb.Range(new pa.Position(this.line,this.tokenStart-this.offset+1),new pa.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case Ob.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Ob.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Ob.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new st.Token({type:st.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case Wu.Literal.True:case Wu.Literal.False:return n.createBoolean(i,e);case Wu.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Rb.Range(new pa.Position(s,e.tokenStart-e.offset+1),new pa.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new fq.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new st.Token({type:st.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Gu.default=ch;ch.scanHandlers={[be.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[be.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(ot.Operator.Member,e))},[be.CharacterCode.EQUAL]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.Equal,e):this.scanPunctuator(ot.Operator.Assign,e)},[be.CharacterCode.ARROW_LEFT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.LessThanOrEqual,e):this.scanPunctuator(ot.Operator.LessThan,e)},[be.CharacterCode.ARROW_RIGHT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.GreaterThanOrEqual,e):this.scanPunctuator(ot.Operator.GreaterThan,e)},[be.CharacterCode.EXCLAMATION_MARK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.NotEqual,e):(this.index++,null)},[be.CharacterCode.MINUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.SubtractShorthand,e):this.scanPunctuator(ot.Operator.Minus,e)},[be.CharacterCode.PLUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.AddShorthand,e):this.scanPunctuator(ot.Operator.Plus,e)},[be.CharacterCode.ASTERISK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.MultiplyShorthand,e):this.scanPunctuator(ot.Operator.Asterik,e)},[be.CharacterCode.SLASH]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.DivideShorthand,e):this.scanPunctuator(ot.Operator.Slash,e)},[be.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[be.CharacterCode.CARET]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.PowerShorthand,e):this.scanPunctuator(ot.Operator.Power,e)},[be.CharacterCode.PERCENT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ot.Operator.ModuloShorthand,e):this.scanPunctuator(ot.Operator.Modulo,e)},[be.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[be.CharacterCode.COMMA]:hs,[be.CharacterCode.CURLY_BRACKET_LEFT]:hs,[be.CharacterCode.CURLY_BRACKET_RIGHT]:hs,[be.CharacterCode.SQUARE_BRACKETS_LEFT]:hs,[be.CharacterCode.SQUARE_BRACKETS_RIGHT]:hs,[be.CharacterCode.PARENTHESIS_LEFT]:hs,[be.CharacterCode.PARENTHESIS_RIGHT]:hs,[be.CharacterCode.AT_SIGN]:hs}});var at=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ASTComment=Hn.ASTBaseBlockWithScope=Hn.ASTBaseBlock=Hn.ASTBase=Hn.ASTType=void 0;var c1;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(c1=Hn.ASTType||(Hn.ASTType={}));var Hu=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Hn.ASTBase=Hu;var lh=class t extends Hu{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
|
37
37
|
`).split(`
|
38
38
|
`).map(n=>` ${n}`).join(`
|
39
39
|
`);return`${this.type}[${this.start}-${this.end}][${e.length>0?`
|
@@ -83,7 +83,7 @@ ${e}
|
|
83
83
|
`).map(n=>` ${n}`).join(`
|
84
84
|
`);return`WhileStatement[${this.start}-${this.end}][${this.condition}
|
85
85
|
${e}
|
86
|
-
]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ah.ASTWhileStatement=P_});var E1=f(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.ASTBreakStatement=void 0;var x1=at(),D_=class t extends x1.ASTBase{constructor(e){super(x1.ASTType.BreakStatement,e),this.iterator=e.iterator}toString(){return`BreakStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ph.ASTBreakStatement=D_});var A1=f(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.ASTContinueStatement=void 0;var k1=at(),R_=class t extends k1.ASTBase{constructor(e){super(k1.ASTType.ContinueStatement,e),this.iterator=e.iterator}toString(){return`ContinueStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Oh.ASTContinueStatement=R_});var Mh=f(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.ASTWhileStatement=H.ASTUnaryExpression=H.ASTSliceExpression=H.ASTReturnStatement=H.ASTParenthesisExpression=H.ASTMapKeyString=H.ASTMapConstructorExpression=H.ASTLogicalExpression=H.ASTStringLiteral=H.ASTNumericLiteral=H.ASTNilLiteral=H.ASTLiteral=H.ASTBooleanLiteral=H.ASTListValue=H.ASTListConstructorExpression=H.ASTIsaExpression=H.ASTIfStatement=H.ASTIfClause=H.ASTElseClause=H.ASTClause=H.ASTMemberExpression=H.ASTIndexExpression=H.ASTIdentifierKind=H.ASTIdentifier=H.ASTFunctionStatement=H.ASTForGenericStatement=H.ASTContinueStatement=H.ASTComparisonGroupExpression=H.ASTChunk=H.ASTCallStatement=H.ASTCallExpression=H.ASTBreakStatement=H.ASTBinaryExpression=H.ASTType=H.ASTComment=H.ASTBaseBlockWithScope=H.ASTBaseBlock=H.ASTBase=H.ASTAssignmentStatement=H.ASTProvider=void 0;var Dh=ps(),P1=Mh(),mq=Lb(),mn=at(),yq=qb(),O1=Bb(),bq=Ub(),_q=Wb(),vq=Hb(),Sq=zb(),I_=Qb(),ds=n_(),Tq=i_(),D1=a_(),Rh=d_(),wq=g_(),R1=b_(),xq=v_(),Eq=T_(),kq=x_(),Aq=A_(),Pq=O_(),C_=class{returnStatement(e){return new Eq.ASTReturnStatement(e)}ifShortcutStatement(e){return new ds.ASTIfStatement(mn.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new ds.ASTIfClause(mn.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new ds.ASTIfClause(mn.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new ds.ASTElseClause(mn.ASTType.ElseShortcutClause,e)}ifStatement(e){return new ds.ASTIfStatement(mn.ASTType.IfStatement,e)}ifClause(e){return new ds.ASTIfClause(mn.ASTType.IfClause,e)}elseifClause(e){return new ds.ASTIfClause(mn.ASTType.ElseifClause,e)}elseClause(e){return new ds.ASTElseClause(mn.ASTType.ElseClause,e)}whileStatement(e){return new Pq.ASTWhileStatement(e)}assignmentStatement(e){return new mq.ASTAssignmentStatement(e)}callStatement(e){return new O1.ASTCallStatement(e)}functionStatement(e){return new Sq.ASTFunctionStatement(e)}forGenericStatement(e){return new vq.ASTForGenericStatement(e)}chunk(e){return new bq.ASTChunk(e)}identifier(e){return new I_.ASTIdentifier(e)}literal(e,n){switch(e){case Dh.TokenType.StringLiteral:return new Rh.ASTStringLiteral(n);case Dh.TokenType.NumericLiteral:return new Rh.ASTNumericLiteral(n);case Dh.TokenType.BooleanLiteral:return new Rh.ASTBooleanLiteral(n);case Dh.TokenType.NilLiteral:return new Rh.ASTNilLiteral(n)}}memberExpression(e){return new I_.ASTMemberExpression(e)}callExpression(e){return new O1.ASTCallExpression(e)}comment(e){return new mn.ASTComment(e)}unaryExpression(e){return new Aq.ASTUnaryExpression(e)}mapKeyString(e){return new R1.ASTMapKeyString(e)}mapConstructorExpression(e){return new R1.ASTMapConstructorExpression(e)}listValue(e){return new D1.ASTListValue(e)}listConstructorExpression(e){return new D1.ASTListConstructorExpression(e)}unknown(e){return new mn.ASTBase(mn.ASTType.Unknown,e)}emptyExpression(e){return new mn.ASTBase(mn.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new mn.ASTBase(mn.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new I_.ASTIndexExpression(e)}logicalExpression(e){return new wq.ASTLogicalExpression(e)}isaExpression(e){return new Tq.ASTIsaExpression(e)}binaryExpression(e){return new yq.ASTBinaryExpression(e)}sliceExpression(e){return new kq.ASTSliceExpression(e)}parenthesisExpression(e){return new xq.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new _q.ASTComparisonGroupExpression(e)}breakStatement(e){return new P1.ASTBreakStatement(e)}continueStatement(e){return new P1.ASTContinueStatement(e)}};H.ASTProvider=C_;var Oq=Lb();Object.defineProperty(H,"ASTAssignmentStatement",{enumerable:!0,get:function(){return Oq.ASTAssignmentStatement}});var zu=at();Object.defineProperty(H,"ASTBase",{enumerable:!0,get:function(){return zu.ASTBase}});Object.defineProperty(H,"ASTBaseBlock",{enumerable:!0,get:function(){return zu.ASTBaseBlock}});Object.defineProperty(H,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return zu.ASTBaseBlockWithScope}});Object.defineProperty(H,"ASTComment",{enumerable:!0,get:function(){return zu.ASTComment}});Object.defineProperty(H,"ASTType",{enumerable:!0,get:function(){return zu.ASTType}});var Dq=qb();Object.defineProperty(H,"ASTBinaryExpression",{enumerable:!0,get:function(){return Dq.ASTBinaryExpression}});var Rq=E1();Object.defineProperty(H,"ASTBreakStatement",{enumerable:!0,get:function(){return Rq.ASTBreakStatement}});var I1=Bb();Object.defineProperty(H,"ASTCallExpression",{enumerable:!0,get:function(){return I1.ASTCallExpression}});Object.defineProperty(H,"ASTCallStatement",{enumerable:!0,get:function(){return I1.ASTCallStatement}});var Iq=Ub();Object.defineProperty(H,"ASTChunk",{enumerable:!0,get:function(){return Iq.ASTChunk}});var Cq=Wb();Object.defineProperty(H,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return Cq.ASTComparisonGroupExpression}});var Mq=A1();Object.defineProperty(H,"ASTContinueStatement",{enumerable:!0,get:function(){return Mq.ASTContinueStatement}});var Lq=Hb();Object.defineProperty(H,"ASTForGenericStatement",{enumerable:!0,get:function(){return Lq.ASTForGenericStatement}});var Nq=zb();Object.defineProperty(H,"ASTFunctionStatement",{enumerable:!0,get:function(){return Nq.ASTFunctionStatement}});var Ih=Qb();Object.defineProperty(H,"ASTIdentifier",{enumerable:!0,get:function(){return Ih.ASTIdentifier}});Object.defineProperty(H,"ASTIdentifierKind",{enumerable:!0,get:function(){return Ih.ASTIdentifierKind}});Object.defineProperty(H,"ASTIndexExpression",{enumerable:!0,get:function(){return Ih.ASTIndexExpression}});Object.defineProperty(H,"ASTMemberExpression",{enumerable:!0,get:function(){return Ih.ASTMemberExpression}});var Ch=n_();Object.defineProperty(H,"ASTClause",{enumerable:!0,get:function(){return Ch.ASTClause}});Object.defineProperty(H,"ASTElseClause",{enumerable:!0,get:function(){return Ch.ASTElseClause}});Object.defineProperty(H,"ASTIfClause",{enumerable:!0,get:function(){return Ch.ASTIfClause}});Object.defineProperty(H,"ASTIfStatement",{enumerable:!0,get:function(){return Ch.ASTIfStatement}});var qq=i_();Object.defineProperty(H,"ASTIsaExpression",{enumerable:!0,get:function(){return qq.ASTIsaExpression}});var C1=a_();Object.defineProperty(H,"ASTListConstructorExpression",{enumerable:!0,get:function(){return C1.ASTListConstructorExpression}});Object.defineProperty(H,"ASTListValue",{enumerable:!0,get:function(){return C1.ASTListValue}});var Xu=d_();Object.defineProperty(H,"ASTBooleanLiteral",{enumerable:!0,get:function(){return Xu.ASTBooleanLiteral}});Object.defineProperty(H,"ASTLiteral",{enumerable:!0,get:function(){return Xu.ASTLiteral}});Object.defineProperty(H,"ASTNilLiteral",{enumerable:!0,get:function(){return Xu.ASTNilLiteral}});Object.defineProperty(H,"ASTNumericLiteral",{enumerable:!0,get:function(){return Xu.ASTNumericLiteral}});Object.defineProperty(H,"ASTStringLiteral",{enumerable:!0,get:function(){return Xu.ASTStringLiteral}});var jq=g_();Object.defineProperty(H,"ASTLogicalExpression",{enumerable:!0,get:function(){return jq.ASTLogicalExpression}});var M1=b_();Object.defineProperty(H,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return M1.ASTMapConstructorExpression}});Object.defineProperty(H,"ASTMapKeyString",{enumerable:!0,get:function(){return M1.ASTMapKeyString}});var Fq=v_();Object.defineProperty(H,"ASTParenthesisExpression",{enumerable:!0,get:function(){return Fq.ASTParenthesisExpression}});var Bq=T_();Object.defineProperty(H,"ASTReturnStatement",{enumerable:!0,get:function(){return Bq.ASTReturnStatement}});var $q=x_();Object.defineProperty(H,"ASTSliceExpression",{enumerable:!0,get:function(){return $q.ASTSliceExpression}});var Uq=A_();Object.defineProperty(H,"ASTUnaryExpression",{enumerable:!0,get:function(){return Uq.ASTUnaryExpression}});var Kq=O_();Object.defineProperty(H,"ASTWhileStatement",{enumerable:!0,get:function(){return Kq.ASTWhileStatement}})});var N_=f(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var fs=ps(),M_=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([fs.TokenType.StringLiteral,fs.TokenType.NumericLiteral,fs.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([fs.TokenType.StringLiteral,fs.TokenType.NumericLiteral,fs.TokenType.BooleanLiteral,fs.TokenType.NilLiteral]))}isComment(e){return e===fs.TokenType.Comment}};L_.default=M_});var j_=f(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var oe=ps(),qr=ua(),_e=la(),Wq;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(Wq=se.SelectorType||(se.SelectorType={}));var q_=class{};se.createSelectorOptions=q_;function ie(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}se.createSelector=ie;function Gq(t){return t.data.value}se.getSelectorValue=Gq;se.Selectors={EndOfLine:ie({type:oe.TokenType.EOL,value:_e.Operator.EndOfLine}),EndOfFile:ie({type:oe.TokenType.EOF,value:_e.Operator.EndOfFile}),LParenthesis:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LParenthesis}),RParenthesis:ie({type:oe.TokenType.Punctuator,value:_e.Operator.RParenthesis}),CLBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.CLBracket}),CRBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.CRBracket}),SLBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SLBracket}),SRBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SRBracket}),Assign:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Assign}),AddShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.AddShorthand}),SubtractShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SubtractShorthand}),MultiplyShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.MultiplyShorthand}),DivideShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.DivideShorthand}),PowerShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.PowerShorthand}),ModuloShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.ModuloShorthand}),Seperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),Function:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Function}),EndFunction:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndFunction}),EndWhile:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndWhile}),EndFor:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndFor}),EndIf:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndIf}),SliceSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapKeyValueSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ListSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),CallSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ArgumentSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ImportCodeSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),ElseIf:ie({type:oe.TokenType.Keyword,value:qr.Keyword.ElseIf}),Then:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Then}),Else:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Else}),In:ie({type:oe.TokenType.Keyword,value:qr.Keyword.In}),MemberSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Member}),NumberSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Member}),Reference:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Reference}),Isa:ie({type:oe.TokenType.Keyword,value:_e.Operator.Isa}),Or:ie({type:oe.TokenType.Keyword,value:_e.Operator.Or}),And:ie({type:oe.TokenType.Keyword,value:_e.Operator.And}),Minus:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Minus}),Plus:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Plus}),Times:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Asterik}),Power:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Power}),Divide:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Slash}),Mod:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Modulo}),Equal:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Equal}),NotEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.NotEqual}),Greater:ie({type:oe.TokenType.Punctuator,value:_e.Operator.GreaterThan}),GreaterEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.GreaterThanOrEqual}),Lesser:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LessThan}),LessEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LessThanOrEqual}),New:ie({type:oe.TokenType.Keyword,value:qr.Keyword.New}),Not:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Not}),Comment:ie({type:oe.TokenType.Comment})};function ri(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
|
86
|
+
]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ah.ASTWhileStatement=P_});var E1=f(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.ASTBreakStatement=void 0;var x1=at(),R_=class t extends x1.ASTBase{constructor(e){super(x1.ASTType.BreakStatement,e),this.iterator=e.iterator}toString(){return`BreakStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ph.ASTBreakStatement=R_});var A1=f(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.ASTContinueStatement=void 0;var k1=at(),D_=class t extends k1.ASTBase{constructor(e){super(k1.ASTType.ContinueStatement,e),this.iterator=e.iterator}toString(){return`ContinueStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Oh.ASTContinueStatement=D_});var Mh=f(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.ASTWhileStatement=H.ASTUnaryExpression=H.ASTSliceExpression=H.ASTReturnStatement=H.ASTParenthesisExpression=H.ASTMapKeyString=H.ASTMapConstructorExpression=H.ASTLogicalExpression=H.ASTStringLiteral=H.ASTNumericLiteral=H.ASTNilLiteral=H.ASTLiteral=H.ASTBooleanLiteral=H.ASTListValue=H.ASTListConstructorExpression=H.ASTIsaExpression=H.ASTIfStatement=H.ASTIfClause=H.ASTElseClause=H.ASTClause=H.ASTMemberExpression=H.ASTIndexExpression=H.ASTIdentifierKind=H.ASTIdentifier=H.ASTFunctionStatement=H.ASTForGenericStatement=H.ASTContinueStatement=H.ASTComparisonGroupExpression=H.ASTChunk=H.ASTCallStatement=H.ASTCallExpression=H.ASTBreakStatement=H.ASTBinaryExpression=H.ASTType=H.ASTComment=H.ASTBaseBlockWithScope=H.ASTBaseBlock=H.ASTBase=H.ASTAssignmentStatement=H.ASTProvider=void 0;var Rh=ps(),P1=Mh(),mq=Lb(),mn=at(),yq=qb(),O1=Bb(),bq=Ub(),_q=Wb(),vq=Hb(),Sq=zb(),I_=Qb(),ds=n_(),Tq=i_(),R1=a_(),Dh=d_(),wq=g_(),D1=b_(),xq=v_(),Eq=T_(),kq=x_(),Aq=A_(),Pq=O_(),C_=class{returnStatement(e){return new Eq.ASTReturnStatement(e)}ifShortcutStatement(e){return new ds.ASTIfStatement(mn.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new ds.ASTIfClause(mn.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new ds.ASTIfClause(mn.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new ds.ASTElseClause(mn.ASTType.ElseShortcutClause,e)}ifStatement(e){return new ds.ASTIfStatement(mn.ASTType.IfStatement,e)}ifClause(e){return new ds.ASTIfClause(mn.ASTType.IfClause,e)}elseifClause(e){return new ds.ASTIfClause(mn.ASTType.ElseifClause,e)}elseClause(e){return new ds.ASTElseClause(mn.ASTType.ElseClause,e)}whileStatement(e){return new Pq.ASTWhileStatement(e)}assignmentStatement(e){return new mq.ASTAssignmentStatement(e)}callStatement(e){return new O1.ASTCallStatement(e)}functionStatement(e){return new Sq.ASTFunctionStatement(e)}forGenericStatement(e){return new vq.ASTForGenericStatement(e)}chunk(e){return new bq.ASTChunk(e)}identifier(e){return new I_.ASTIdentifier(e)}literal(e,n){switch(e){case Rh.TokenType.StringLiteral:return new Dh.ASTStringLiteral(n);case Rh.TokenType.NumericLiteral:return new Dh.ASTNumericLiteral(n);case Rh.TokenType.BooleanLiteral:return new Dh.ASTBooleanLiteral(n);case Rh.TokenType.NilLiteral:return new Dh.ASTNilLiteral(n)}}memberExpression(e){return new I_.ASTMemberExpression(e)}callExpression(e){return new O1.ASTCallExpression(e)}comment(e){return new mn.ASTComment(e)}unaryExpression(e){return new Aq.ASTUnaryExpression(e)}mapKeyString(e){return new D1.ASTMapKeyString(e)}mapConstructorExpression(e){return new D1.ASTMapConstructorExpression(e)}listValue(e){return new R1.ASTListValue(e)}listConstructorExpression(e){return new R1.ASTListConstructorExpression(e)}unknown(e){return new mn.ASTBase(mn.ASTType.Unknown,e)}emptyExpression(e){return new mn.ASTBase(mn.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new mn.ASTBase(mn.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new I_.ASTIndexExpression(e)}logicalExpression(e){return new wq.ASTLogicalExpression(e)}isaExpression(e){return new Tq.ASTIsaExpression(e)}binaryExpression(e){return new yq.ASTBinaryExpression(e)}sliceExpression(e){return new kq.ASTSliceExpression(e)}parenthesisExpression(e){return new xq.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new _q.ASTComparisonGroupExpression(e)}breakStatement(e){return new P1.ASTBreakStatement(e)}continueStatement(e){return new P1.ASTContinueStatement(e)}};H.ASTProvider=C_;var Oq=Lb();Object.defineProperty(H,"ASTAssignmentStatement",{enumerable:!0,get:function(){return Oq.ASTAssignmentStatement}});var zu=at();Object.defineProperty(H,"ASTBase",{enumerable:!0,get:function(){return zu.ASTBase}});Object.defineProperty(H,"ASTBaseBlock",{enumerable:!0,get:function(){return zu.ASTBaseBlock}});Object.defineProperty(H,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return zu.ASTBaseBlockWithScope}});Object.defineProperty(H,"ASTComment",{enumerable:!0,get:function(){return zu.ASTComment}});Object.defineProperty(H,"ASTType",{enumerable:!0,get:function(){return zu.ASTType}});var Rq=qb();Object.defineProperty(H,"ASTBinaryExpression",{enumerable:!0,get:function(){return Rq.ASTBinaryExpression}});var Dq=E1();Object.defineProperty(H,"ASTBreakStatement",{enumerable:!0,get:function(){return Dq.ASTBreakStatement}});var I1=Bb();Object.defineProperty(H,"ASTCallExpression",{enumerable:!0,get:function(){return I1.ASTCallExpression}});Object.defineProperty(H,"ASTCallStatement",{enumerable:!0,get:function(){return I1.ASTCallStatement}});var Iq=Ub();Object.defineProperty(H,"ASTChunk",{enumerable:!0,get:function(){return Iq.ASTChunk}});var Cq=Wb();Object.defineProperty(H,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return Cq.ASTComparisonGroupExpression}});var Mq=A1();Object.defineProperty(H,"ASTContinueStatement",{enumerable:!0,get:function(){return Mq.ASTContinueStatement}});var Lq=Hb();Object.defineProperty(H,"ASTForGenericStatement",{enumerable:!0,get:function(){return Lq.ASTForGenericStatement}});var Nq=zb();Object.defineProperty(H,"ASTFunctionStatement",{enumerable:!0,get:function(){return Nq.ASTFunctionStatement}});var Ih=Qb();Object.defineProperty(H,"ASTIdentifier",{enumerable:!0,get:function(){return Ih.ASTIdentifier}});Object.defineProperty(H,"ASTIdentifierKind",{enumerable:!0,get:function(){return Ih.ASTIdentifierKind}});Object.defineProperty(H,"ASTIndexExpression",{enumerable:!0,get:function(){return Ih.ASTIndexExpression}});Object.defineProperty(H,"ASTMemberExpression",{enumerable:!0,get:function(){return Ih.ASTMemberExpression}});var Ch=n_();Object.defineProperty(H,"ASTClause",{enumerable:!0,get:function(){return Ch.ASTClause}});Object.defineProperty(H,"ASTElseClause",{enumerable:!0,get:function(){return Ch.ASTElseClause}});Object.defineProperty(H,"ASTIfClause",{enumerable:!0,get:function(){return Ch.ASTIfClause}});Object.defineProperty(H,"ASTIfStatement",{enumerable:!0,get:function(){return Ch.ASTIfStatement}});var qq=i_();Object.defineProperty(H,"ASTIsaExpression",{enumerable:!0,get:function(){return qq.ASTIsaExpression}});var C1=a_();Object.defineProperty(H,"ASTListConstructorExpression",{enumerable:!0,get:function(){return C1.ASTListConstructorExpression}});Object.defineProperty(H,"ASTListValue",{enumerable:!0,get:function(){return C1.ASTListValue}});var Xu=d_();Object.defineProperty(H,"ASTBooleanLiteral",{enumerable:!0,get:function(){return Xu.ASTBooleanLiteral}});Object.defineProperty(H,"ASTLiteral",{enumerable:!0,get:function(){return Xu.ASTLiteral}});Object.defineProperty(H,"ASTNilLiteral",{enumerable:!0,get:function(){return Xu.ASTNilLiteral}});Object.defineProperty(H,"ASTNumericLiteral",{enumerable:!0,get:function(){return Xu.ASTNumericLiteral}});Object.defineProperty(H,"ASTStringLiteral",{enumerable:!0,get:function(){return Xu.ASTStringLiteral}});var jq=g_();Object.defineProperty(H,"ASTLogicalExpression",{enumerable:!0,get:function(){return jq.ASTLogicalExpression}});var M1=b_();Object.defineProperty(H,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return M1.ASTMapConstructorExpression}});Object.defineProperty(H,"ASTMapKeyString",{enumerable:!0,get:function(){return M1.ASTMapKeyString}});var Fq=v_();Object.defineProperty(H,"ASTParenthesisExpression",{enumerable:!0,get:function(){return Fq.ASTParenthesisExpression}});var Bq=T_();Object.defineProperty(H,"ASTReturnStatement",{enumerable:!0,get:function(){return Bq.ASTReturnStatement}});var $q=x_();Object.defineProperty(H,"ASTSliceExpression",{enumerable:!0,get:function(){return $q.ASTSliceExpression}});var Uq=A_();Object.defineProperty(H,"ASTUnaryExpression",{enumerable:!0,get:function(){return Uq.ASTUnaryExpression}});var Kq=O_();Object.defineProperty(H,"ASTWhileStatement",{enumerable:!0,get:function(){return Kq.ASTWhileStatement}})});var N_=f(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var fs=ps(),M_=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([fs.TokenType.StringLiteral,fs.TokenType.NumericLiteral,fs.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([fs.TokenType.StringLiteral,fs.TokenType.NumericLiteral,fs.TokenType.BooleanLiteral,fs.TokenType.NilLiteral]))}isComment(e){return e===fs.TokenType.Comment}};L_.default=M_});var j_=f(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var oe=ps(),qr=ua(),_e=la(),Wq;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(Wq=se.SelectorType||(se.SelectorType={}));var q_=class{};se.createSelectorOptions=q_;function ie(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}se.createSelector=ie;function Gq(t){return t.data.value}se.getSelectorValue=Gq;se.Selectors={EndOfLine:ie({type:oe.TokenType.EOL,value:_e.Operator.EndOfLine}),EndOfFile:ie({type:oe.TokenType.EOF,value:_e.Operator.EndOfFile}),LParenthesis:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LParenthesis}),RParenthesis:ie({type:oe.TokenType.Punctuator,value:_e.Operator.RParenthesis}),CLBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.CLBracket}),CRBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.CRBracket}),SLBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SLBracket}),SRBracket:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SRBracket}),Assign:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Assign}),AddShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.AddShorthand}),SubtractShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.SubtractShorthand}),MultiplyShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.MultiplyShorthand}),DivideShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.DivideShorthand}),PowerShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.PowerShorthand}),ModuloShorthand:ie({type:oe.TokenType.Punctuator,value:_e.Operator.ModuloShorthand}),Seperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),Function:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Function}),EndFunction:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndFunction}),EndWhile:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndWhile}),EndFor:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndFor}),EndIf:ie({type:oe.TokenType.Keyword,value:qr.Keyword.EndIf}),SliceSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapKeyValueSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ListSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),CallSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ArgumentSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Comma}),ImportCodeSeperator:ie({type:oe.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),ElseIf:ie({type:oe.TokenType.Keyword,value:qr.Keyword.ElseIf}),Then:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Then}),Else:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Else}),In:ie({type:oe.TokenType.Keyword,value:qr.Keyword.In}),MemberSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Member}),NumberSeperator:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Member}),Reference:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Reference}),Isa:ie({type:oe.TokenType.Keyword,value:_e.Operator.Isa}),Or:ie({type:oe.TokenType.Keyword,value:_e.Operator.Or}),And:ie({type:oe.TokenType.Keyword,value:_e.Operator.And}),Minus:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Minus}),Plus:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Plus}),Times:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Asterik}),Power:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Power}),Divide:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Slash}),Mod:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Modulo}),Equal:ie({type:oe.TokenType.Punctuator,value:_e.Operator.Equal}),NotEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.NotEqual}),Greater:ie({type:oe.TokenType.Punctuator,value:_e.Operator.GreaterThan}),GreaterEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.GreaterThanOrEqual}),Lesser:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LessThan}),LessEqual:ie({type:oe.TokenType.Punctuator,value:_e.Operator.LessThanOrEqual}),New:ie({type:oe.TokenType.Keyword,value:qr.Keyword.New}),Not:ie({type:oe.TokenType.Keyword,value:qr.Keyword.Not}),Comment:ie({type:oe.TokenType.Comment})};function ri(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
|
87
87
|
`),s=e.filter(a=>a.data.value===void 0).map(a=>`case '${a.data.type}':`).join(`
|
88
88
|
`),o=new Function("token",`
|
89
89
|
${s.length>0?`switch(token.type) {
|
@@ -93,67 +93,68 @@ ${e}
|
|
93
93
|
${r.length>0?`switch(token.value) {
|
94
94
|
${r}
|
95
95
|
}`:""}
|
96
|
-
return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}se.createSelectorGroup=ri;function Hq(t){return t.selectors}se.getSelectorsFromGroup=Hq;var ii;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})(ii=se.SelectorGroupType||(se.SelectorGroupType={}));se.SelectorGroups={BlockEndOfLine:ri(ii.AssignmentEndOfExpr,[se.Selectors.EndOfLine,se.Selectors.Comment]),AssignmentEndOfExpr:ri(ii.AssignmentEndOfExpr,[se.Selectors.EndOfFile,se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),AssignmentShorthand:ri(ii.AssignmentShorthand,[se.Selectors.AddShorthand,se.Selectors.SubtractShorthand,se.Selectors.MultiplyShorthand,se.Selectors.DivideShorthand,se.Selectors.PowerShorthand,se.Selectors.ModuloShorthand]),AssignmentCommandArgs:ri(ii.AssignmentCommandArgs,[se.Selectors.ArgumentSeperator,se.Selectors.EndOfLine,se.Selectors.EndOfFile]),ReturnStatementEnd:ri(ii.ReturnStatementEnd,[se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),FunctionDeclarationArgEnd:ri(ii.FunctionDeclarationArgEnd,[se.Selectors.RParenthesis,se.Selectors.EndOfFile,se.Selectors.EndOfLine]),ComparisonOperators:ri(ii.ComparisonOperators,[se.Selectors.Equal,se.Selectors.NotEqual,se.Selectors.Greater,se.Selectors.GreaterEqual,se.Selectors.Lesser,se.Selectors.LessEqual]),MultiDivOperators:ri(ii.MultiDivOperators,[se.Selectors.Times,se.Selectors.Divide,se.Selectors.Mod]),CallArgsEnd:ri(ii.CallArgsEnd,[se.Selectors.ArgumentSeperator,se.Selectors.RParenthesis])}});var B_=f(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Stack=void 0;var F_=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};Lh.Stack=F_});var H_=f(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.PendingWhile=Ze.isPendingWhile=Ze.PendingIf=Ze.isPendingIf=Ze.PendingFunction=Ze.isPendingFunction=Ze.PendingFor=Ze.isPendingFor=Ze.PendingChunk=Ze.isPendingChunk=Ze.PendingBlockType=void 0;var jr;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(jr=Ze.PendingBlockType||(Ze.PendingBlockType={}));var Ys=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function Vq(t){return t.type===jr.Chunk}Ze.isPendingChunk=Vq;var $_=class extends Ys{constructor(e,n){super(e,jr.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Ze.PendingChunk=$_;function zq(t){return t.type===jr.For}Ze.isPendingFor=zq;var U_=class extends Ys{constructor(e,n){super(e,jr.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ze.PendingFor=U_;function Xq(t){return t.type===jr.Function}Ze.isPendingFunction=Xq;var K_=class extends Ys{constructor(e,n,r){super(e,jr.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToLine(this.base.end.line,this.base)):this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ze.PendingFunction=K_;function Yq(t){return t.type===jr.If}Ze.isPendingIf=Yq;var W_=class extends Ys{constructor(e,n,r){super(e,jr.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line!==this.block.start.line&&this.lineRegistry.addItemToLine(this.currentClause.start.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ze.PendingIf=W_;function Jq(t){return t.type===jr.While}Ze.isPendingWhile=Jq;var G_=class extends Ys{constructor(e,n){super(e,jr.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ze.PendingWhile=G_});var z_=f(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.LineRegistry=void 0;var V_=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Nh.LineRegistry=V_});var N1=f(Yu=>{"use strict";var L1=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var Qq=L1(Rb()),ma=ps(),Vn=Mh(),Zq=L1(N_()),ej=ah(),Zt=ua(),Oi=la(),Lt=Ku(),X=j_(),tj=B_(),si=H_(),nj=z_(),X_=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new tj.Stack,r.statementErrors=[],r.lexer=n.lexer||new Qq.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new nj.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.iteratorStack=[],r.literals=[],r.comments=[],r.validator=n.validator||new Zq.default,r.astProvider=n.astProvider||new Vn.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new Lt.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,X.getSelectorValue)(e)}" is required`,new Lt.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,X.getSelectorsFromGroup)(e).map(i=>`"${(0,X.getSelectorValue)(i)}"`).join(", ")} is required`,new Lt.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(X.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.comments.push(s),n.lineRegistry.addItemToLines(s)}else if(X.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==ma.TokenType.EOL&&e.token.type!==ma.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,si.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Lt.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new si.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!X.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!X.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.comments=e.comments,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(ma.TokenType.Keyword===e.token.type&&Zt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseContinueStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseBreakStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Zt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Zt.Keyword.If:{e.next(),e.parseIfStatement();return}case Zt.Keyword.ElseIf:{e.next(),e.nextIfClause(Vn.ASTType.ElseifClause);return}case Zt.Keyword.Else:{e.next(),e.nextIfClause(Vn.ASTType.ElseClause);return}case Zt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Zt.Keyword.For:{e.next(),e.parseForStatement();return}case Zt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Zt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Zt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Zt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Zt.Keyword.Continue:{e.next(),e.parseContinueStatement();return}case Zt.Keyword.Break:{e.next(),e.parseBreakStatement();return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Lt.Range(e.token.start,e.token.end))}parseShortcutContinueStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutBreakStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutStatement(){let e=this;if(ma.TokenType.Keyword===e.token.type&&Zt.Keyword.Not!==e.token.value)switch(e.token.value){case Zt.Keyword.Return:return e.next(),e.parseReturnStatement();case Zt.Keyword.Continue:return e.next(),e.parseShortcutContinueStatement();case Zt.Keyword.Break:return e.next(),e.parseShortcutBreakStatement();default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Lt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(X.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(X.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.definitions.push(o),o}else if(X.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),p=e.parseExpr(a),h=e.astProvider.parenthesisExpression({start:p.start,end:p.end,range:p.range,expression:p});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:h,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.definitions.push(a),a}let s=[];for(;!X.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),X.SelectorGroups.BlockEndOfLine(e.token)||X.Selectors.Else(e.token))break;if(X.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(X.SelectorGroups.AssignmentCommandArgs,r.start);if(X.Selectors.EndOfLine(a)||X.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return X.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(X.Selectors.Then,n.start),!X.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new si.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,si.isPendingIf)(r)){n.raise("no matching open if block",new Lt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case Vn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(X.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case Vn.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),X.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Lt.Range(n.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new si.PendingWhile(i,e.lineRegistry);e.backpatches.push(s),e.iteratorStack.push(i)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingWhile)(n)){e.raise("no matching open while block",new Lt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(Vn.ASTIdentifierKind.ForInVariable);e.requireToken(X.Selectors.In,r.start);let s=e.parseExpr(null);if(!s){e.raise("sequence expression expected for 'for' loop",new Lt.Range(r.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,s,r);let o=e.astProvider.forGenericStatement({variable:i,iterator:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n});n.definitions.push(o);let a=new si.PendingFor(o,e.lineRegistry);e.backpatches.push(a),e.iteratorStack.push(o)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingFor)(n)){e.raise("no matching open for block",new Lt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.currentScope,o=i.backpatches.peek(),a=i.parseShortcutStatement(),u=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[a],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});s.definitions.push(u),i.lineRegistry.addItemToLines(u),o.body.push(u)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!X.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!X.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(X.Selectors.LParenthesis,s.start);!X.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(Vn.ASTIdentifierKind.Argument),l=c;if(i.consume(X.Selectors.Assign)){let p=i.parseExpr(null);if(p instanceof Vn.ASTLiteral){let h=i.astProvider.assignmentStatement({variable:c,init:p,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(h),a.push(h)}else i.raise("parameter default value must be a literal value",new Lt.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let p=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(p),a.push(c)}if(X.Selectors.RParenthesis(i.token))break;if(i.requireToken(X.Selectors.ArgumentSeperator,s.start),X.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Lt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(X.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new si.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingFunction)(n)){e.raise("no matching open function block",new Lt.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;X.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:Oi.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;X.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:Oi.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(X.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:Oi.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(X.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:Oi.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!X.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(X.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;X.Selectors.Plus(r.token)||X.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;X.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!X.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof Vn.ASTNumericLiteral||s instanceof Vn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Oi.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!X.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:Oi.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!X.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower(!0,n);return r.astProvider.unaryExpression({operator:Oi.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(X.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:Oi.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!X.Selectors.EndOfFile(r.token);)if(X.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(Vn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:Oi.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(X.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),X.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(X.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,isStatementStart:n,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(X.Selectors.SRBracket,i.start)}else if(X.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(X.Selectors.LParenthesis(e.token))if(e.next(),X.Selectors.RParenthesis(e.token))e.next();else for(;!X.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),X.Selectors.RParenthesis(e.requireTokenOfAny(X.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!X.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(X.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!X.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!X.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(X.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(ma.TokenType.Identifier)?r.parseIdentifier(Vn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new Lt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(ma.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==Vn.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new ej.ParserException(e,n);return r.statementErrors.push(i),i}};Yu.default=X_});var Te=f(Pe=>{"use strict";var rj=Pe&&Pe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Fr=Pe&&Pe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rj(e,t,n)},qh=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ASTRange=Pe.ASTPosition=Pe.LineRegistry=Pe.ParserValidatorm=Pe.Parser=Pe.LexerValidator=Pe.Lexer=void 0;var ij=Rb();Object.defineProperty(Pe,"Lexer",{enumerable:!0,get:function(){return qh(ij).default}});Fr(ps(),Pe);var sj=Sb();Object.defineProperty(Pe,"LexerValidator",{enumerable:!0,get:function(){return qh(sj).default}});var oj=N1();Object.defineProperty(Pe,"Parser",{enumerable:!0,get:function(){return qh(oj).default}});Fr(Mh(),Pe);var aj=N_();Object.defineProperty(Pe,"ParserValidatorm",{enumerable:!0,get:function(){return qh(aj).default}});var uj=z_();Object.defineProperty(Pe,"LineRegistry",{enumerable:!0,get:function(){return uj.LineRegistry}});Fr(H_(),Pe);Fr(B_(),Pe);Fr(Pb(),Pe);Fr(oh(),Pe);Fr(ah(),Pe);Fr(ua(),Pe);Fr(xb(),Pe);Fr(la(),Pe);var cj=qu();Object.defineProperty(Pe,"ASTPosition",{enumerable:!0,get:function(){return cj.Position}});var lj=Ku();Object.defineProperty(Pe,"ASTRange",{enumerable:!0,get:function(){return lj.Range}});Fr(j_(),Pe)});var Y_=f(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.getSignaturePayloadDefinitionType=void 0;function pj(t){return t==null?null:typeof t=="object"?t.type:t}jh.getSignaturePayloadDefinitionType=pj});var Di=f(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.SignatureDefinitionBaseType=void 0;var hj;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(hj=Ju.SignatureDefinitionBaseType||(Ju.SignatureDefinitionBaseType={}))});var J_=f(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.TypeParser=void 0;var Fh=Di(),dj=function(){function t(e){this._input=e,this._rx=/(\w+|<|>|,)/g,this._lastMatch=null}return t.prototype.next=function(){return this._lastMatch=this._rx.exec(this._input),this._lastMatch?this._lastMatch[0]:null},t.prototype.createDefault=function(){return{type:Fh.SignatureDefinitionBaseType.Any}},t.prototype.parseList=function(e){var n={type:e,valueType:Fh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.valueType=r,this.next()!==">")return this.createDefault()}return n},t.prototype.parseMap=function(e){var n={type:e,keyType:Fh.SignatureDefinitionBaseType.Any,valueType:Fh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.keyType=r,this.next()!==",")return this.createDefault();var i=this.parse();if(n.valueType=i,this.next()!==">")return this.createDefault()}return n},t.prototype.parse=function(){var e=this.next();if(!e)return this.createDefault();switch(e){case"list":return this.parseList(e);case"map":return this.parseMap(e)}return{type:e}},t}();Bh.TypeParser=dj});var Qu=f($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.SignatureDefinitionTypeMeta=void 0;var Q_=Y_(),ln=Di(),fj=J_(),gj=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=new fj.TypeParser(e),r=n.parse();return t.parse(r)},t.parseValueString=function(e){var n=e,r=null,i=null;return n===ln.SignatureDefinitionBaseType.Map?(r=new t({type:ln.SignatureDefinitionBaseType.Any}),i=new t({type:ln.SignatureDefinitionBaseType.Any})):n===ln.SignatureDefinitionBaseType.List&&(r=new t({type:ln.SignatureDefinitionBaseType.Any})),new t({type:n,valueType:r,keyType:i})},t.parseValueObject=function(e){var n,r,i,s=e.type,o=null,a=null;if(s===ln.SignatureDefinitionBaseType.Map){var u=(n=(0,Q_.getSignaturePayloadDefinitionType)(e.keyType))!==null&&n!==void 0?n:ln.SignatureDefinitionBaseType.Any,c=(r=(0,Q_.getSignaturePayloadDefinitionType)(e.valueType))!==null&&r!==void 0?r:ln.SignatureDefinitionBaseType.Any;u===ln.SignatureDefinitionBaseType.Map||u===ln.SignatureDefinitionBaseType.List?a=t.parse(e.keyType):a=new t({type:u}),c===ln.SignatureDefinitionBaseType.Map||c===ln.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}else if(s===ln.SignatureDefinitionBaseType.List){var c=(i=(0,Q_.getSignaturePayloadDefinitionType)(e.valueType))!==null&&i!==void 0?i:ln.SignatureDefinitionBaseType.Any;c===ln.SignatureDefinitionBaseType.Map||c===ln.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}return new t({type:s,valueType:o,keyType:a})},t.parse=function(e){if(typeof e=="string")return t.parseValueString(e);if(typeof e=="object")return t.parseValueObject(e);throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType.type===e.keyType.type&&this.valueType.type===e.valueType.type},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType.toString(),">"):"".concat(this.type,"<").concat(this.keyType.toString(),",").concat(this.valueType.toString(),">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType.toJSON()}:{type:this.type,keyType:this.keyType.toJSON(),valueType:this.valueType.toJSON()}},t.prototype.copy=function(){var e,n;return new t({type:this.type,keyType:(e=this.keyType)===null||e===void 0?void 0:e.copy(),valueType:(n=this.valueType)===null||n===void 0?void 0:n.copy()})},t}();$h.SignatureDefinitionTypeMeta=gj});var Z_=f(gs=>{"use strict";var q1=gs&&gs.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},j1=gs&&gs.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(gs,"__esModule",{value:!0});gs.SignatureDefinitionFunctionArg=void 0;var F1=Qu(),mj=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(F1.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,j1([],q1(e.types.map(F1.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return j1([],q1(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();gs.SignatureDefinitionFunctionArg=mj});var $1=f((M8,B1)=>{var yj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";B1.exports={urlAlphabet:yj}});var z1=f((L8,V1)=>{var U1=require("crypto"),{urlAlphabet:K1}=$1(),bj=128,ms,ys,W1=t=>{!ms||ms.length<t?(ms=Buffer.allocUnsafe(t*bj),U1.randomFillSync(ms),ys=0):ys+t>ms.length&&(U1.randomFillSync(ms),ys=0),ys+=t},G1=t=>(W1(t|=0),ms.subarray(ys-t,ys)),H1=(t,e,n)=>{let r=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*r*e/t.length);return(s=e)=>{let o="";for(;;){let a=n(i),u=i;for(;u--;)if(o+=t[a[u]&r]||"",o.length===s)return o}}},_j=(t,e=21)=>H1(t,e,G1),vj=(t=21)=>{W1(t|=0);let e="";for(let n=ys-t;n<ys;n++)e+=K1[ms[n]&63];return e};V1.exports={nanoid:vj,customAlphabet:_j,customRandom:H1,urlAlphabet:K1,random:G1}});var Uh=f(bs=>{"use strict";var Js=bs&&bs.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Qs=bs&&bs.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(bs,"__esModule",{value:!0});bs.VariationRegistry=void 0;var Sj=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(Qs(Qs([],Js(e),!1),Js(this._variations),!1)),this},t.prototype.getAll=function(){return Qs([],Js(this._variations),!1)},t}(),Tj=function(){function t(){}return t.add=function(e,n){var r=new Sj(e);return r.push.apply(r,Qs([],Js(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){for(var n=new Set,r=0;r<e.length;r++){var i=e[r];if(typeof i=="string"&&i.startsWith("!")){var s=i.slice(1),o=this.get(s);if(o!==null)n=new Set(Qs(Qs([],Js(o.getAll()),!1),Js(n),!1));else throw new Error("Cannot find variation container for ".concat(s));continue}n.add(i)}return Qs([],Js(n),!1)},t.variationContainers=new Map,t}();bs.VariationRegistry=Tj});var Kh=f(_s=>{"use strict";var wj=_s&&_s.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},xj=_s&&_s.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(_s,"__esModule",{value:!0});_s.SignatureDefinition=void 0;var Ej=Uh(),kj=Qu(),Aj=function(){function t(e){this._origin=e.origin,this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations,this._tags=e.tags}return t.parse=function(e,n){var r,i,s,o;return new t({origin:e,type:kj.SignatureDefinitionTypeMeta.parse(n.type),isProtected:!!n.isProtected,description:(r=n.description)!==null&&r!==void 0?r:null,example:(i=n.example)!==null&&i!==void 0?i:null,variations:(s=n.variations)!==null&&s!==void 0?s:null,tags:(o=n.tags)!==null&&o!==void 0?o:null})},t.prototype.getOrigin=function(){return this._origin},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.getTags=function(){return this._tags},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return Ej.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?xj([],wj(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({origin:this._origin,type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations,tags:this._tags})},t.prototype.copy=function(){return new t({origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations,tags:this._tags})},t}();_s.SignatureDefinition=Aj});var Gh=f(pr=>{"use strict";var Pj=pr&&pr.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wh=pr&&pr.__assign||function(){return Wh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Wh.apply(this,arguments)},Oj=pr&&pr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Dj=pr&&pr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(pr,"__esModule",{value:!0});pr.SignatureDefinitionFunction=void 0;var Rj=z1(),Ij=Di(),Cj=Uh(),Mj=Kh(),Lj=Z_(),X1=Qu(),Nj=function(t){Pj(e,t);function e(n){var r=this,i;return r=t.call(this,{type:n.type,origin:n.origin,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations,tags:n.tags})||this,r._id=(i=n.id)!==null&&i!==void 0?i:(0,Rj.nanoid)(),r._argList=n.arguments.map(function(s){return s.getLabel()}),r._argRefs=n.arguments.reduce(function(s,o){return s.set(o.getLabel(),o)},new Map),r._returns=n.returns.reduce(function(s,o){return s.set(o.type,o)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n,r){var i,s,o,a,u,c,l;return new e({id:r.id,origin:n,type:new X1.SignatureDefinitionTypeMeta({type:Ij.SignatureDefinitionBaseType.Function}),isProtected:(i=r.isProtected)!==null&&i!==void 0?i:!1,description:(s=r.description)!==null&&s!==void 0?s:null,example:(o=r.example)!==null&&o!==void 0?o:null,arguments:(u=(a=r.arguments)===null||a===void 0?void 0:a.map(Lj.SignatureDefinitionFunctionArg.parse))!==null&&u!==void 0?u:[],returns:r.returns.map(X1.SignatureDefinitionTypeMeta.parse),variations:r.variations,returnVariations:(c=r.returnVariations)!==null&&c!==void 0?c:null,tags:(l=r.tags)!==null&&l!==void 0?l:null})},e.prototype.getId=function(){return this._id},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return Dj([],Oj(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),Cj.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Wh(Wh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({id:this._id,origin:this._origin,type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e.prototype.copy=function(){return new e({id:this._id,origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e}(Mj.SignatureDefinition);pr.SignatureDefinitionFunction=Nj});var J1=f((F8,Y1)=>{"use strict";Y1.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var ev=f((Q1,Z1)=>{"use strict";var qj=J1();Z1.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:qj(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Q1.assert)}}});var Ce=f(($8,eP)=>{"use strict";var jj=ev();eP.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new jj(e)}});var Zs=f((U8,nP)=>{"use strict";var tv=Ce(),tP={};nP.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);tv(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&tP.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){tv(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),tv(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};tP.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var nv=f((yn,iP)=>{"use strict";var rP={};yn=iP.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};rP.typeMap=new Map([["[object Error]",yn.error],["[object Map]",yn.map],["[object Promise]",yn.promise],["[object Set]",yn.set],["[object WeakMap]",yn.weakMap],["[object WeakSet]",yn.weakSet]]);yn.getInternalProto=function(t){if(Array.isArray(t))return yn.array;if(Buffer&&t instanceof Buffer)return yn.buffer;if(t instanceof Date)return yn.date;if(t instanceof RegExp)return yn.regex;if(t instanceof Error)return yn.error;let e=Object.prototype.toString.call(t);return rP.typeMap.get(e)||yn.generic}});var rv=f(sP=>{"use strict";sP.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var bn=f((W8,oP)=>{"use strict";var Fj=Zs(),zn=nv(),Bj=rv(),Ri={needsProtoHack:new Set([zn.set,zn.map,zn.weakSet,zn.weakMap])};oP.exports=Ri.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=Ri.clone,i=n;if(e.shallow){if(e.shallow!==!0)return Ri.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=zn.getInternalProto(t);if(s===zn.buffer)return Buffer&&Buffer.from(t);if(s===zn.date)return new Date(t.getTime());if(s===zn.regex)return new RegExp(t);let o=Ri.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===zn.set)for(let u of t)o.add(r(u,e,i));else if(s===zn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=Bj.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===zn.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};Ri.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=Fj(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return Ri.clone(t,e,r)};Ri.base=function(t,e,n){if(n.prototype===!1)return Ri.needsProtoHack.has(e)?new e.constructor:e===zn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===zn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(Ri.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var aP=f((G8,$j)=>{$j.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Hh=f(Zu=>{"use strict";var D=Vh(),fe={};fe.wrap=D.string().min(1).max(2).allow(!1);Zu.preferences=D.object({allowUnknown:D.boolean(),abortEarly:D.boolean(),artifacts:D.boolean(),cache:D.boolean(),context:D.object(),convert:D.boolean(),dateFormat:D.valid("date","iso","string","time","utc"),debug:D.boolean(),errors:{escapeHtml:D.boolean(),label:D.valid("path","key",!1),language:[D.string(),D.object().ref()],render:D.boolean(),stack:D.boolean(),wrap:{label:fe.wrap,array:fe.wrap,string:fe.wrap}},externals:D.boolean(),messages:D.object(),noDefaults:D.boolean(),nonEnumerables:D.boolean(),presence:D.valid("required","optional","forbidden"),skipFunctions:D.boolean(),stripUnknown:D.object({arrays:D.boolean(),objects:D.boolean()}).or("arrays","objects").allow(!0,!1),warnings:D.boolean()}).strict();fe.nameRx=/^[a-zA-Z0-9]\w*$/;fe.rule=D.object({alias:D.array().items(D.string().pattern(fe.nameRx)).single(),args:D.array().items(D.string(),D.object({name:D.string().pattern(fe.nameRx).required(),ref:D.boolean(),assert:D.alternatives([D.function(),D.object().schema()]).conditional("ref",{is:!0,then:D.required()}),normalize:D.function(),message:D.string().when("assert",{is:D.function(),then:D.required()})})),convert:D.boolean(),manifest:D.boolean(),method:D.function().allow(!1),multi:D.boolean(),validate:D.function()});Zu.extension=D.object({type:D.alternatives([D.string(),D.object().regex()]).required(),args:D.function(),cast:D.object().pattern(fe.nameRx,D.object({from:D.function().maxArity(1).required(),to:D.function().minArity(1).maxArity(2).required()})),base:D.object().schema().when("type",{is:D.object().regex(),then:D.forbidden()}),coerce:[D.function().maxArity(3),D.object({method:D.function().maxArity(3).required(),from:D.array().items(D.string()).single()})],flags:D.object().pattern(fe.nameRx,D.object({setter:D.string(),default:D.any()})),manifest:{build:D.function().arity(2)},messages:[D.object(),D.string()],modifiers:D.object().pattern(fe.nameRx,D.function().minArity(1).maxArity(2)),overrides:D.object().pattern(fe.nameRx,D.function()),prepare:D.function().maxArity(3),rebuild:D.function().arity(1),rules:D.object().pattern(fe.nameRx,fe.rule),terms:D.object().pattern(fe.nameRx,D.object({init:D.array().allow(null).required(),manifest:D.object().pattern(/.+/,[D.valid("schema","single"),D.object({mapped:D.object({from:D.string().required(),to:D.string().required()}).required()})])})),validate:D.function().maxArity(3)}).strict();Zu.extensions=D.array().items(D.object(),D.function().arity(1)).strict();fe.desc={buffer:D.object({buffer:D.string()}),func:D.object({function:D.function().required(),options:{literal:!0}}),override:D.object({override:!0}),ref:D.object({ref:D.object({type:D.valid("value","global","local"),path:D.array().required(),separator:D.string().length(1).allow(!1),ancestor:D.number().min(0).integer().allow("root"),map:D.array().items(D.array().length(2)).min(1),adjust:D.function(),iterables:D.boolean(),in:D.boolean(),render:D.boolean()}).required()}),regex:D.object({regex:D.string().min(3)}),special:D.object({special:D.valid("deep").required()}),template:D.object({template:D.string().required(),options:D.object()}),value:D.object({value:D.alternatives([D.object(),D.array()]).required()})};fe.desc.entity=D.alternatives([D.array().items(D.link("...")),D.boolean(),D.function(),D.number(),D.string(),fe.desc.buffer,fe.desc.func,fe.desc.ref,fe.desc.regex,fe.desc.special,fe.desc.template,fe.desc.value,D.link("/")]);fe.desc.values=D.array().items(null,D.boolean(),D.function(),D.number().allow(1/0,-1/0),D.string().allow(""),D.symbol(),fe.desc.buffer,fe.desc.func,fe.desc.override,fe.desc.ref,fe.desc.regex,fe.desc.template,fe.desc.value);fe.desc.messages=D.object().pattern(/.+/,[D.string(),fe.desc.template,D.object().pattern(/.+/,[D.string(),fe.desc.template])]);Zu.description=D.object({type:D.string().required(),flags:D.object({cast:D.string(),default:D.any(),description:D.string(),empty:D.link("/"),failover:fe.desc.entity,id:D.string(),label:D.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:D.boolean(),unit:D.string()}).unknown(),preferences:{allowUnknown:D.boolean(),abortEarly:D.boolean(),artifacts:D.boolean(),cache:D.boolean(),convert:D.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:D.boolean(),label:["path","key"],language:[D.string(),fe.desc.ref],wrap:{label:fe.wrap,array:fe.wrap}},externals:D.boolean(),messages:fe.desc.messages,noDefaults:D.boolean(),nonEnumerables:D.boolean(),presence:["required","optional","forbidden"],skipFunctions:D.boolean(),stripUnknown:D.object({arrays:D.boolean(),objects:D.boolean()}).or("arrays","objects").allow(!0,!1),warnings:D.boolean()},allow:fe.desc.values,invalid:fe.desc.values,rules:D.array().min(1).items({name:D.string().required(),args:D.object().min(1),keep:D.boolean(),message:[D.string(),fe.desc.messages],warn:D.boolean()}),keys:D.object().pattern(/.*/,D.link("/")),link:fe.desc.ref}).pattern(/^[a-z]\w*$/,D.any())});var cP=f((V8,uP)=>{"use strict";var vs={};uP.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);vs.isSafe(r)?e+=t[n]:e+=vs.escapeHtmlChar(r)}return e};vs.escapeHtmlChar=function(t){let e=vs.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};vs.isSafe=function(t){return vs.safeCharCodes.has(t)};vs.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);vs.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var lP=f(ec=>{"use strict";var Oe={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};ec.Parser=class{constructor(t,e={}){if(!e[Oe.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Oe.settings]?e:Object.assign({[Oe.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new ec.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Oe.operatorCharacters.includes(n))u&&u.type==="operator"&&Oe.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Oe.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Oe.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Oe.literals?i=Oe.literals[a]:a==="("?(s(),++r):Oe.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Oe.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Oe.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Oe.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Oe.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Oe.literals&&!s?(i+=c,o=Oe.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new ec.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Oe.evaluate(i,t);e[n]=Oe.single(r.value,s)}}return Oe.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Oe.evaluate(e[r-1],t),o=Oe.evaluate(e[r+1],t);e.splice(r,2);let a=Oe.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Oe.evaluate(e[0],t)}};ec.Parser.prototype[Oe.symbol]=!0;Oe.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Oe.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Oe.symbol]?t.evaluate(e):t};Oe.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Oe.calculate=function(t,e,n){if(t==="??")return Oe.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Oe.exists(e)?e:"",n=Oe.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Oe.exists=function(t){return t!=null}});var hP=f(pP=>{"use strict";var Uj=bn(),Kj=et(),eo={annotations:Symbol("annotations")};pP.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=Uj(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,p=i;for(let h=0;;++h){let m=l[h];if(Kj.isSchema(p)&&(p=p.clone()),h+1<l.length&&typeof p[m]!="string")p=p[m];else{let b=p[eo.annotations]||{errors:{},missing:{}};p[eo.annotations]=b;let v=m||c.context.key;p[m]!==void 0?(b.errors[v]=b.errors[v]||[],b.errors[v].push(u)):b.missing[v]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=eo.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
|
96
|
+
return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}se.createSelectorGroup=ri;function Hq(t){return t.selectors}se.getSelectorsFromGroup=Hq;var ii;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})(ii=se.SelectorGroupType||(se.SelectorGroupType={}));se.SelectorGroups={BlockEndOfLine:ri(ii.AssignmentEndOfExpr,[se.Selectors.EndOfLine,se.Selectors.Comment]),AssignmentEndOfExpr:ri(ii.AssignmentEndOfExpr,[se.Selectors.EndOfFile,se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),AssignmentShorthand:ri(ii.AssignmentShorthand,[se.Selectors.AddShorthand,se.Selectors.SubtractShorthand,se.Selectors.MultiplyShorthand,se.Selectors.DivideShorthand,se.Selectors.PowerShorthand,se.Selectors.ModuloShorthand]),AssignmentCommandArgs:ri(ii.AssignmentCommandArgs,[se.Selectors.ArgumentSeperator,se.Selectors.EndOfLine,se.Selectors.EndOfFile]),ReturnStatementEnd:ri(ii.ReturnStatementEnd,[se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),FunctionDeclarationArgEnd:ri(ii.FunctionDeclarationArgEnd,[se.Selectors.RParenthesis,se.Selectors.EndOfFile,se.Selectors.EndOfLine]),ComparisonOperators:ri(ii.ComparisonOperators,[se.Selectors.Equal,se.Selectors.NotEqual,se.Selectors.Greater,se.Selectors.GreaterEqual,se.Selectors.Lesser,se.Selectors.LessEqual]),MultiDivOperators:ri(ii.MultiDivOperators,[se.Selectors.Times,se.Selectors.Divide,se.Selectors.Mod]),CallArgsEnd:ri(ii.CallArgsEnd,[se.Selectors.ArgumentSeperator,se.Selectors.RParenthesis])}});var B_=f(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Stack=void 0;var F_=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};Lh.Stack=F_});var H_=f(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.PendingWhile=Ze.isPendingWhile=Ze.PendingIf=Ze.isPendingIf=Ze.PendingFunction=Ze.isPendingFunction=Ze.PendingFor=Ze.isPendingFor=Ze.PendingChunk=Ze.isPendingChunk=Ze.PendingBlockType=void 0;var jr;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(jr=Ze.PendingBlockType||(Ze.PendingBlockType={}));var Ys=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function Vq(t){return t.type===jr.Chunk}Ze.isPendingChunk=Vq;var $_=class extends Ys{constructor(e,n){super(e,jr.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Ze.PendingChunk=$_;function zq(t){return t.type===jr.For}Ze.isPendingFor=zq;var U_=class extends Ys{constructor(e,n){super(e,jr.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ze.PendingFor=U_;function Xq(t){return t.type===jr.Function}Ze.isPendingFunction=Xq;var K_=class extends Ys{constructor(e,n,r){super(e,jr.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToLine(this.base.end.line,this.base)):this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ze.PendingFunction=K_;function Yq(t){return t.type===jr.If}Ze.isPendingIf=Yq;var W_=class extends Ys{constructor(e,n,r){super(e,jr.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line!==this.block.start.line&&this.lineRegistry.addItemToLine(this.currentClause.start.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(this.block.end.line,this.block),super.complete(e)}};Ze.PendingIf=W_;function Jq(t){return t.type===jr.While}Ze.isPendingWhile=Jq;var G_=class extends Ys{constructor(e,n){super(e,jr.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToLine(e.end.line,this.block),super.complete(e)}};Ze.PendingWhile=G_});var z_=f(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.LineRegistry=void 0;var V_=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Nh.LineRegistry=V_});var N1=f(Yu=>{"use strict";var L1=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var Qq=L1(Db()),ma=ps(),Vn=Mh(),Zq=L1(N_()),ej=ah(),Zt=ua(),Oi=la(),Lt=Ku(),X=j_(),tj=B_(),si=H_(),nj=z_(),X_=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new tj.Stack,r.statementErrors=[],r.lexer=n.lexer||new Qq.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new nj.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.iteratorStack=[],r.literals=[],r.comments=[],r.validator=n.validator||new Zq.default,r.astProvider=n.astProvider||new Vn.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new Lt.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,X.getSelectorValue)(e)}" is required`,new Lt.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,X.getSelectorsFromGroup)(e).map(i=>`"${(0,X.getSelectorValue)(i)}"`).join(", ")} is required`,new Lt.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(X.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.comments.push(s),n.lineRegistry.addItemToLines(s)}else if(X.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==ma.TokenType.EOL&&e.token.type!==ma.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,si.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Lt.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new si.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!X.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!X.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.comments=e.comments,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(ma.TokenType.Keyword===e.token.type&&Zt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseContinueStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseBreakStatement(){let e=this,n=e.backpatches.peek();e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end));let r=e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Zt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Zt.Keyword.If:{e.next(),e.parseIfStatement();return}case Zt.Keyword.ElseIf:{e.next(),e.nextIfClause(Vn.ASTType.ElseifClause);return}case Zt.Keyword.Else:{e.next(),e.nextIfClause(Vn.ASTType.ElseClause);return}case Zt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Zt.Keyword.For:{e.next(),e.parseForStatement();return}case Zt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Zt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Zt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Zt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Zt.Keyword.Continue:{e.next(),e.parseContinueStatement();return}case Zt.Keyword.Break:{e.next(),e.parseBreakStatement();return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Lt.Range(e.token.start,e.token.end))}parseShortcutContinueStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'continue' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.continueStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutBreakStatement(){let e=this;return e.iteratorStack.length===0&&e.raise("'break' without open loop block",new Lt.Range(e.previousToken.start,e.previousToken.end)),e.astProvider.breakStatement({iterator:e.iteratorStack[e.iteratorStack.length-1],start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope})}parseShortcutStatement(){let e=this;if(ma.TokenType.Keyword===e.token.type&&Zt.Keyword.Not!==e.token.value)switch(e.token.value){case Zt.Keyword.Return:return e.next(),e.parseReturnStatement();case Zt.Keyword.Continue:return e.next(),e.parseShortcutContinueStatement();case Zt.Keyword.Break:return e.next(),e.parseShortcutBreakStatement();default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Lt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(X.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(X.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.definitions.push(o),o}else if(X.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),p=e.parseExpr(a),h=e.astProvider.parenthesisExpression({start:p.start,end:p.end,range:p.range,expression:p});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:h,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.definitions.push(a),a}let s=[];for(;!X.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),X.SelectorGroups.BlockEndOfLine(e.token)||X.Selectors.Else(e.token))break;if(X.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(X.SelectorGroups.AssignmentCommandArgs,r.start);if(X.Selectors.EndOfLine(a)||X.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return X.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(X.Selectors.Then,n.start),!X.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new si.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,si.isPendingIf)(r)){n.raise("no matching open if block",new Lt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case Vn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(X.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case Vn.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),X.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Lt.Range(n.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new si.PendingWhile(i,e.lineRegistry);e.backpatches.push(s),e.iteratorStack.push(i)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingWhile)(n)){e.raise("no matching open while block",new Lt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(Vn.ASTIdentifierKind.ForInVariable);e.requireToken(X.Selectors.In,r.start);let s=e.parseExpr(null);if(!s){e.raise("sequence expression expected for 'for' loop",new Lt.Range(r.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,s,r);let o=e.astProvider.forGenericStatement({variable:i,iterator:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n});n.definitions.push(o);let a=new si.PendingFor(o,e.lineRegistry);e.backpatches.push(a),e.iteratorStack.push(o)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingFor)(n)){e.raise("no matching open for block",new Lt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.iteratorStack.pop(),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.currentScope,o=i.backpatches.peek(),a=i.parseShortcutStatement(),u=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[a],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});s.definitions.push(u),i.lineRegistry.addItemToLines(u),o.body.push(u)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!X.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!X.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(X.Selectors.LParenthesis,s.start);!X.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(Vn.ASTIdentifierKind.Argument),l=c;if(i.consume(X.Selectors.Assign)){let p=i.parseExpr(null);if(p instanceof Vn.ASTLiteral){let h=i.astProvider.assignmentStatement({variable:c,init:p,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(h),a.push(h)}else i.raise("parameter default value must be a literal value",new Lt.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let p=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(p),a.push(c)}if(X.Selectors.RParenthesis(i.token))break;if(i.requireToken(X.Selectors.ArgumentSeperator,s.start),X.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Lt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(X.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new si.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,si.isPendingFunction)(n)){e.raise("no matching open function block",new Lt.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;X.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:Oi.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;X.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:Oi.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(X.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:Oi.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(X.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:Oi.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!X.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(X.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;X.Selectors.Plus(r.token)||X.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;X.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!X.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof Vn.ASTNumericLiteral||s instanceof Vn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Oi.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!X.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:Oi.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!X.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower(!0,n);return r.astProvider.unaryExpression({operator:Oi.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(X.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:Oi.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!X.Selectors.EndOfFile(r.token);)if(X.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(Vn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:Oi.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(X.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),X.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(X.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,isStatementStart:n,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(X.Selectors.SRBracket,i.start)}else if(X.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(X.Selectors.LParenthesis(e.token))if(e.next(),X.Selectors.RParenthesis(e.token))e.next();else for(;!X.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),X.Selectors.RParenthesis(e.requireTokenOfAny(X.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!X.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(X.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!X.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!X.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(X.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(ma.TokenType.Identifier)?r.parseIdentifier(Vn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new Lt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(ma.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==Vn.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new ej.ParserException(e,n);return r.statementErrors.push(i),i}};Yu.default=X_});var Te=f(Pe=>{"use strict";var rj=Pe&&Pe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Fr=Pe&&Pe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rj(e,t,n)},qh=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ASTRange=Pe.ASTPosition=Pe.LineRegistry=Pe.ParserValidatorm=Pe.Parser=Pe.LexerValidator=Pe.Lexer=void 0;var ij=Db();Object.defineProperty(Pe,"Lexer",{enumerable:!0,get:function(){return qh(ij).default}});Fr(ps(),Pe);var sj=Sb();Object.defineProperty(Pe,"LexerValidator",{enumerable:!0,get:function(){return qh(sj).default}});var oj=N1();Object.defineProperty(Pe,"Parser",{enumerable:!0,get:function(){return qh(oj).default}});Fr(Mh(),Pe);var aj=N_();Object.defineProperty(Pe,"ParserValidatorm",{enumerable:!0,get:function(){return qh(aj).default}});var uj=z_();Object.defineProperty(Pe,"LineRegistry",{enumerable:!0,get:function(){return uj.LineRegistry}});Fr(H_(),Pe);Fr(B_(),Pe);Fr(Pb(),Pe);Fr(oh(),Pe);Fr(ah(),Pe);Fr(ua(),Pe);Fr(xb(),Pe);Fr(la(),Pe);var cj=qu();Object.defineProperty(Pe,"ASTPosition",{enumerable:!0,get:function(){return cj.Position}});var lj=Ku();Object.defineProperty(Pe,"ASTRange",{enumerable:!0,get:function(){return lj.Range}});Fr(j_(),Pe)});var Y_=f(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.getSignaturePayloadDefinitionType=void 0;function pj(t){return t==null?null:typeof t=="object"?t.type:t}jh.getSignaturePayloadDefinitionType=pj});var Ri=f(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.SignatureDefinitionBaseType=void 0;var hj;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(hj=Ju.SignatureDefinitionBaseType||(Ju.SignatureDefinitionBaseType={}))});var J_=f(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.TypeParser=void 0;var Fh=Ri(),dj=function(){function t(e){this._input=e,this._rx=/(\w+|<|>|,)/g,this._lastMatch=null}return t.prototype.next=function(){return this._lastMatch=this._rx.exec(this._input),this._lastMatch?this._lastMatch[0]:null},t.prototype.createDefault=function(){return{type:Fh.SignatureDefinitionBaseType.Any}},t.prototype.parseList=function(e){var n={type:e,valueType:Fh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.valueType=r,this.next()!==">")return this.createDefault()}return n},t.prototype.parseMap=function(e){var n={type:e,keyType:Fh.SignatureDefinitionBaseType.Any,valueType:Fh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.keyType=r,this.next()!==",")return this.createDefault();var i=this.parse();if(n.valueType=i,this.next()!==">")return this.createDefault()}return n},t.prototype.parse=function(){var e=this.next();if(!e)return this.createDefault();switch(e){case"list":return this.parseList(e);case"map":return this.parseMap(e)}return{type:e}},t}();Bh.TypeParser=dj});var Qu=f($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.SignatureDefinitionTypeMeta=void 0;var Q_=Y_(),ln=Ri(),fj=J_(),gj=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=new fj.TypeParser(e),r=n.parse();return t.parse(r)},t.parseValueString=function(e){var n=e,r=null,i=null;return n===ln.SignatureDefinitionBaseType.Map?(r=new t({type:ln.SignatureDefinitionBaseType.Any}),i=new t({type:ln.SignatureDefinitionBaseType.Any})):n===ln.SignatureDefinitionBaseType.List&&(r=new t({type:ln.SignatureDefinitionBaseType.Any})),new t({type:n,valueType:r,keyType:i})},t.parseValueObject=function(e){var n,r,i,s=e.type,o=null,a=null;if(s===ln.SignatureDefinitionBaseType.Map){var u=(n=(0,Q_.getSignaturePayloadDefinitionType)(e.keyType))!==null&&n!==void 0?n:ln.SignatureDefinitionBaseType.Any,c=(r=(0,Q_.getSignaturePayloadDefinitionType)(e.valueType))!==null&&r!==void 0?r:ln.SignatureDefinitionBaseType.Any;u===ln.SignatureDefinitionBaseType.Map||u===ln.SignatureDefinitionBaseType.List?a=t.parse(e.keyType):a=new t({type:u}),c===ln.SignatureDefinitionBaseType.Map||c===ln.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}else if(s===ln.SignatureDefinitionBaseType.List){var c=(i=(0,Q_.getSignaturePayloadDefinitionType)(e.valueType))!==null&&i!==void 0?i:ln.SignatureDefinitionBaseType.Any;c===ln.SignatureDefinitionBaseType.Map||c===ln.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}return new t({type:s,valueType:o,keyType:a})},t.parse=function(e){if(typeof e=="string")return t.parseValueString(e);if(typeof e=="object")return t.parseValueObject(e);throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType.type===e.keyType.type&&this.valueType.type===e.valueType.type},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType.toString(),">"):"".concat(this.type,"<").concat(this.keyType.toString(),",").concat(this.valueType.toString(),">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType.toJSON()}:{type:this.type,keyType:this.keyType.toJSON(),valueType:this.valueType.toJSON()}},t.prototype.copy=function(){var e,n;return new t({type:this.type,keyType:(e=this.keyType)===null||e===void 0?void 0:e.copy(),valueType:(n=this.valueType)===null||n===void 0?void 0:n.copy()})},t}();$h.SignatureDefinitionTypeMeta=gj});var Z_=f(gs=>{"use strict";var q1=gs&&gs.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},j1=gs&&gs.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(gs,"__esModule",{value:!0});gs.SignatureDefinitionFunctionArg=void 0;var F1=Qu(),mj=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(F1.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,j1([],q1(e.types.map(F1.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return j1([],q1(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();gs.SignatureDefinitionFunctionArg=mj});var $1=f((M8,B1)=>{var yj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";B1.exports={urlAlphabet:yj}});var z1=f((L8,V1)=>{var U1=require("crypto"),{urlAlphabet:K1}=$1(),bj=128,ms,ys,W1=t=>{!ms||ms.length<t?(ms=Buffer.allocUnsafe(t*bj),U1.randomFillSync(ms),ys=0):ys+t>ms.length&&(U1.randomFillSync(ms),ys=0),ys+=t},G1=t=>(W1(t|=0),ms.subarray(ys-t,ys)),H1=(t,e,n)=>{let r=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*r*e/t.length);return(s=e)=>{let o="";for(;;){let a=n(i),u=i;for(;u--;)if(o+=t[a[u]&r]||"",o.length===s)return o}}},_j=(t,e=21)=>H1(t,e,G1),vj=(t=21)=>{W1(t|=0);let e="";for(let n=ys-t;n<ys;n++)e+=K1[ms[n]&63];return e};V1.exports={nanoid:vj,customAlphabet:_j,customRandom:H1,urlAlphabet:K1,random:G1}});var Uh=f(bs=>{"use strict";var Js=bs&&bs.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Qs=bs&&bs.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(bs,"__esModule",{value:!0});bs.VariationRegistry=void 0;var Sj=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(Qs(Qs([],Js(e),!1),Js(this._variations),!1)),this},t.prototype.getAll=function(){return Qs([],Js(this._variations),!1)},t}(),Tj=function(){function t(){}return t.add=function(e,n){var r=new Sj(e);return r.push.apply(r,Qs([],Js(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){for(var n=new Set,r=0;r<e.length;r++){var i=e[r];if(typeof i=="string"&&i.startsWith("!")){var s=i.slice(1),o=this.get(s);if(o!==null)n=new Set(Qs(Qs([],Js(o.getAll()),!1),Js(n),!1));else throw new Error("Cannot find variation container for ".concat(s));continue}n.add(i)}return Qs([],Js(n),!1)},t.variationContainers=new Map,t}();bs.VariationRegistry=Tj});var Kh=f(_s=>{"use strict";var wj=_s&&_s.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},xj=_s&&_s.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(_s,"__esModule",{value:!0});_s.SignatureDefinition=void 0;var Ej=Uh(),kj=Qu(),Aj=function(){function t(e){this._origin=e.origin,this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations,this._tags=e.tags}return t.parse=function(e,n){var r,i,s,o;return new t({origin:e,type:kj.SignatureDefinitionTypeMeta.parse(n.type),isProtected:!!n.isProtected,description:(r=n.description)!==null&&r!==void 0?r:null,example:(i=n.example)!==null&&i!==void 0?i:null,variations:(s=n.variations)!==null&&s!==void 0?s:null,tags:(o=n.tags)!==null&&o!==void 0?o:null})},t.prototype.getOrigin=function(){return this._origin},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.getTags=function(){return this._tags},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return Ej.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?xj([],wj(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({origin:this._origin,type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations,tags:this._tags})},t.prototype.copy=function(){return new t({origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations,tags:this._tags})},t}();_s.SignatureDefinition=Aj});var Gh=f(pr=>{"use strict";var Pj=pr&&pr.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wh=pr&&pr.__assign||function(){return Wh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Wh.apply(this,arguments)},Oj=pr&&pr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Rj=pr&&pr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(pr,"__esModule",{value:!0});pr.SignatureDefinitionFunction=void 0;var Dj=z1(),Ij=Ri(),Cj=Uh(),Mj=Kh(),Lj=Z_(),X1=Qu(),Nj=function(t){Pj(e,t);function e(n){var r=this,i;return r=t.call(this,{type:n.type,origin:n.origin,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations,tags:n.tags})||this,r._id=(i=n.id)!==null&&i!==void 0?i:(0,Dj.nanoid)(),r._argList=n.arguments.map(function(s){return s.getLabel()}),r._argRefs=n.arguments.reduce(function(s,o){return s.set(o.getLabel(),o)},new Map),r._returns=n.returns.reduce(function(s,o){return s.set(o.type,o)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n,r){var i,s,o,a,u,c,l;return new e({id:r.id,origin:n,type:new X1.SignatureDefinitionTypeMeta({type:Ij.SignatureDefinitionBaseType.Function}),isProtected:(i=r.isProtected)!==null&&i!==void 0?i:!1,description:(s=r.description)!==null&&s!==void 0?s:null,example:(o=r.example)!==null&&o!==void 0?o:null,arguments:(u=(a=r.arguments)===null||a===void 0?void 0:a.map(Lj.SignatureDefinitionFunctionArg.parse))!==null&&u!==void 0?u:[],returns:r.returns.map(X1.SignatureDefinitionTypeMeta.parse),variations:r.variations,returnVariations:(c=r.returnVariations)!==null&&c!==void 0?c:null,tags:(l=r.tags)!==null&&l!==void 0?l:null})},e.prototype.getId=function(){return this._id},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return Rj([],Oj(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),Cj.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Wh(Wh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({id:this._id,origin:this._origin,type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e.prototype.copy=function(){return new e({id:this._id,origin:this._origin,type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations,tags:this._tags})},e}(Mj.SignatureDefinition);pr.SignatureDefinitionFunction=Nj});var J1=f((F8,Y1)=>{"use strict";Y1.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var ev=f((Q1,Z1)=>{"use strict";var qj=J1();Z1.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:qj(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Q1.assert)}}});var Ce=f(($8,eP)=>{"use strict";var jj=ev();eP.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new jj(e)}});var Zs=f((U8,nP)=>{"use strict";var tv=Ce(),tP={};nP.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);tv(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&tP.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){tv(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),tv(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};tP.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var nv=f((yn,iP)=>{"use strict";var rP={};yn=iP.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};rP.typeMap=new Map([["[object Error]",yn.error],["[object Map]",yn.map],["[object Promise]",yn.promise],["[object Set]",yn.set],["[object WeakMap]",yn.weakMap],["[object WeakSet]",yn.weakSet]]);yn.getInternalProto=function(t){if(Array.isArray(t))return yn.array;if(Buffer&&t instanceof Buffer)return yn.buffer;if(t instanceof Date)return yn.date;if(t instanceof RegExp)return yn.regex;if(t instanceof Error)return yn.error;let e=Object.prototype.toString.call(t);return rP.typeMap.get(e)||yn.generic}});var rv=f(sP=>{"use strict";sP.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var bn=f((W8,oP)=>{"use strict";var Fj=Zs(),zn=nv(),Bj=rv(),Di={needsProtoHack:new Set([zn.set,zn.map,zn.weakSet,zn.weakMap])};oP.exports=Di.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=Di.clone,i=n;if(e.shallow){if(e.shallow!==!0)return Di.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=zn.getInternalProto(t);if(s===zn.buffer)return Buffer&&Buffer.from(t);if(s===zn.date)return new Date(t.getTime());if(s===zn.regex)return new RegExp(t);let o=Di.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===zn.set)for(let u of t)o.add(r(u,e,i));else if(s===zn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=Bj.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===zn.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};Di.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=Fj(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return Di.clone(t,e,r)};Di.base=function(t,e,n){if(n.prototype===!1)return Di.needsProtoHack.has(e)?new e.constructor:e===zn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===zn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(Di.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var aP=f((G8,$j)=>{$j.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Hh=f(Zu=>{"use strict";var R=Vh(),fe={};fe.wrap=R.string().min(1).max(2).allow(!1);Zu.preferences=R.object({allowUnknown:R.boolean(),abortEarly:R.boolean(),artifacts:R.boolean(),cache:R.boolean(),context:R.object(),convert:R.boolean(),dateFormat:R.valid("date","iso","string","time","utc"),debug:R.boolean(),errors:{escapeHtml:R.boolean(),label:R.valid("path","key",!1),language:[R.string(),R.object().ref()],render:R.boolean(),stack:R.boolean(),wrap:{label:fe.wrap,array:fe.wrap,string:fe.wrap}},externals:R.boolean(),messages:R.object(),noDefaults:R.boolean(),nonEnumerables:R.boolean(),presence:R.valid("required","optional","forbidden"),skipFunctions:R.boolean(),stripUnknown:R.object({arrays:R.boolean(),objects:R.boolean()}).or("arrays","objects").allow(!0,!1),warnings:R.boolean()}).strict();fe.nameRx=/^[a-zA-Z0-9]\w*$/;fe.rule=R.object({alias:R.array().items(R.string().pattern(fe.nameRx)).single(),args:R.array().items(R.string(),R.object({name:R.string().pattern(fe.nameRx).required(),ref:R.boolean(),assert:R.alternatives([R.function(),R.object().schema()]).conditional("ref",{is:!0,then:R.required()}),normalize:R.function(),message:R.string().when("assert",{is:R.function(),then:R.required()})})),convert:R.boolean(),manifest:R.boolean(),method:R.function().allow(!1),multi:R.boolean(),validate:R.function()});Zu.extension=R.object({type:R.alternatives([R.string(),R.object().regex()]).required(),args:R.function(),cast:R.object().pattern(fe.nameRx,R.object({from:R.function().maxArity(1).required(),to:R.function().minArity(1).maxArity(2).required()})),base:R.object().schema().when("type",{is:R.object().regex(),then:R.forbidden()}),coerce:[R.function().maxArity(3),R.object({method:R.function().maxArity(3).required(),from:R.array().items(R.string()).single()})],flags:R.object().pattern(fe.nameRx,R.object({setter:R.string(),default:R.any()})),manifest:{build:R.function().arity(2)},messages:[R.object(),R.string()],modifiers:R.object().pattern(fe.nameRx,R.function().minArity(1).maxArity(2)),overrides:R.object().pattern(fe.nameRx,R.function()),prepare:R.function().maxArity(3),rebuild:R.function().arity(1),rules:R.object().pattern(fe.nameRx,fe.rule),terms:R.object().pattern(fe.nameRx,R.object({init:R.array().allow(null).required(),manifest:R.object().pattern(/.+/,[R.valid("schema","single"),R.object({mapped:R.object({from:R.string().required(),to:R.string().required()}).required()})])})),validate:R.function().maxArity(3)}).strict();Zu.extensions=R.array().items(R.object(),R.function().arity(1)).strict();fe.desc={buffer:R.object({buffer:R.string()}),func:R.object({function:R.function().required(),options:{literal:!0}}),override:R.object({override:!0}),ref:R.object({ref:R.object({type:R.valid("value","global","local"),path:R.array().required(),separator:R.string().length(1).allow(!1),ancestor:R.number().min(0).integer().allow("root"),map:R.array().items(R.array().length(2)).min(1),adjust:R.function(),iterables:R.boolean(),in:R.boolean(),render:R.boolean()}).required()}),regex:R.object({regex:R.string().min(3)}),special:R.object({special:R.valid("deep").required()}),template:R.object({template:R.string().required(),options:R.object()}),value:R.object({value:R.alternatives([R.object(),R.array()]).required()})};fe.desc.entity=R.alternatives([R.array().items(R.link("...")),R.boolean(),R.function(),R.number(),R.string(),fe.desc.buffer,fe.desc.func,fe.desc.ref,fe.desc.regex,fe.desc.special,fe.desc.template,fe.desc.value,R.link("/")]);fe.desc.values=R.array().items(null,R.boolean(),R.function(),R.number().allow(1/0,-1/0),R.string().allow(""),R.symbol(),fe.desc.buffer,fe.desc.func,fe.desc.override,fe.desc.ref,fe.desc.regex,fe.desc.template,fe.desc.value);fe.desc.messages=R.object().pattern(/.+/,[R.string(),fe.desc.template,R.object().pattern(/.+/,[R.string(),fe.desc.template])]);Zu.description=R.object({type:R.string().required(),flags:R.object({cast:R.string(),default:R.any(),description:R.string(),empty:R.link("/"),failover:fe.desc.entity,id:R.string(),label:R.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:R.boolean(),unit:R.string()}).unknown(),preferences:{allowUnknown:R.boolean(),abortEarly:R.boolean(),artifacts:R.boolean(),cache:R.boolean(),convert:R.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:R.boolean(),label:["path","key"],language:[R.string(),fe.desc.ref],wrap:{label:fe.wrap,array:fe.wrap}},externals:R.boolean(),messages:fe.desc.messages,noDefaults:R.boolean(),nonEnumerables:R.boolean(),presence:["required","optional","forbidden"],skipFunctions:R.boolean(),stripUnknown:R.object({arrays:R.boolean(),objects:R.boolean()}).or("arrays","objects").allow(!0,!1),warnings:R.boolean()},allow:fe.desc.values,invalid:fe.desc.values,rules:R.array().min(1).items({name:R.string().required(),args:R.object().min(1),keep:R.boolean(),message:[R.string(),fe.desc.messages],warn:R.boolean()}),keys:R.object().pattern(/.*/,R.link("/")),link:fe.desc.ref}).pattern(/^[a-z]\w*$/,R.any())});var cP=f((V8,uP)=>{"use strict";var vs={};uP.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);vs.isSafe(r)?e+=t[n]:e+=vs.escapeHtmlChar(r)}return e};vs.escapeHtmlChar=function(t){let e=vs.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};vs.isSafe=function(t){return vs.safeCharCodes.has(t)};vs.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);vs.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var lP=f(ec=>{"use strict";var Oe={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};ec.Parser=class{constructor(t,e={}){if(!e[Oe.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Oe.settings]?e:Object.assign({[Oe.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new ec.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Oe.operatorCharacters.includes(n))u&&u.type==="operator"&&Oe.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Oe.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Oe.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Oe.literals?i=Oe.literals[a]:a==="("?(s(),++r):Oe.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Oe.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Oe.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Oe.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Oe.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Oe.literals&&!s?(i+=c,o=Oe.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new ec.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Oe.evaluate(i,t);e[n]=Oe.single(r.value,s)}}return Oe.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Oe.evaluate(e[r-1],t),o=Oe.evaluate(e[r+1],t);e.splice(r,2);let a=Oe.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Oe.evaluate(e[0],t)}};ec.Parser.prototype[Oe.symbol]=!0;Oe.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Oe.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Oe.symbol]?t.evaluate(e):t};Oe.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Oe.calculate=function(t,e,n){if(t==="??")return Oe.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Oe.exists(e)?e:"",n=Oe.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Oe.exists=function(t){return t!=null}});var hP=f(pP=>{"use strict";var Uj=bn(),Kj=et(),eo={annotations:Symbol("annotations")};pP.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=Uj(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,p=i;for(let h=0;;++h){let m=l[h];if(Kj.isSchema(p)&&(p=p.clone()),h+1<l.length&&typeof p[m]!="string")p=p[m];else{let b=p[eo.annotations]||{errors:{},missing:{}};p[eo.annotations]=b;let v=m||c.context.key;p[m]!==void 0?(b.errors[v]=b.errors[v]||[],b.errors[v].push(u)):b.missing[v]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=eo.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
|
97
97
|
${c} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
|
98
98
|
${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
99
|
-
[${u}] ${this.details[a].message}`}return o=o+r,o};eo.safeStringify=function(t,e){return JSON.stringify(t,eo.serializer(),e)};eo.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[eo.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var Ii=f(Ct=>{"use strict";var Wj=hP(),Gj=et(),Hj=Ss();Ct.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ct.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return Ct.template(this.value,t,e||this.code,this.state,this.prefs)}};Ct.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ct.template=function(t,e,n,r,i){if(!e)return;if(Hj.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(Gj.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};Ct.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=Ct.path(i);return s||Ct.template(null,n.messages,"root",e,n)||r&&Ct.template(null,r,"root",e,n)||"value"};Ct.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Ct.details(t);if(r)return r;if(n.errors.stack)return new Ct.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ct.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Ct.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ct.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ct.ValidationError}};Ct.ValidationError.prototype.isJoi=!0;Ct.ValidationError.prototype.name="ValidationError";Ct.ValidationError.prototype.annotate=Wj.error});var Ci=f(fr=>{"use strict";var hr=Ce(),Vj=bn(),zj=Zs(),tc=et(),iv,dr={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};fr.create=function(t,e={}){hr(typeof t=="string","Invalid reference key:",t),tc.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),hr(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},dr.defaults,e);delete n.prefix;let r=n.separator,i=dr.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(hr(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)hr(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=dr.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new dr.Ref(n)};fr.in=function(t,e={}){return fr.create(t,{...e,in:!0})};fr.isRef=function(t){return t?!!t[tc.symbols.ref]:!1};dr.Ref=class{constructor(t){hr(typeof t=="object","Invalid reference construction"),tc.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),hr([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),hr(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),hr(!t.map||Array.isArray(t.map),"options.map must be an array"),hr(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,dr.defaults,t),hr(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return hr(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(hr(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=zj(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new dr.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};dr.Ref.prototype[tc.symbols.ref]=!0;fr.build=function(t){return t=Object.assign({},dr.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new dr.Ref(t)};dr.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};dr.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};fr.toSibling=0;fr.toParent=1;fr.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?fr.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(tc.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}fr.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),iv=iv||Ss(),iv.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new fr.Manager;return t.refs=Vj(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Ss=f((mP,yP)=>{"use strict";var zh=Ce(),Xj=bn(),Yj=cP(),Jj=lP(),fP=et(),dP=Ii(),gP=Ci(),Fe={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};yP.exports=mP=Fe.Template=class{constructor(t,e){if(zh(typeof t=="string","Template source must be a string"),zh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?Xj(r):void 0,this._functions=n,this._functions&&(zh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),zh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=Fe.encode(this.source),e=Fe.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${Fe.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let p=this._ref(Fe.decode(c),{raw:o,wrapped:l});r.push(p),typeof p!="string"&&(n=!0);let h=s.slice(u+a.length);h&&r.push(Fe.decode(h))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Fe.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new Fe.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[fP.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=Fe.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:Yj(u);s.push(Fe.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=gP.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...Fe.functions,...this._functions}:Fe.functions;var s=new Jj.Parser(t,{reference:i,functions:o,constants:Fe.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return Fe.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Fe.Template.prototype[fP.symbols.template]=!0;Fe.Template.prototype.isImmutable=!0;Fe.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Fe.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Fe.closes.slice(0,n.length))};Fe.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Fe.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};Fe.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Fe.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(gP.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return Fe.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return Fe.Template.date(t,r);if(t instanceof Map){let l=[];for(let[p,h]of t.entries())l.push(`${p.toString()} -> ${h.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Fe.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Fe.wrap(c.join(", "),!u&&a.array)};Fe.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Fe.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=dP.template(e,o[0],t,n,r)||dP.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var ya=f(nc=>{"use strict";var to=Ce(),bP=bn(),Xn=Ss();nc.compile=function(t,e){if(typeof t=="string")return to(!e,"Cannot set single message string"),new Xn(t);if(Xn.isTemplate(t))return to(!e,"Cannot set single message template"),t;to(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?bP(e):{};for(let n in t){let r=t[n];if(n==="root"||Xn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Xn(r);continue}to(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Xn.isTemplate(s)){e[i][n]=s;continue}to(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Xn(s)}}return e};nc.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Xn.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};nc.merge=function(t,e){if(!t)return nc.compile(e);if(!e)return t;if(typeof e=="string")return new Xn(e);if(Xn.isTemplate(e))return e;let n=bP(t);for(let r in e){let i=e[r];if(r==="root"||Xn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Xn(i);continue}to(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Xn.isTemplate(o)){n[s][r]=o;continue}to(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Xn(o)}}return n}});var et=f(tt=>{"use strict";var Xh=Ce(),Qj=ev(),Zj=aP(),sv,ov,eF={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};tt.version=Zj.version;tt.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};tt.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};tt.assertOptions=function(t,e,n="Options"){Xh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Xh(r.length===0,`${n} contain unknown keys: ${r}`)};tt.checkPreferences=function(t){ov=ov||Hh();let e=ov.preferences.validate(t);if(e.error)throw new Qj([e.error.details[0].message])};tt.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};tt.default=function(t,e){return t===void 0?e:t};tt.isIsoDate=function(t){return eF.isoDate.test(t)};tt.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};tt.isResolvable=function(t){return t?t[tt.symbols.ref]||t[tt.symbols.template]:!1};tt.isSchema=function(t,e={}){let n=t&&t[tt.symbols.any];return n?(Xh(e.legacy||n.version===tt.version,"Cannot mix different versions of joi schemas"),!0):!1};tt.isValues=function(t){return t[tt.symbols.values]};tt.limit=function(t){return Number.isSafeInteger(t)&&t>=0};tt.preferences=function(t,e){sv=sv||ya(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=sv.compile(e.messages,t.messages)),delete n[tt.symbols.prefs],n};tt.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};tt.validateArg=function(t,e,{assert:n,message:r}){if(tt.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};tt.verifyFlat=function(t,e){for(let n of t)Xh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var av=f(_P=>{"use strict";var tF=Ce(),nF=bn(),rF=et(),ba={max:1e3,supported:new Set(["undefined","boolean","number","string"])};_P.provider={provision(t){return new ba.Cache(t)}};ba.Cache=class{constructor(t={}){rF.assertOptions(t,["max"]),tF(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||ba.max,this._map=new Map,this._list=new ba.List}get length(){return this._map.size}set(t,e){if(t!==null&&!ba.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),nF(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};ba.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var no=f(Mi=>{"use strict";var _t=Ce(),Yn=et(),_a=Ci(),gr={};Mi.schema=function(t,e,n={}){Yn.assertOptions(n,["appendPath","override"]);try{return gr.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};gr.schema=function(t,e,n){_t(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(_t(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(gr.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(_t(typeof e=="object","Invalid schema content:",typeof e),Yn.isResolvable(e))return r(t,e);if(Yn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!gr.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(_t(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Mi.ref=function(t,e){return _a.isRef(t)?t:_a.create(t,e)};Mi.compile=function(t,e,n={}){Yn.assertOptions(n,["legacy"]);let r=e&&e[Yn.symbols.any];if(r)return _t(n.legacy||r.version===Yn.version,"Cannot mix different versions of joi schemas:",r.version,Yn.version),e;if(typeof e!="object"||!n.legacy)return Mi.schema(t,e,{appendPath:!0});let i=gr.walk(e);return i?i.compile(i.root,e):Mi.schema(t,e,{appendPath:!0})};gr.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=gr.walk(n);if(r)return r}return null}let e=t[Yn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};_t(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=gr.walk(t[n]);if(r)return r}return null};gr.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Mi.when=function(t,e,n){if(n===void 0&&(_t(e&&typeof e=="object","Missing options"),n=e,e=_a.create(".")),Array.isArray(n)&&(n={switch:n}),Yn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Yn.isSchema(e))return _t(n.is===void 0,'"is" can not be used with a schema condition'),_t(n.not===void 0,'"not" can not be used with a schema condition'),_t(n.switch===void 0,'"switch" can not be used with a schema condition'),gr.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(_t(_a.isRef(e)||typeof e=="string","Invalid condition:",e),_t(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return _t(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),_t(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!_a.isRef(n.is)&&!Yn.isSchema(n.is)&&(s=s.required()),gr.condition(t,{ref:Mi.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}_t(Array.isArray(n.switch),'"switch" must be an array'),_t(n.is===void 0,'Cannot combine "switch" with "is"'),_t(n.not===void 0,'Cannot combine "switch" with "not"'),_t(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Mi.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;Yn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),_t(s.is!==void 0,'Switch statement missing "is"'),_t(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!_a.isRef(s.is)&&!Yn.isSchema(s.is)&&(a.is=a.is.required()),o){_t(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(_t(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};gr.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var uv=f(SP=>{"use strict";var Ts=Ce(),iF=bn(),vP=et(),sF=ya(),oi={};SP.type=function(t,e){let n=Object.getPrototypeOf(t),r=iF(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=sF.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let p in s.terms){let h=s.terms[p];Ts(i.$_terms[p]===void 0,"Invalid term override for",s.type,p),i.$_terms[p]=h.init,a[p]=h}s.terms=a,s.args||(s.args=o.args),s.prepare=oi.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=oi.coerce(s.coerce,o.coerce),s.validate=oi.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let p in s.rules){let h=s.rules[p];Ts(typeof h=="object","Invalid rule definition for",s.type,p);let m=h.method;if(m===void 0&&(m=function(){return this.$_addRule(p)}),m&&(Ts(!r[p],"Rule conflict in",s.type,p),r[p]=m),Ts(!u[p],"Rule conflict in",s.type,p),u[p]=h,h.alias){let b=[].concat(h.alias);for(let v of b)r[v]=h.method}h.args&&(h.argsByName=new Map,h.args=h.args.map(b=>(typeof b=="string"&&(b={name:b}),Ts(!h.argsByName.has(b.name),"Duplicated argument name",b.name),vP.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),h.argsByName.set(b.name,b),b)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let p in s.modifiers){Ts(!r[p],"Rule conflict in",s.type,p);let h=s.modifiers[p];Ts(typeof h=="function","Invalid modifier definition for",s.type,p);let m=function(b){return this.rule({[p]:b})};r[p]=m,c[p]=h}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let p in s.overrides)Ts(n[p],"Cannot override missing",p),s.overrides[p][vP.symbols.parent]=n[p],i.$_super[p]=n[p].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=oi.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=oi.rebuild(s.rebuild,o.rebuild),i};oi.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};oi.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};oi.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};oi.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};oi.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var pv=f(lv=>{"use strict";var ai=Ce(),Yh=bn(),ro=et(),oF=ya(),TP=Ci(),aF=Ss(),cv,_n={};lv.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=_n.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Yh(t._preferences,{shallow:["messages"]}),delete n.preferences[ro.symbols.prefs],n.preferences.messages&&(n.preferences.messages=oF.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=_n.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=_n.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;ai(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(ro.isValues(i)){n[r]=i.describe();continue}ai(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(_n.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){ai(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return _n.validate(t.$_root,n),n};_n.describe=function(t,e={}){if(Array.isArray(t))return t.map(_n.describe);if(t===ro.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Yh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[ro.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=_n.describe(i,{assign:r}))}return n};lv.build=function(t,e){return new _n.Builder(t).parse(e)};_n.Builder=class{constructor(t){this.joi=t}parse(t){_n.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;ai(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){ai(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){ai(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else ai(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;ai(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return Yh(t);if(e.assign==="regex")return _n.regex(t);if(e.assign==="ref")return TP.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return ai(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[ro.symbols.literal]:!0,literal:t.function};if(t.override)return ro.symbols.override;if(t.ref)return TP.build(t.ref);if(t.regex)return _n.regex(t.regex);if(t.special)return ai(["deep"].includes(t.special),"Unknown special value",t.special),ro.symbols.deepDefault;if(t.value)return Yh(t.value)}if(t.type)return this.parse(t);if(t.template)return aF.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};_n.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};_n.validate=function(t,e){cv=cv||Hh(),t.assert(e,cv.description)}});var rc=f((d9,wP)=>{"use strict";var ui=nv(),pn={mismatched:null};wP.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!pn.isDeepEqual(t,e,n,[])};pn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=pn.getSharedType(t,e,!!n.prototype);switch(s){case ui.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case ui.promise:return t===e;case ui.regex:return t.toString()===e.toString();case pn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new pn.SeenEntry(t,e));try{return!!pn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};pn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?pn.mismatched:ui.getInternalProto(t);let r=ui.getInternalProto(t);return r!==ui.getInternalProto(e)?pn.mismatched:r};pn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};pn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};pn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};pn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=pn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===ui.array)if(r.part){for(let b of e)for(let v of n)if(s(b,v,r,i))return!0}else{if(e.length!==n.length)return!1;for(let b=0;b<e.length;++b)if(!s(e[b],n[b],r,i))return!1;return!0}else if(t===ui.set){if(e.size!==n.size)return!1;if(!pn.isSetSimpleEqual(e,n)){let b=new Set(Set.prototype.values.call(n));for(let v of Set.prototype.values.call(e)){if(b.delete(v))continue;let R=!1;for(let A of b)if(s(v,A,r,i)){b.delete(A),R=!0;break}if(!R)return!1}}}else if(t===ui.map){if(e.size!==n.size)return!1;for(let[b,v]of Map.prototype.entries.call(e))if(v===void 0&&!Map.prototype.has.call(n,b)||!s(v,Map.prototype.get.call(n,b),r,i))return!1}else if(t===ui.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),p=o(n);if((e!==l||n!==p)&&!s(l,p,r,i))return!1;let h=u(e);if(!r.part&&h.length!==u(n).length&&!r.skip)return!1;let m=0;for(let b of h){if(r.skip&&r.skip.includes(b)){n[b]===void 0&&++m;continue}if(!a(n,b)||!s(e[b],n[b],r,i))return!1}if(!r.part&&h.length-m!==u(n).length)return!1;if(r.symbols!==!1){let b=c(e),v=new Set(c(n));for(let R of b){if(!r.skip||!r.skip.includes(R)){if(a(e,R)){if(!a(n,R)||!s(e[R],n[R],r,i))return!1}else if(a(n,R))return!1}v.delete(R)}for(let R of v)if(a(n,R))return!1}return!0};pn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var EP=f(xP=>{"use strict";xP.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var dv=f(hv=>{"use strict";var kP=rc(),AP=EP(),uF=Ii(),hn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};hv.setup=function(t){let e=function(){return t._tracer=t._tracer||new hn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};hv.location=function(t){return t.$_setFlag("_tracerLocation",AP.location(2))};hn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new hn.Store(t),{filename:r,line:i}=t._flags._tracerLocation||AP.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(hn.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let p=a[`_${l}s`];if(!p)continue;let h=new Set(p._values),m=new Set(p._refs);for(let{value:b,ref:v}of u[l])h.delete(b),m.delete(v);(h.size||m.size)&&s.push({status:[...h,...[...m].map(b=>b.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let p=hn.labels[u.rule[l]||0];if(p){let h={rule:l,status:p};u.paths.size&&(h.paths=[...u.paths]),s.push(h)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(hn.message).join(", ")}`})}return e.length?e:null}};hn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){hn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){hn.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){hn.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=hn.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||kP(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=hn.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};hn.message=function(t){return`${t.paths?uF.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};hn.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};hn.sub=function(t,e){for(let n of t)for(let r of e)if(kP(n.slice(0,r.length),r))return!0;return!1};hn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Jh=f((_9,DP)=>{"use strict";var fv=Ce(),PP=bn(),cF=rv(),OP={};DP.exports=OP.merge=function(t,e,n){if(fv(t&&typeof t=="object","Invalid target value: must be an object"),fv(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){fv(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(PP(e[i],{symbols:n.symbols}));return t}let r=cF.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=PP(o,{symbols:n.symbols}):OP.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var RP=f(Qh=>{"use strict";var Li=Ce(),gv=et(),lF=Ci(),ci={};Qh.Ids=ci.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new ci.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())Li(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Li(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};Li(gv.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:ci.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);Li(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!gv.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);Li(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Li(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Li(!this._byKey.has(e),"Schema already contains key:",e),Li(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);Li(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};ci.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Qh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Qh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=ci.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=ci.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=ci.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};ci.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=ci.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&gv.isSchema(t)||n.ref!==!1&&lF.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=ci.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var CP=f((T9,IP)=>{"use strict";IP.exports=function(){}});var NP=f((w9,LP)=>{"use strict";var pF=bn(),MP=Zs(),hF=et(),li={value:Symbol("value")};LP.exports=li.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new li.State(t,e,this);return n&&r.schemas&&(r.schemas=[li.schemas(n),...r.schemas]),r}nest(t,e){let n=new li.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[li.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new li.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=pF(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};li.schemas=function(t){return hF.isSchema(t)?{schema:t}:t};li.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[li.value]=e}get(t){let e=this.node(t);if(e)return e[li.value]}node(t){if(this._values)return MP(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=MP(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var jP=f(sc=>{"use strict";var ic=Ce(),qP=bn(),va=CP(),dF=Zs(),Nt=et(),ws=Ii(),fF=NP(),ve={result:Symbol("result")};sc.entry=function(t,e,n){let r=Nt.defaults;n&&(ic(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),ic(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Nt.preferences(Nt.defaults,n));let i=ve.entry(t,e,r);ic(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=ws.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};sc.entryAsync=async function(t,e,n){let r=Nt.defaults;n&&(r=Nt.preferences(Nt.defaults,n));let i=ve.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,p=c.schema.type==="link"?s.links.get(c.schema):null,h=a,m,b,v=l.length?[a]:[],R=l.length?dF(t,l):t;if(l.length){m=l[l.length-1];let A=a;for(let T of l.slice(0,-1))A=A[T],v.unshift(A);b=v[0],h=b[m]}try{let A=(w,_)=>(p||c.schema).$_createError(w,h,_,c.state,r),T=await c.method(h,{schema:c.schema,linked:p,state:c.state,prefs:n,original:R,error:A,errorsArray:ve.errorsArray,warn:(w,_)=>s.warnings.push((p||c.schema).$_createError(w,h,_,c.state,r)),message:(w,_)=>(p||c.schema).$_createError("external",h,_,c.state,r,{messages:w})});if(T===void 0||T===h)continue;if(T instanceof ws.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(T),r.abortEarly)break;continue}if(Array.isArray(T)&&T[Nt.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...T),r.abortEarly)break;continue}b?(s.tracer.value(c.state,"rule",h,T,"external"),b[m]=T):(s.tracer.value(c.state,"rule",a,T,"external"),a=T)}catch(A){throw r.errors.label&&(A.message+=` (${c.label})`),A}}if(i.value=a,u.length)throw i.error=ws.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=ws.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ve.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};ve.entry=function(t,e,n){let{tracer:r,cleanup:i}=ve.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ve.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new fF([],[],{mainstay:a,schemas:u}),l=sc.validate(t,e,c,n);i&&e.$_root.untrace();let p=ws.process(l.errors,t,n);return{value:l.value,error:p,mainstay:a}};ve.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(ic(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ve.ignore}};sc.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ve.prefs(e,r)),e._cache&&r.cache){let p=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!p),p)return p}let s=(p,h,m)=>e.$_createError(p,t,h,m||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ve.errorsArray,warn:(p,h,m)=>n.mainstay.warnings.push(s(p,h,m)),message:(p,h)=>e.$_createError("custom",t,h,n,r,{messages:p})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let p=a.prepare(t,o);if(p){if(n.mainstay.tracer.value(n,"prepare",t,p.value),p.errors)return ve.finalize(p.value,[].concat(p.errors),o);t=p.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let p=a.coerce.method(t,o);if(p){if(n.mainstay.tracer.value(n,"coerced",t,p.value),p.errors)return ve.finalize(p.value,[].concat(p.errors),o);t=p.value}}let u=e._flags.empty;u&&u.$_match(ve.trim(t,e),n.nest(u),Nt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return ve.finalize(t,null,o);if(c==="required")return ve.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Nt.symbols.deepDefault)return ve.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ve.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let p=e._valids.get(t,n,r,e._flags.insensitive);if(p)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,p.value),t=p.value),n.mainstay.tracer.filter(e,n,"valid",p),ve.finalize(t,null,o);if(e._flags.only){let h=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[h],o);l.push(h)}}if(e._invalids){let p=e._invalids.get(t,n,r,e._flags.insensitive);if(p){n.mainstay.tracer.filter(e,n,"invalid",p);let h=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[h],o);l.push(h)}}if(a.validate){let p=a.validate(t,o);if(p&&(n.mainstay.tracer.value(n,"base",t,p.value),t=p.value,p.errors)){if(!Array.isArray(p.errors))return l.push(p.errors),ve.finalize(t,l,o);if(p.errors.length)return l.push(...p.errors),ve.finalize(t,l,o)}}return e._rules.length?ve.rules(t,l,o):ve.finalize(t,l,o)};ve.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let p of o._resolve){let h=a.argsByName.get(p),m=c[p].resolve(t,i,s),b=h.normalize?h.normalize(m):m,v=Nt.validateArg(b,null,h);if(v){u=r.$_createError("any.ref",m,{arg:p,ref:c[p],reason:v},i,s);break}c[p]=b}}u=u||a.validate(t,n,c,o);let l=ve.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return ve.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return ve.finalize(t,e,n)};ve.rule=function(t,e){return t instanceof ws.Report?(ve.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Nt.symbols.errors]?(t.forEach(n=>ve.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ve.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ve.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ve.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)ic(a instanceof Error||a instanceof ws.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ve.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:ws.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};ve.prefs=function(t,e){let n=e===Nt.defaults;return n&&t._preferences[Nt.symbols.prefs]?t._preferences[Nt.symbols.prefs]:(e=Nt.preferences(e,t._preferences),n&&(t._preferences[Nt.symbols.prefs]=e),e)};ve.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[qP(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[Nt.symbols.literal]?a.literal:Nt.isResolvable(a)?a.resolve(e,s,o):qP(a)};ve.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ve.ignore={active:!1,debug:va,entry:va,filter:va,log:va,resolve:va,value:va};ve.errorsArray=function(){let t=[];return t[Nt.symbols.errors]=!0,t}});var yv=f((P9,BP)=>{"use strict";var gF=Ce(),FP=rc(),mv=et(),Ni={};BP.exports=Ni.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Ni.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(mv.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new Ni.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(mv.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if(FP(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if(FP(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new Ni.Values(this._values,this._refs);return t._override=this._override,t}concat(t){gF(!t._override,"Cannot concat override set of values");let e=new Ni.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};Ni.Values.prototype[mv.symbols.values]=!0;Ni.Values.prototype.slice=Ni.Values.prototype.clone;Ni.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var zP=f((D9,VP)=>{"use strict";var Q=Ce(),$P=bn(),UP=rc(),bv=Jh(),mF=av(),At=et(),_v=no(),yF=Ii(),bF=uv(),KP=pv(),_F=ya(),WP=RP(),GP=Ci(),HP=dv(),Zh=jP(),ed=yv(),Wt={};Wt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new WP.Ids,this._preferences=null,this._refs=new GP.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return Q(typeof KP.describe=="function","Manifest functionality disabled"),KP.describe(this)}allow(...t){return At.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Q(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Q(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];Q(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return Q(t!==void 0,"Artifact cannot be undefined"),Q(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Q(t===!1||typeof t=="string","Invalid to value"),Q(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return Q(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return Q(t,"Missing error"),Q(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Q(t!==void 0,"Missing example"),At.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Q(!e,"Cannot combine options with description"),e=t.description,t=t.method),Q(typeof t=="function","Method must be a function"),Q(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(Q(typeof t=="string","id must be a non-empty string"),Q(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return Q(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Q(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Q(t.length,"Missing notes");for(let e of t)Q(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Q(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Q(t,"Missing preferences"),Q(t.context===void 0,"Cannot override context"),Q(t.externals===void 0,"Cannot override externals"),Q(t.warnings===void 0,"Cannot override warnings"),Q(t.debug===void 0,"Cannot override debug"),At.checkPreferences(t);let e=this.clone();return e._preferences=At.preferences(e._preferences,t),e}presence(t){return Q(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return Q(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=At.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Q(t.length,"Missing tags");for(let e of t)Q(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Q(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){At.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=_v.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Q(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Q(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){Q(!this._inRuleset(),"Cannot set caching inside a ruleset"),Q(!this._cache,"Cannot override schema cache"),Q(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||mF.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Q(At.isSchema(t),"Invalid schema object"),Q(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Q(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Q(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,GP.toSibling),e._preferences=e._preferences?At.preferences(e._preferences,t._preferences):t._preferences,e._valids=ed.merge(e._valids,t._valids,t._invalids),e._invalids=ed.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,bv(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,bv(e._flags,n)}else bv(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return Q(!t.base,"Cannot extend type with another base"),bF.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Q(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;At.assertOptions(t,Object.keys(e.modifiers)),Q(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;Q(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=$P(s);for(let a in t)e.modifiers[a](o,t[a]),Q(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){Q(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),Q(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),Q(At.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return HP.location?HP.location(this):this}validate(t,e){return Zh.entry(t,this,e)}validateAsync(t,e){return Zh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Q(t&&typeof t=="object","Invalid options"),Q(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Q(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;Q(n,"Unknown rule",e.method);let i=this.clone();if(r){Q(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&At.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=At.validateArg(o,s,a);Q(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return _v.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?_F.merge(this._definition.messages,s.messages):this._definition.messages;return new yF.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!Zh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return At.assertOptions(t,["each","once","ref","schema"]),WP.schema(this,t)||this}$_mutateRebuild(){Q(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){Q(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(UP(e,r.default)&&(e=void 0),UP(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][At.symbols.parent].call(this,...e)}$_validate(t,e,n){return Zh.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=$P(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return At.assertOptions(n,"literal"),Q(e!==void 0,"Missing",t,"value"),Q(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[At.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,p=i.length;for(let h=0;h<l.length;++h){let{is:m,then:b,otherwise:v}=l[h],R=`${a}${u.switch?"."+h:""}`;if(m.$_match(c,e.nest(m,`${R}.is`),n)){if(b){let A=e.localize([...e.path,`${R}.then`],e.ancestors,e.schemas),{schema:T,id:w}=b._generate(t,A,n);r.push(T),i.push(`${R}.then${w?`(${w})`:""}`);break}}else if(v){let A=e.localize([...e.path,`${R}.otherwise`],e.ancestors,e.schemas),{schema:T,id:w}=v._generate(t,A,n);r.push(T),i.push(`${R}.otherwise${w?`(${w})`:""}`);break}}if(u.break&&i.length>p)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){Q(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){At.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===At.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new ed:r&&(n[e]=t.length?new ed:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Q(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Q(i!==At.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Q(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Wt.Base.prototype[At.symbols.any]={version:At.version,compile:_v.compile,root:"$_root"};Wt.Base.prototype.isImmutable=!0;Wt.Base.prototype.deny=Wt.Base.prototype.invalid;Wt.Base.prototype.disallow=Wt.Base.prototype.invalid;Wt.Base.prototype.equal=Wt.Base.prototype.valid;Wt.Base.prototype.exist=Wt.Base.prototype.required;Wt.Base.prototype.not=Wt.Base.prototype.invalid;Wt.Base.prototype.options=Wt.Base.prototype.prefs;Wt.Base.prototype.preferences=Wt.Base.prototype.prefs;VP.exports=new Wt.Base});var mr=f((I9,XP)=>{"use strict";var td=Ce(),vF=zP(),SF=et(),TF=ya();XP.exports=vF.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return td(typeof t=="function","Method must be a function"),td(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){td(SF.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return td(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=TF.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var QP=f((C9,JP)=>{"use strict";var io=Ce(),wF=Jh(),xF=mr(),YP=et(),EF=no(),nd=Ii(),kF=Ci(),Sa={};JP.exports=xF.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:kF.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let p=n.$_terms.matches[l],h=i.nest(p.schema,`match.${l}`);h.snapshot();let m=p.schema.$_validate(t,h,s);m.errors?(u.push(m.errors),h.restore()):(a.push(m.value),h.commit())}if(a.length===0){let l={details:u.map(p=>nd.details(p,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(p=>nd.details(p,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(p=>p.schema.type==="object"||p.schema.type==="alternatives"&&c(p.schema));return c(n)?{value:a.reduce((l,p)=>wF(l,p,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let p=i.nest(u.schema,`match.${a}`);p.snapshot();let h=u.schema.$_validate(t,p,s);if(!h.errors)return p.commit(),h;p.restore(),o.push({schema:u.schema,reports:h.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let p=0;p<l.length;++p){let h=l[p],{is:m,then:b,otherwise:v}=h,R=`match.${a}${u.switch?"."+p:""}`;if(m.$_match(c,i.nest(m,`${R}.is`),s)){if(b)return b.$_validate(t,i.nest(b,`${R}.then`),s)}else if(v)return v.$_validate(t,i.nest(v,`${R}.otherwise`),s)}}return Sa.errors(o,e)},rules:{conditional:{method(t,e){io(!this._flags._endedSwitch,"Unreachable condition"),io(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),io(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=EF.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(io(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)io(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){io(t.length,"Missing alternative schemas"),YP.verifyFlat(t,"try"),io(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{YP.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});Sa.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return Sa.unmatched(t,e);let a=s[0];if(!(a instanceof nd.Report))return Sa.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:Sa.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Sa.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",nd.details(n,{override:!1}))}}});var eO=f((M9,ZP)=>{"use strict";var oc=Ce(),AF=rc(),PF=Zs(),OF=mr(),yr=et(),DF=no(),dt={};ZP.exports=OF.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return dt.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[yr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){yr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=yr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[yr.symbols.arraySingle];delete t[yr.symbols.arraySingle];let l=s(),p=t.length;for(let h=0;h<p;++h){let m=t[h],b=!1,v=!1,R=c?h:new Number(h),A=[...r.path,R];if(!e._flags.sparse&&m===void 0){if(l.push(n("array.sparse",{key:R,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly)return l;a.shift();continue}let T=[t,...r.ancestors];for(let O of e.$_terms._exclusions)if(O.$_match(m,r.localize(A,T,O),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:h,value:m},r.localize(A))),i.abortEarly)return l;b=!0,a.shift();break}if(b)continue;if(e.$_terms.ordered.length){if(a.length){let O=a.shift(),G=O.$_validate(m,r.localize(A,T,O),i);if(G.errors){if(l.push(...G.errors),i.abortEarly)return l}else if(O._flags.result==="strip")dt.fastSplice(t,h),--h,--p;else if(!e._flags.sparse&&G.value===void 0){if(l.push(n("array.sparse",{key:R,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly)return l;continue}else t[h]=G.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:h,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let w=[],_=o.length;for(let O=0;O<_;++O){let G=r.localize(A,T,o[O]);G.snapshot();let re=o[O].$_validate(m,G,i);if(w[O]=re,!re.errors){if(G.commit(),t[h]=re.value,v=!0,dt.fastSplice(o,O),--O,--_,!e._flags.sparse&&re.value===void 0&&(l.push(n("array.sparse",{key:R,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly))return l;break}G.restore()}if(v)continue;let N=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let O of u){let G,re=o.indexOf(O);if(re!==-1)G=w[re];else{let ae=r.localize(A,T,O);if(ae.snapshot(),G=O.$_validate(m,ae,i),!G.errors){ae.commit(),O._flags.result==="strip"?(dt.fastSplice(t,h),--h,--p):!e._flags.sparse&&G.value===void 0?(l.push(n("array.sparse",{key:R,path:A,pos:h,value:void 0},r.localize(A))),b=!0):t[h]=G.value,v=!0;break}ae.restore()}if(_===1){if(N){dt.fastSplice(t,h),--h,--p,v=!0;break}if(l.push(...G.errors),i.abortEarly)return l;b=!0;break}}if(!b&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!v){if(N){dt.fastSplice(t,h),--h,--p;continue}if(l.push(n("array.includes",{pos:h,value:m},r.localize(A))),i.abortEarly)return l}}return o.length&&dt.fillMissedErrors(e,l,o,t,r,i),a.length&&(dt.fillOrderedErrors(e,l,a,t,r,i),l.length||dt.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return yr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:yr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){yr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=yr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});dt.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return oc(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){yr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=DF.ref(t.by,{ancestor:0}),oc(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=dt.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){oc(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),yr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=yr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||AF,l=s.ignoreUndefined;for(let p=0;p<t.length;++p){let h=a?PF(t[p],a):t[p],m=o?u.custom:u[typeof h];if(oc(m,"Failed to find unique map container for type",typeof h),m instanceof Map){let b=m.entries(),v;for(;!(v=b.next()).done;)if(c(v.value[0],h)){let R=e.localize([...e.path,p],[t,...e.ancestors]),A={pos:p,value:t[p],dupePos:v.value[1],dupeValue:t[v.value[1]]};return a&&(A.path=i),n("array.unique",A,R)}m.set(h,p)}else{if((!l||h!==void 0)&&m[h]!==void 0){let b={pos:p,value:t[p],dupePos:m[h],dupeValue:t[m[h]]};a&&(b.path=i);let v=e.localize([...e.path,p],[t,...e.ancestors]);return n("array.unique",b,v)}m[h]=p}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)dt.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)dt.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});dt.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};dt.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&dt.fillMissedErrors(t,e,o,r,i,s)};dt.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};dt.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};dt.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(oc(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};dt.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let p=dt.compare(c,l,o,a);if(p!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),p=dt.compare(c,l,o,a),p!==null))return p;let h=typeof c;if(h!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(h!=="number"&&h!=="string")throw t.$_createError("array.sort.unsupported",e,{type:h},r,i);return h==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};dt.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var sO=f((L9,iO)=>{"use strict";var tO=Ce(),RF=mr(),nO=et(),rO=yv(),vv={};vv.isBool=function(t){return typeof t=="boolean"};iO.exports=RF.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){nO.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new rO;for(let n=0;n<t.length;++n){let r=t[n];tO(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){nO.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new rO;for(let n=0;n<t.length;++n){let r=t[n];tO(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:vv.isBool,to(t,e){return t?1:0}},string:{from:vv.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var cO=f((N9,uO)=>{"use strict";var oO=Ce(),IF=mr(),aO=et(),CF=Ss(),Br={};Br.isDate=function(t){return t instanceof Date};uO.exports=IF.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Br.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return aO.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:Br.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return oO(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return oO(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Br.isDate,to(t,e){return t.getTime()}},string:{from:Br.isDate,to(t,{prefs:e}){return CF.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});Br.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return aO.isIsoDate(t)?Br.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Br.date(1*t);if(e==="unix")return Br.date(1e3*t);if(typeof n=="string")return null}return Br.date(t)};Br.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var fO=f((q9,dO)=>{"use strict";var rd=Ce(),pO=bn(),hO=Jh(),lO=Zs(),id={};dO.exports=function(t,e,n={}){if(rd(t&&typeof t=="object","Invalid defaults value: must be an object"),rd(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),rd(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return id.applyToDefaultsWithShallow(t,e,n);let r=pO(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return hO(r,e,{nullOverride:i,mergeArrays:!1})};id.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;rd(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=lO(t,u);c&&typeof c=="object"?i.set(c,s&&lO(e,u)||c):s&&s.add(u)}let o=pO(t,{},i);if(!s)return o;for(let u of s)id.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return hO(o,e,{nullOverride:a,mergeArrays:!1})};id.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var yO=f(mO=>{"use strict";var so=Ce(),gO={};mO.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;so(!n.includes(i),`Item cannot come before itself: ${i}`),so(!n.includes("?"),"Item cannot come before unassociated items"),so(!r.includes(i),`Item cannot come after itself: ${i}`),so(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();so(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(gO.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return so(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return so(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,p=0;for(let h=0;h<l;++h)i[r[c][h]]&&++p;if(p===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};gO.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Tv=f((B9,vO)=>{"use strict";var MF=fO(),br=Ce(),bO=bn(),LF=yO(),NF=mr(),dn=et(),Sv=no(),qF=Ii(),_O=Ci(),sd=Ss(),le={renameDefaults:{alias:!1,multiple:!1,override:!1}};vO.exports=NF.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=le.clone(t,i);let s=[];if(e.$_terms.renames&&!le.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let p=r.localize([...r.path,c],a,u),h=u.schema.$_validate(l,p,i);if(h.errors){if(i.abortEarly)return{value:t,errors:h.errors};h.value!==void 0&&(t[c]=h.value),s.push(...h.errors)}else u.schema._flags.result==="strip"||h.value===void 0&&l!==void 0?delete t[c]:h.value!==void 0&&(t[c]=h.value)}}if(o.size||e._flags._hasPatternMatch){let a=le.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&le.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=le.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return dn.verifyFlat(t,"and"),le.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){sd.isTemplate(t)||(t=Sv.ref(t)),br(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=_O.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return br(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){br(t===void 0||typeof t=="object","Object schema must be a valid object"),br(!dn.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new le.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new le.Keys;for(let n in t)dn.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return dn.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:dn.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return dn.verifyFlat(t,"nand"),le.dependency(this,"nand",null,t)}},or:{method(...t){return dn.verifyFlat(t,"or"),le.dependency(this,"or",null,t)}},oxor:{method(...t){return le.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),br(e!==void 0,"Invalid rule"),dn.assertOptions(n,["fallthrough","matches"]),r&&br(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return _O.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){br(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),br(typeof e=="string"||e instanceof sd,"Invalid rename to argument"),br(e!==t,"Cannot rename key to same name:",t),dn.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)br(i.from!==t,"Cannot rename the same key multiple times");return e instanceof sd&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:MF(le.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return dn.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return le.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return le.dependency(this,"without",t,e,n)}},xor:{method(...t){return dn.verifyFlat(t,"xor"),le.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=dn.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new LF.Sorter;for(let n of t.$_terms.keys)dn.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new le.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=le.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});le.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return bO(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=bO(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};le.dependency=function(t,e,n,r,i){br(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),dn.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=dn.default(i.separator,"."),o=[];for(let u of r)br(typeof u=="string",e,"peers must be strings"),o.push(Sv.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Sv.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new le.Dependency(e,n,o,r,i)),a};le.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=le.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:le.keysToLabels(t,o),missing:s,missingWithLabels:le.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:le.keysToLabels(t,a),peers:u,peersWithLabels:le.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.xor",context:a})}};le.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};le.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};le.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,p=c.to;if(p instanceof sd&&(p=p.render(e,n,r,c.match)),l!==p){if(!o.options.multiple&&s[p]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:p,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,p)&&!o.options.override&&!s[p]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:p,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[p]:e[p]=e[l],s[p]=!0,o.options.alias||delete e[l]}}}return!0};le.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let p=e[l],h=[...i.path,l];for(let m=0;m<t.$_terms.patterns.length;++m){let b=t.$_terms.patterns[m];if(b.regex){let A=b.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${m}`,A?"pass":"error"),!A)continue}else if(!b.schema.$_match(l,i.nest(b.schema,`pattern.${m}`),s))continue;n.delete(l);let v=i.localize(h,c,{schema:b.rule,key:l}),R=b.rule.$_validate(p,v,s);if(R.errors){if(s.abortEarly)return{value:e,errors:R.errors};r.push(...R.errors)}if(b.matches&&u[m].push(l),e[l]=R.value,!b.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let p=u[l];if(!p)continue;let h=t.$_terms.patterns[l].matches,m=i.localize(i.path,c,h),b=h.$_validate(p,m,s);if(b.errors){let v=qF.details(b.errors,{override:!1});v.matches=p;let R=t.$_createError("object.pattern.match",e,v,i,s);if(s.abortEarly)return{value:e,errors:R};r.push(R)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!dn.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};le.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};le.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var TO=f((K9,SO)=>{"use strict";var wv=Ce(),jF=Tv();SO.exports=jF.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return wv(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return wv(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return wv(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var xO=f((W9,wO)=>{"use strict";var qi=Ce(),FF=mr(),BF=et(),$F=no(),UF=Ii(),ji={};wO.exports=FF.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){qi(e.$_terms.link,"Uninitialized link schema");let i=ji.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return ji.generate(t,e,n,r)},rules:{ref:{method(t){qi(!this.$_terms.link,"Cannot reinitialize schema"),t=$F.ref(t),qi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),qi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){qi(this.$_terms.link,"Uninitialized link schema"),qi(BF.isSchema(t),"Invalid schema object"),qi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return qi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});ji.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=ji.perspective(s,n);ji.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{ji.assert(!1,"to non-existing schema",s,t,n,r)}return ji.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};ji.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};ji.assert=function(t,e,n,r,i,s){t||qi(!1,`"${UF.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var kO=f((G9,EO)=>{"use strict";var xv=Ce(),KF=mr(),Ev=et(),Jn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};EO.exports=KF.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(Jn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(Jn.extractSignificantDigits(t)!==Jn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==Jn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!Ev.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return Ev.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Ev.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?Jn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return Jn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return xv(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(Jn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return xv(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return xv(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});Jn.extractSignificantDigits=function(t){return t.replace(Jn.exponentialPartRegex,"").replace(Jn.dotRegex,"").replace(Jn.trailingZerosRegex,"").replace(Jn.leadingSignAndZerosRegex,"")};Jn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var PO=f((H9,AO)=>{"use strict";var WF=Tv();AO.exports=WF.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var kv=f(od=>{"use strict";od.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};od.code=function(t){return{code:t,error:od.codes[t]}}});var Av=f(ad=>{"use strict";var GF=require("url"),$r=kv(),xs={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:GF.URL||URL};ad.analyze=function(t,e={}){if(!t)return $r.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return $r.code("DOMAIN_TOO_LONG");if(!!xs.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return $r.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(xs.domainControlRx.test(t))return $r.code("DOMAIN_INVALID_CHARS");t=xs.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||xs.minDomainSegments,i=t.split(".");if(i.length<r)return $r.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return $r.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return $r.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return $r.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return $r.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!xs.domainSegmentRx.test(a))return $r.code("DOMAIN_INVALID_CHARS")}else if(!xs.tldSegmentRx.test(a))return $r.code("DOMAIN_INVALID_TLDS_CHARS")}return null};ad.isValid=function(t,e){return!ad.analyze(t,e)};xs.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new xs.URL(`http://${t}`).host}catch{return t}}});var OO=f(Pv=>{"use strict";var HF=require("util"),VF=Av(),pi=kv(),vn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(HF.TextEncoder||TextEncoder)};Pv.analyze=function(t,e){return vn.email(t,e)};Pv.isValid=function(t,e){return!vn.email(t,e)};vn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return pi.code("EMPTY_STRING");let n=!vn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return pi.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?pi.code("MULTIPLE_AT_CHAR"):pi.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return pi.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return pi.code("ADDRESS_TOO_LONG");if(vn.encoder.encode(i).length>64)return pi.code("LOCAL_TOO_LONG")}return vn.local(i,n)||VF.analyze(s,e)};vn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return pi.code("EMPTY_LOCAL_SEGMENT");if(e){if(!vn.atextRx.test(r))return pi.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(vn.atextRx.test(i))continue;let s=vn.binary(i);if(!vn.atomRx.test(s))return pi.code("INVALID_LOCAL_CHARS")}}};vn.binary=function(t){return Array.from(vn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};vn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;vn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var Ov=f((Y9,DO)=>{"use strict";DO.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Rv=f(Dv=>{"use strict";var ud=Ce(),zF=Ov(),en={};en.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",p="(?:"+c+":){6}"+l,h="::(?:"+c+":){5}"+l,m="(?:"+c+")?::(?:"+c+":){4}"+l,b="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,v="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,R="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,A="(?:(?:"+c+":){0,4}"+c+")?::"+l,T="(?:(?:"+c+":){0,5}"+c+")?::"+c,w="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+p+"|"+h+"|"+m+"|"+b+"|"+v+"|"+R+"|"+A+"|"+T+"|"+w+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let _="["+r+s+i+":]*",N="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",O="["+r+s+i+"]{1,255}",G="(?:"+N+"|"+t.ipv4address+"|"+O+")",re="\\d*",ae="(?:"+_+"@)?"+G+"(?::"+re+")?",K="(?:"+_+"@)?("+G+")(?::"+re+")?",P=a+"*",M=a+"+",L="["+r+s+i+"@]+",F="",he="(?:\\/"+P+")*",ce="\\/(?:"+M+he+")?",$t=M+he,Et=L+he,je="(?:\\/\\/\\/"+P+he+")";return t.hierPart="(?:(?:\\/\\/"+ae+he+")|"+ce+"|"+$t+"|"+je+")",t.hierPartCapture="(?:(?:\\/\\/"+K+he+")|"+ce+"|"+$t+")",t.relativeRef="(?:(?:\\/\\/"+ae+he+")|"+ce+"|"+Et+"|"+F+")",t.relativeRefCapture="(?:(?:\\/\\/"+K+he+")|"+ce+"|"+Et+"|"+F+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};en.rfc3986=en.generate();Dv.ip={v4Cidr:en.rfc3986.ipv4Cidr,v6Cidr:en.rfc3986.ipv6Cidr,ipv4:en.rfc3986.ipv4address,ipv6:en.rfc3986.ipv6address,ipvfuture:en.rfc3986.ipvFuture};en.createRegex=function(t){let e=en.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return en.wrap(i+r);let s="";if(t.scheme){ud(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);ud(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let p=0;p<c.length;++p){let h=c[p];ud(h instanceof RegExp||typeof h=="string","scheme at position "+p+" must be a RegExp or String"),h instanceof RegExp?l.push(h.source.toString()):(ud(e.schemeRegex.test(h),"scheme at position "+p+" must be a valid scheme"),l.push(zF(h)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return en.wrap(u+r,s)};en.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};en.uriRegex=en.createRegex({});Dv.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?en.createRegex(t):en.uriRegex}});var IO=f(RO=>{"use strict";var Ta=Ce(),ac=Rv();RO.regex=function(t={}){Ta(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Ta(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Ta(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),Ta(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Ta(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Ta(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return ac.ip[o];let a=`\\/${o==="ipv4"?ac.ip.v4Cidr:ac.ip.v6Cidr}`;return e==="required"?`${ac.ip[o]}${a}`:`${ac.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var LO=f((Z9,MO)=>{"use strict";var CO={};CO.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];MO.exports=new Set(CO.tlds.map(t=>t.toLowerCase()))});var BO=f((eX,FO)=>{"use strict";var Be=Ce(),cd=Av(),XF=OO(),jO=IO(),NO=Ov(),qO=LO(),YF=Rv(),JF=mr(),Sn=et(),De={tlds:qO instanceof Set?{tlds:{allow:qO,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:jO.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};FO.exports=JF.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=De.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(Sn.isResolvable(c)&&(c=c.resolve(t,n,r),!Sn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return Sn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Be(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return De.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Be(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return Sn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(De.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||De.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&Sn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=De.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return cd.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){Sn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Be(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=De.addressOptions(t),n=new RegExp(`\\s*[${t.separator?NO(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)XF.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){Sn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Be(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];Be(typeof a=="string","version at position "+o+" must be a string");let u=De.guidVersions[a.toLowerCase()];Be(u,"version at position "+o+" must be one of "+Object.keys(De.guidVersions).join(", ")),Be(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Be(De.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||De.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return Sn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Be(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Be(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?De.hexRegex.withOptionalPrefix:n.prefix===!0?De.hexRegex.withPrefix:De.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return cd.isValid(t,{minDomainSegments:1})||De.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){Sn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=jO.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return De.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return De.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return De.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return Sn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:Sn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return De.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return De.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Be(De.normalizationForms.includes(t),"normalization form must be one of "+De.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){Be(t instanceof RegExp,"regex must be a RegExp"),Be(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),Sn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(NO(t),"g")),Be(t instanceof RegExp,"pattern must be a RegExp"),Be(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){Sn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&Sn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=YF.regex(t),r=t.domain?De.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!cd.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});De.addressOptions=function(t){if(!t)return De.tlds||t;if(Be(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Be(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return Be(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds);Be(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),Be(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Be(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),De.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Be(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Be(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),De.validateTlds(t.tlds.allow,"tlds.allow"),t):t};De.validateTlds=function(t,e){for(let n of t)Be(cd.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};De.isoDate=function(t){if(!Sn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};De.length=function(t,e,n,r,i){return Be(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var UO=f((tX,$O)=>{"use strict";var ld=Ce(),QF=mr(),Iv={};Iv.Map=class extends Map{slice(){return new Iv.Map(this)}};$O.exports=QF.extend({type:"symbol",terms:{map:{init:new Iv.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),ld(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){ld(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;ld(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),ld(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var GO=f((rX,WO)=>{"use strict";var ZF=Ce(),eB=mr(),KO=et();WO.exports=eB.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return ZF(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return KO.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:KO.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var Vh=f((iX,XO)=>{"use strict";var ao=Ce(),tB=bn(),nB=av(),oo=et(),rB=no(),Mv=Ii(),iB=uv(),HO=pv(),Cv=Ci(),VO=Ss(),zO=dv(),pd,qt={types:{alternatives:QP(),any:mr(),array:eO(),boolean:sO(),date:cO(),function:TO(),link:xO(),number:kO(),object:PO(),string:BO(),symbol:UO()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(qt.types.binary=GO());qt.root=function(){let t={_types:new Set(Object.keys(qt.types))};for(let e of t._types)t[e]=function(...n){return ao(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),qt.generate(this,qt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,qt.methods);for(let e in qt.aliases){let n=qt.aliases[e];t[e]=t[n]}return t.x=t.expression,zO.setup&&zO.setup(t),t};qt.methods={ValidationError:Mv.ValidationError,version:oo.version,cache:nB.provider,assert(t,e,...n){qt.assert(t,e,!0,n)},attempt(t,e,...n){return qt.assert(t,e,!1,n)},build(t){return ao(typeof HO.build=="function","Manifest functionality disabled"),HO.build(this,t)},checkPreferences(t){oo.checkPreferences(t)},compile(t,e){return rB.compile(this,t,e)},defaults(t){ao(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());ao(oo.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return qt.generate(this,r,i)}}return e},expression(...t){return new VO(...t)},extend(...t){oo.verifyFlat(t,"extend"),pd=pd||Hh(),ao(t.length,"You need to provide at least one extension"),this.assert(t,pd.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,pd.extension);let r=qt.expandExtension(n,e);for(let i of r){ao(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=iB.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return qt.generate(this,o,a)}}}return e},isError:Mv.ValidationError.isError,isExpression:VO.isTemplate,isRef:Cv.isRef,isSchema:oo.isSchema,in(...t){return Cv.in(...t)},override:oo.symbols.override,ref(...t){return Cv.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in qt.aliases)t[e]=this[e]();return t}};qt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,oo.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof Mv.ValidationError||(a=tB(a)),a.message=i?`${i} ${u}`:u,a};qt.generate=function(t,e,n){return ao(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};qt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};XO.exports=qt.root()});var YO=f(Se=>{"use strict";var sB=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.descriptionContainerSchema=Se.signatureSchema=Se.signatureDefinitionContainerSchema=Se.signatureDefinitionSchema=Se.signatureDefinitionFunctionSchema=Se.signatureDefinitionFunctionSchemaArg=Se.signatureDefinitionFunctionSchemaArgMultiTypes=Se.signatureDefinitionFunctionSchemaArgDefaultNumber=Se.signatureDefinitionFunctionSchemaArgDefaultString=Se.signatureDefinitionTypeSchema=Se.variationsSchema=void 0;var te=sB(Vh()),hd=Di();Se.variationsSchema=te.default.array().items(te.default.alternatives(te.default.string(),te.default.number()));Se.signatureDefinitionTypeSchema=te.default.alternatives(te.default.string(),te.default.object({type:te.default.string().required(),keyType:te.default.link("#SignatureDefinitionTypeSchema").optional(),valueType:te.default.link("#SignatureDefinitionTypeSchema").optional()})).id("SignatureDefinitionTypeSchema");Se.signatureDefinitionFunctionSchemaArgDefaultString=te.default.object({type:te.default.string().valid(hd.SignatureDefinitionBaseType.String).required(),value:te.default.string().allow("").required()});Se.signatureDefinitionFunctionSchemaArgDefaultNumber=te.default.object({type:te.default.string().valid(hd.SignatureDefinitionBaseType.Number).required(),value:te.default.number().required()});Se.signatureDefinitionFunctionSchemaArgMultiTypes=te.default.object({label:te.default.string().required(),types:te.default.array().items(Se.signatureDefinitionTypeSchema).required(),opt:te.default.boolean().optional(),default:te.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchemaArg=te.default.object({label:te.default.string().required(),type:Se.signatureDefinitionTypeSchema.required(),opt:te.default.boolean().optional(),default:te.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchema=te.default.object({id:te.default.string().required(),type:te.default.string().valid(hd.SignatureDefinitionBaseType.Function).required(),description:te.default.string().optional(),example:te.default.string().optional(),isProtected:te.default.boolean().optional(),arguments:te.default.array().items(te.default.alternatives(Se.signatureDefinitionFunctionSchemaArg,Se.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:te.default.array().items(Se.signatureDefinitionTypeSchema).required(),tags:te.default.array().items(te.default.string()).optional(),variations:Se.variationsSchema.optional(),returnVariations:Se.variationsSchema.optional()});Se.signatureDefinitionSchema=te.default.object({type:Se.signatureDefinitionTypeSchema.invalid(hd.SignatureDefinitionBaseType.Function).required(),description:te.default.string().optional(),example:te.default.string().optional(),isProtected:te.default.boolean().optional(),variations:Se.variationsSchema.optional(),tags:te.default.array().items(te.default.string()).optional()});Se.signatureDefinitionContainerSchema=te.default.object().pattern(te.default.string(),te.default.alternatives(Se.signatureDefinitionFunctionSchema,Se.signatureDefinitionSchema));Se.signatureSchema=te.default.object({type:te.default.string().required(),hidden:te.default.boolean().optional(),extends:te.default.string().optional(),definitions:te.default.object().required()});Se.descriptionContainerSchema=te.default.object({$meta:te.default.object({description:te.default.string().required(),example:te.default.array().items(te.default.string().allow("")).optional()}).optional()}).pattern(te.default.string(),te.default.object({description:te.default.string().required(),example:te.default.array().items(te.default.string().allow("")).optional()}))});var Fv=f(qn=>{"use strict";var wa=qn&&qn.__assign||function(){return wa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wa.apply(this,arguments)},oB=qn&&qn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Lv=qn&&qn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nv=qn&&qn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},aB=qn&&qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qn,"__esModule",{value:!0});qn.Signature=void 0;var qv=aB(Vh()),jv=YO(),uB=Di(),cB=Kh(),lB=Gh(),pB=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e,n){var r,i;qv.default.assert(n,jv.signatureDefinitionContainerSchema);var s={};try{for(var o=Lv(Object.entries(n)),a=o.next();!a.done;a=o.next()){var u=Nv(a.value,2),c=u[0],l=u[1],p=l.type===uB.SignatureDefinitionBaseType.Function?lB.SignatureDefinitionFunction.parse(e,l):cB.SignatureDefinition.parse(e,l);s[c]=p}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},t.parseDescriptions=function(e){var n,r,i,s,o;qv.default.assert(e,jv.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=oB(e,["$meta"]);u=c,a=l}var p={};try{for(var h=Lv(Object.entries(a)),m=h.next();!m.done;m=h.next()){var b=Nv(m.value,2),v=b[0],R=b[1];p[v]={description:R.description,example:(i=R.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{m&&!m.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return wa({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},p)},t.parse=function(e,n){var r,i;qv.default.assert(e,jv.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.type,e.definitions);if(s.setDefinitions(o),n!=null)try{for(var a=Lv(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=Nv(u.value,2),l=c[0],p=c[1],h=t.parseDescriptions(p);s.addDescriptions(l,h)}}catch(m){r={error:m}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinitions=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];this._definitions[i]=e[i]}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r=this._descriptions[e];r==null&&(r={},this._descriptions[e]=r);for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s];r[o]=wa(wa({},r[o]),n[o])}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){for(var e={},n=Object.keys(this._definitions),r=0;r<n.length;r++){var i=n[r];e[i]=this._definitions[i].toJSON()}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:e}},t.prototype.copy=function(){for(var e=new t({type:this._type,hidden:this._hidden,extends:this._extends}),n={},r=Object.keys(this._definitions),i=0;i<r.length;i++){var s=r[i];n[s]=this._definitions[s].copy()}for(var o={},a=Object.keys(this._descriptions),i=0;i<a.length;i++){var s=a[i];o[s]=wa({},o[s])}return e._descriptions=o,e._definitions=n,e},t}();qn.Signature=pB});var JO=f(fi=>{"use strict";var _r=fi&&fi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},hi=fi&&fi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},Bv=fi&&fi.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fi,"__esModule",{value:!0});fi.Container=void 0;var di=Fv(),hB=Gh(),Pt=Di(),dB=function(){function t(){this._primitives=new Map([[Pt.SignatureDefinitionBaseType.Any,new di.Signature({type:Pt.SignatureDefinitionBaseType.Any})],[Pt.SignatureDefinitionBaseType.General,new di.Signature({type:Pt.SignatureDefinitionBaseType.General})],[Pt.SignatureDefinitionBaseType.String,new di.Signature({type:Pt.SignatureDefinitionBaseType.String})],[Pt.SignatureDefinitionBaseType.Function,new di.Signature({type:Pt.SignatureDefinitionBaseType.Function})],[Pt.SignatureDefinitionBaseType.Number,new di.Signature({type:Pt.SignatureDefinitionBaseType.Number})],[Pt.SignatureDefinitionBaseType.List,new di.Signature({type:Pt.SignatureDefinitionBaseType.List})],[Pt.SignatureDefinitionBaseType.Map,new di.Signature({type:Pt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new di.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAvailableTags=function(){var e=this,n=hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).flatMap(function(r){var i=e.getTypeSignature(r);return Object.values(i.getDefinitions()).flatMap(function(s){return s.getTags()})});return Array.from(new Set(n))},t.prototype.getAllVisibleTypes=function(){var e=this;return hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==Pt.SignatureDefinitionBaseType.Any&&n!==Pt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return hi(hi([],_r(this.getAllPrimitiveSignatures()),!1),_r(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return hi(hi([],_r(this.getAllPrimitiveSignatures()),!1),_r(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=di.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){for(var r={},i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],a=di.Signature.parseDescriptions(n[o]);r[o]=a}return this.addMeta(e,r),this},t.prototype.addMeta=function(e,n){for(var r=Object.keys(n),i=0;i<r.length;i++){var s=r[i],o=this.getOrCreateTypeSignature(s);o.addDescriptions(e,n[s])}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(Pt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Bv(o),l=c.next();!l.done;l=c.next()){var p=l.value;if(!this._excludeFromSearch.has(p)){for(var h=p,m=this.getTypeSignature(p),b=null;m!==null&&!a.has(m.getType())&&(a.add(m.getType()),m.isHidden()||(b=m.getDefinition(n,r)),b===null);)h=m.getExtendedType(),m=this.getTypeSignature(h);b!==null&&u.set(h,b)}}}catch(v){i={error:v}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(Pt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(Pt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(Pt.SignatureDefinitionBaseType.Any)?s.get(Pt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.getDefinitionsById=function(e){var n=this;return hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).flatMap(function(r){var i=n.getTypeSignature(r);return Object.values(i.getDefinitions()).filter(function(s){return s instanceof hB.SignatureDefinitionFunction&&s.getId()===e})})},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=Bv(this._primitives),a=o.next();!a.done;a=o.next()){var u=_r(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(b){e={error:b}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var p=Bv(this._types),h=p.next();!h.done;h=p.next()){var m=_r(h.value,2),c=m[0],l=m[1];s._types.set(c,l.copy())}}catch(b){r={error:b}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();fi.Container=dB});var Ve=f(ut=>{"use strict";var fB=ut&&ut.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),QO=ut&&ut.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&fB(e,t,n)};Object.defineProperty(ut,"__esModule",{value:!0});ut.TypeParser=ut.VariationRegistry=ut.Container=ut.Signature=ut.SignatureDefinition=ut.SignatureDefinitionTypeMeta=ut.SignatureDefinitionFunction=ut.SignatureDefinitionFunctionArg=void 0;var gB=Z_();Object.defineProperty(ut,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return gB.SignatureDefinitionFunctionArg}});var mB=Gh();Object.defineProperty(ut,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return mB.SignatureDefinitionFunction}});var yB=Qu();Object.defineProperty(ut,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return yB.SignatureDefinitionTypeMeta}});var bB=Kh();Object.defineProperty(ut,"SignatureDefinition",{enumerable:!0,get:function(){return bB.SignatureDefinition}});var _B=Fv();Object.defineProperty(ut,"Signature",{enumerable:!0,get:function(){return _B.Signature}});var vB=JO();Object.defineProperty(ut,"Container",{enumerable:!0,get:function(){return vB.Container}});var SB=Uh();Object.defineProperty(ut,"VariationRegistry",{enumerable:!0,get:function(){return SB.VariationRegistry}});var TB=J_();Object.defineProperty(ut,"TypeParser",{enumerable:!0,get:function(){return TB.TypeParser}});QO(Y_(),ut);QO(Di(),ut)});var Ur=f(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.CompletionItemKind=void 0;var wB;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(wB=uc.CompletionItemKind||(uc.CompletionItemKind={}))});var ft=f(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isUnknownType=ye.isUnionType=ye.isListType=ye.isFunctionType=ye.isClassType=ye.isMapType=ye.isValidKeyValue=ye.isKeyType=ye.isBaseType=ye.DEFAULT_SOURCE_DOCUMENT_ID=ye.TypeKind=ye.BASE_TYPE_SET=ye.META_DOCS_SIGNATURE_ORIGIN=ye.DEFAULT_SIGNATURE_ORIGIN=ye.ISA_PROPERTY=ye.UNKNOWN_TYPE_ID=ye.NIL_TYPE_ID=ye.MAX_TO_META_DEPTH=ye.MAX_ALL_PROPERTIES_DEPTH=ye.MAX_STRING_LENGTH=void 0;var xB=Ve();ye.MAX_STRING_LENGTH=10;ye.MAX_ALL_PROPERTIES_DEPTH=10;ye.MAX_TO_META_DEPTH=3;ye.NIL_TYPE_ID="null";ye.UNKNOWN_TYPE_ID="unknown";ye.ISA_PROPERTY="__isa";ye.DEFAULT_SIGNATURE_ORIGIN="custom";ye.META_DOCS_SIGNATURE_ORIGIN="metadocs";ye.BASE_TYPE_SET=new Set(Object.values(xB.SignatureDefinitionBaseType));var Fi;(function(t){t[t.Base=0]="Base",t[t.KeyType=1]="KeyType",t[t.MapType=2]="MapType",t[t.ClassType=3]="ClassType",t[t.FunctionType=4]="FunctionType",t[t.ListType=5]="ListType",t[t.UnionType=6]="UnionType",t[t.UnknownType=7]="UnknownType"})(Fi=ye.TypeKind||(ye.TypeKind={}));ye.DEFAULT_SOURCE_DOCUMENT_ID="unknown";function EB(t){return t.kind===Fi.Base}ye.isBaseType=EB;function ZO(t){return t.kind===Fi.KeyType}ye.isKeyType=ZO;function kB(t){return typeof t=="string"||ZO(t)}ye.isValidKeyValue=kB;function AB(t){return t.kind===Fi.MapType}ye.isMapType=AB;function PB(t){return t.kind===Fi.ClassType}ye.isClassType=PB;function OB(t){return t.kind===Fi.FunctionType}ye.isFunctionType=OB;function DB(t){return t.kind===Fi.ListType}ye.isListType=DB;function RB(t){return t.kind===Fi.UnionType}ye.isUnionType=RB;function IB(t){return t.kind===Fi.UnknownType}ye.isUnknownType=IB});var xa=f(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.MAX_DEPTH=void 0;dd.MAX_DEPTH=30});var Qn=f(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.EntityInfo=void 0;var $v=class{constructor(e,n){this.name=e,this.type=n}};fd.EntityInfo=$v});var Ea=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.simplifyForMeta=Es.persistTypeInNativeFunction=Es.createProxyForNativeType=void 0;var CB=ka(),eD=ft();function MB(t,e){return new CB.ClassType(t,null,t,e.typeStorage,e,e.globals)}Es.createProxyForNativeType=MB;function LB(t,e,n,r,i){let s=i.getTypeById(t);if(s==null)throw new Error(`Native type ${t} not found in global type storage.`);let o=s.getProperty(e);if(o==null)throw new Error(`Property ${e} not found in native type ${t}.`);if(!(0,eD.isFunctionType)(o.type))throw new Error(`Property ${e} in native type ${t} is not a function type.`);let a=o.type.copy(!1,!0,r.typeStorage);return a.returnType=n,a.isPersistent=!0,a}Es.persistTypeInNativeFunction=LB;function NB(t){if(!(0,eD.isUnionType)(t))return[t];let e=new Set,n=[];for(let r=0;r<t.variants.length;r++){let i=t.variants[r],s=i.getKeyType();s!=null&&(e.has(s)||(e.add(s),n.push(i)))}return n}Es.simplifyForMeta=NB});var md=f(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SourceMap=void 0;var qB=ft(),Uv=class t{static createTypeSourceMapKey(e,n,r){return`${e?.name||qB.DEFAULT_SOURCE_DOCUMENT_ID}||${n.line}:${n.character}||${r.line}:${r.character}`}static parseTypeSourceMapKey(e){let n=e.split("||");if(n.length!==3)throw new Error(`Invalid type source map key format: ${e}`);let[r,i,s]=n,[o,a]=i.split(":"),[u,c]=s.split(":");return{document:r,start:{line:Number(o),character:Number(a)},end:{line:Number(u),character:Number(c)}}}constructor(){this.map=new Map}get size(){return this.map.size}add(e,n){let r=t.createTypeSourceMapKey(e,n.start,n.end);return this.map.set(r,n),this}extend(e){for(let[n,r]of e.map.entries())this.map.set(n,r);return this}clear(){return this.map.clear(),this}getAllSources(){return Array.from(this.map.entries()).reduce((e,[n,r])=>(e.push({...t.parseTypeSourceMapKey(n),astRef:r}),e),[])}};gd.SourceMap=Uv});var Tn=f(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.Type=void 0;var tD=Ve(),Kv=ft(),jB=xa(),nD=md(),Wv=class t{static createBaseType(e,n,r,i,s){return new t(e,Kv.TypeKind.Base,e,n,r,i,s)}static simplify(e){let n=e.getKeyType()?.id||tD.SignatureDefinitionBaseType.Any;return new t(n,Kv.TypeKind.Base,n,e.typeStorage,e.document,e.scope,e.astRef)}constructor(e,n,r=null,i,s,o,a){this.id=e,this.kind=n,this.inheritFrom=r,this.typeStorage=i,this.document=s,this.scope=o,this.astRef=a,this.sourceMap=a?new nD.SourceMap().add(s,a):new nD.SourceMap}referenceEqualsTo(e){return this===e}equalsTo(e){return this.referenceEqualsTo(e)||this.id===e.id}getKeyType(){return this.typeStorage.getKeyType(this)}setProperty(e,n){}getProperty(e,n=1){return n>jB.MAX_DEPTH||typeof e!="string"||this.inheritFrom==null?void 0:this.typeStorage.getTypeById(this.inheritFrom)?.getProperty(e,n+1)}hasProperty(e){if(typeof e!="string")return;let n=this.typeStorage.getTypeById(this.inheritFrom);if(n!=null)return n.hasProperty(e)}containsOwnProperties(){return!1}getAllProperties(e=1){return e>Kv.MAX_ALL_PROPERTIES_DEPTH?[]:(this.inheritFrom?this.typeStorage.getTypeById(this.inheritFrom):null)?.getAllProperties(e+1)||[]}reset(e,n,r,i){return this.typeStorage=e||this.typeStorage,this.document=n||this.document,this.scope=r||this.scope,this.astRef=i||this.astRef,this.sourceMap.clear().add(this.document,this.astRef),this}invoke(e,n,r,i){return this}deepCopy(e,n,r,i,s,o){return this.copy(e,!0,n,r,i,s)}copy(e,n,r,i,s,o){let a=new t(this.id,this.kind,this.inheritFrom,r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){this.sourceMap.extend(e.sourceMap)}getSource(){return this.sourceMap.size===0?null:this.sourceMap.getAllSources()}addToSource(e){this.sourceMap.extend(e.sourceMap)}toMeta(e){return[{type:this.getKeyType()?.id||tD.SignatureDefinitionBaseType.Any}]}};yd.Type=Wv});var vr=f(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.UnionType=void 0;var rD=Ve(),Aa=ft(),FB=Ea(),BB=md(),$B=Qn(),iD=Tn(),Gv=class t extends iD.Type{static createDefault(e,n,r,i){return new t(e.generateId(Aa.TypeKind.UnionType,i),[],e,n,r,i)}static createSmartly(e,n,r,i,s){let o=new t(n.generateId(Aa.TypeKind.UnionType,s),e,n,r,i,s);return o.variants.length===0?iD.Type.createBaseType(rD.SignatureDefinitionBaseType.Any,n||o.typeStorage,r||o.document,i||o.scope):o.variants.length===1?o.firstVariant():o}constructor(e,n,r,i,s,o){super(e,Aa.TypeKind.UnionType,null,r,i,s,o),this.variants=n,this.uniquifyVariants()}uniquifyVariants(){let e=[],n=[...this.variants];for(;n.length>0;){let r=n.pop();if((0,Aa.isUnionType)(r)){this.addToSource(r),n.push(...r.variants);continue}let i=e.findIndex(s=>s.equalsTo(r));if(i!==-1){e[i].merge(r);continue}e.push(r)}this.variants.length=0,this.variants.push(...e)}firstVariant(){return this.variants.length>0?this.variants[0]:void 0}containsVariant(e){return this.variants.some(n=>n.equalsTo(e))}addVariant(e){if((0,Aa.isUnionType)(e)){this.addToSource(e),e.variants.forEach(r=>this.addVariant(r));return}let n=this.variants.findIndex(r=>r.equalsTo(e));if(n!==-1){this.variants[n].merge(e);return}this.variants.push(e)}setProperty(e,n){this.variants.forEach(r=>r.setProperty(e,n))}getProperty(e,n=1){let r=[];for(let i=0;i<this.variants.length;i++){let o=this.variants[i].getProperty(e,n+1);o&&r.push(o)}if(r.length!==0)return r.length===1?r[0]:new $B.EntityInfo(r[0].name,t.createSmartly(r.map(i=>i.type),this.typeStorage,this.document,this.scope,null))}getAllProperties(e=1){let n=new Map;for(let r=0;r<this.variants.length;r++){let s=this.variants[r].getAllProperties(e+1);for(let o=0;o<s.length;o++){let a=s[o];n.has(a.name)||n.set(a.name,a)}}return Array.from(n.values())}hasProperty(e){return this.variants.some(n=>n.hasProperty(e))}containsOwnProperties(){return this.variants.some(e=>e.containsOwnProperties())}invoke(e,n,r,i){return t.createSmartly(this.variants.map(s=>s.invoke(e||this.typeStorage,n||this.document,r||this.scope,i)),e||this.typeStorage,n||this.document,r||this.scope,i)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,[],n||this.typeStorage,r||this.document,i||this.scope,s);return o.set(this,u),this.variants.forEach(c=>{let l=c.deepCopy(e,n,r,i,null,o);u.variants.push(l)}),e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.variants.map(u=>u.copy(e,n,r||this.typeStorage,i||this.document,s||this.scope)),r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}getSource(){let e=new BB.SourceMap;return e.extend(this.sourceMap),this.variants.forEach(n=>e.extend(n.sourceMap)),e.size===0?null:e.getAllSources()}toMeta(e=1){return e>Aa.MAX_TO_META_DEPTH?[{type:rD.SignatureDefinitionBaseType.Any}]:(0,FB.simplifyForMeta)(this).flatMap(n=>n.toMeta(e+1))}};bd.UnionType=Gv});var uo=f(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.ListType=void 0;var cc=Ve(),Bi=ft(),UB=Ea(),KB=Qn(),Hv=Tn(),WB=vr(),Vv=class t extends Hv.Type{constructor(e,n,r,i,s,o){super(e,Bi.TypeKind.ListType,cc.SignatureDefinitionBaseType.List,r,i,s,o),this.elementType=n??Hv.Type.createBaseType(Bi.UNKNOWN_TYPE_ID,r,i,s)}referenceEqualsTo(e){return(0,Bi.isListType)(e)?this===e||this.id===e.id&&this.elementType.referenceEqualsTo(e.elementType):!1}equalsTo(e){return(0,Bi.isListType)(e)?this.referenceEqualsTo(e)||this.id===e.id&&this.elementType.equalsTo(e.elementType):!1}addElementType(e){if(e==null)return;let n=Hv.Type.simplify(e);if(this.elementType.id===Bi.UNKNOWN_TYPE_ID){this.elementType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.elementType))return;(0,Bi.isUnionType)(this.elementType)||(this.elementType=new WB.UnionType(this.typeStorage.generateId(Bi.TypeKind.UnionType),[this.elementType],this.typeStorage,this.document,this.scope,null)),this.elementType.addVariant(n)}getProperty(e,n=1){return typeof e!="string"&&e.id===cc.SignatureDefinitionBaseType.Number?new KB.EntityInfo(e.id,this.elementType):super.getProperty(e,n+1)}copy(e,n,r,i,s,o){let a=new t(this.id,this.elementType.copy(e,!0,r,i,s,o),r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){(0,Bi.isListType)(e)&&(this.addElementType(e.elementType),this.sourceMap.extend(e.sourceMap))}toMeta(e=1){return e>Bi.MAX_TO_META_DEPTH?[{type:cc.SignatureDefinitionBaseType.List,valueType:cc.SignatureDefinitionBaseType.Any}]:(0,UB.simplifyForMeta)(this.elementType).flatMap(r=>r.toMeta(e+1)).flatMap(r=>({type:cc.SignatureDefinitionBaseType.List,valueType:r}))}};_d.ListType=Vv});var gi=f(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.MapType=void 0;var $i=Ve(),zv=Ur(),Ot=ft(),GB=xa(),sD=Ea(),Xv=Qn(),Pa=Tn(),Yv=vr(),Jv=class t extends Pa.Type{static createDefault(e,n,r){return new t(e.generateId(Ot.TypeKind.MapType),null,null,e,n,r,null)}constructor(e,n,r,i,s,o,a,u,c=!1){super(e,Ot.TypeKind.MapType,$i.SignatureDefinitionBaseType.Map,i,s,o,u),this.properties=a||new Map,this.keyType=n??Pa.Type.createBaseType(Ot.UNKNOWN_TYPE_ID,i,s,o),this.valueType=r??Pa.Type.createBaseType(Ot.UNKNOWN_TYPE_ID,i,s,o),this.isScope=c}addKeyVariant(e){let n=typeof e=="string"?Pa.Type.createBaseType($i.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope):Pa.Type.simplify(e);if(this.keyType.id===Ot.UNKNOWN_TYPE_ID){this.keyType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.keyType))return;(0,Ot.isUnionType)(this.keyType)||(this.keyType=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[this.keyType],this.typeStorage,this.document,this.scope,null)),this.keyType.addVariant(n)}addValueVariant(e){if(e==null)return;let n=Pa.Type.simplify(e);if(this.valueType.id===Ot.UNKNOWN_TYPE_ID){this.valueType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.valueType))return;(0,Ot.isUnionType)(this.valueType)||(this.valueType=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[this.valueType],this.typeStorage,this.document,this.scope,null)),this.valueType.addVariant(n)}setPropertyInPath(e,n){if(e.length===0)return;let r=[...e],i=r.pop(),s=this,o=null;for(;r.length>0;){if(!s.containsOwnProperties())return;let a=r.shift();if(o=s,s=s.getProperty(a)?.type,s==null){let u=t.createDefault(this.typeStorage,this.document,this.scope);o.setProperty(a,new Xv.EntityInfo(a,u)),s=u}}s.setProperty(i,n)}getPropertyInPath(e){if(e.length===0)return;let n=[...e],r=this,i;for(;n.length>0;){let s=n.shift(),o=r.getProperty(s);if(o==null)return null;i=o,r=i.type}return i}setProperty(e,n){if(!(0,Ot.isValidKeyValue)(e))throw new Error(`Invalid key type: ${e}`);this.addKeyVariant(e),this.addValueVariant(n.type);let r=this.properties.get(e);if(r){(0,Ot.isUnknownType)(r.type)?(r.type.mergeIntoType(n.type),this.properties.set(e,n)):(0,Ot.isUnknownType)(n.type)?n.type.mergeIntoType(r.type):(0,Ot.isUnionType)(r.type)?r.type.addVariant(n.type):n.type.equalsTo(r.type)?r.type.addToSource(n.type):r.type=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[r.type,n.type],this.typeStorage,this.document,this.scope);return}this.properties.set(e,n)}getProperty(e,n=1){if(n>GB.MAX_DEPTH)return;let r=this.properties.get(e);if(r)return r;let i=this.properties.get(Ot.ISA_PROPERTY);if(i!=null){let o=i.type.getProperty(e,n+1);if(o)return o}return this.inheritFrom==null?void 0:this.typeStorage.getTypeById(this.inheritFrom)?.getProperty(e,n+1)}hasProperty(e){return this.properties.has(e)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>Ot.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map;for(let[i,s]of this.properties)typeof i=="string"&&(n.has(i)||n.set(i,{type:s.type,name:s.name,kind:(0,Ot.isFunctionType)(s.type)?zv.CompletionItemKind.Function:this.isScope?zv.CompletionItemKind.Variable:zv.CompletionItemKind.Property}));let r=this.properties.get(Ot.ISA_PROPERTY);if(r!=null)for(let i of r.type.getAllProperties(e+1))n.has(i.name)||n.set(i.name,i);if(this.inheritFrom){let i=this.typeStorage.getTypeById(this.inheritFrom);for(let s of i.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return Array.from(n.values())}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,this.keyType.copy(e,!0,n,r,i,s),this.valueType.copy(e,!0,n,r,i,s),n||this.typeStorage,r||this.document,i||this.scope,new Map,s,this.isScope);o.set(this,u);for(let[c,l]of this.properties)u.properties.set(c,new Xv.EntityInfo(l.name,l.type.deepCopy(e,n,r,i,null,o)));return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.keyType.copy(e,!0,r,i,s,o),this.valueType.copy(e,!0,r,i,s,o),r||this.typeStorage,i||this.document,s||this.scope,n?new Map(this.properties):this.properties,o,this.isScope);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){if((0,Ot.isMapType)(e)){for(let[n,r]of this.properties)this.properties.set(n,new Xv.EntityInfo(r.name,r.type));this.sourceMap.extend(e.sourceMap)}}toMeta(e=1){if(e>Ot.MAX_TO_META_DEPTH)return[{type:$i.SignatureDefinitionBaseType.Map,keyType:$i.SignatureDefinitionBaseType.Any,valueType:$i.SignatureDefinitionBaseType.Any}];let n=(0,sD.simplifyForMeta)(this.keyType).flatMap(i=>i.toMeta(e+1)),r=(0,sD.simplifyForMeta)(this.valueType).flatMap(i=>i.toMeta(e+1));return n.length+r.length>5?[{type:$i.SignatureDefinitionBaseType.Map,keyType:$i.SignatureDefinitionBaseType.Any,valueType:$i.SignatureDefinitionBaseType.Any}]:n.flatMap(i=>r.flatMap(s=>({type:$i.SignatureDefinitionBaseType.Map,keyType:i,valueType:s})))}};vd.MapType=Jv});var pc=f(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.UnknownType=void 0;var ks=Ve(),oD=Ur(),we=ft(),HB=xa(),VB=hc(),zB=uo(),XB=gi(),lc=Tn(),Qv=vr(),Zv=class t extends lc.Type{get assumedId(){switch(this.getKind()){case we.TypeKind.ListType:return ks.SignatureDefinitionBaseType.List;case we.TypeKind.MapType:return ks.SignatureDefinitionBaseType.Map;case we.TypeKind.FunctionType:return ks.SignatureDefinitionBaseType.Function;default:return ks.SignatureDefinitionBaseType.Any}}constructor(e,n,r,i){super(ks.SignatureDefinitionBaseType.Any,we.TypeKind.UnknownType,ks.SignatureDefinitionBaseType.Any,e,n,r,i),this.properties=null,this.keyType=null,this.valueType=null,this.signature=null}getKind(){return this.keyType!=null&&(0,we.isBaseType)(this.keyType)&&this.keyType.id===ks.SignatureDefinitionBaseType.Number&&this.valueType!=null?we.TypeKind.ListType:this.properties!=null&&this.properties.size>0||this.keyType!=null&&this.valueType!=null?we.TypeKind.MapType:this.signature!=null?we.TypeKind.FunctionType:we.TypeKind.Base}getKeyType(){return this.typeStorage.getKeyTypeById(this.assumedId)}assumeType(e,n,r){let i=this.getKind(),s=e||this.typeStorage,o=n||this.document,a=r||this.scope;switch(i){case we.TypeKind.ListType:return new zB.ListType(this.typeStorage.generateId(we.TypeKind.ListType),this.valueType,s,o,a);case we.TypeKind.MapType:return new XB.MapType(this.typeStorage.generateId(we.TypeKind.MapType),this.keyType,this.valueType,s,o,a,this.properties);case we.TypeKind.FunctionType:return new VB.FunctionType(this.typeStorage.generateId(we.TypeKind.FunctionType),this.signature,s,o,a);default:return lc.Type.createBaseType(this.assumedId,s,o,a)}}addKeyVariant(e){if(e==null)return;let n=lc.Type.simplify(e);if(this.keyType==null){this.keyType=n;return}if(this.keyType.id===we.UNKNOWN_TYPE_ID){this.keyType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.keyType))return;(0,we.isUnionType)(this.keyType)||(this.keyType=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[this.keyType],this.typeStorage,this.document,this.scope,null)),this.keyType.addVariant(n)}addValueVariant(e){if(e==null)return;let n=lc.Type.simplify(e);if(this.valueType==null){this.valueType=n;return}if(this.valueType.id===we.UNKNOWN_TYPE_ID){this.valueType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.valueType))return;(0,we.isUnionType)(this.valueType)||(this.valueType=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[this.valueType],this.typeStorage,this.document,this.scope,null)),this.valueType.addVariant(n)}setProperty(e,n){let r=typeof e=="string"?lc.Type.createBaseType(ks.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope):e;if(this.addKeyVariant(r),this.addValueVariant(n.type),typeof e!="string")return;this.properties==null&&(this.properties=new Map);let i=this.properties.get(e);if(i){(0,we.isUnionType)(i.type)?i.type.addVariant(n.type):n.type.equalsTo(i.type)||(i.type=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[i.type,n.type],this.typeStorage,this.document,this.scope));return}this.properties.set(e,n)}getProperty(e,n=1){if(this.properties==null)return super.getProperty(e,n);if(n>HB.MAX_DEPTH||typeof e!="string")return;let r=this.properties.get(e);if(r)return r;let i=this.properties.get(we.ISA_PROPERTY);if(i!=null){let o=i.type.getProperty(e,n+1);if(o)return o}return this.typeStorage.getTypeById(this.assumedId)?.getProperty(e,n+1)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>we.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map,r=this.typeStorage.getTypeById(this.assumedId);if(r!=null){let i=r.getAllProperties(e+1);for(let s=0;s<i.length;s++){let o=i[s];n.has(o.name)||n.set(o.name,o)}}if(this.properties!=null){for(let[s,o]of this.properties)n.has(s)||n.set(s,{type:o.type,name:o.name,kind:(0,we.isFunctionType)(o.type)?oD.CompletionItemKind.Function:oD.CompletionItemKind.Property});let i=this.properties.get(we.ISA_PROPERTY);if(i!=null)for(let s of i.type.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return[...Array.from(n.values())]}mergeIntoType(e){if(e.addToSource(this),(0,we.isUnknownType)(e))e.merge(this);else if((0,we.isMapType)(e)){if(this.keyType!=null)if((0,we.isUnionType)(this.keyType))for(let n of this.keyType.variants){let r=n.getKeyType();r!=null&&e.addKeyVariant(r)}else{let n=this.keyType.getKeyType();n!=null&&e.addKeyVariant(n)}if(this.valueType!=null&&e.addValueVariant(this.valueType),this.properties!=null)for(let[n,r]of this.properties)e.setProperty(n,r)}else if((0,we.isListType)(e))this.valueType!=null&&e.addElementType(this.valueType);else if((0,we.isUnionType)(e))for(let n of e.variants)this.mergeIntoType(n)}merge(e){if((0,we.isUnknownType)(e)){if(e.keyType!=null&&this.addKeyVariant(e.keyType),e.valueType!=null&&this.addValueVariant(e.valueType),e.properties!=null){this.properties==null&&(this.properties=new Map);for(let[n,r]of e.properties)this.properties.set(n,r)}e.signature!=null&&(this.signature=e.signature)}else if((0,we.isMapType)(e)){this.addKeyVariant(e.keyType),this.addValueVariant(e.valueType),this.properties==null&&(this.properties=new Map);for(let[n,r]of e.properties)typeof n=="string"&&this.properties.set(n,r)}else if((0,we.isListType)(e))this.addValueVariant(e.elementType);else if((0,we.isUnionType)(e))for(let n of e.variants)this.merge(n);else(0,we.isFunctionType)(e)&&(this.signature=e.signature)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(n||this.typeStorage,r||this.document,i||this.scope,s);if(o.set(this,u),u.signature=this.signature,u.keyType=this.keyType?.copy(e,!0,n,r,i,s),u.valueType=this.valueType?.copy(e,!0,n,r,i,s),this.properties!=null){u.properties=new Map;for(let[c,l]of this.properties)u.properties.set(c,{name:l.name,type:l.type.deepCopy(e,n,r,i,null,o)})}return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n=!1,r,i,s,o){let a=new t(r||this.typeStorage,i||this.document,s||this.scope,o);return a.signature=this.signature,a.keyType=this.keyType?.copy(e,!0,r,i,s),a.valueType=this.valueType?.copy(e,!0,r,i,s),a.properties=this.properties!=null?n?new Map(this.properties):this.properties:null,e&&a.sourceMap.extend(this.sourceMap),a}toMeta(){return[{type:this.assumedId}]}};Sd.UnknownType=Zv});var Oa=f(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.determineTypeFromMeta=void 0;var Ui=Ve(),YB=uo(),JB=gi(),Td=Tn(),QB=pc(),wd=ft();function xd(t,e,n,r,i){switch(t.type){case Ui.SignatureDefinitionBaseType.List:{let s=t.valueType?xd(t.valueType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i);return new YB.ListType(e.generateId(wd.TypeKind.ListType,i),s,e,n,r,i)}case Ui.SignatureDefinitionBaseType.Map:{let s=t.keyType?xd(t.keyType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i),o=t.valueType?xd(t.valueType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i);return new JB.MapType(e.generateId(wd.TypeKind.MapType,i),s,o,e,n,r,null,i)}case Ui.SignatureDefinitionBaseType.Any:case wd.UNKNOWN_TYPE_ID:return new QB.UnknownType(e,n,r,i);case wd.NIL_TYPE_ID:case Ui.SignatureDefinitionBaseType.Number:case Ui.SignatureDefinitionBaseType.String:case Ui.SignatureDefinitionBaseType.Function:default:return Td.Type.createBaseType(t.type,e,n,r,i)}}Ed.determineTypeFromMeta=xd});var hc=f(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.FunctionType=void 0;var aD=Ve(),eS=ft(),ZB=Oa(),e$=Tn(),t$=vr(),tS=class t extends e$.Type{constructor(e,n,r,i,s,o){super(e,eS.TypeKind.FunctionType,aD.SignatureDefinitionBaseType.Function,r,i,s,o),this.signature=n,this.returnType=null}getReturnType(e,n,r,i){if(this.returnType==null){let s=this.signature.getReturns().map(o=>(0,ZB.determineTypeFromMeta)(o,e||this.typeStorage,n||this.document,r||this.scope));return s.length===1?s[0]:new t$.UnionType(this.typeStorage.generateId(eS.TypeKind.UnionType,i),s,e||this.typeStorage,n||this.document,r||this.scope,null)}return this.returnType}equalsTo(e){return(0,eS.isFunctionType)(e)?e.signature.getId()===this.signature.getId():!1}invoke(e,n,r,i){let s=this.getReturnType(e,n,r,i);return this.isPersistent?s:s.copy(!1,!0,e,n,r)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,this.signature,n||this.typeStorage,r||this.document,i||this.scope,s);return o.set(this,u),u.returnType=this.returnType?this.returnType.deepCopy(!1,n,r,i,null,o):null,e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.signature,r||this.typeStorage,i||this.document,s||this.scope,o);return a.returnType=this.returnType,e&&a.sourceMap.extend(this.sourceMap),a}toMeta(e){return[{type:aD.SignatureDefinitionBaseType.Function}]}};kd.FunctionType=tS});var ka=f(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.ClassType=void 0;var mi=Ve(),Ad=Ur(),Sr=ft(),n$=xa(),co=Qn(),r$=hc(),i$=uo(),s$=gi(),Da=Tn(),nS=class t extends Da.Type{constructor(e,n=null,r=null,i,s,o,a,u){super(e,Sr.TypeKind.ClassType,r,i,s,o,u),this.associatedMap=n,this.properties=a||new Map}insertDefinition(e,n){if(this.hasProperty(e))return;let r=n.getType();switch(r.type){case mi.SignatureDefinitionBaseType.Function:{let i=new r$.FunctionType(mi.SignatureDefinitionBaseType.Function,n,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.List:{let i=new i$.ListType(this.typeStorage.generateId(Sr.TypeKind.ListType),Da.Type.createBaseType(r.valueType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.Map:{let i=new s$.MapType(this.typeStorage.generateId(Sr.TypeKind.MapType),Da.Type.createBaseType(r.keyType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),Da.Type.createBaseType(r.valueType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope,null),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.Number:case mi.SignatureDefinitionBaseType.String:case mi.SignatureDefinitionBaseType.Any:{let i=Da.Type.createBaseType(r.type??mi.SignatureDefinitionBaseType.Any,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}default:{let i=Da.Type.createBaseType(r.type??mi.SignatureDefinitionBaseType.Any,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}}}insertSignature(e){let n=Object.keys(e.getDefinitions());for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i);this.insertDefinition(i,s)}}equalsTo(e){return(0,Sr.isClassType)(e)?this.referenceEqualsTo(e)||this.id===e.id&&this.document===e.document:!1}getProperty(e,n=1){if(n>n$.MAX_DEPTH||typeof e!="string")return;if(this.associatedMap){let s=this.associatedMap.getProperty(e,n+1);if(s)return s}let r=this.properties.get(e);return r||(this.inheritFrom==null?void 0:this.typeStorage.getInerhitType(this)?.getProperty(e,n+1))}setProperty(e,n){typeof e=="string"&&(this.properties.set(e,n),this.id!==mi.SignatureDefinitionBaseType.General&&this.typeStorage.addToAny(e,n))}hasProperty(e){return typeof e!="string"?!1:this.properties.has(e)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>Sr.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map,r=Sr.BASE_TYPE_SET.has(this.id);for(let[i,s]of this.properties)n.has(i)||n.set(i,{type:s.type,name:s.name,kind:r?(0,Sr.isFunctionType)(s.type)?Ad.CompletionItemKind.InternalFunction:Ad.CompletionItemKind.InternalProperty:(0,Sr.isFunctionType)(s.type)?Ad.CompletionItemKind.Function:Ad.CompletionItemKind.Property});if(this.associatedMap)for(let i of this.associatedMap.getAllProperties(e+1))n.has(i.name)||n.set(i.name,i);if(this.inheritFrom){let i=this.typeStorage.getInerhitType(this);for(let s of i.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return Array.from(n.values())}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,null,this.inheritFrom,n||this.typeStorage,r||this.document,i||this.scope,new Map,s);o.set(this,u),u.associatedMap=this.associatedMap?this.associatedMap.deepCopy(e,n,r,i,s,o):null;for(let[c,l]of this.properties)u.properties.set(c,new co.EntityInfo(l.name,l.type.deepCopy(e,n,r,i,null,o)));return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.associatedMap,this.inheritFrom,r||this.typeStorage,i||this.document,s||this.scope,n?new Map(this.properties):this.properties);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){if((0,Sr.isClassType)(e)){for(let[n,r]of e.properties)this.properties.has(n)||this.properties.set(n,new co.EntityInfo(r.name,r.type));this.sourceMap.extend(e.sourceMap)}}toMeta(e){return[{type:this.id}]}};Pd.ClassType=nS});var Ra=f(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.KeyType=void 0;var o$=ft(),a$=Tn(),rS=class t extends a$.Type{constructor(e,n,r,i,s=!1,o){super(e,o$.TypeKind.KeyType,e,n,r,i,o),this.isUserDefined=s}getKeyType(){return this}copy(e,n,r,i,s,o){let a=new t(this.id,r||this.typeStorage,i||this.document,s||this.scope,this.isUserDefined,o);return e&&a.sourceMap.extend(this.sourceMap),a}};Od.KeyType=rS});var dc=f(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.mergeScope=yi.deepMerge=yi.shallowMergeList=yi.shallowMergeMap=void 0;var lo=Qn(),u$=uo(),c$=gi(),l$=vr(),ct=ft();function p$(t,e,n){if(!(0,ct.isMapType)(t)||!(0,ct.isMapType)(e))return t;let r=t.copy(!1,!0),i=new c$.MapType(t.id,r.keyType,r.valueType,r.typeStorage,r.document,r.scope,null,n);i.properties=r.properties;for(let[s,o]of e.properties)i.setProperty(s,new lo.EntityInfo(o.name,o.type.copy(!1,!0,r.typeStorage)));return i}yi.shallowMergeMap=p$;function h$(t,e,n){if(!(0,ct.isListType)(t)||!(0,ct.isListType)(e))return t;let r=t.copy(!1,!0),i=new u$.ListType(t.id,r.keyType,r.typeStorage,r.document,r.scope,n);return i.addElementType(e.elementType),i}yi.shallowMergeList=h$;function Ki(t,e,n,r){if(r.add(e),r.add(n),e.properties==null&&n.properties==null)return e;if(e.properties==null)return n;if(n.properties==null)return e;let i=(0,ct.isMapType)(e);for(let[s,o]of n.properties){if(!i&&typeof s!="string")continue;let a=e.properties.get(s);a?e.setProperty(s,new lo.EntityInfo(a.name,Ia(t,a.type,o.type,r))):e.setProperty(s,new lo.EntityInfo(o.name,o.type.copy(!0,!0,t)))}return e}function d$(t,e,n,r){return e.returnType!=null&&n.returnType!=null?e.returnType=Ia(t,e.returnType,n.returnType,r):n.returnType!=null&&(e.returnType=n.returnType.copy(!0,!0,t)),e}function f$(t,e,n){for(let r of n.variants)e.addVariant(r.copy(!0,!0,t));return e}function Ia(t,e,n,r=new WeakSet){if(e===n||r.has(e)||r.has(n))return e;if(r.add(e),r.add(n),(0,ct.isMapType)(e)){if((0,ct.isMapType)(n))return Ki(t,e,n,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,e,n,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.addVariant(e),r.add(i),i}}else if((0,ct.isClassType)(e)){if((0,ct.isMapType)(n))return Ki(t,e,n,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,e,n,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.addVariant(e),r.add(i),i}}else if((0,ct.isUnknownType)(e)){if((0,ct.isMapType)(n))return Ki(t,n.copy(!0,!0,t),e,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,n.copy(!0,!0,t),e,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.variants.forEach(s=>Ia(t,s,e,r)),r.add(i),i}return n.copy(!0,!0,t)}else if((0,ct.isFunctionType)(e)){if((0,ct.isFunctionType)(n))return d$(t,e,n,r)}else if((0,ct.isUnionType)(e))return(0,ct.isUnionType)(n)?f$(t,e,n):(e.addVariant(n.copy(!0,!0,t)),e);if(!n.equalsTo(e)){let i=l$.UnionType.createDefault(t,e.document,e.scope);return r.add(i),i.addVariant(e),i.addVariant(n.copy(!0,!0,t)),i}return e}yi.deepMerge=Ia;function g$(t,e,n,r){if(r){for(let s=0;s<r.length;s++){let o=r[s],a=e.locals.getProperty(o.namespace),u=n.locals.getPropertyInPath(o.exportFrom.split("."));u!=null&&a!=null?e.locals.setProperty(o.namespace,new lo.EntityInfo(a.name,Ia(t,a.type,u.type))):u!=null&&a==null&&e.locals.setProperty(o.namespace,new lo.EntityInfo(u.name,u.type.copy(!0,!0,t)))}return}let i=new Map;for(let[s,o]of n.locals.properties){let a=e.locals.getProperty(s);a!=null?e.locals.setProperty(s,new lo.EntityInfo(a.name,Ia(t,a.type,o.type))):e.locals.setProperty(s,new lo.EntityInfo(o.name,o.type.deepCopy(!0,t,null,null,null,i)))}}yi.mergeScope=g$});var Rd=f(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.TypeStorage=void 0;var uD=dc(),iS=class t{constructor(e){this.memory=new Map,this.parent=e,this.memory=new Map,this.typeInterfaces=new Map,this.keyTypes=new Map,this.__internalHandleCounter=0}addToAny(e,n){}addType(e){let n=this.typeInterfaces.get(e.id);if(n){n.merge(e);return}this.typeInterfaces.set(e.id,e)}getType(e){let n=this.typeInterfaces.get(e.id);return n&&n!==e?n:this.parent?.getType(e)||null}getInerhitType(e){if(e.inheritFrom==null)return null;let n=this.typeInterfaces.get(e.inheritFrom);return n&&n!==e?n:this.parent?.getInerhitType(e)||null}getTypeById(e){let n=this.typeInterfaces.get(e);return n||this.parent?.getTypeById(e)||null}getTypePropertyById(e,n){let r=this.typeInterfaces.get(e)?.getProperty(n);return r||this.parent?.getTypePropertyById(e,n)||null}addKeyType(e){this.keyTypes.has(e.id)||this.keyTypes.set(e.id,e)}getKeyType(e){return this.keyTypes.get(e.id)||this.parent?.getKeyType(e)||this.getInerhitKeyType(e)}getInerhitKeyType(e){if(e.inheritFrom==null)return null;let n=this.keyTypes.get(e.inheritFrom);return n||this.parent?.getInerhitKeyType(e)||null}getKeyTypeById(e){let n=this.keyTypes.get(e);return n||this.parent?.getKeyTypeById(e)||null}merge(e){e.memory.forEach((n,r)=>{let i=this.memory.get(r);if(i){this.memory.set(r,(0,uD.deepMerge)(e,i,n));return}this.memory.set(r,n.deepCopy(!0,this))}),e.typeInterfaces.forEach((n,r)=>{let i=this.typeInterfaces.get(r);if(i){this.typeInterfaces.set(r,(0,uD.deepMerge)(e,i,n));return}this.typeInterfaces.set(r,n.deepCopy(!0,this))}),e.keyTypes.forEach((n,r)=>{this.keyTypes.has(r)||this.keyTypes.set(r,n.copy(!0,!0,this))})}generateId(e,n){let r=n?`<${n.type}:${n.start.toString()}-${n.end.toString()}>`:"<virtual>";return`${e}-global-${this.__internalHandleCounter++}-${r}`}copy(){let e=new t(this.parent);return this.typeInterfaces.forEach((n,r)=>{e.typeInterfaces.set(r,n.copy(!0,!0,e))}),this.keyTypes.forEach((n,r)=>{e.keyTypes.set(r,n.copy(!0,!0,e))}),e}};Dd.TypeStorage=iS});var uS=f(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.GlobalTypeStorage=void 0;var cD=Ve(),sS=ka(),oS=Ra(),Id=ft(),m$=Rd(),aS=class extends m$.TypeStorage{insertPrimitives(e){e.getPrimitives().forEach((r,i)=>{let s=new sS.ClassType(i,null,null,this);s.insertSignature(r),this.typeInterfaces.set(i,s),this.keyTypes.set(i,new oS.KeyType(i,this))});let n=new sS.ClassType(Id.NIL_TYPE_ID,null,null,this);this.typeInterfaces.set(Id.NIL_TYPE_ID,n),this.keyTypes.set(Id.NIL_TYPE_ID,new oS.KeyType(Id.NIL_TYPE_ID,this))}insertNonPrimitives(e){e.getTypes().forEach((n,r)=>{let i=new sS.ClassType(r,null,null,this);i.insertSignature(n),this.typeInterfaces.set(r,i),this.keyTypes.set(r,new oS.KeyType(r,this))})}insertAllAnyTypeMembers(e){let n=this.typeInterfaces.get(cD.SignatureDefinitionBaseType.Any);e.getPrimitives().forEach(r=>{r.getType()!==cD.SignatureDefinitionBaseType.General&&n.insertSignature(r)}),e.getTypes().forEach(r=>{n.insertSignature(r)})}};Cd.GlobalTypeStorage=aS});var Ca=f(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.GreybelKeyword=void 0;var y$;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})(y$=fc.GreybelKeyword||(fc.GreybelKeyword={}))});var pS=f(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});var po=Te(),b$=Ca(),cS=class extends po.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(po.Keyword),...Object.values(b$.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===po.CharacterCode.HASH}isMultilineComment(e,n){return po.CharacterCode.SLASH===e&&po.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return po.CharacterCode.ASTERISK===e&&po.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};lS.default=cS});var hS=f(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CharacterCode=void 0;var _$;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(_$=gc.CharacterCode||(gc.CharacterCode={}))});var Ma=f(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.Operator=void 0;var v$;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(v$=mc.Operator||(mc.Operator={}))});var fS=f(yc=>{"use strict";var S$=yc&&yc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yc,"__esModule",{value:!0});var Kr=Te(),T$=S$(pS()),lD=hS(),pD=Ca(),dS=Ma();function hD(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Md=class t extends Kr.Lexer{constructor(e,n={}){n.validator=n.validator||new T$.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let p=n.codeAt();if(n.validator.isEndOfLine(p))n.validator.isWinNewline(p,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new Kr.ASTRange(new Kr.ASTPosition(r,s-o+1),new Kr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new Kr.Token({type:Kr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(pD.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(pD.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};yc.default=Md;Md.greybelScanHandlers={[Kr.CharacterCode.ARROW_LEFT]:function(e){if(Kr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(dS.Operator.LeftShift,e)},[Kr.CharacterCode.ARROW_RIGHT]:function(e){if(Kr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return Kr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(dS.Operator.UnsignedRightShift,e):this.scanPunctuator(dS.Operator.RightShift,e)},[lD.CharacterCode.AMPERSAND]:hD,[lD.CharacterCode.VERTICAL_LINE]:hD}});var Ld=f(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.ASTType=void 0;var w$;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(w$=bc.ASTType||(bc.ASTType={}))});var mS=f(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.ASTChunkGreybel=void 0;var x$=Te(),gS=class t extends x$.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nd.ASTChunkGreybel=gS});var TS=f(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.ASTFeatureFileExpression=Tr.ASTFeatureInjectExpression=Tr.ASTFeatureEnvarExpression=Tr.ASTFeatureIncludeExpression=Tr.ASTFeatureImportExpression=void 0;var _c=Te(),vc=Ld(),yS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureImportExpression=yS;var bS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureIncludeExpression=bS;var _S=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureEnvarExpression=_S;var vS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureInjectExpression=vS;var SS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureFileExpression=SS});var ES=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ASTFeatureInjectExpression=Gt.ASTFeatureIncludeExpression=Gt.ASTFeatureImportExpression=Gt.ASTFeatureFileExpression=Gt.ASTFeatureEnvarExpression=Gt.ASTChunkGreybel=Gt.ASTType=Gt.ASTProvider=void 0;var wS=Te(),dD=Ld(),E$=mS(),Sc=TS(),xS=class extends wS.ASTProvider{featureImportExpression(e){return new Sc.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Sc.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Sc.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Sc.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new wS.ASTBase(dD.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new wS.ASTBase(dD.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Sc.ASTFeatureFileExpression(e)}chunk(e){return new E$.ASTChunkGreybel(e)}};Gt.ASTProvider=xS;var k$=Ld();Object.defineProperty(Gt,"ASTType",{enumerable:!0,get:function(){return k$.ASTType}});var A$=mS();Object.defineProperty(Gt,"ASTChunkGreybel",{enumerable:!0,get:function(){return A$.ASTChunkGreybel}});var Tc=TS();Object.defineProperty(Gt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureEnvarExpression}});Object.defineProperty(Gt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureFileExpression}});Object.defineProperty(Gt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureImportExpression}});Object.defineProperty(Gt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureIncludeExpression}});Object.defineProperty(Gt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureInjectExpression}})});var kS=f(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.SelectorGroups=vt.SelectorGroupType=vt.Selectors=vt.SelectorTypes=void 0;var $e=Te(),qd=Ca(),wc=Ma(),P$;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(P$=vt.SelectorTypes||(vt.SelectorTypes={}));vt.Selectors=Object.assign(Object.assign({},$e.Selectors),{From:(0,$e.createSelector)({type:$e.TokenType.Identifier,value:"from"}),Envar:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Envar}),Inject:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Inject}),Line:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Line}),File:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.File}),LeftShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.LeftShift}),RightShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.RightShift}),UnsignedRightShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.UnsignedRightShift}),BitwiseOr:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.BitwiseOr}),BitwiseAnd:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.BitwiseAnd}),Escape:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:$e.Operator.Escape})});var Wi;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(Wi=vt.SelectorGroupType||(vt.SelectorGroupType={}));vt.SelectorGroups=Object.assign(Object.assign({},$e.SelectorGroups),{[Wi.MapSeparator]:(0,$e.createSelectorGroup)(Wi.MapSeparator,[vt.Selectors.MapSeperator,vt.Selectors.CRBracket]),[Wi.ListSeparator]:(0,$e.createSelectorGroup)(Wi.ListSeparator,[vt.Selectors.MapSeperator,vt.Selectors.SRBracket]),[Wi.PathSegmentEnd]:(0,$e.createSelectorGroup)(Wi.PathSegmentEnd,[vt.Selectors.EndOfLine,vt.Selectors.Comment,vt.Selectors.EndOfFile]),[Wi.BitwiseOperators]:(0,$e.createSelectorGroup)(Wi.BitwiseOperators,[vt.Selectors.LeftShift,vt.Selectors.RightShift,vt.Selectors.UnsignedRightShift])})});var mD=f(xc=>{"use strict";var O$=xc&&xc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xc,"__esModule",{value:!0});var Zn=Te(),D$=qu(),fD=Ku(),R$=O$(fS()),I$=ES(),ho=Ca(),gD=Ma(),Ne=kS(),AS=class extends Zn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new R$.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new I$.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(Ne.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
|
100
|
-
`)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.comments.push(s),n.lineRegistry.addItemToLines(s)}else if(Ne.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!Ne.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),Ne.Selectors.CRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(Ne.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ne.SelectorGroups.MapSeparator,s.start);if(Ne.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!Ne.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),Ne.Selectors.SRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ne.SelectorGroups.ListSeparator,s.start);if(Ne.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Zn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Ne.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Ne.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(Zn.ASTIdentifierKind.Variable);if(!n.consume(Ne.Selectors.From))return n.raise("expected from keyword",new fD.Range(r.start,new D$.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});return n.imports.push(o),n.currentScope.definitions.push(o),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(Ne.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Zn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;Ne.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:gD.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;Ne.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:gD.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;Ne.Selectors.Plus(r.token)||Ne.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;Ne.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return Ne.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Ne.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Ne.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):Ne.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(Zn.TokenType.Keyword))switch(e.token.value){case ho.GreybelKeyword.Include:case ho.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Import:case ho.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunk({start:n.start,end:null,range:[n.range[0],null]}),i=new Zn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!Ne.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Ne.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Zn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new fD.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.comments=e.comments,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};xc.default=AS});var Wr=f(jt=>{"use strict";var C$=jt&&jt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ec=jt&&jt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&C$(e,t,n)},PS=jt&&jt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jt,"__esModule",{value:!0});jt.Parser=jt.LexerValidator=jt.Lexer=void 0;var M$=fS();Object.defineProperty(jt,"Lexer",{enumerable:!0,get:function(){return PS(M$).default}});var L$=pS();Object.defineProperty(jt,"LexerValidator",{enumerable:!0,get:function(){return PS(L$).default}});var N$=mD();Object.defineProperty(jt,"Parser",{enumerable:!0,get:function(){return PS(N$).default}});Ec(ES(),jt);Ec(hS(),jt);Ec(Ca(),jt);Ec(Ma(),jt);Ec(kS(),jt)});var Fd=f(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.InferContext=void 0;var OS=class{constructor(e,n,r,i){this.typeStorage=e,this.document=n,this.scope=r,this.onRequestScope=i}};jd.InferContext=OS});var As=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SIMPLE_BINARY_OPERATORS_SET=tn.PathType=tn.UnaryType=tn.ConstantIdentifierSet=tn.ConstantIdentifier=tn.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;var fo=Te();tn.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```";var yD;(function(t){t.Self="self",t.Globals="globals",t.Outer="outer",t.Locals="locals",t.Super="super"})(yD=tn.ConstantIdentifier||(tn.ConstantIdentifier={}));tn.ConstantIdentifierSet=new Set(Object.values(yD));var q$;(function(t){t.Not="not",t.Negate="negate",t.AddressOf="addressOf"})(q$=tn.UnaryType||(tn.UnaryType={}));var j$;(function(t){t.Map="{}",t.List="[]",t.String="$string",t.Number="$number",t.Nil="null",t.Slice="[:]",t.Function="$funcRef",t.Expression="$expr"})(j$=tn.PathType||(tn.PathType={}));tn.SIMPLE_BINARY_OPERATORS_SET=new Set([fo.Operator.Modulo,fo.Operator.Equal,fo.Operator.NotEqual,fo.Operator.GreaterThan,fo.Operator.GreaterThanOrEqual,fo.Operator.LessThan,fo.Operator.LessThanOrEqual])});var La=f(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.Markers=void 0;var F$;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(F$=kc.Markers||(kc.Markers={}))});var Gr=f(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.rewireSpecs=St.rewireSource=St.seedTokens=St.seedSpec=St.seedBlock=St.splitLines=St.splitSpace=St.splitCR=St.hasCR=St.isSpace=void 0;function B$(t){return/^\s+$/.test(t)}St.isSpace=B$;function $$(t){return/\r$/.test(t)}St.hasCR=$$;function U$(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}St.splitCR=U$;function K$(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}St.splitSpace=K$;function W$(t){return t.split(/\n/)}St.splitLines=W$;function G$(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}St.seedBlock=G$;function H$(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}St.seedSpec=H$;function V$(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}St.seedTokens=V$;function z$(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}St.rewireSource=z$;function X$(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}St.rewireSpecs=X$});var bD=f(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Y$=/^@\S+/;function J$({fence:t="```"}={}){let e=Q$(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)Y$.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}DS.default=J$;function Q$(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var _D=f(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Z$=La(),Ac=Gr();function e2({startLine:t=0,markers:e=Z$.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,Ac.seedTokens)();if([a.lineEnd,o]=(0,Ac.splitCR)(o),[a.start,o]=(0,Ac.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,Ac.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,Ac.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}RS.default=e2});var vD=f(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var t2=Gr();function n2({tokenizers:t}){return function(n){var r;let i=(0,t2.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}IS.default=n2});var MS=f(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});function r2(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}CS.default=r2});var NS=f(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var i2=Gr();function s2(t="compact"){let e=a2(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,i2.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}LS.default=s2;var o2=t=>t.trim();function a2(t){return t==="compact"?e=>e.map(o2).join(""):t==="preserve"?e=>e.join(`
|
101
|
-
`):t}});var FS=f(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var qS=Gr(),u2=t=>t&&t.startsWith('"')&&t.endsWith('"');function c2(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,qS.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,qS.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!u2(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,qS.splitSpace)(r.slice(n.name.length)),e}}jS.default=c2});var $S=f(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.getJoiner=void 0;var BS=La();function l2(t="compact",e=BS.Markers){let n=
|
102
|
-
`)}});var
|
103
|
-
`)}KS.default=E2});var
|
104
|
-
`)}GS.default=K2});var Ic=f(Ft=>{"use strict";var W2=Ft&&Ft.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),G2=Ft&&Ft.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&W2(e,t,n)};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.util=Ft.tokenizers=Ft.transforms=Ft.inspect=Ft.stringify=Ft.parse=void 0;var H2=
|
99
|
+
[${u}] ${this.details[a].message}`}return o=o+r,o};eo.safeStringify=function(t,e){return JSON.stringify(t,eo.serializer(),e)};eo.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[eo.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var Ii=f(Ct=>{"use strict";var Wj=hP(),Gj=et(),Hj=Ss();Ct.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ct.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return Ct.template(this.value,t,e||this.code,this.state,this.prefs)}};Ct.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ct.template=function(t,e,n,r,i){if(!e)return;if(Hj.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(Gj.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};Ct.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=Ct.path(i);return s||Ct.template(null,n.messages,"root",e,n)||r&&Ct.template(null,r,"root",e,n)||"value"};Ct.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Ct.details(t);if(r)return r;if(n.errors.stack)return new Ct.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ct.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Ct.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ct.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ct.ValidationError}};Ct.ValidationError.prototype.isJoi=!0;Ct.ValidationError.prototype.name="ValidationError";Ct.ValidationError.prototype.annotate=Wj.error});var Ci=f(fr=>{"use strict";var hr=Ce(),Vj=bn(),zj=Zs(),tc=et(),iv,dr={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};fr.create=function(t,e={}){hr(typeof t=="string","Invalid reference key:",t),tc.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),hr(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},dr.defaults,e);delete n.prefix;let r=n.separator,i=dr.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(hr(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)hr(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=dr.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new dr.Ref(n)};fr.in=function(t,e={}){return fr.create(t,{...e,in:!0})};fr.isRef=function(t){return t?!!t[tc.symbols.ref]:!1};dr.Ref=class{constructor(t){hr(typeof t=="object","Invalid reference construction"),tc.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),hr([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),hr(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),hr(!t.map||Array.isArray(t.map),"options.map must be an array"),hr(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,dr.defaults,t),hr(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return hr(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(hr(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=zj(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new dr.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};dr.Ref.prototype[tc.symbols.ref]=!0;fr.build=function(t){return t=Object.assign({},dr.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new dr.Ref(t)};dr.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};dr.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};fr.toSibling=0;fr.toParent=1;fr.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?fr.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(tc.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}fr.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),iv=iv||Ss(),iv.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new fr.Manager;return t.refs=Vj(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Ss=f((mP,yP)=>{"use strict";var zh=Ce(),Xj=bn(),Yj=cP(),Jj=lP(),fP=et(),dP=Ii(),gP=Ci(),Fe={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};yP.exports=mP=Fe.Template=class{constructor(t,e){if(zh(typeof t=="string","Template source must be a string"),zh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?Xj(r):void 0,this._functions=n,this._functions&&(zh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),zh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=Fe.encode(this.source),e=Fe.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${Fe.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let p=this._ref(Fe.decode(c),{raw:o,wrapped:l});r.push(p),typeof p!="string"&&(n=!0);let h=s.slice(u+a.length);h&&r.push(Fe.decode(h))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Fe.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new Fe.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[fP.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=Fe.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:Yj(u);s.push(Fe.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=gP.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...Fe.functions,...this._functions}:Fe.functions;var s=new Jj.Parser(t,{reference:i,functions:o,constants:Fe.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return Fe.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Fe.Template.prototype[fP.symbols.template]=!0;Fe.Template.prototype.isImmutable=!0;Fe.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Fe.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Fe.closes.slice(0,n.length))};Fe.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Fe.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};Fe.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Fe.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(gP.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return Fe.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return Fe.Template.date(t,r);if(t instanceof Map){let l=[];for(let[p,h]of t.entries())l.push(`${p.toString()} -> ${h.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Fe.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Fe.wrap(c.join(", "),!u&&a.array)};Fe.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Fe.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=dP.template(e,o[0],t,n,r)||dP.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var ya=f(nc=>{"use strict";var to=Ce(),bP=bn(),Xn=Ss();nc.compile=function(t,e){if(typeof t=="string")return to(!e,"Cannot set single message string"),new Xn(t);if(Xn.isTemplate(t))return to(!e,"Cannot set single message template"),t;to(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?bP(e):{};for(let n in t){let r=t[n];if(n==="root"||Xn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Xn(r);continue}to(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Xn.isTemplate(s)){e[i][n]=s;continue}to(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Xn(s)}}return e};nc.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Xn.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};nc.merge=function(t,e){if(!t)return nc.compile(e);if(!e)return t;if(typeof e=="string")return new Xn(e);if(Xn.isTemplate(e))return e;let n=bP(t);for(let r in e){let i=e[r];if(r==="root"||Xn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Xn(i);continue}to(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Xn.isTemplate(o)){n[s][r]=o;continue}to(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Xn(o)}}return n}});var et=f(tt=>{"use strict";var Xh=Ce(),Qj=ev(),Zj=aP(),sv,ov,eF={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};tt.version=Zj.version;tt.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};tt.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};tt.assertOptions=function(t,e,n="Options"){Xh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Xh(r.length===0,`${n} contain unknown keys: ${r}`)};tt.checkPreferences=function(t){ov=ov||Hh();let e=ov.preferences.validate(t);if(e.error)throw new Qj([e.error.details[0].message])};tt.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};tt.default=function(t,e){return t===void 0?e:t};tt.isIsoDate=function(t){return eF.isoDate.test(t)};tt.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};tt.isResolvable=function(t){return t?t[tt.symbols.ref]||t[tt.symbols.template]:!1};tt.isSchema=function(t,e={}){let n=t&&t[tt.symbols.any];return n?(Xh(e.legacy||n.version===tt.version,"Cannot mix different versions of joi schemas"),!0):!1};tt.isValues=function(t){return t[tt.symbols.values]};tt.limit=function(t){return Number.isSafeInteger(t)&&t>=0};tt.preferences=function(t,e){sv=sv||ya(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=sv.compile(e.messages,t.messages)),delete n[tt.symbols.prefs],n};tt.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};tt.validateArg=function(t,e,{assert:n,message:r}){if(tt.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};tt.verifyFlat=function(t,e){for(let n of t)Xh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var av=f(_P=>{"use strict";var tF=Ce(),nF=bn(),rF=et(),ba={max:1e3,supported:new Set(["undefined","boolean","number","string"])};_P.provider={provision(t){return new ba.Cache(t)}};ba.Cache=class{constructor(t={}){rF.assertOptions(t,["max"]),tF(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||ba.max,this._map=new Map,this._list=new ba.List}get length(){return this._map.size}set(t,e){if(t!==null&&!ba.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),nF(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};ba.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var no=f(Mi=>{"use strict";var _t=Ce(),Yn=et(),_a=Ci(),gr={};Mi.schema=function(t,e,n={}){Yn.assertOptions(n,["appendPath","override"]);try{return gr.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};gr.schema=function(t,e,n){_t(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(_t(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(gr.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(_t(typeof e=="object","Invalid schema content:",typeof e),Yn.isResolvable(e))return r(t,e);if(Yn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!gr.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(_t(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Mi.ref=function(t,e){return _a.isRef(t)?t:_a.create(t,e)};Mi.compile=function(t,e,n={}){Yn.assertOptions(n,["legacy"]);let r=e&&e[Yn.symbols.any];if(r)return _t(n.legacy||r.version===Yn.version,"Cannot mix different versions of joi schemas:",r.version,Yn.version),e;if(typeof e!="object"||!n.legacy)return Mi.schema(t,e,{appendPath:!0});let i=gr.walk(e);return i?i.compile(i.root,e):Mi.schema(t,e,{appendPath:!0})};gr.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=gr.walk(n);if(r)return r}return null}let e=t[Yn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};_t(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=gr.walk(t[n]);if(r)return r}return null};gr.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Mi.when=function(t,e,n){if(n===void 0&&(_t(e&&typeof e=="object","Missing options"),n=e,e=_a.create(".")),Array.isArray(n)&&(n={switch:n}),Yn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Yn.isSchema(e))return _t(n.is===void 0,'"is" can not be used with a schema condition'),_t(n.not===void 0,'"not" can not be used with a schema condition'),_t(n.switch===void 0,'"switch" can not be used with a schema condition'),gr.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(_t(_a.isRef(e)||typeof e=="string","Invalid condition:",e),_t(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return _t(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),_t(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!_a.isRef(n.is)&&!Yn.isSchema(n.is)&&(s=s.required()),gr.condition(t,{ref:Mi.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}_t(Array.isArray(n.switch),'"switch" must be an array'),_t(n.is===void 0,'Cannot combine "switch" with "is"'),_t(n.not===void 0,'Cannot combine "switch" with "not"'),_t(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Mi.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;Yn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),_t(s.is!==void 0,'Switch statement missing "is"'),_t(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!_a.isRef(s.is)&&!Yn.isSchema(s.is)&&(a.is=a.is.required()),o){_t(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(_t(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};gr.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var uv=f(SP=>{"use strict";var Ts=Ce(),iF=bn(),vP=et(),sF=ya(),oi={};SP.type=function(t,e){let n=Object.getPrototypeOf(t),r=iF(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=sF.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let p in s.terms){let h=s.terms[p];Ts(i.$_terms[p]===void 0,"Invalid term override for",s.type,p),i.$_terms[p]=h.init,a[p]=h}s.terms=a,s.args||(s.args=o.args),s.prepare=oi.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=oi.coerce(s.coerce,o.coerce),s.validate=oi.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let p in s.rules){let h=s.rules[p];Ts(typeof h=="object","Invalid rule definition for",s.type,p);let m=h.method;if(m===void 0&&(m=function(){return this.$_addRule(p)}),m&&(Ts(!r[p],"Rule conflict in",s.type,p),r[p]=m),Ts(!u[p],"Rule conflict in",s.type,p),u[p]=h,h.alias){let b=[].concat(h.alias);for(let v of b)r[v]=h.method}h.args&&(h.argsByName=new Map,h.args=h.args.map(b=>(typeof b=="string"&&(b={name:b}),Ts(!h.argsByName.has(b.name),"Duplicated argument name",b.name),vP.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),h.argsByName.set(b.name,b),b)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let p in s.modifiers){Ts(!r[p],"Rule conflict in",s.type,p);let h=s.modifiers[p];Ts(typeof h=="function","Invalid modifier definition for",s.type,p);let m=function(b){return this.rule({[p]:b})};r[p]=m,c[p]=h}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let p in s.overrides)Ts(n[p],"Cannot override missing",p),s.overrides[p][vP.symbols.parent]=n[p],i.$_super[p]=n[p].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=oi.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=oi.rebuild(s.rebuild,o.rebuild),i};oi.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};oi.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};oi.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};oi.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};oi.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var pv=f(lv=>{"use strict";var ai=Ce(),Yh=bn(),ro=et(),oF=ya(),TP=Ci(),aF=Ss(),cv,_n={};lv.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=_n.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=Yh(t._preferences,{shallow:["messages"]}),delete n.preferences[ro.symbols.prefs],n.preferences.messages&&(n.preferences.messages=oF.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=_n.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=_n.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;ai(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(ro.isValues(i)){n[r]=i.describe();continue}ai(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(_n.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){ai(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return _n.validate(t.$_root,n),n};_n.describe=function(t,e={}){if(Array.isArray(t))return t.map(_n.describe);if(t===ro.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return Yh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[ro.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=_n.describe(i,{assign:r}))}return n};lv.build=function(t,e){return new _n.Builder(t).parse(e)};_n.Builder=class{constructor(t){this.joi=t}parse(t){_n.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;ai(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){ai(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){ai(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else ai(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;ai(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return Yh(t);if(e.assign==="regex")return _n.regex(t);if(e.assign==="ref")return TP.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return ai(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[ro.symbols.literal]:!0,literal:t.function};if(t.override)return ro.symbols.override;if(t.ref)return TP.build(t.ref);if(t.regex)return _n.regex(t.regex);if(t.special)return ai(["deep"].includes(t.special),"Unknown special value",t.special),ro.symbols.deepDefault;if(t.value)return Yh(t.value)}if(t.type)return this.parse(t);if(t.template)return aF.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};_n.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};_n.validate=function(t,e){cv=cv||Hh(),t.assert(e,cv.description)}});var rc=f((d9,wP)=>{"use strict";var ui=nv(),pn={mismatched:null};wP.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!pn.isDeepEqual(t,e,n,[])};pn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=pn.getSharedType(t,e,!!n.prototype);switch(s){case ui.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case ui.promise:return t===e;case ui.regex:return t.toString()===e.toString();case pn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new pn.SeenEntry(t,e));try{return!!pn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};pn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?pn.mismatched:ui.getInternalProto(t);let r=ui.getInternalProto(t);return r!==ui.getInternalProto(e)?pn.mismatched:r};pn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};pn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};pn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};pn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=pn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===ui.array)if(r.part){for(let b of e)for(let v of n)if(s(b,v,r,i))return!0}else{if(e.length!==n.length)return!1;for(let b=0;b<e.length;++b)if(!s(e[b],n[b],r,i))return!1;return!0}else if(t===ui.set){if(e.size!==n.size)return!1;if(!pn.isSetSimpleEqual(e,n)){let b=new Set(Set.prototype.values.call(n));for(let v of Set.prototype.values.call(e)){if(b.delete(v))continue;let D=!1;for(let A of b)if(s(v,A,r,i)){b.delete(A),D=!0;break}if(!D)return!1}}}else if(t===ui.map){if(e.size!==n.size)return!1;for(let[b,v]of Map.prototype.entries.call(e))if(v===void 0&&!Map.prototype.has.call(n,b)||!s(v,Map.prototype.get.call(n,b),r,i))return!1}else if(t===ui.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),p=o(n);if((e!==l||n!==p)&&!s(l,p,r,i))return!1;let h=u(e);if(!r.part&&h.length!==u(n).length&&!r.skip)return!1;let m=0;for(let b of h){if(r.skip&&r.skip.includes(b)){n[b]===void 0&&++m;continue}if(!a(n,b)||!s(e[b],n[b],r,i))return!1}if(!r.part&&h.length-m!==u(n).length)return!1;if(r.symbols!==!1){let b=c(e),v=new Set(c(n));for(let D of b){if(!r.skip||!r.skip.includes(D)){if(a(e,D)){if(!a(n,D)||!s(e[D],n[D],r,i))return!1}else if(a(n,D))return!1}v.delete(D)}for(let D of v)if(a(n,D))return!1}return!0};pn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var EP=f(xP=>{"use strict";xP.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var dv=f(hv=>{"use strict";var kP=rc(),AP=EP(),uF=Ii(),hn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};hv.setup=function(t){let e=function(){return t._tracer=t._tracer||new hn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};hv.location=function(t){return t.$_setFlag("_tracerLocation",AP.location(2))};hn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new hn.Store(t),{filename:r,line:i}=t._flags._tracerLocation||AP.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(hn.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let p=a[`_${l}s`];if(!p)continue;let h=new Set(p._values),m=new Set(p._refs);for(let{value:b,ref:v}of u[l])h.delete(b),m.delete(v);(h.size||m.size)&&s.push({status:[...h,...[...m].map(b=>b.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let p=hn.labels[u.rule[l]||0];if(p){let h={rule:l,status:p};u.paths.size&&(h.paths=[...u.paths]),s.push(h)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(hn.message).join(", ")}`})}return e.length?e:null}};hn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){hn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){hn.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){hn.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=hn.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||kP(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=hn.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};hn.message=function(t){return`${t.paths?uF.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};hn.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};hn.sub=function(t,e){for(let n of t)for(let r of e)if(kP(n.slice(0,r.length),r))return!0;return!1};hn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Jh=f((_9,RP)=>{"use strict";var fv=Ce(),PP=bn(),cF=rv(),OP={};RP.exports=OP.merge=function(t,e,n){if(fv(t&&typeof t=="object","Invalid target value: must be an object"),fv(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){fv(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(PP(e[i],{symbols:n.symbols}));return t}let r=cF.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=PP(o,{symbols:n.symbols}):OP.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var DP=f(Qh=>{"use strict";var Li=Ce(),gv=et(),lF=Ci(),ci={};Qh.Ids=ci.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new ci.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())Li(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Li(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};Li(gv.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:ci.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);Li(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!gv.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);Li(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Li(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Li(!this._byKey.has(e),"Schema already contains key:",e),Li(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);Li(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};ci.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Qh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Qh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=ci.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=ci.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=ci.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};ci.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=ci.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&gv.isSchema(t)||n.ref!==!1&&lF.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=ci.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var CP=f((T9,IP)=>{"use strict";IP.exports=function(){}});var NP=f((w9,LP)=>{"use strict";var pF=bn(),MP=Zs(),hF=et(),li={value:Symbol("value")};LP.exports=li.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new li.State(t,e,this);return n&&r.schemas&&(r.schemas=[li.schemas(n),...r.schemas]),r}nest(t,e){let n=new li.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[li.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new li.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=pF(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};li.schemas=function(t){return hF.isSchema(t)?{schema:t}:t};li.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[li.value]=e}get(t){let e=this.node(t);if(e)return e[li.value]}node(t){if(this._values)return MP(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=MP(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var jP=f(sc=>{"use strict";var ic=Ce(),qP=bn(),va=CP(),dF=Zs(),Nt=et(),ws=Ii(),fF=NP(),ve={result:Symbol("result")};sc.entry=function(t,e,n){let r=Nt.defaults;n&&(ic(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),ic(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Nt.preferences(Nt.defaults,n));let i=ve.entry(t,e,r);ic(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=ws.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};sc.entryAsync=async function(t,e,n){let r=Nt.defaults;n&&(r=Nt.preferences(Nt.defaults,n));let i=ve.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,p=c.schema.type==="link"?s.links.get(c.schema):null,h=a,m,b,v=l.length?[a]:[],D=l.length?dF(t,l):t;if(l.length){m=l[l.length-1];let A=a;for(let T of l.slice(0,-1))A=A[T],v.unshift(A);b=v[0],h=b[m]}try{let A=(w,_)=>(p||c.schema).$_createError(w,h,_,c.state,r),T=await c.method(h,{schema:c.schema,linked:p,state:c.state,prefs:n,original:D,error:A,errorsArray:ve.errorsArray,warn:(w,_)=>s.warnings.push((p||c.schema).$_createError(w,h,_,c.state,r)),message:(w,_)=>(p||c.schema).$_createError("external",h,_,c.state,r,{messages:w})});if(T===void 0||T===h)continue;if(T instanceof ws.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(T),r.abortEarly)break;continue}if(Array.isArray(T)&&T[Nt.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...T),r.abortEarly)break;continue}b?(s.tracer.value(c.state,"rule",h,T,"external"),b[m]=T):(s.tracer.value(c.state,"rule",a,T,"external"),a=T)}catch(A){throw r.errors.label&&(A.message+=` (${c.label})`),A}}if(i.value=a,u.length)throw i.error=ws.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=ws.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ve.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};ve.entry=function(t,e,n){let{tracer:r,cleanup:i}=ve.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ve.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new fF([],[],{mainstay:a,schemas:u}),l=sc.validate(t,e,c,n);i&&e.$_root.untrace();let p=ws.process(l.errors,t,n);return{value:l.value,error:p,mainstay:a}};ve.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(ic(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ve.ignore}};sc.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ve.prefs(e,r)),e._cache&&r.cache){let p=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!p),p)return p}let s=(p,h,m)=>e.$_createError(p,t,h,m||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ve.errorsArray,warn:(p,h,m)=>n.mainstay.warnings.push(s(p,h,m)),message:(p,h)=>e.$_createError("custom",t,h,n,r,{messages:p})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let p=a.prepare(t,o);if(p){if(n.mainstay.tracer.value(n,"prepare",t,p.value),p.errors)return ve.finalize(p.value,[].concat(p.errors),o);t=p.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let p=a.coerce.method(t,o);if(p){if(n.mainstay.tracer.value(n,"coerced",t,p.value),p.errors)return ve.finalize(p.value,[].concat(p.errors),o);t=p.value}}let u=e._flags.empty;u&&u.$_match(ve.trim(t,e),n.nest(u),Nt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return ve.finalize(t,null,o);if(c==="required")return ve.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Nt.symbols.deepDefault)return ve.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ve.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let p=e._valids.get(t,n,r,e._flags.insensitive);if(p)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,p.value),t=p.value),n.mainstay.tracer.filter(e,n,"valid",p),ve.finalize(t,null,o);if(e._flags.only){let h=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[h],o);l.push(h)}}if(e._invalids){let p=e._invalids.get(t,n,r,e._flags.insensitive);if(p){n.mainstay.tracer.filter(e,n,"invalid",p);let h=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[h],o);l.push(h)}}if(a.validate){let p=a.validate(t,o);if(p&&(n.mainstay.tracer.value(n,"base",t,p.value),t=p.value,p.errors)){if(!Array.isArray(p.errors))return l.push(p.errors),ve.finalize(t,l,o);if(p.errors.length)return l.push(...p.errors),ve.finalize(t,l,o)}}return e._rules.length?ve.rules(t,l,o):ve.finalize(t,l,o)};ve.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let p of o._resolve){let h=a.argsByName.get(p),m=c[p].resolve(t,i,s),b=h.normalize?h.normalize(m):m,v=Nt.validateArg(b,null,h);if(v){u=r.$_createError("any.ref",m,{arg:p,ref:c[p],reason:v},i,s);break}c[p]=b}}u=u||a.validate(t,n,c,o);let l=ve.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return ve.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return ve.finalize(t,e,n)};ve.rule=function(t,e){return t instanceof ws.Report?(ve.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Nt.symbols.errors]?(t.forEach(n=>ve.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ve.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ve.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ve.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)ic(a instanceof Error||a instanceof ws.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ve.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:ws.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};ve.prefs=function(t,e){let n=e===Nt.defaults;return n&&t._preferences[Nt.symbols.prefs]?t._preferences[Nt.symbols.prefs]:(e=Nt.preferences(e,t._preferences),n&&(t._preferences[Nt.symbols.prefs]=e),e)};ve.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[qP(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[Nt.symbols.literal]?a.literal:Nt.isResolvable(a)?a.resolve(e,s,o):qP(a)};ve.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ve.ignore={active:!1,debug:va,entry:va,filter:va,log:va,resolve:va,value:va};ve.errorsArray=function(){let t=[];return t[Nt.symbols.errors]=!0,t}});var yv=f((P9,BP)=>{"use strict";var gF=Ce(),FP=rc(),mv=et(),Ni={};BP.exports=Ni.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Ni.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(mv.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new Ni.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(mv.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if(FP(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if(FP(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new Ni.Values(this._values,this._refs);return t._override=this._override,t}concat(t){gF(!t._override,"Cannot concat override set of values");let e=new Ni.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};Ni.Values.prototype[mv.symbols.values]=!0;Ni.Values.prototype.slice=Ni.Values.prototype.clone;Ni.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var zP=f((R9,VP)=>{"use strict";var Q=Ce(),$P=bn(),UP=rc(),bv=Jh(),mF=av(),At=et(),_v=no(),yF=Ii(),bF=uv(),KP=pv(),_F=ya(),WP=DP(),GP=Ci(),HP=dv(),Zh=jP(),ed=yv(),Wt={};Wt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new WP.Ids,this._preferences=null,this._refs=new GP.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return Q(typeof KP.describe=="function","Manifest functionality disabled"),KP.describe(this)}allow(...t){return At.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Q(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Q(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];Q(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return Q(t!==void 0,"Artifact cannot be undefined"),Q(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Q(t===!1||typeof t=="string","Invalid to value"),Q(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return Q(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return Q(t,"Missing error"),Q(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Q(t!==void 0,"Missing example"),At.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Q(!e,"Cannot combine options with description"),e=t.description,t=t.method),Q(typeof t=="function","Method must be a function"),Q(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(Q(typeof t=="string","id must be a non-empty string"),Q(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return Q(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Q(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Q(t.length,"Missing notes");for(let e of t)Q(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Q(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Q(t,"Missing preferences"),Q(t.context===void 0,"Cannot override context"),Q(t.externals===void 0,"Cannot override externals"),Q(t.warnings===void 0,"Cannot override warnings"),Q(t.debug===void 0,"Cannot override debug"),At.checkPreferences(t);let e=this.clone();return e._preferences=At.preferences(e._preferences,t),e}presence(t){return Q(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return Q(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=At.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Q(t.length,"Missing tags");for(let e of t)Q(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Q(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){At.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=_v.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Q(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Q(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){Q(!this._inRuleset(),"Cannot set caching inside a ruleset"),Q(!this._cache,"Cannot override schema cache"),Q(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||mF.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Q(At.isSchema(t),"Invalid schema object"),Q(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Q(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Q(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,GP.toSibling),e._preferences=e._preferences?At.preferences(e._preferences,t._preferences):t._preferences,e._valids=ed.merge(e._valids,t._valids,t._invalids),e._invalids=ed.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,bv(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,bv(e._flags,n)}else bv(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return Q(!t.base,"Cannot extend type with another base"),bF.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Q(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;At.assertOptions(t,Object.keys(e.modifiers)),Q(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;Q(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=$P(s);for(let a in t)e.modifiers[a](o,t[a]),Q(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){Q(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),Q(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),Q(At.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return HP.location?HP.location(this):this}validate(t,e){return Zh.entry(t,this,e)}validateAsync(t,e){return Zh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Q(t&&typeof t=="object","Invalid options"),Q(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Q(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;Q(n,"Unknown rule",e.method);let i=this.clone();if(r){Q(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&At.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=At.validateArg(o,s,a);Q(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return _v.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?_F.merge(this._definition.messages,s.messages):this._definition.messages;return new yF.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!Zh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return At.assertOptions(t,["each","once","ref","schema"]),WP.schema(this,t)||this}$_mutateRebuild(){Q(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){Q(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(UP(e,r.default)&&(e=void 0),UP(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][At.symbols.parent].call(this,...e)}$_validate(t,e,n){return Zh.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=$P(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return At.assertOptions(n,"literal"),Q(e!==void 0,"Missing",t,"value"),Q(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[At.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,p=i.length;for(let h=0;h<l.length;++h){let{is:m,then:b,otherwise:v}=l[h],D=`${a}${u.switch?"."+h:""}`;if(m.$_match(c,e.nest(m,`${D}.is`),n)){if(b){let A=e.localize([...e.path,`${D}.then`],e.ancestors,e.schemas),{schema:T,id:w}=b._generate(t,A,n);r.push(T),i.push(`${D}.then${w?`(${w})`:""}`);break}}else if(v){let A=e.localize([...e.path,`${D}.otherwise`],e.ancestors,e.schemas),{schema:T,id:w}=v._generate(t,A,n);r.push(T),i.push(`${D}.otherwise${w?`(${w})`:""}`);break}}if(u.break&&i.length>p)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){Q(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){At.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===At.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new ed:r&&(n[e]=t.length?new ed:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Q(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Q(i!==At.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Q(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Wt.Base.prototype[At.symbols.any]={version:At.version,compile:_v.compile,root:"$_root"};Wt.Base.prototype.isImmutable=!0;Wt.Base.prototype.deny=Wt.Base.prototype.invalid;Wt.Base.prototype.disallow=Wt.Base.prototype.invalid;Wt.Base.prototype.equal=Wt.Base.prototype.valid;Wt.Base.prototype.exist=Wt.Base.prototype.required;Wt.Base.prototype.not=Wt.Base.prototype.invalid;Wt.Base.prototype.options=Wt.Base.prototype.prefs;Wt.Base.prototype.preferences=Wt.Base.prototype.prefs;VP.exports=new Wt.Base});var mr=f((I9,XP)=>{"use strict";var td=Ce(),vF=zP(),SF=et(),TF=ya();XP.exports=vF.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return td(typeof t=="function","Method must be a function"),td(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){td(SF.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return td(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=TF.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var QP=f((C9,JP)=>{"use strict";var io=Ce(),wF=Jh(),xF=mr(),YP=et(),EF=no(),nd=Ii(),kF=Ci(),Sa={};JP.exports=xF.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:kF.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let p=n.$_terms.matches[l],h=i.nest(p.schema,`match.${l}`);h.snapshot();let m=p.schema.$_validate(t,h,s);m.errors?(u.push(m.errors),h.restore()):(a.push(m.value),h.commit())}if(a.length===0){let l={details:u.map(p=>nd.details(p,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(p=>nd.details(p,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(p=>p.schema.type==="object"||p.schema.type==="alternatives"&&c(p.schema));return c(n)?{value:a.reduce((l,p)=>wF(l,p,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let p=i.nest(u.schema,`match.${a}`);p.snapshot();let h=u.schema.$_validate(t,p,s);if(!h.errors)return p.commit(),h;p.restore(),o.push({schema:u.schema,reports:h.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let p=0;p<l.length;++p){let h=l[p],{is:m,then:b,otherwise:v}=h,D=`match.${a}${u.switch?"."+p:""}`;if(m.$_match(c,i.nest(m,`${D}.is`),s)){if(b)return b.$_validate(t,i.nest(b,`${D}.then`),s)}else if(v)return v.$_validate(t,i.nest(v,`${D}.otherwise`),s)}}return Sa.errors(o,e)},rules:{conditional:{method(t,e){io(!this._flags._endedSwitch,"Unreachable condition"),io(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),io(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=EF.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(io(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)io(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){io(t.length,"Missing alternative schemas"),YP.verifyFlat(t,"try"),io(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{YP.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});Sa.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return Sa.unmatched(t,e);let a=s[0];if(!(a instanceof nd.Report))return Sa.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:Sa.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Sa.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",nd.details(n,{override:!1}))}}});var eO=f((M9,ZP)=>{"use strict";var oc=Ce(),AF=rc(),PF=Zs(),OF=mr(),yr=et(),RF=no(),dt={};ZP.exports=OF.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return dt.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[yr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){yr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=yr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[yr.symbols.arraySingle];delete t[yr.symbols.arraySingle];let l=s(),p=t.length;for(let h=0;h<p;++h){let m=t[h],b=!1,v=!1,D=c?h:new Number(h),A=[...r.path,D];if(!e._flags.sparse&&m===void 0){if(l.push(n("array.sparse",{key:D,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly)return l;a.shift();continue}let T=[t,...r.ancestors];for(let O of e.$_terms._exclusions)if(O.$_match(m,r.localize(A,T,O),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:h,value:m},r.localize(A))),i.abortEarly)return l;b=!0,a.shift();break}if(b)continue;if(e.$_terms.ordered.length){if(a.length){let O=a.shift(),G=O.$_validate(m,r.localize(A,T,O),i);if(G.errors){if(l.push(...G.errors),i.abortEarly)return l}else if(O._flags.result==="strip")dt.fastSplice(t,h),--h,--p;else if(!e._flags.sparse&&G.value===void 0){if(l.push(n("array.sparse",{key:D,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly)return l;continue}else t[h]=G.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:h,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let w=[],_=o.length;for(let O=0;O<_;++O){let G=r.localize(A,T,o[O]);G.snapshot();let re=o[O].$_validate(m,G,i);if(w[O]=re,!re.errors){if(G.commit(),t[h]=re.value,v=!0,dt.fastSplice(o,O),--O,--_,!e._flags.sparse&&re.value===void 0&&(l.push(n("array.sparse",{key:D,path:A,pos:h,value:void 0},r.localize(A))),i.abortEarly))return l;break}G.restore()}if(v)continue;let N=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let O of u){let G,re=o.indexOf(O);if(re!==-1)G=w[re];else{let ae=r.localize(A,T,O);if(ae.snapshot(),G=O.$_validate(m,ae,i),!G.errors){ae.commit(),O._flags.result==="strip"?(dt.fastSplice(t,h),--h,--p):!e._flags.sparse&&G.value===void 0?(l.push(n("array.sparse",{key:D,path:A,pos:h,value:void 0},r.localize(A))),b=!0):t[h]=G.value,v=!0;break}ae.restore()}if(_===1){if(N){dt.fastSplice(t,h),--h,--p,v=!0;break}if(l.push(...G.errors),i.abortEarly)return l;b=!0;break}}if(!b&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!v){if(N){dt.fastSplice(t,h),--h,--p;continue}if(l.push(n("array.includes",{pos:h,value:m},r.localize(A))),i.abortEarly)return l}}return o.length&&dt.fillMissedErrors(e,l,o,t,r,i),a.length&&(dt.fillOrderedErrors(e,l,a,t,r,i),l.length||dt.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return yr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:yr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){yr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=yr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});dt.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return oc(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){yr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=RF.ref(t.by,{ancestor:0}),oc(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=dt.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){oc(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),yr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=yr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||AF,l=s.ignoreUndefined;for(let p=0;p<t.length;++p){let h=a?PF(t[p],a):t[p],m=o?u.custom:u[typeof h];if(oc(m,"Failed to find unique map container for type",typeof h),m instanceof Map){let b=m.entries(),v;for(;!(v=b.next()).done;)if(c(v.value[0],h)){let D=e.localize([...e.path,p],[t,...e.ancestors]),A={pos:p,value:t[p],dupePos:v.value[1],dupeValue:t[v.value[1]]};return a&&(A.path=i),n("array.unique",A,D)}m.set(h,p)}else{if((!l||h!==void 0)&&m[h]!==void 0){let b={pos:p,value:t[p],dupePos:m[h],dupeValue:t[m[h]]};a&&(b.path=i);let v=e.localize([...e.path,p],[t,...e.ancestors]);return n("array.unique",b,v)}m[h]=p}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)dt.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)dt.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});dt.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};dt.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&dt.fillMissedErrors(t,e,o,r,i,s)};dt.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};dt.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};dt.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(oc(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};dt.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let p=dt.compare(c,l,o,a);if(p!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),p=dt.compare(c,l,o,a),p!==null))return p;let h=typeof c;if(h!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(h!=="number"&&h!=="string")throw t.$_createError("array.sort.unsupported",e,{type:h},r,i);return h==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};dt.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var sO=f((L9,iO)=>{"use strict";var tO=Ce(),DF=mr(),nO=et(),rO=yv(),vv={};vv.isBool=function(t){return typeof t=="boolean"};iO.exports=DF.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){nO.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new rO;for(let n=0;n<t.length;++n){let r=t[n];tO(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){nO.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new rO;for(let n=0;n<t.length;++n){let r=t[n];tO(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:vv.isBool,to(t,e){return t?1:0}},string:{from:vv.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var cO=f((N9,uO)=>{"use strict";var oO=Ce(),IF=mr(),aO=et(),CF=Ss(),Br={};Br.isDate=function(t){return t instanceof Date};uO.exports=IF.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Br.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return aO.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:Br.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return oO(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return oO(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Br.isDate,to(t,e){return t.getTime()}},string:{from:Br.isDate,to(t,{prefs:e}){return CF.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});Br.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return aO.isIsoDate(t)?Br.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Br.date(1*t);if(e==="unix")return Br.date(1e3*t);if(typeof n=="string")return null}return Br.date(t)};Br.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var fO=f((q9,dO)=>{"use strict";var rd=Ce(),pO=bn(),hO=Jh(),lO=Zs(),id={};dO.exports=function(t,e,n={}){if(rd(t&&typeof t=="object","Invalid defaults value: must be an object"),rd(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),rd(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return id.applyToDefaultsWithShallow(t,e,n);let r=pO(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return hO(r,e,{nullOverride:i,mergeArrays:!1})};id.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;rd(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=lO(t,u);c&&typeof c=="object"?i.set(c,s&&lO(e,u)||c):s&&s.add(u)}let o=pO(t,{},i);if(!s)return o;for(let u of s)id.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return hO(o,e,{nullOverride:a,mergeArrays:!1})};id.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var yO=f(mO=>{"use strict";var so=Ce(),gO={};mO.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;so(!n.includes(i),`Item cannot come before itself: ${i}`),so(!n.includes("?"),"Item cannot come before unassociated items"),so(!r.includes(i),`Item cannot come after itself: ${i}`),so(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();so(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(gO.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return so(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return so(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,p=0;for(let h=0;h<l;++h)i[r[c][h]]&&++p;if(p===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};gO.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Tv=f((B9,vO)=>{"use strict";var MF=fO(),br=Ce(),bO=bn(),LF=yO(),NF=mr(),dn=et(),Sv=no(),qF=Ii(),_O=Ci(),sd=Ss(),le={renameDefaults:{alias:!1,multiple:!1,override:!1}};vO.exports=NF.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=le.clone(t,i);let s=[];if(e.$_terms.renames&&!le.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let p=r.localize([...r.path,c],a,u),h=u.schema.$_validate(l,p,i);if(h.errors){if(i.abortEarly)return{value:t,errors:h.errors};h.value!==void 0&&(t[c]=h.value),s.push(...h.errors)}else u.schema._flags.result==="strip"||h.value===void 0&&l!==void 0?delete t[c]:h.value!==void 0&&(t[c]=h.value)}}if(o.size||e._flags._hasPatternMatch){let a=le.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&le.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=le.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return dn.verifyFlat(t,"and"),le.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){sd.isTemplate(t)||(t=Sv.ref(t)),br(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=_O.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return br(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){br(t===void 0||typeof t=="object","Object schema must be a valid object"),br(!dn.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new le.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new le.Keys;for(let n in t)dn.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return dn.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:dn.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return dn.verifyFlat(t,"nand"),le.dependency(this,"nand",null,t)}},or:{method(...t){return dn.verifyFlat(t,"or"),le.dependency(this,"or",null,t)}},oxor:{method(...t){return le.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),br(e!==void 0,"Invalid rule"),dn.assertOptions(n,["fallthrough","matches"]),r&&br(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return _O.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){br(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),br(typeof e=="string"||e instanceof sd,"Invalid rename to argument"),br(e!==t,"Cannot rename key to same name:",t),dn.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)br(i.from!==t,"Cannot rename the same key multiple times");return e instanceof sd&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:MF(le.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return dn.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return le.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return le.dependency(this,"without",t,e,n)}},xor:{method(...t){return dn.verifyFlat(t,"xor"),le.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=dn.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new LF.Sorter;for(let n of t.$_terms.keys)dn.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new le.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=le.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});le.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return bO(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=bO(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};le.dependency=function(t,e,n,r,i){br(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),dn.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=dn.default(i.separator,"."),o=[];for(let u of r)br(typeof u=="string",e,"peers must be strings"),o.push(Sv.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Sv.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new le.Dependency(e,n,o,r,i)),a};le.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=le.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:le.keysToLabels(t,o),missing:s,missingWithLabels:le.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:le.keysToLabels(t,a),peers:u,peersWithLabels:le.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=le.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:le.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:le.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=le.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:le.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=le.keysToLabels(t,s),{code:"object.xor",context:a})}};le.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};le.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};le.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,p=c.to;if(p instanceof sd&&(p=p.render(e,n,r,c.match)),l!==p){if(!o.options.multiple&&s[p]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:p,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,p)&&!o.options.override&&!s[p]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:p,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[p]:e[p]=e[l],s[p]=!0,o.options.alias||delete e[l]}}}return!0};le.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let p=e[l],h=[...i.path,l];for(let m=0;m<t.$_terms.patterns.length;++m){let b=t.$_terms.patterns[m];if(b.regex){let A=b.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${m}`,A?"pass":"error"),!A)continue}else if(!b.schema.$_match(l,i.nest(b.schema,`pattern.${m}`),s))continue;n.delete(l);let v=i.localize(h,c,{schema:b.rule,key:l}),D=b.rule.$_validate(p,v,s);if(D.errors){if(s.abortEarly)return{value:e,errors:D.errors};r.push(...D.errors)}if(b.matches&&u[m].push(l),e[l]=D.value,!b.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let p=u[l];if(!p)continue;let h=t.$_terms.patterns[l].matches,m=i.localize(i.path,c,h),b=h.$_validate(p,m,s);if(b.errors){let v=qF.details(b.errors,{override:!1});v.matches=p;let D=t.$_createError("object.pattern.match",e,v,i,s);if(s.abortEarly)return{value:e,errors:D};r.push(D)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!dn.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};le.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};le.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var TO=f((K9,SO)=>{"use strict";var wv=Ce(),jF=Tv();SO.exports=jF.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return wv(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return wv(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return wv(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var xO=f((W9,wO)=>{"use strict";var qi=Ce(),FF=mr(),BF=et(),$F=no(),UF=Ii(),ji={};wO.exports=FF.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){qi(e.$_terms.link,"Uninitialized link schema");let i=ji.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return ji.generate(t,e,n,r)},rules:{ref:{method(t){qi(!this.$_terms.link,"Cannot reinitialize schema"),t=$F.ref(t),qi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),qi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){qi(this.$_terms.link,"Uninitialized link schema"),qi(BF.isSchema(t),"Invalid schema object"),qi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return qi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});ji.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=ji.perspective(s,n);ji.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{ji.assert(!1,"to non-existing schema",s,t,n,r)}return ji.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};ji.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};ji.assert=function(t,e,n,r,i,s){t||qi(!1,`"${UF.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var kO=f((G9,EO)=>{"use strict";var xv=Ce(),KF=mr(),Ev=et(),Jn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};EO.exports=KF.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(Jn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(Jn.extractSignificantDigits(t)!==Jn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==Jn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!Ev.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return Ev.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Ev.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?Jn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return Jn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return xv(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(Jn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return xv(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return xv(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});Jn.extractSignificantDigits=function(t){return t.replace(Jn.exponentialPartRegex,"").replace(Jn.dotRegex,"").replace(Jn.trailingZerosRegex,"").replace(Jn.leadingSignAndZerosRegex,"")};Jn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var PO=f((H9,AO)=>{"use strict";var WF=Tv();AO.exports=WF.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var kv=f(od=>{"use strict";od.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};od.code=function(t){return{code:t,error:od.codes[t]}}});var Av=f(ad=>{"use strict";var GF=require("url"),$r=kv(),xs={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:GF.URL||URL};ad.analyze=function(t,e={}){if(!t)return $r.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return $r.code("DOMAIN_TOO_LONG");if(!!xs.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return $r.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(xs.domainControlRx.test(t))return $r.code("DOMAIN_INVALID_CHARS");t=xs.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||xs.minDomainSegments,i=t.split(".");if(i.length<r)return $r.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return $r.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return $r.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return $r.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return $r.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!xs.domainSegmentRx.test(a))return $r.code("DOMAIN_INVALID_CHARS")}else if(!xs.tldSegmentRx.test(a))return $r.code("DOMAIN_INVALID_TLDS_CHARS")}return null};ad.isValid=function(t,e){return!ad.analyze(t,e)};xs.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new xs.URL(`http://${t}`).host}catch{return t}}});var OO=f(Pv=>{"use strict";var HF=require("util"),VF=Av(),pi=kv(),vn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(HF.TextEncoder||TextEncoder)};Pv.analyze=function(t,e){return vn.email(t,e)};Pv.isValid=function(t,e){return!vn.email(t,e)};vn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return pi.code("EMPTY_STRING");let n=!vn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return pi.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?pi.code("MULTIPLE_AT_CHAR"):pi.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return pi.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return pi.code("ADDRESS_TOO_LONG");if(vn.encoder.encode(i).length>64)return pi.code("LOCAL_TOO_LONG")}return vn.local(i,n)||VF.analyze(s,e)};vn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return pi.code("EMPTY_LOCAL_SEGMENT");if(e){if(!vn.atextRx.test(r))return pi.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(vn.atextRx.test(i))continue;let s=vn.binary(i);if(!vn.atomRx.test(s))return pi.code("INVALID_LOCAL_CHARS")}}};vn.binary=function(t){return Array.from(vn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};vn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;vn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var Ov=f((Y9,RO)=>{"use strict";RO.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Dv=f(Rv=>{"use strict";var ud=Ce(),zF=Ov(),en={};en.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",p="(?:"+c+":){6}"+l,h="::(?:"+c+":){5}"+l,m="(?:"+c+")?::(?:"+c+":){4}"+l,b="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,v="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,D="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,A="(?:(?:"+c+":){0,4}"+c+")?::"+l,T="(?:(?:"+c+":){0,5}"+c+")?::"+c,w="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+p+"|"+h+"|"+m+"|"+b+"|"+v+"|"+D+"|"+A+"|"+T+"|"+w+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let _="["+r+s+i+":]*",N="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",O="["+r+s+i+"]{1,255}",G="(?:"+N+"|"+t.ipv4address+"|"+O+")",re="\\d*",ae="(?:"+_+"@)?"+G+"(?::"+re+")?",K="(?:"+_+"@)?("+G+")(?::"+re+")?",P=a+"*",M=a+"+",L="["+r+s+i+"@]+",F="",he="(?:\\/"+P+")*",ce="\\/(?:"+M+he+")?",$t=M+he,Et=L+he,je="(?:\\/\\/\\/"+P+he+")";return t.hierPart="(?:(?:\\/\\/"+ae+he+")|"+ce+"|"+$t+"|"+je+")",t.hierPartCapture="(?:(?:\\/\\/"+K+he+")|"+ce+"|"+$t+")",t.relativeRef="(?:(?:\\/\\/"+ae+he+")|"+ce+"|"+Et+"|"+F+")",t.relativeRefCapture="(?:(?:\\/\\/"+K+he+")|"+ce+"|"+Et+"|"+F+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};en.rfc3986=en.generate();Rv.ip={v4Cidr:en.rfc3986.ipv4Cidr,v6Cidr:en.rfc3986.ipv6Cidr,ipv4:en.rfc3986.ipv4address,ipv6:en.rfc3986.ipv6address,ipvfuture:en.rfc3986.ipvFuture};en.createRegex=function(t){let e=en.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return en.wrap(i+r);let s="";if(t.scheme){ud(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);ud(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let p=0;p<c.length;++p){let h=c[p];ud(h instanceof RegExp||typeof h=="string","scheme at position "+p+" must be a RegExp or String"),h instanceof RegExp?l.push(h.source.toString()):(ud(e.schemeRegex.test(h),"scheme at position "+p+" must be a valid scheme"),l.push(zF(h)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return en.wrap(u+r,s)};en.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};en.uriRegex=en.createRegex({});Rv.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?en.createRegex(t):en.uriRegex}});var IO=f(DO=>{"use strict";var Ta=Ce(),ac=Dv();DO.regex=function(t={}){Ta(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Ta(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Ta(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),Ta(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Ta(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Ta(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return ac.ip[o];let a=`\\/${o==="ipv4"?ac.ip.v4Cidr:ac.ip.v6Cidr}`;return e==="required"?`${ac.ip[o]}${a}`:`${ac.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var LO=f((Z9,MO)=>{"use strict";var CO={};CO.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];MO.exports=new Set(CO.tlds.map(t=>t.toLowerCase()))});var BO=f((eX,FO)=>{"use strict";var Be=Ce(),cd=Av(),XF=OO(),jO=IO(),NO=Ov(),qO=LO(),YF=Dv(),JF=mr(),Sn=et(),Re={tlds:qO instanceof Set?{tlds:{allow:qO,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:jO.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};FO.exports=JF.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=Re.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(Sn.isResolvable(c)&&(c=c.resolve(t,n,r),!Sn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return Sn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Be(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Re.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Be(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return Sn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Be(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Re.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Re.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&Sn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Re.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return cd.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){Sn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Be(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Re.addressOptions(t),n=new RegExp(`\\s*[${t.separator?NO(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)XF.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){Sn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Be(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];Be(typeof a=="string","version at position "+o+" must be a string");let u=Re.guidVersions[a.toLowerCase()];Be(u,"version at position "+o+" must be one of "+Object.keys(Re.guidVersions).join(", ")),Be(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Be(Re.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||Re.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return Sn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Be(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Be(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?Re.hexRegex.withOptionalPrefix:n.prefix===!0?Re.hexRegex.withPrefix:Re.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return cd.isValid(t,{minDomainSegments:1})||Re.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){Sn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=jO.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return Re.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Re.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Re.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return Sn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:Sn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Re.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Re.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Be(Re.normalizationForms.includes(t),"normalization form must be one of "+Re.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){Be(t instanceof RegExp,"regex must be a RegExp"),Be(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),Sn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(NO(t),"g")),Be(t instanceof RegExp,"pattern must be a RegExp"),Be(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return Be(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){Sn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&Sn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=YF.regex(t),r=t.domain?Re.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!cd.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});Re.addressOptions=function(t){if(!t)return Re.tlds||t;if(Be(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Be(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return Be(Re.tlds,"Built-in TLD list disabled"),Object.assign({},t,Re.tlds);Be(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),Be(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Be(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Re.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Be(Re.tlds,"Built-in TLD list disabled"),Object.assign({},t,Re.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Be(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Re.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Re.validateTlds=function(t,e){for(let n of t)Be(cd.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Re.isoDate=function(t){if(!Sn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Re.length=function(t,e,n,r,i){return Be(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var UO=f((tX,$O)=>{"use strict";var ld=Ce(),QF=mr(),Iv={};Iv.Map=class extends Map{slice(){return new Iv.Map(this)}};$O.exports=QF.extend({type:"symbol",terms:{map:{init:new Iv.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),ld(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){ld(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;ld(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),ld(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var GO=f((rX,WO)=>{"use strict";var ZF=Ce(),eB=mr(),KO=et();WO.exports=eB.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return ZF(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return KO.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:KO.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var Vh=f((iX,XO)=>{"use strict";var ao=Ce(),tB=bn(),nB=av(),oo=et(),rB=no(),Mv=Ii(),iB=uv(),HO=pv(),Cv=Ci(),VO=Ss(),zO=dv(),pd,qt={types:{alternatives:QP(),any:mr(),array:eO(),boolean:sO(),date:cO(),function:TO(),link:xO(),number:kO(),object:PO(),string:BO(),symbol:UO()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(qt.types.binary=GO());qt.root=function(){let t={_types:new Set(Object.keys(qt.types))};for(let e of t._types)t[e]=function(...n){return ao(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),qt.generate(this,qt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,qt.methods);for(let e in qt.aliases){let n=qt.aliases[e];t[e]=t[n]}return t.x=t.expression,zO.setup&&zO.setup(t),t};qt.methods={ValidationError:Mv.ValidationError,version:oo.version,cache:nB.provider,assert(t,e,...n){qt.assert(t,e,!0,n)},attempt(t,e,...n){return qt.assert(t,e,!1,n)},build(t){return ao(typeof HO.build=="function","Manifest functionality disabled"),HO.build(this,t)},checkPreferences(t){oo.checkPreferences(t)},compile(t,e){return rB.compile(this,t,e)},defaults(t){ao(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());ao(oo.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return qt.generate(this,r,i)}}return e},expression(...t){return new VO(...t)},extend(...t){oo.verifyFlat(t,"extend"),pd=pd||Hh(),ao(t.length,"You need to provide at least one extension"),this.assert(t,pd.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,pd.extension);let r=qt.expandExtension(n,e);for(let i of r){ao(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=iB.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return qt.generate(this,o,a)}}}return e},isError:Mv.ValidationError.isError,isExpression:VO.isTemplate,isRef:Cv.isRef,isSchema:oo.isSchema,in(...t){return Cv.in(...t)},override:oo.symbols.override,ref(...t){return Cv.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in qt.aliases)t[e]=this[e]();return t}};qt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,oo.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof Mv.ValidationError||(a=tB(a)),a.message=i?`${i} ${u}`:u,a};qt.generate=function(t,e,n){return ao(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};qt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};XO.exports=qt.root()});var YO=f(Se=>{"use strict";var sB=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.descriptionContainerSchema=Se.signatureSchema=Se.signatureDefinitionContainerSchema=Se.signatureDefinitionSchema=Se.signatureDefinitionFunctionSchema=Se.signatureDefinitionFunctionSchemaArg=Se.signatureDefinitionFunctionSchemaArgMultiTypes=Se.signatureDefinitionFunctionSchemaArgDefaultNumber=Se.signatureDefinitionFunctionSchemaArgDefaultString=Se.signatureDefinitionTypeSchema=Se.variationsSchema=void 0;var te=sB(Vh()),hd=Ri();Se.variationsSchema=te.default.array().items(te.default.alternatives(te.default.string(),te.default.number()));Se.signatureDefinitionTypeSchema=te.default.alternatives(te.default.string(),te.default.object({type:te.default.string().required(),keyType:te.default.link("#SignatureDefinitionTypeSchema").optional(),valueType:te.default.link("#SignatureDefinitionTypeSchema").optional()})).id("SignatureDefinitionTypeSchema");Se.signatureDefinitionFunctionSchemaArgDefaultString=te.default.object({type:te.default.string().valid(hd.SignatureDefinitionBaseType.String).required(),value:te.default.string().allow("").required()});Se.signatureDefinitionFunctionSchemaArgDefaultNumber=te.default.object({type:te.default.string().valid(hd.SignatureDefinitionBaseType.Number).required(),value:te.default.number().required()});Se.signatureDefinitionFunctionSchemaArgMultiTypes=te.default.object({label:te.default.string().required(),types:te.default.array().items(Se.signatureDefinitionTypeSchema).required(),opt:te.default.boolean().optional(),default:te.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchemaArg=te.default.object({label:te.default.string().required(),type:Se.signatureDefinitionTypeSchema.required(),opt:te.default.boolean().optional(),default:te.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchema=te.default.object({id:te.default.string().required(),type:te.default.string().valid(hd.SignatureDefinitionBaseType.Function).required(),description:te.default.string().optional(),example:te.default.string().optional(),isProtected:te.default.boolean().optional(),arguments:te.default.array().items(te.default.alternatives(Se.signatureDefinitionFunctionSchemaArg,Se.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:te.default.array().items(Se.signatureDefinitionTypeSchema).required(),tags:te.default.array().items(te.default.string()).optional(),variations:Se.variationsSchema.optional(),returnVariations:Se.variationsSchema.optional()});Se.signatureDefinitionSchema=te.default.object({type:Se.signatureDefinitionTypeSchema.invalid(hd.SignatureDefinitionBaseType.Function).required(),description:te.default.string().optional(),example:te.default.string().optional(),isProtected:te.default.boolean().optional(),variations:Se.variationsSchema.optional(),tags:te.default.array().items(te.default.string()).optional()});Se.signatureDefinitionContainerSchema=te.default.object().pattern(te.default.string(),te.default.alternatives(Se.signatureDefinitionFunctionSchema,Se.signatureDefinitionSchema));Se.signatureSchema=te.default.object({type:te.default.string().required(),hidden:te.default.boolean().optional(),extends:te.default.string().optional(),definitions:te.default.object().required()});Se.descriptionContainerSchema=te.default.object({$meta:te.default.object({description:te.default.string().required(),example:te.default.array().items(te.default.string().allow("")).optional()}).optional()}).pattern(te.default.string(),te.default.object({description:te.default.string().required(),example:te.default.array().items(te.default.string().allow("")).optional()}))});var Fv=f(qn=>{"use strict";var wa=qn&&qn.__assign||function(){return wa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wa.apply(this,arguments)},oB=qn&&qn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Lv=qn&&qn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nv=qn&&qn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},aB=qn&&qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qn,"__esModule",{value:!0});qn.Signature=void 0;var qv=aB(Vh()),jv=YO(),uB=Ri(),cB=Kh(),lB=Gh(),pB=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e,n){var r,i;qv.default.assert(n,jv.signatureDefinitionContainerSchema);var s={};try{for(var o=Lv(Object.entries(n)),a=o.next();!a.done;a=o.next()){var u=Nv(a.value,2),c=u[0],l=u[1],p=l.type===uB.SignatureDefinitionBaseType.Function?lB.SignatureDefinitionFunction.parse(e,l):cB.SignatureDefinition.parse(e,l);s[c]=p}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},t.parseDescriptions=function(e){var n,r,i,s,o;qv.default.assert(e,jv.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=oB(e,["$meta"]);u=c,a=l}var p={};try{for(var h=Lv(Object.entries(a)),m=h.next();!m.done;m=h.next()){var b=Nv(m.value,2),v=b[0],D=b[1];p[v]={description:D.description,example:(i=D.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{m&&!m.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return wa({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},p)},t.parse=function(e,n){var r,i;qv.default.assert(e,jv.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.type,e.definitions);if(s.setDefinitions(o),n!=null)try{for(var a=Lv(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=Nv(u.value,2),l=c[0],p=c[1],h=t.parseDescriptions(p);s.addDescriptions(l,h)}}catch(m){r={error:m}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinitions=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];this._definitions[i]=e[i]}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r=this._descriptions[e];r==null&&(r={},this._descriptions[e]=r);for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s];r[o]=wa(wa({},r[o]),n[o])}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){for(var e={},n=Object.keys(this._definitions),r=0;r<n.length;r++){var i=n[r];e[i]=this._definitions[i].toJSON()}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:e}},t.prototype.copy=function(){for(var e=new t({type:this._type,hidden:this._hidden,extends:this._extends}),n={},r=Object.keys(this._definitions),i=0;i<r.length;i++){var s=r[i];n[s]=this._definitions[s].copy()}for(var o={},a=Object.keys(this._descriptions),i=0;i<a.length;i++){var s=a[i];o[s]=wa({},o[s])}return e._descriptions=o,e._definitions=n,e},t}();qn.Signature=pB});var JO=f(fi=>{"use strict";var _r=fi&&fi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},hi=fi&&fi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},Bv=fi&&fi.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fi,"__esModule",{value:!0});fi.Container=void 0;var di=Fv(),hB=Gh(),Pt=Ri(),dB=function(){function t(){this._primitives=new Map([[Pt.SignatureDefinitionBaseType.Any,new di.Signature({type:Pt.SignatureDefinitionBaseType.Any})],[Pt.SignatureDefinitionBaseType.General,new di.Signature({type:Pt.SignatureDefinitionBaseType.General})],[Pt.SignatureDefinitionBaseType.String,new di.Signature({type:Pt.SignatureDefinitionBaseType.String})],[Pt.SignatureDefinitionBaseType.Function,new di.Signature({type:Pt.SignatureDefinitionBaseType.Function})],[Pt.SignatureDefinitionBaseType.Number,new di.Signature({type:Pt.SignatureDefinitionBaseType.Number})],[Pt.SignatureDefinitionBaseType.List,new di.Signature({type:Pt.SignatureDefinitionBaseType.List})],[Pt.SignatureDefinitionBaseType.Map,new di.Signature({type:Pt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new di.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAvailableTags=function(){var e=this,n=hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).flatMap(function(r){var i=e.getTypeSignature(r);return Object.values(i.getDefinitions()).flatMap(function(s){return s.getTags()})});return Array.from(new Set(n))},t.prototype.getAllVisibleTypes=function(){var e=this;return hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==Pt.SignatureDefinitionBaseType.Any&&n!==Pt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return hi(hi([],_r(this.getAllPrimitiveSignatures()),!1),_r(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return hi(hi([],_r(this.getAllPrimitiveSignatures()),!1),_r(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=di.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){for(var r={},i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],a=di.Signature.parseDescriptions(n[o]);r[o]=a}return this.addMeta(e,r),this},t.prototype.addMeta=function(e,n){for(var r=Object.keys(n),i=0;i<r.length;i++){var s=r[i],o=this.getOrCreateTypeSignature(s);o.addDescriptions(e,n[s])}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(Pt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Bv(o),l=c.next();!l.done;l=c.next()){var p=l.value;if(!this._excludeFromSearch.has(p)){for(var h=p,m=this.getTypeSignature(p),b=null;m!==null&&!a.has(m.getType())&&(a.add(m.getType()),m.isHidden()||(b=m.getDefinition(n,r)),b===null);)h=m.getExtendedType(),m=this.getTypeSignature(h);b!==null&&u.set(h,b)}}}catch(v){i={error:v}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(Pt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(Pt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(Pt.SignatureDefinitionBaseType.Any)?s.get(Pt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.getDefinitionsById=function(e){var n=this;return hi(hi([],_r(this._primitives.keys()),!1),_r(this._types.keys()),!1).flatMap(function(r){var i=n.getTypeSignature(r);return Object.values(i.getDefinitions()).filter(function(s){return s instanceof hB.SignatureDefinitionFunction&&s.getId()===e})})},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=Bv(this._primitives),a=o.next();!a.done;a=o.next()){var u=_r(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(b){e={error:b}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var p=Bv(this._types),h=p.next();!h.done;h=p.next()){var m=_r(h.value,2),c=m[0],l=m[1];s._types.set(c,l.copy())}}catch(b){r={error:b}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();fi.Container=dB});var Ve=f(ut=>{"use strict";var fB=ut&&ut.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),QO=ut&&ut.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&fB(e,t,n)};Object.defineProperty(ut,"__esModule",{value:!0});ut.TypeParser=ut.VariationRegistry=ut.Container=ut.Signature=ut.SignatureDefinition=ut.SignatureDefinitionTypeMeta=ut.SignatureDefinitionFunction=ut.SignatureDefinitionFunctionArg=void 0;var gB=Z_();Object.defineProperty(ut,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return gB.SignatureDefinitionFunctionArg}});var mB=Gh();Object.defineProperty(ut,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return mB.SignatureDefinitionFunction}});var yB=Qu();Object.defineProperty(ut,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return yB.SignatureDefinitionTypeMeta}});var bB=Kh();Object.defineProperty(ut,"SignatureDefinition",{enumerable:!0,get:function(){return bB.SignatureDefinition}});var _B=Fv();Object.defineProperty(ut,"Signature",{enumerable:!0,get:function(){return _B.Signature}});var vB=JO();Object.defineProperty(ut,"Container",{enumerable:!0,get:function(){return vB.Container}});var SB=Uh();Object.defineProperty(ut,"VariationRegistry",{enumerable:!0,get:function(){return SB.VariationRegistry}});var TB=J_();Object.defineProperty(ut,"TypeParser",{enumerable:!0,get:function(){return TB.TypeParser}});QO(Y_(),ut);QO(Ri(),ut)});var Ur=f(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.CompletionItemKind=void 0;var wB;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(wB=uc.CompletionItemKind||(uc.CompletionItemKind={}))});var ft=f(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isUnknownType=ye.isUnionType=ye.isListType=ye.isFunctionType=ye.isClassType=ye.isMapType=ye.isValidKeyValue=ye.isKeyType=ye.isBaseType=ye.DEFAULT_SOURCE_DOCUMENT_ID=ye.TypeKind=ye.BASE_TYPE_SET=ye.META_DOCS_SIGNATURE_ORIGIN=ye.DEFAULT_SIGNATURE_ORIGIN=ye.ISA_PROPERTY=ye.UNKNOWN_TYPE_ID=ye.NIL_TYPE_ID=ye.MAX_TO_META_DEPTH=ye.MAX_ALL_PROPERTIES_DEPTH=ye.MAX_STRING_LENGTH=void 0;var xB=Ve();ye.MAX_STRING_LENGTH=10;ye.MAX_ALL_PROPERTIES_DEPTH=10;ye.MAX_TO_META_DEPTH=3;ye.NIL_TYPE_ID="null";ye.UNKNOWN_TYPE_ID="unknown";ye.ISA_PROPERTY="__isa";ye.DEFAULT_SIGNATURE_ORIGIN="custom";ye.META_DOCS_SIGNATURE_ORIGIN="metadocs";ye.BASE_TYPE_SET=new Set(Object.values(xB.SignatureDefinitionBaseType));var Fi;(function(t){t[t.Base=0]="Base",t[t.KeyType=1]="KeyType",t[t.MapType=2]="MapType",t[t.ClassType=3]="ClassType",t[t.FunctionType=4]="FunctionType",t[t.ListType=5]="ListType",t[t.UnionType=6]="UnionType",t[t.UnknownType=7]="UnknownType"})(Fi=ye.TypeKind||(ye.TypeKind={}));ye.DEFAULT_SOURCE_DOCUMENT_ID="unknown";function EB(t){return t.kind===Fi.Base}ye.isBaseType=EB;function ZO(t){return t.kind===Fi.KeyType}ye.isKeyType=ZO;function kB(t){return typeof t=="string"||ZO(t)}ye.isValidKeyValue=kB;function AB(t){return t.kind===Fi.MapType}ye.isMapType=AB;function PB(t){return t.kind===Fi.ClassType}ye.isClassType=PB;function OB(t){return t.kind===Fi.FunctionType}ye.isFunctionType=OB;function RB(t){return t.kind===Fi.ListType}ye.isListType=RB;function DB(t){return t.kind===Fi.UnionType}ye.isUnionType=DB;function IB(t){return t.kind===Fi.UnknownType}ye.isUnknownType=IB});var xa=f(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.MAX_DEPTH=void 0;dd.MAX_DEPTH=30});var Qn=f(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.EntityInfo=void 0;var $v=class{constructor(e,n){this.name=e,this.type=n}};fd.EntityInfo=$v});var Ea=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.simplifyForMeta=Es.persistTypeInNativeFunction=Es.createProxyForNativeType=void 0;var CB=ka(),eR=ft();function MB(t,e){return new CB.ClassType(t,null,t,e.typeStorage,e,e.globals)}Es.createProxyForNativeType=MB;function LB(t,e,n,r,i){let s=i.getTypeById(t);if(s==null)throw new Error(`Native type ${t} not found in global type storage.`);let o=s.getProperty(e);if(o==null)throw new Error(`Property ${e} not found in native type ${t}.`);if(!(0,eR.isFunctionType)(o.type))throw new Error(`Property ${e} in native type ${t} is not a function type.`);let a=o.type.copy(!1,!0,r.typeStorage);return a.returnType=n,a.isPersistent=!0,a}Es.persistTypeInNativeFunction=LB;function NB(t){if(!(0,eR.isUnionType)(t))return[t];let e=new Set,n=[];for(let r=0;r<t.variants.length;r++){let i=t.variants[r],s=i.getKeyType();s!=null&&(e.has(s)||(e.add(s),n.push(i)))}return n}Es.simplifyForMeta=NB});var md=f(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SourceMap=void 0;var qB=ft(),Uv=class t{static createTypeSourceMapKey(e,n,r){return`${e?.name||qB.DEFAULT_SOURCE_DOCUMENT_ID}||${n.line}:${n.character}||${r.line}:${r.character}`}static parseTypeSourceMapKey(e){let n=e.split("||");if(n.length!==3)throw new Error(`Invalid type source map key format: ${e}`);let[r,i,s]=n,[o,a]=i.split(":"),[u,c]=s.split(":");return{document:r,start:{line:Number(o),character:Number(a)},end:{line:Number(u),character:Number(c)}}}constructor(){this.map=new Map}get size(){return this.map.size}add(e,n){let r=t.createTypeSourceMapKey(e,n.start,n.end);return this.map.set(r,n),this}extend(e){for(let[n,r]of e.map.entries())this.map.set(n,r);return this}clear(){return this.map.clear(),this}getAllSources(){return Array.from(this.map.entries()).reduce((e,[n,r])=>(e.push({...t.parseTypeSourceMapKey(n),astRef:r}),e),[])}};gd.SourceMap=Uv});var Tn=f(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.Type=void 0;var tR=Ve(),Kv=ft(),jB=xa(),nR=md(),Wv=class t{static createBaseType(e,n,r,i,s){return new t(e,Kv.TypeKind.Base,e,n,r,i,s)}static simplify(e){let n=e.getKeyType()?.id||tR.SignatureDefinitionBaseType.Any;return new t(n,Kv.TypeKind.Base,n,e.typeStorage,e.document,e.scope,e.astRef)}constructor(e,n,r=null,i,s,o,a){this.id=e,this.kind=n,this.inheritFrom=r,this.typeStorage=i,this.document=s,this.scope=o,this.astRef=a,this.sourceMap=a?new nR.SourceMap().add(s,a):new nR.SourceMap}referenceEqualsTo(e){return this===e}equalsTo(e){return this.referenceEqualsTo(e)||this.id===e.id}getKeyType(){return this.typeStorage.getKeyType(this)}setProperty(e,n){}getProperty(e,n=1){return n>jB.MAX_DEPTH||typeof e!="string"||this.inheritFrom==null?void 0:this.typeStorage.getTypeById(this.inheritFrom)?.getProperty(e,n+1)}hasProperty(e){if(typeof e!="string")return;let n=this.typeStorage.getTypeById(this.inheritFrom);if(n!=null)return n.hasProperty(e)}containsOwnProperties(){return!1}getAllProperties(e=1){return e>Kv.MAX_ALL_PROPERTIES_DEPTH?[]:(this.inheritFrom?this.typeStorage.getTypeById(this.inheritFrom):null)?.getAllProperties(e+1)||[]}reset(e,n,r,i){return this.typeStorage=e||this.typeStorage,this.document=n||this.document,this.scope=r||this.scope,this.astRef=i||this.astRef,this.sourceMap.clear().add(this.document,this.astRef),this}invoke(e,n,r,i){return this}deepCopy(e,n,r,i,s,o){return this.copy(e,!0,n,r,i,s)}copy(e,n,r,i,s,o){let a=new t(this.id,this.kind,this.inheritFrom,r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){this.sourceMap.extend(e.sourceMap)}getSource(){return this.sourceMap.size===0?null:this.sourceMap.getAllSources()}addToSource(e){this.sourceMap.extend(e.sourceMap)}toMeta(e){return[{type:this.getKeyType()?.id||tR.SignatureDefinitionBaseType.Any}]}};yd.Type=Wv});var vr=f(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.UnionType=void 0;var rR=Ve(),Aa=ft(),FB=Ea(),BB=md(),$B=Qn(),iR=Tn(),Gv=class t extends iR.Type{static createDefault(e,n,r,i){return new t(e.generateId(Aa.TypeKind.UnionType,i),[],e,n,r,i)}static createSmartly(e,n,r,i,s){let o=new t(n.generateId(Aa.TypeKind.UnionType,s),e,n,r,i,s);return o.variants.length===0?iR.Type.createBaseType(rR.SignatureDefinitionBaseType.Any,n||o.typeStorage,r||o.document,i||o.scope):o.variants.length===1?o.firstVariant():o}constructor(e,n,r,i,s,o){super(e,Aa.TypeKind.UnionType,null,r,i,s,o),this.variants=n,this.uniquifyVariants()}uniquifyVariants(){let e=[],n=[...this.variants];for(;n.length>0;){let r=n.pop();if((0,Aa.isUnionType)(r)){this.addToSource(r),n.push(...r.variants);continue}let i=e.findIndex(s=>s.equalsTo(r));if(i!==-1){e[i].merge(r);continue}e.push(r)}this.variants.length=0,this.variants.push(...e)}firstVariant(){return this.variants.length>0?this.variants[0]:void 0}containsVariant(e){return this.variants.some(n=>n.equalsTo(e))}addVariant(e){if((0,Aa.isUnionType)(e)){this.addToSource(e),e.variants.forEach(r=>this.addVariant(r));return}let n=this.variants.findIndex(r=>r.equalsTo(e));if(n!==-1){this.variants[n].merge(e);return}this.variants.push(e)}setProperty(e,n){this.variants.forEach(r=>r.setProperty(e,n))}getProperty(e,n=1){let r=[];for(let i=0;i<this.variants.length;i++){let o=this.variants[i].getProperty(e,n+1);o&&r.push(o)}if(r.length!==0)return r.length===1?r[0]:new $B.EntityInfo(r[0].name,t.createSmartly(r.map(i=>i.type),this.typeStorage,this.document,this.scope,null))}getAllProperties(e=1){let n=new Map;for(let r=0;r<this.variants.length;r++){let s=this.variants[r].getAllProperties(e+1);for(let o=0;o<s.length;o++){let a=s[o];n.has(a.name)||n.set(a.name,a)}}return Array.from(n.values())}hasProperty(e){return this.variants.some(n=>n.hasProperty(e))}containsOwnProperties(){return this.variants.some(e=>e.containsOwnProperties())}invoke(e,n,r,i){return t.createSmartly(this.variants.map(s=>s.invoke(e||this.typeStorage,n||this.document,r||this.scope,i)),e||this.typeStorage,n||this.document,r||this.scope,i)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,[],n||this.typeStorage,r||this.document,i||this.scope,s);return o.set(this,u),this.variants.forEach(c=>{let l=c.deepCopy(e,n,r,i,null,o);u.variants.push(l)}),e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.variants.map(u=>u.copy(e,n,r||this.typeStorage,i||this.document,s||this.scope)),r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}getSource(){let e=new BB.SourceMap;return e.extend(this.sourceMap),this.variants.forEach(n=>e.extend(n.sourceMap)),e.size===0?null:e.getAllSources()}toMeta(e=1){return e>Aa.MAX_TO_META_DEPTH?[{type:rR.SignatureDefinitionBaseType.Any}]:(0,FB.simplifyForMeta)(this).flatMap(n=>n.toMeta(e+1))}};bd.UnionType=Gv});var uo=f(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.ListType=void 0;var cc=Ve(),Bi=ft(),UB=Ea(),KB=Qn(),Hv=Tn(),WB=vr(),Vv=class t extends Hv.Type{constructor(e,n,r,i,s,o){super(e,Bi.TypeKind.ListType,cc.SignatureDefinitionBaseType.List,r,i,s,o),this.elementType=n??Hv.Type.createBaseType(Bi.UNKNOWN_TYPE_ID,r,i,s)}referenceEqualsTo(e){return(0,Bi.isListType)(e)?this===e||this.id===e.id&&this.elementType.referenceEqualsTo(e.elementType):!1}equalsTo(e){return(0,Bi.isListType)(e)?this.referenceEqualsTo(e)||this.id===e.id&&this.elementType.equalsTo(e.elementType):!1}addElementType(e){if(e==null)return;let n=Hv.Type.simplify(e);if(this.elementType.id===Bi.UNKNOWN_TYPE_ID){this.elementType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.elementType))return;(0,Bi.isUnionType)(this.elementType)||(this.elementType=new WB.UnionType(this.typeStorage.generateId(Bi.TypeKind.UnionType),[this.elementType],this.typeStorage,this.document,this.scope,null)),this.elementType.addVariant(n)}getProperty(e,n=1){return typeof e!="string"&&e.id===cc.SignatureDefinitionBaseType.Number?new KB.EntityInfo(e.id,this.elementType):super.getProperty(e,n+1)}copy(e,n,r,i,s,o){let a=new t(this.id,this.elementType.copy(e,!0,r,i,s,o),r||this.typeStorage,i||this.document,s||this.scope,o);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){(0,Bi.isListType)(e)&&(this.addElementType(e.elementType),this.sourceMap.extend(e.sourceMap))}toMeta(e=1){return e>Bi.MAX_TO_META_DEPTH?[{type:cc.SignatureDefinitionBaseType.List,valueType:cc.SignatureDefinitionBaseType.Any}]:(0,UB.simplifyForMeta)(this.elementType).flatMap(r=>r.toMeta(e+1)).flatMap(r=>({type:cc.SignatureDefinitionBaseType.List,valueType:r}))}};_d.ListType=Vv});var gi=f(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.MapType=void 0;var $i=Ve(),zv=Ur(),Ot=ft(),GB=xa(),sR=Ea(),Xv=Qn(),Pa=Tn(),Yv=vr(),Jv=class t extends Pa.Type{static createDefault(e,n,r){return new t(e.generateId(Ot.TypeKind.MapType),null,null,e,n,r,null)}constructor(e,n,r,i,s,o,a,u,c=!1){super(e,Ot.TypeKind.MapType,$i.SignatureDefinitionBaseType.Map,i,s,o,u),this.properties=a||new Map,this.keyType=n??Pa.Type.createBaseType(Ot.UNKNOWN_TYPE_ID,i,s,o),this.valueType=r??Pa.Type.createBaseType(Ot.UNKNOWN_TYPE_ID,i,s,o),this.isScope=c}addKeyVariant(e){let n=typeof e=="string"?Pa.Type.createBaseType($i.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope):Pa.Type.simplify(e);if(this.keyType.id===Ot.UNKNOWN_TYPE_ID){this.keyType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.keyType))return;(0,Ot.isUnionType)(this.keyType)||(this.keyType=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[this.keyType],this.typeStorage,this.document,this.scope,null)),this.keyType.addVariant(n)}addValueVariant(e){if(e==null)return;let n=Pa.Type.simplify(e);if(this.valueType.id===Ot.UNKNOWN_TYPE_ID){this.valueType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.valueType))return;(0,Ot.isUnionType)(this.valueType)||(this.valueType=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[this.valueType],this.typeStorage,this.document,this.scope,null)),this.valueType.addVariant(n)}setPropertyInPath(e,n){if(e.length===0)return;let r=[...e],i=r.pop(),s=this,o=null;for(;r.length>0;){if(!s.containsOwnProperties())return;let a=r.shift();if(o=s,s=s.getProperty(a)?.type,s==null){let u=t.createDefault(this.typeStorage,this.document,this.scope);o.setProperty(a,new Xv.EntityInfo(a,u)),s=u}}s.setProperty(i,n)}getPropertyInPath(e){if(e.length===0)return;let n=[...e],r=this,i;for(;n.length>0;){let s=n.shift(),o=r.getProperty(s);if(o==null)return null;i=o,r=i.type}return i}setProperty(e,n){if(!(0,Ot.isValidKeyValue)(e))throw new Error(`Invalid key type: ${e}`);this.addKeyVariant(e),this.addValueVariant(n.type);let r=this.properties.get(e);if(r){(0,Ot.isUnknownType)(r.type)?(r.type.mergeIntoType(n.type),this.properties.set(e,n)):(0,Ot.isUnknownType)(n.type)?n.type.mergeIntoType(r.type):(0,Ot.isUnionType)(r.type)?r.type.addVariant(n.type):n.type.equalsTo(r.type)?r.type.addToSource(n.type):r.type=new Yv.UnionType(this.typeStorage.generateId(Ot.TypeKind.UnionType),[r.type,n.type],this.typeStorage,this.document,this.scope);return}this.properties.set(e,n)}getProperty(e,n=1){if(n>GB.MAX_DEPTH)return;let r=this.properties.get(e);if(r)return r;let i=this.properties.get(Ot.ISA_PROPERTY);if(i!=null){let o=i.type.getProperty(e,n+1);if(o)return o}return this.inheritFrom==null?void 0:this.typeStorage.getTypeById(this.inheritFrom)?.getProperty(e,n+1)}hasProperty(e){return this.properties.has(e)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>Ot.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map;for(let[i,s]of this.properties)typeof i=="string"&&(n.has(i)||n.set(i,{type:s.type,name:s.name,kind:(0,Ot.isFunctionType)(s.type)?zv.CompletionItemKind.Function:this.isScope?zv.CompletionItemKind.Variable:zv.CompletionItemKind.Property}));let r=this.properties.get(Ot.ISA_PROPERTY);if(r!=null)for(let i of r.type.getAllProperties(e+1))n.has(i.name)||n.set(i.name,i);if(this.inheritFrom){let i=this.typeStorage.getTypeById(this.inheritFrom);for(let s of i.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return Array.from(n.values())}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,this.keyType.copy(e,!0,n,r,i,s),this.valueType.copy(e,!0,n,r,i,s),n||this.typeStorage,r||this.document,i||this.scope,new Map,s,this.isScope);o.set(this,u);for(let[c,l]of this.properties)u.properties.set(c,new Xv.EntityInfo(l.name,l.type.deepCopy(e,n,r,i,null,o)));return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.keyType.copy(e,!0,r,i,s,o),this.valueType.copy(e,!0,r,i,s,o),r||this.typeStorage,i||this.document,s||this.scope,n?new Map(this.properties):this.properties,o,this.isScope);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){if((0,Ot.isMapType)(e)){for(let[n,r]of this.properties)this.properties.set(n,new Xv.EntityInfo(r.name,r.type));this.sourceMap.extend(e.sourceMap)}}toMeta(e=1){if(e>Ot.MAX_TO_META_DEPTH)return[{type:$i.SignatureDefinitionBaseType.Map,keyType:$i.SignatureDefinitionBaseType.Any,valueType:$i.SignatureDefinitionBaseType.Any}];let n=(0,sR.simplifyForMeta)(this.keyType).flatMap(i=>i.toMeta(e+1)),r=(0,sR.simplifyForMeta)(this.valueType).flatMap(i=>i.toMeta(e+1));return n.length+r.length>5?[{type:$i.SignatureDefinitionBaseType.Map,keyType:$i.SignatureDefinitionBaseType.Any,valueType:$i.SignatureDefinitionBaseType.Any}]:n.flatMap(i=>r.flatMap(s=>({type:$i.SignatureDefinitionBaseType.Map,keyType:i,valueType:s})))}};vd.MapType=Jv});var pc=f(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.UnknownType=void 0;var ks=Ve(),oR=Ur(),we=ft(),HB=xa(),VB=hc(),zB=uo(),XB=gi(),lc=Tn(),Qv=vr(),Zv=class t extends lc.Type{get assumedId(){switch(this.getKind()){case we.TypeKind.ListType:return ks.SignatureDefinitionBaseType.List;case we.TypeKind.MapType:return ks.SignatureDefinitionBaseType.Map;case we.TypeKind.FunctionType:return ks.SignatureDefinitionBaseType.Function;default:return ks.SignatureDefinitionBaseType.Any}}constructor(e,n,r,i){super(ks.SignatureDefinitionBaseType.Any,we.TypeKind.UnknownType,ks.SignatureDefinitionBaseType.Any,e,n,r,i),this.properties=null,this.keyType=null,this.valueType=null,this.signature=null}getKind(){return this.keyType!=null&&(0,we.isBaseType)(this.keyType)&&this.keyType.id===ks.SignatureDefinitionBaseType.Number&&this.valueType!=null?we.TypeKind.ListType:this.properties!=null&&this.properties.size>0||this.keyType!=null&&this.valueType!=null?we.TypeKind.MapType:this.signature!=null?we.TypeKind.FunctionType:we.TypeKind.Base}getKeyType(){return this.typeStorage.getKeyTypeById(this.assumedId)}assumeType(e,n,r){let i=this.getKind(),s=e||this.typeStorage,o=n||this.document,a=r||this.scope;switch(i){case we.TypeKind.ListType:return new zB.ListType(this.typeStorage.generateId(we.TypeKind.ListType),this.valueType,s,o,a);case we.TypeKind.MapType:return new XB.MapType(this.typeStorage.generateId(we.TypeKind.MapType),this.keyType,this.valueType,s,o,a,this.properties);case we.TypeKind.FunctionType:return new VB.FunctionType(this.typeStorage.generateId(we.TypeKind.FunctionType),this.signature,s,o,a);default:return lc.Type.createBaseType(this.assumedId,s,o,a)}}addKeyVariant(e){if(e==null)return;let n=lc.Type.simplify(e);if(this.keyType==null){this.keyType=n;return}if(this.keyType.id===we.UNKNOWN_TYPE_ID){this.keyType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.keyType))return;(0,we.isUnionType)(this.keyType)||(this.keyType=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[this.keyType],this.typeStorage,this.document,this.scope,null)),this.keyType.addVariant(n)}addValueVariant(e){if(e==null)return;let n=lc.Type.simplify(e);if(this.valueType==null){this.valueType=n;return}if(this.valueType.id===we.UNKNOWN_TYPE_ID){this.valueType=n.copy(!0,!0,this.typeStorage,this.document,this.scope);return}if(n.equalsTo(this.valueType))return;(0,we.isUnionType)(this.valueType)||(this.valueType=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[this.valueType],this.typeStorage,this.document,this.scope,null)),this.valueType.addVariant(n)}setProperty(e,n){let r=typeof e=="string"?lc.Type.createBaseType(ks.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope):e;if(this.addKeyVariant(r),this.addValueVariant(n.type),typeof e!="string")return;this.properties==null&&(this.properties=new Map);let i=this.properties.get(e);if(i){(0,we.isUnionType)(i.type)?i.type.addVariant(n.type):n.type.equalsTo(i.type)||(i.type=new Qv.UnionType(this.typeStorage.generateId(we.TypeKind.UnionType),[i.type,n.type],this.typeStorage,this.document,this.scope));return}this.properties.set(e,n)}getProperty(e,n=1){if(this.properties==null)return super.getProperty(e,n);if(n>HB.MAX_DEPTH||typeof e!="string")return;let r=this.properties.get(e);if(r)return r;let i=this.properties.get(we.ISA_PROPERTY);if(i!=null){let o=i.type.getProperty(e,n+1);if(o)return o}return this.typeStorage.getTypeById(this.assumedId)?.getProperty(e,n+1)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>we.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map,r=this.typeStorage.getTypeById(this.assumedId);if(r!=null){let i=r.getAllProperties(e+1);for(let s=0;s<i.length;s++){let o=i[s];n.has(o.name)||n.set(o.name,o)}}if(this.properties!=null){for(let[s,o]of this.properties)n.has(s)||n.set(s,{type:o.type,name:o.name,kind:(0,we.isFunctionType)(o.type)?oR.CompletionItemKind.Function:oR.CompletionItemKind.Property});let i=this.properties.get(we.ISA_PROPERTY);if(i!=null)for(let s of i.type.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return[...Array.from(n.values())]}mergeIntoType(e){if(e.addToSource(this),(0,we.isUnknownType)(e))e.merge(this);else if((0,we.isMapType)(e)){if(this.keyType!=null)if((0,we.isUnionType)(this.keyType))for(let n of this.keyType.variants){let r=n.getKeyType();r!=null&&e.addKeyVariant(r)}else{let n=this.keyType.getKeyType();n!=null&&e.addKeyVariant(n)}if(this.valueType!=null&&e.addValueVariant(this.valueType),this.properties!=null)for(let[n,r]of this.properties)e.setProperty(n,r)}else if((0,we.isListType)(e))this.valueType!=null&&e.addElementType(this.valueType);else if((0,we.isUnionType)(e))for(let n of e.variants)this.mergeIntoType(n)}merge(e){if((0,we.isUnknownType)(e)){if(e.keyType!=null&&this.addKeyVariant(e.keyType),e.valueType!=null&&this.addValueVariant(e.valueType),e.properties!=null){this.properties==null&&(this.properties=new Map);for(let[n,r]of e.properties)this.properties.set(n,r)}e.signature!=null&&(this.signature=e.signature)}else if((0,we.isMapType)(e)){this.addKeyVariant(e.keyType),this.addValueVariant(e.valueType),this.properties==null&&(this.properties=new Map);for(let[n,r]of e.properties)typeof n=="string"&&this.properties.set(n,r)}else if((0,we.isListType)(e))this.addValueVariant(e.elementType);else if((0,we.isUnionType)(e))for(let n of e.variants)this.merge(n);else(0,we.isFunctionType)(e)&&(this.signature=e.signature)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(n||this.typeStorage,r||this.document,i||this.scope,s);if(o.set(this,u),u.signature=this.signature,u.keyType=this.keyType?.copy(e,!0,n,r,i,s),u.valueType=this.valueType?.copy(e,!0,n,r,i,s),this.properties!=null){u.properties=new Map;for(let[c,l]of this.properties)u.properties.set(c,{name:l.name,type:l.type.deepCopy(e,n,r,i,null,o)})}return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n=!1,r,i,s,o){let a=new t(r||this.typeStorage,i||this.document,s||this.scope,o);return a.signature=this.signature,a.keyType=this.keyType?.copy(e,!0,r,i,s),a.valueType=this.valueType?.copy(e,!0,r,i,s),a.properties=this.properties!=null?n?new Map(this.properties):this.properties:null,e&&a.sourceMap.extend(this.sourceMap),a}toMeta(){return[{type:this.assumedId}]}};Sd.UnknownType=Zv});var Oa=f(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.determineTypeFromMeta=void 0;var Ui=Ve(),YB=uo(),JB=gi(),Td=Tn(),QB=pc(),wd=ft();function xd(t,e,n,r,i){switch(t.type){case Ui.SignatureDefinitionBaseType.List:{let s=t.valueType?xd(t.valueType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i);return new YB.ListType(e.generateId(wd.TypeKind.ListType,i),s,e,n,r,i)}case Ui.SignatureDefinitionBaseType.Map:{let s=t.keyType?xd(t.keyType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i),o=t.valueType?xd(t.valueType,e,n,r,i):Td.Type.createBaseType(Ui.SignatureDefinitionBaseType.Any,e,n,r,i);return new JB.MapType(e.generateId(wd.TypeKind.MapType,i),s,o,e,n,r,null,i)}case Ui.SignatureDefinitionBaseType.Any:case wd.UNKNOWN_TYPE_ID:return new QB.UnknownType(e,n,r,i);case wd.NIL_TYPE_ID:case Ui.SignatureDefinitionBaseType.Number:case Ui.SignatureDefinitionBaseType.String:case Ui.SignatureDefinitionBaseType.Function:default:return Td.Type.createBaseType(t.type,e,n,r,i)}}Ed.determineTypeFromMeta=xd});var hc=f(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.FunctionType=void 0;var aR=Ve(),eS=ft(),ZB=Oa(),e$=Tn(),t$=vr(),tS=class t extends e$.Type{constructor(e,n,r,i,s,o){super(e,eS.TypeKind.FunctionType,aR.SignatureDefinitionBaseType.Function,r,i,s,o),this.signature=n,this.returnType=null}getReturnType(e,n,r,i){if(this.returnType==null){let s=this.signature.getReturns().map(o=>(0,ZB.determineTypeFromMeta)(o,e||this.typeStorage,n||this.document,r||this.scope));return s.length===1?s[0]:new t$.UnionType(this.typeStorage.generateId(eS.TypeKind.UnionType,i),s,e||this.typeStorage,n||this.document,r||this.scope,null)}return this.returnType}equalsTo(e){return(0,eS.isFunctionType)(e)?e.signature.getId()===this.signature.getId():!1}invoke(e,n,r,i){let s=this.getReturnType(e,n,r,i);return this.isPersistent?s:s.copy(!1,!0,e,n,r)}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,this.signature,n||this.typeStorage,r||this.document,i||this.scope,s);return o.set(this,u),u.returnType=this.returnType?this.returnType.deepCopy(!1,n,r,i,null,o):null,e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.signature,r||this.typeStorage,i||this.document,s||this.scope,o);return a.returnType=this.returnType,e&&a.sourceMap.extend(this.sourceMap),a}toMeta(e){return[{type:aR.SignatureDefinitionBaseType.Function}]}};kd.FunctionType=tS});var ka=f(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.ClassType=void 0;var mi=Ve(),Ad=Ur(),Sr=ft(),n$=xa(),co=Qn(),r$=hc(),i$=uo(),s$=gi(),Ra=Tn(),nS=class t extends Ra.Type{constructor(e,n=null,r=null,i,s,o,a,u){super(e,Sr.TypeKind.ClassType,r,i,s,o,u),this.associatedMap=n,this.properties=a||new Map}insertDefinition(e,n){if(this.hasProperty(e))return;let r=n.getType();switch(r.type){case mi.SignatureDefinitionBaseType.Function:{let i=new r$.FunctionType(mi.SignatureDefinitionBaseType.Function,n,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.List:{let i=new i$.ListType(this.typeStorage.generateId(Sr.TypeKind.ListType),Ra.Type.createBaseType(r.valueType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.Map:{let i=new s$.MapType(this.typeStorage.generateId(Sr.TypeKind.MapType),Ra.Type.createBaseType(r.keyType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),Ra.Type.createBaseType(r.valueType.type??Sr.UNKNOWN_TYPE_ID,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope,null),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}case mi.SignatureDefinitionBaseType.Number:case mi.SignatureDefinitionBaseType.String:case mi.SignatureDefinitionBaseType.Any:{let i=Ra.Type.createBaseType(r.type??mi.SignatureDefinitionBaseType.Any,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}default:{let i=Ra.Type.createBaseType(r.type??mi.SignatureDefinitionBaseType.Any,this.typeStorage,this.document,this.scope),s=new co.EntityInfo(e,i);this.setProperty(e,s);break}}}insertSignature(e){let n=Object.keys(e.getDefinitions());for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i);this.insertDefinition(i,s)}}equalsTo(e){return(0,Sr.isClassType)(e)?this.referenceEqualsTo(e)||this.id===e.id&&this.document===e.document:!1}getProperty(e,n=1){if(n>n$.MAX_DEPTH||typeof e!="string")return;if(this.associatedMap){let s=this.associatedMap.getProperty(e,n+1);if(s)return s}let r=this.properties.get(e);return r||(this.inheritFrom==null?void 0:this.typeStorage.getInerhitType(this)?.getProperty(e,n+1))}setProperty(e,n){typeof e=="string"&&(this.properties.set(e,n),this.id!==mi.SignatureDefinitionBaseType.General&&this.typeStorage.addToAny(e,n))}hasProperty(e){return typeof e!="string"?!1:this.properties.has(e)}containsOwnProperties(){return!0}getAllProperties(e=1){if(e>Sr.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map,r=Sr.BASE_TYPE_SET.has(this.id);for(let[i,s]of this.properties)n.has(i)||n.set(i,{type:s.type,name:s.name,kind:r?(0,Sr.isFunctionType)(s.type)?Ad.CompletionItemKind.InternalFunction:Ad.CompletionItemKind.InternalProperty:(0,Sr.isFunctionType)(s.type)?Ad.CompletionItemKind.Function:Ad.CompletionItemKind.Property});if(this.associatedMap)for(let i of this.associatedMap.getAllProperties(e+1))n.has(i.name)||n.set(i.name,i);if(this.inheritFrom){let i=this.typeStorage.getInerhitType(this);for(let s of i.getAllProperties(e+1))n.has(s.name)||n.set(s.name,s)}return Array.from(n.values())}deepCopy(e,n,r,i,s,o=new WeakMap){let a=o.get(this);if(a)return a;let u=new t(this.id,null,this.inheritFrom,n||this.typeStorage,r||this.document,i||this.scope,new Map,s);o.set(this,u),u.associatedMap=this.associatedMap?this.associatedMap.deepCopy(e,n,r,i,s,o):null;for(let[c,l]of this.properties)u.properties.set(c,new co.EntityInfo(l.name,l.type.deepCopy(e,n,r,i,null,o)));return e&&u.sourceMap.extend(this.sourceMap),u}copy(e,n,r,i,s,o){let a=new t(this.id,this.associatedMap,this.inheritFrom,r||this.typeStorage,i||this.document,s||this.scope,n?new Map(this.properties):this.properties);return e&&a.sourceMap.extend(this.sourceMap),a}merge(e){if((0,Sr.isClassType)(e)){for(let[n,r]of e.properties)this.properties.has(n)||this.properties.set(n,new co.EntityInfo(r.name,r.type));this.sourceMap.extend(e.sourceMap)}}toMeta(e){return[{type:this.id}]}};Pd.ClassType=nS});var Da=f(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.KeyType=void 0;var o$=ft(),a$=Tn(),rS=class t extends a$.Type{constructor(e,n,r,i,s=!1,o){super(e,o$.TypeKind.KeyType,e,n,r,i,o),this.isUserDefined=s}getKeyType(){return this}copy(e,n,r,i,s,o){let a=new t(this.id,r||this.typeStorage,i||this.document,s||this.scope,this.isUserDefined,o);return e&&a.sourceMap.extend(this.sourceMap),a}};Od.KeyType=rS});var dc=f(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.mergeScope=yi.deepMerge=yi.shallowMergeList=yi.shallowMergeMap=void 0;var lo=Qn(),u$=uo(),c$=gi(),l$=vr(),ct=ft();function p$(t,e,n){if(!(0,ct.isMapType)(t)||!(0,ct.isMapType)(e))return t;let r=t.copy(!1,!0),i=new c$.MapType(t.id,r.keyType,r.valueType,r.typeStorage,r.document,r.scope,null,n);i.properties=r.properties;for(let[s,o]of e.properties)i.setProperty(s,new lo.EntityInfo(o.name,o.type.copy(!1,!0,r.typeStorage)));return i}yi.shallowMergeMap=p$;function h$(t,e,n){if(!(0,ct.isListType)(t)||!(0,ct.isListType)(e))return t;let r=t.copy(!1,!0),i=new u$.ListType(t.id,r.keyType,r.typeStorage,r.document,r.scope,n);return i.addElementType(e.elementType),i}yi.shallowMergeList=h$;function Ki(t,e,n,r){if(r.add(e),r.add(n),e.properties==null&&n.properties==null)return e;if(e.properties==null)return n;if(n.properties==null)return e;let i=(0,ct.isMapType)(e);for(let[s,o]of n.properties){if(!i&&typeof s!="string")continue;let a=e.properties.get(s);a?e.setProperty(s,new lo.EntityInfo(a.name,Ia(t,a.type,o.type,r))):e.setProperty(s,new lo.EntityInfo(o.name,o.type.copy(!0,!0,t)))}return e}function d$(t,e,n,r){return e.returnType!=null&&n.returnType!=null?e.returnType=Ia(t,e.returnType,n.returnType,r):n.returnType!=null&&(e.returnType=n.returnType.copy(!0,!0,t)),e}function f$(t,e,n){for(let r of n.variants)e.addVariant(r.copy(!0,!0,t));return e}function Ia(t,e,n,r=new WeakSet){if(e===n||r.has(e)||r.has(n))return e;if(r.add(e),r.add(n),(0,ct.isMapType)(e)){if((0,ct.isMapType)(n))return Ki(t,e,n,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,e,n,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.addVariant(e),r.add(i),i}}else if((0,ct.isClassType)(e)){if((0,ct.isMapType)(n))return Ki(t,e,n,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,e,n,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.addVariant(e),r.add(i),i}}else if((0,ct.isUnknownType)(e)){if((0,ct.isMapType)(n))return Ki(t,n.copy(!0,!0,t),e,r);if((0,ct.isUnknownType)(n))return Ki(t,e,n,r);if((0,ct.isClassType)(n))return Ki(t,n.copy(!0,!0,t),e,r);if((0,ct.isUnionType)(n)){let i=n.copy(!0,!0,t);return i.variants.forEach(s=>Ia(t,s,e,r)),r.add(i),i}return n.copy(!0,!0,t)}else if((0,ct.isFunctionType)(e)){if((0,ct.isFunctionType)(n))return d$(t,e,n,r)}else if((0,ct.isUnionType)(e))return(0,ct.isUnionType)(n)?f$(t,e,n):(e.addVariant(n.copy(!0,!0,t)),e);if(!n.equalsTo(e)){let i=l$.UnionType.createDefault(t,e.document,e.scope);return r.add(i),i.addVariant(e),i.addVariant(n.copy(!0,!0,t)),i}return e}yi.deepMerge=Ia;function g$(t,e,n,r){if(r){for(let s=0;s<r.length;s++){let o=r[s],a=e.locals.getProperty(o.namespace),u=n.locals.getPropertyInPath(o.exportFrom.split("."));u!=null&&a!=null?e.locals.setProperty(o.namespace,new lo.EntityInfo(a.name,Ia(t,a.type,u.type))):u!=null&&a==null&&e.locals.setProperty(o.namespace,new lo.EntityInfo(u.name,u.type.copy(!0,!0,t)))}return}let i=new Map;for(let[s,o]of n.locals.properties){let a=e.locals.getProperty(s);a!=null?e.locals.setProperty(s,new lo.EntityInfo(a.name,Ia(t,a.type,o.type))):e.locals.setProperty(s,new lo.EntityInfo(o.name,o.type.deepCopy(!0,t,null,null,null,i)))}}yi.mergeScope=g$});var Dd=f(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.TypeStorage=void 0;var uR=dc(),iS=class t{constructor(e){this.memory=new Map,this.parent=e,this.memory=new Map,this.typeInterfaces=new Map,this.keyTypes=new Map,this.__internalHandleCounter=0}addToAny(e,n){}addType(e){let n=this.typeInterfaces.get(e.id);if(n){n.merge(e);return}this.typeInterfaces.set(e.id,e)}getType(e){let n=this.typeInterfaces.get(e.id);return n&&n!==e?n:this.parent?.getType(e)||null}getInerhitType(e){if(e.inheritFrom==null)return null;let n=this.typeInterfaces.get(e.inheritFrom);return n&&n!==e?n:this.parent?.getInerhitType(e)||null}getTypeById(e){let n=this.typeInterfaces.get(e);return n||this.parent?.getTypeById(e)||null}getTypePropertyById(e,n){let r=this.typeInterfaces.get(e)?.getProperty(n);return r||this.parent?.getTypePropertyById(e,n)||null}addKeyType(e){this.keyTypes.has(e.id)||this.keyTypes.set(e.id,e)}getKeyType(e){return this.keyTypes.get(e.id)||this.parent?.getKeyType(e)||this.getInerhitKeyType(e)}getInerhitKeyType(e){if(e.inheritFrom==null)return null;let n=this.keyTypes.get(e.inheritFrom);return n||this.parent?.getInerhitKeyType(e)||null}getKeyTypeById(e){let n=this.keyTypes.get(e);return n||this.parent?.getKeyTypeById(e)||null}merge(e){e.memory.forEach((n,r)=>{let i=this.memory.get(r);if(i){this.memory.set(r,(0,uR.deepMerge)(e,i,n));return}this.memory.set(r,n.deepCopy(!0,this))}),e.typeInterfaces.forEach((n,r)=>{let i=this.typeInterfaces.get(r);if(i){this.typeInterfaces.set(r,(0,uR.deepMerge)(e,i,n));return}this.typeInterfaces.set(r,n.deepCopy(!0,this))}),e.keyTypes.forEach((n,r)=>{this.keyTypes.has(r)||this.keyTypes.set(r,n.copy(!0,!0,this))})}generateId(e,n){let r=n?`<${n.type}:${n.start.toString()}-${n.end.toString()}>`:"<virtual>";return`${e}-global-${this.__internalHandleCounter++}-${r}`}copy(){let e=new t(this.parent);return this.typeInterfaces.forEach((n,r)=>{e.typeInterfaces.set(r,n.copy(!0,!0,e))}),this.keyTypes.forEach((n,r)=>{e.keyTypes.set(r,n.copy(!0,!0,e))}),e}};Rd.TypeStorage=iS});var uS=f(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.GlobalTypeStorage=void 0;var cR=Ve(),sS=ka(),oS=Da(),Id=ft(),m$=Dd(),aS=class extends m$.TypeStorage{insertPrimitives(e){e.getPrimitives().forEach((r,i)=>{let s=new sS.ClassType(i,null,null,this);s.insertSignature(r),this.typeInterfaces.set(i,s),this.keyTypes.set(i,new oS.KeyType(i,this))});let n=new sS.ClassType(Id.NIL_TYPE_ID,null,null,this);this.typeInterfaces.set(Id.NIL_TYPE_ID,n),this.keyTypes.set(Id.NIL_TYPE_ID,new oS.KeyType(Id.NIL_TYPE_ID,this))}insertNonPrimitives(e){e.getTypes().forEach((n,r)=>{let i=new sS.ClassType(r,null,null,this);i.insertSignature(n),this.typeInterfaces.set(r,i),this.keyTypes.set(r,new oS.KeyType(r,this))})}insertAllAnyTypeMembers(e){let n=this.typeInterfaces.get(cR.SignatureDefinitionBaseType.Any);e.getPrimitives().forEach(r=>{r.getType()!==cR.SignatureDefinitionBaseType.General&&n.insertSignature(r)}),e.getTypes().forEach(r=>{n.insertSignature(r)})}};Cd.GlobalTypeStorage=aS});var Ca=f(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.GreybelKeyword=void 0;var y$;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})(y$=fc.GreybelKeyword||(fc.GreybelKeyword={}))});var pS=f(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});var po=Te(),b$=Ca(),cS=class extends po.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(po.Keyword),...Object.values(b$.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===po.CharacterCode.HASH}isMultilineComment(e,n){return po.CharacterCode.SLASH===e&&po.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return po.CharacterCode.ASTERISK===e&&po.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};lS.default=cS});var hS=f(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CharacterCode=void 0;var _$;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(_$=gc.CharacterCode||(gc.CharacterCode={}))});var Ma=f(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.Operator=void 0;var v$;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(v$=mc.Operator||(mc.Operator={}))});var fS=f(yc=>{"use strict";var S$=yc&&yc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yc,"__esModule",{value:!0});var Kr=Te(),T$=S$(pS()),lR=hS(),pR=Ca(),dS=Ma();function hR(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Md=class t extends Kr.Lexer{constructor(e,n={}){n.validator=n.validator||new T$.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let p=n.codeAt();if(n.validator.isEndOfLine(p))n.validator.isWinNewline(p,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new Kr.ASTRange(new Kr.ASTPosition(r,s-o+1),new Kr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new Kr.Token({type:Kr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(pR.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(pR.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};yc.default=Md;Md.greybelScanHandlers={[Kr.CharacterCode.ARROW_LEFT]:function(e){if(Kr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(dS.Operator.LeftShift,e)},[Kr.CharacterCode.ARROW_RIGHT]:function(e){if(Kr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return Kr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(dS.Operator.UnsignedRightShift,e):this.scanPunctuator(dS.Operator.RightShift,e)},[lR.CharacterCode.AMPERSAND]:hR,[lR.CharacterCode.VERTICAL_LINE]:hR}});var Ld=f(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.ASTType=void 0;var w$;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(w$=bc.ASTType||(bc.ASTType={}))});var mS=f(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.ASTChunkGreybel=void 0;var x$=Te(),gS=class t extends x$.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nd.ASTChunkGreybel=gS});var TS=f(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.ASTFeatureFileExpression=Tr.ASTFeatureInjectExpression=Tr.ASTFeatureEnvarExpression=Tr.ASTFeatureIncludeExpression=Tr.ASTFeatureImportExpression=void 0;var _c=Te(),vc=Ld(),yS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureImportExpression=yS;var bS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureIncludeExpression=bS;var _S=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureEnvarExpression=_S;var vS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureInjectExpression=vS;var SS=class t extends _c.ASTBase{constructor(e){super(vc.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Tr.ASTFeatureFileExpression=SS});var ES=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ASTFeatureInjectExpression=Gt.ASTFeatureIncludeExpression=Gt.ASTFeatureImportExpression=Gt.ASTFeatureFileExpression=Gt.ASTFeatureEnvarExpression=Gt.ASTChunkGreybel=Gt.ASTType=Gt.ASTProvider=void 0;var wS=Te(),dR=Ld(),E$=mS(),Sc=TS(),xS=class extends wS.ASTProvider{featureImportExpression(e){return new Sc.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Sc.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Sc.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Sc.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new wS.ASTBase(dR.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new wS.ASTBase(dR.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Sc.ASTFeatureFileExpression(e)}chunk(e){return new E$.ASTChunkGreybel(e)}};Gt.ASTProvider=xS;var k$=Ld();Object.defineProperty(Gt,"ASTType",{enumerable:!0,get:function(){return k$.ASTType}});var A$=mS();Object.defineProperty(Gt,"ASTChunkGreybel",{enumerable:!0,get:function(){return A$.ASTChunkGreybel}});var Tc=TS();Object.defineProperty(Gt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureEnvarExpression}});Object.defineProperty(Gt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureFileExpression}});Object.defineProperty(Gt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureImportExpression}});Object.defineProperty(Gt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureIncludeExpression}});Object.defineProperty(Gt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Tc.ASTFeatureInjectExpression}})});var kS=f(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.SelectorGroups=vt.SelectorGroupType=vt.Selectors=vt.SelectorTypes=void 0;var $e=Te(),qd=Ca(),wc=Ma(),P$;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(P$=vt.SelectorTypes||(vt.SelectorTypes={}));vt.Selectors=Object.assign(Object.assign({},$e.Selectors),{From:(0,$e.createSelector)({type:$e.TokenType.Identifier,value:"from"}),Envar:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Envar}),Inject:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Inject}),Line:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.Line}),File:(0,$e.createSelector)({type:$e.TokenType.Keyword,value:qd.GreybelKeyword.File}),LeftShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.LeftShift}),RightShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.RightShift}),UnsignedRightShift:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.UnsignedRightShift}),BitwiseOr:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.BitwiseOr}),BitwiseAnd:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:wc.Operator.BitwiseAnd}),Escape:(0,$e.createSelector)({type:$e.TokenType.Punctuator,value:$e.Operator.Escape})});var Wi;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(Wi=vt.SelectorGroupType||(vt.SelectorGroupType={}));vt.SelectorGroups=Object.assign(Object.assign({},$e.SelectorGroups),{[Wi.MapSeparator]:(0,$e.createSelectorGroup)(Wi.MapSeparator,[vt.Selectors.MapSeperator,vt.Selectors.CRBracket]),[Wi.ListSeparator]:(0,$e.createSelectorGroup)(Wi.ListSeparator,[vt.Selectors.MapSeperator,vt.Selectors.SRBracket]),[Wi.PathSegmentEnd]:(0,$e.createSelectorGroup)(Wi.PathSegmentEnd,[vt.Selectors.EndOfLine,vt.Selectors.Comment,vt.Selectors.EndOfFile]),[Wi.BitwiseOperators]:(0,$e.createSelectorGroup)(Wi.BitwiseOperators,[vt.Selectors.LeftShift,vt.Selectors.RightShift,vt.Selectors.UnsignedRightShift])})});var mR=f(xc=>{"use strict";var O$=xc&&xc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xc,"__esModule",{value:!0});var Zn=Te(),R$=qu(),fR=Ku(),D$=O$(fS()),I$=ES(),ho=Ca(),gR=Ma(),Ne=kS(),AS=class extends Zn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new D$.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new I$.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(Ne.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
|
100
|
+
`)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.comments.push(s),n.lineRegistry.addItemToLines(s)}else if(Ne.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!Ne.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),Ne.Selectors.CRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(Ne.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ne.SelectorGroups.MapSeparator,s.start);if(Ne.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!Ne.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),Ne.Selectors.SRBracket(r.token))r.next();else for(;!Ne.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ne.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ne.SelectorGroups.ListSeparator,s.start);if(Ne.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Zn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Ne.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Ne.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(Zn.ASTIdentifierKind.Variable);if(!n.consume(Ne.Selectors.From))return n.raise("expected from keyword",new fR.Range(r.start,new R$.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});return n.imports.push(o),n.currentScope.definitions.push(o),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(Ne.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Zn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;Ne.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:gR.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;Ne.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:gR.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;Ne.Selectors.Plus(r.token)||Ne.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;Ne.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return Ne.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Ne.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Ne.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):Ne.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(Zn.TokenType.Keyword))switch(e.token.value){case ho.GreybelKeyword.Include:case ho.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Import:case ho.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case ho.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Zn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Zn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunk({start:n.start,end:null,range:[n.range[0],null]}),i=new Zn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!Ne.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Ne.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Zn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new fR.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.comments=e.comments,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};xc.default=AS});var Wr=f(jt=>{"use strict";var C$=jt&&jt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ec=jt&&jt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&C$(e,t,n)},PS=jt&&jt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jt,"__esModule",{value:!0});jt.Parser=jt.LexerValidator=jt.Lexer=void 0;var M$=fS();Object.defineProperty(jt,"Lexer",{enumerable:!0,get:function(){return PS(M$).default}});var L$=pS();Object.defineProperty(jt,"LexerValidator",{enumerable:!0,get:function(){return PS(L$).default}});var N$=mR();Object.defineProperty(jt,"Parser",{enumerable:!0,get:function(){return PS(N$).default}});Ec(ES(),jt);Ec(hS(),jt);Ec(Ca(),jt);Ec(Ma(),jt);Ec(kS(),jt)});var Fd=f(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.InferContext=void 0;var OS=class{constructor(e,n,r,i){this.typeStorage=e,this.document=n,this.scope=r,this.onRequestScope=i}};jd.InferContext=OS});var As=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SIMPLE_BINARY_OPERATORS_SET=tn.PathType=tn.UnaryType=tn.ConstantIdentifierSet=tn.ConstantIdentifier=tn.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;var fo=Te();tn.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```";var yR;(function(t){t.Self="self",t.Globals="globals",t.Outer="outer",t.Locals="locals",t.Super="super"})(yR=tn.ConstantIdentifier||(tn.ConstantIdentifier={}));tn.ConstantIdentifierSet=new Set(Object.values(yR));var q$;(function(t){t.Not="not",t.Negate="negate",t.AddressOf="addressOf"})(q$=tn.UnaryType||(tn.UnaryType={}));var j$;(function(t){t.Map="{}",t.List="[]",t.String="$string",t.Number="$number",t.Nil="null",t.Slice="[:]",t.Function="$funcRef",t.Expression="$expr"})(j$=tn.PathType||(tn.PathType={}));tn.SIMPLE_BINARY_OPERATORS_SET=new Set([fo.Operator.Modulo,fo.Operator.Equal,fo.Operator.NotEqual,fo.Operator.GreaterThan,fo.Operator.GreaterThanOrEqual,fo.Operator.LessThan,fo.Operator.LessThanOrEqual])});var La=f(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.Markers=void 0;var F$;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(F$=kc.Markers||(kc.Markers={}))});var Gr=f(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.rewireSpecs=St.rewireSource=St.seedTokens=St.seedSpec=St.seedBlock=St.splitLines=St.splitSpace=St.splitCR=St.hasCR=St.isSpace=void 0;function B$(t){return/^\s+$/.test(t)}St.isSpace=B$;function $$(t){return/\r$/.test(t)}St.hasCR=$$;function U$(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}St.splitCR=U$;function K$(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}St.splitSpace=K$;function W$(t){return t.split(/\n/)}St.splitLines=W$;function G$(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}St.seedBlock=G$;function H$(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}St.seedSpec=H$;function V$(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}St.seedTokens=V$;function z$(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}St.rewireSource=z$;function X$(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}St.rewireSpecs=X$});var bR=f(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Y$=/^@\S+/;function J$({fence:t="```"}={}){let e=Q$(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)Y$.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}RS.default=J$;function Q$(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var _R=f(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Z$=La(),Ac=Gr();function e2({startLine:t=0,markers:e=Z$.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,Ac.seedTokens)();if([a.lineEnd,o]=(0,Ac.splitCR)(o),[a.start,o]=(0,Ac.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,Ac.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,Ac.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}DS.default=e2});var vR=f(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var t2=Gr();function n2({tokenizers:t}){return function(n){var r;let i=(0,t2.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}IS.default=n2});var MS=f(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});function r2(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}CS.default=r2});var NS=f(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var i2=Gr();function s2(t="compact"){let e=a2(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,i2.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}LS.default=s2;var o2=t=>t.trim();function a2(t){return t==="compact"?e=>e.map(o2).join(""):t==="preserve"?e=>e.join(`
|
101
|
+
`):t}});var FS=f(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var qS=Gr(),u2=t=>t&&t.startsWith('"')&&t.endsWith('"');function c2(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,qS.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,qS.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!u2(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,qS.splitSpace)(r.slice(n.name.length)),e}}jS.default=c2});var $S=f(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.getJoiner=void 0;var BS=La();function l2(t="compact",e=BS.Markers){let n=SR(t);return r=>(r.description=n(r.source,e),r)}Pc.default=l2;function SR(t){return t==="compact"?p2:t==="preserve"?f2:t}Pc.getJoiner=SR;function p2(t,e=BS.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var h2=(t,{tokens:e},n)=>e.type===""?t:n,d2=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function f2(t,e=BS.Markers){if(t.length===0)return"";t[0].tokens.description===""&&t[0].tokens.delimiter===e.start&&(t=t.slice(1));let n=t[t.length-1];return n!==void 0&&n.tokens.description===""&&n.tokens.end.endsWith(e.end)&&(t=t.slice(0,-1)),t=t.slice(t.reduce(h2,0)),t.map(d2).join(`
|
102
|
+
`)}});var wR=f(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var g2=La(),m2=Gr(),y2=bR(),b2=_R(),_2=vR(),v2=MS(),S2=NS(),T2=FS(),TR=$S();function w2({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=g2.Markers,tokenizers:i=[(0,v2.default)(),(0,S2.default)(n),(0,T2.default)(),(0,TR.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,b2.default)({startLine:t,markers:r}),o=(0,y2.default)({fence:e}),a=(0,_2.default)({tokenizers:i}),u=(0,TR.getJoiner)(n);return function(c){let l=[];for(let p of(0,m2.splitLines)(c)){let h=s(p);if(h===null)continue;let m=o(h),b=m.slice(1).map(a);l.push({description:u(m[0],r),tags:b,source:h,problems:b.reduce((v,D)=>v.concat(D.problems),[])})}return l}}US.default=w2});var xR=f(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});function x2(t){return t.start+t.delimiter+t.postDelimiter+t.tag+t.postTag+t.type+t.postType+t.name+t.postName+t.description+t.end+t.lineEnd}function E2(){return t=>t.source.map(({tokens:e})=>x2(e)).join(`
|
103
|
+
`)}KS.default=E2});var kR=f(Oc=>{"use strict";var k2=Oc&&Oc.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(Oc,"__esModule",{value:!0});var ER=La(),A2=Gr(),P2={start:0,tag:0,type:0,name:0},O2=(t=ER.Markers)=>(e,{tokens:n})=>({start:n.delimiter===t.start?n.start.length:e.start,tag:Math.max(e.tag,n.tag.length),type:Math.max(e.type,n.type.length),name:Math.max(e.name,n.name.length)}),go=t=>"".padStart(t," ");function R2(t=ER.Markers){let e=!1,n;function r(i){let s=Object.assign({},i.tokens);s.tag!==""&&(e=!0);let o=s.tag===""&&s.name===""&&s.type===""&&s.description==="";if(s.end===t.end&&o)return s.start=go(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=go(n.start);break;case t.delim:s.start=go(n.start+1);break;default:s.delimiter="",s.start=go(n.start+2)}if(!e)return s.postDelimiter=s.description===""?"":" ",Object.assign(Object.assign({},i),{tokens:s});let a={delim:!1,tag:!1,type:!1,name:!1};return s.description===""&&(a.name=!0,s.postName="",s.name===""&&(a.type=!0,s.postType="",s.type===""&&(a.tag=!0,s.postTag="",s.tag===""&&(a.delim=!0)))),s.postDelimiter=a.delim?"":" ",a.tag||(s.postTag=go(n.tag-s.tag.length+1)),a.type||(s.postType=go(n.type-s.type.length+1)),a.name||(s.postName=go(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=k2(i,["source"]);return n=s.reduce(O2(t),Object.assign({},P2)),(0,A2.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Oc.default=R2});var AR=f(Rc=>{"use strict";var D2=Rc&&Rc.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(Rc,"__esModule",{value:!0});var I2=Gr(),C2=t=>e=>e.slice(t),M2=t=>{let e="".padStart(t," ");return n=>n+e};function L2(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?M2(s):C2(-s)}return e(i)},r=i=>Object.assign(Object.assign({},i),{tokens:Object.assign(Object.assign({},i.tokens),{start:n(i.tokens.start)})});return i=>{var{source:s}=i,o=D2(i,["source"]);return(0,I2.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}Rc.default=L2});var PR=f(Dc=>{"use strict";var N2=Dc&&Dc.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(Dc,"__esModule",{value:!0});var q2=Gr();function j2(t){function e(n){return Object.assign(Object.assign({},n),{tokens:Object.assign(Object.assign({},n.tokens),{lineEnd:t==="LF"?"":"\r"})})}return n=>{var{source:r}=n,i=N2(n,["source"]);return(0,q2.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}Dc.default=j2});var OR=f(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.flow=void 0;function F2(...t){return e=>t.reduce((n,r)=>r(n),e)}Bd.flow=F2});var CR=f(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var B2=Gr(),DR={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0},RR={lineEnd:"CR"},WS=Object.keys(DR),IR=t=>(0,B2.isSpace)(t)?`{${t.length}}`:t,$2=t=>"|"+t.join("|")+"|",U2=(t,e)=>Object.keys(e).map(n=>IR(e[n]).padEnd(t[n]));function K2({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},DR);for(let s of WS)r[s]=((e=RR[s])!==null&&e!==void 0?e:s).length;for(let{number:s,tokens:o}of t){r.line=Math.max(r.line,s.toString().length);for(let a in o)r[a]=Math.max(r[a],IR(o[a]).length)}let i=[[],[]];for(let s of WS)i[0].push(((n=RR[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of WS)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...U2(r,o)])}return i.map($2).join(`
|
104
|
+
`)}GS.default=K2});var Ic=f(Ft=>{"use strict";var W2=Ft&&Ft.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),G2=Ft&&Ft.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&W2(e,t,n)};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.util=Ft.tokenizers=Ft.transforms=Ft.inspect=Ft.stringify=Ft.parse=void 0;var H2=wR(),V2=$S(),z2=FS(),X2=MS(),Y2=NS(),J2=xR(),Q2=kR(),Z2=AR(),eU=PR(),tU=OR(),$d=Gr();G2(La(),Ft);function nU(t,e={}){return(0,H2.default)(e)(t)}Ft.parse=nU;Ft.stringify=(0,J2.default)();var rU=CR();Object.defineProperty(Ft,"inspect",{enumerable:!0,get:function(){return rU.default}});Ft.transforms={flow:tU.flow,align:Q2.default,indent:Z2.default,crlf:eU.default};Ft.tokenizers={tag:X2.default,type:Y2.default,name:z2.default,description:V2.default};Ft.util={rewireSpecs:$d.rewireSpecs,rewireSource:$d.rewireSource,seedBlock:$d.seedBlock,seedTokens:$d.seedTokens}});var Kd=f(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.normalizeText=void 0;var iU=t=>t.trimLeft().replace(/\r$/,"");Ud.normalizeText=iU});var Na=f(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.createCommentBlock=void 0;var sU=Kd(),oU=t=>`/**
|
105
105
|
${t.split(`
|
106
106
|
`).map(e=>`*${(0,sU.normalizeText)(e)}`).join(`
|
107
107
|
`)}
|
108
|
-
*/`;Wd.createCommentBlock=oU});var VS=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.enrichWithMetaInformation=mo.FunctionBlockTag=void 0;var aU=Ic(),HS=Ve(),uU=As(),
|
108
|
+
*/`;Wd.createCommentBlock=oU});var VS=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.enrichWithMetaInformation=mo.FunctionBlockTag=void 0;var aU=Ic(),HS=Ve(),uU=As(),MR=ft(),cU=Na(),Gi;(function(t){t.Description="description",t.Param="param",t.Params="params",t.Return="return",t.Returns="returns",t.Example="example"})(Gi=mo.FunctionBlockTag||(mo.FunctionBlockTag={}));var lU=new Set(Object.values(Gi));function pU(t){return t.tag===Gi.Description?[t.name,t.description].filter(e=>e!==void 0).join(" "):[`@${t.tag}`,t.name,t.description].filter(e=>e!==void 0).join(" ")}function hU(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}function LR(t){return new HS.TypeParser(t).parse()}function dU(t){return t.type.split("|").map(LR)}function fU(t){return{types:t.type.split("|").map(LR),label:t.name,opt:t.optional}}function gU(t){let e={},n=[t.description??"",...t.tags.filter(o=>o.tag===Gi.Description||!NR(o)).map(pU)].join(`
|
109
109
|
|
110
|
-
`),r=t.tags.filter(o=>o.tag===Gi.Param||o.tag===Gi.Params).map(fU),i=t.tags.filter(o=>o.tag===Gi.Return||o.tag===Gi.Returns).flatMap(dU),s=t.tags.filter(o=>o.tag===Gi.Example).map(hU);return n.length>0&&(e.descriptions=n),r.length>0&&(e.args=r),i.length>0&&(e.returns=i),s.length>0&&(e.examples=s),e}function
|
111
|
-
`),i=(0,BU.parseAssignDescription)(r);if(i!=null)return i.type.length>1?new
|
110
|
+
`),r=t.tags.filter(o=>o.tag===Gi.Param||o.tag===Gi.Params).map(fU),i=t.tags.filter(o=>o.tag===Gi.Return||o.tag===Gi.Returns).flatMap(dU),s=t.tags.filter(o=>o.tag===Gi.Example).map(hU);return n.length>0&&(e.descriptions=n),r.length>0&&(e.args=r),i.length>0&&(e.returns=i),s.length>0&&(e.examples=s),e}function NR(t){return lU.has(t.tag)}function mU(t,e){let n=(0,aU.parse)((0,cU.createCommentBlock)(e.getDescription())),[r]=n;if(r.tags.filter(NR).length>0){let{descriptions:s,args:o,returns:a,examples:u}=gU(r),c=new Map;return o&&o.forEach(l=>c.set(l.label,l)),HS.SignatureDefinitionFunction.parse(MR.META_DOCS_SIGNATURE_ORIGIN,{id:t.generateId(MR.TypeKind.FunctionType),type:HS.SignatureDefinitionBaseType.Function,arguments:e.getArguments().map(l=>{let p=l.getLabel(),h=l.getTypes().map(b=>b.toString()),m=l.isOptional();return{types:h,opt:m,...c.get(p),label:p}}),returns:a||e.getReturns(),description:s||uU.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION,example:u||e.getExample()})}return e}mo.enrichWithMetaInformation=mU});var zS=f(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.parseMapDescription=yo.MapTag=void 0;var yU=Ic(),bU=Ve(),_U=Na(),Cc;(function(t){t.Type="type",t.Property="property",t.Extends="extends"})(Cc=yo.MapTag||(yo.MapTag={}));var vU=new Set(Object.values(Cc));function SU(t){return bU.SignatureDefinitionTypeMeta.fromString(t)}function TU(t){return{path:t.name,type:t.type.split("|").map(SU)}}function wU(t){let e=t.tags.find(i=>i.tag===Cc.Type);if(!e)return null;let n=t.tags.find(i=>i.tag===Cc.Extends),r=t.tags.filter(i=>i.tag===Cc.Property);return{type:e.name,extends:n?.name||null,properties:r.map(TU)}}function xU(t){return vU.has(t.tag)}function EU(t){let e=(0,yU.parse)((0,_U.createCommentBlock)(t)),[n]=e;return n.tags.filter(xU).length>0?wU(n):null}yo.parseMapDescription=EU});var jR=f(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.assumeCompletionItemKind=void 0;var qR=Ve(),bo=Ur(),qa=ft(),kU=".",AU="[";function PU(t,e){let r=e?.includes(kU)||e?.includes(AU)?bo.CompletionItemKind.Property:bo.CompletionItemKind.Variable;if(t==null)return r;switch(t.kind){case qa.TypeKind.MapType:return bo.CompletionItemKind.MapConstructor;case qa.TypeKind.ListType:return bo.CompletionItemKind.ListConstructor;case qa.TypeKind.FunctionType:return bo.CompletionItemKind.Function;case qa.TypeKind.ClassType:return bo.CompletionItemKind.Constant;case qa.TypeKind.Base:switch(t.id){case qR.SignatureDefinitionBaseType.String:case qR.SignatureDefinitionBaseType.Number:case qa.NIL_TYPE_ID:return bo.CompletionItemKind.Literal}return r;default:return r}}Gd.assumeCompletionItemKind=PU});var YS=f(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.parseAssignDescription=_o.AssignTag=void 0;var OU=Ic(),RU=Ve(),DU=Na(),XS;(function(t){t.Define="define"})(XS=_o.AssignTag||(_o.AssignTag={}));var IU=new Set(Object.values(XS));function CU(t){return RU.SignatureDefinitionTypeMeta.fromString(t)}function MU(t){let e=t.tags.find(n=>n.tag===XS.Define);return e?{type:e.type.split("|").map(CU)}:null}function LU(t){return IU.has(t.tag)}function NU(t){let e=(0,OU.parse)((0,DU.createCommentBlock)(t)),[n]=e;return n.tags.filter(LU).length>0?MU(n):null}_o.parseAssignDescription=NU});var Vd=f(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.InferBase=void 0;var Ge=Ve(),ja=Te(),qU=Qn(),jU=gi(),Tt=Tn(),FR=vr(),er=Ur(),nn=As(),wn=ft(),FU=jR(),BR=Oa(),$R=dc(),UR=Kd(),BU=YS(),JS=class{constructor(e,n=!0){this.context=e,this.skipNextInvoke=!n,this.path="",this.value=null}getCompletionItemKind(){return this.completionItemKind}getPath(){return this.path}getValue(){return this.value}invoke(e){let n=null;if((0,wn.isFunctionType)(e)){let r=this.context.document.scopeFnMapping.get(e);r!=null&&this.context.onRequestScope?.(r.astRef),n=e.invoke(this.context.typeStorage,this.context.document,this.context.scope)}else n=e.invoke(this.context.typeStorage,this.context.document,this.context.scope);return this.completionItemKind=(0,FU.assumeCompletionItemKind)(n,this.path),this.value=null,n}checkSkipNextInvoke(){return this.skipNextInvoke?(this.skipNextInvoke=!1,!0):!1}resolveRelatedCommentLines(e){let n=this.context.document.chunkHelper,r=n.getLastASTItemOfLine(e.start.line-1),i=n.findASTItemInLine(e.start.line,ja.ASTType.Comment);if(r?.type===ja.ASTType.Comment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=n.getLastASTItemOfLine(a--);if(!s.has(u))if(u?.type===ja.ASTType.Comment)s.add(u),o.unshift((0,UR.normalizeText)(u.value));else break}return o}else if(i?.type===ja.ASTType.Comment)return[(0,UR.normalizeText)(i.value)];return null}inferCommentDefinition(e){let n=this.resolveRelatedCommentLines(e);if(n!=null){let r=n.join(`
|
111
|
+
`),i=(0,BU.parseAssignDescription)(r);if(i!=null)return i.type.length>1?new FR.UnionType(this.context.typeStorage.generateId(wn.TypeKind.UnionType,e),i.type.map(s=>(0,BR.determineTypeFromMeta)(s,this.context.typeStorage,this.context.document,this.context.scope)),this.context.typeStorage,this.context.document,this.context.scope,e):(0,BR.determineTypeFromMeta)(i.type[0],this.context.typeStorage,this.context.document,this.context.scope,e)}return null}createFunctionDescription(e,n=nn.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this.resolveRelatedCommentLines(e);return r==null?n:r.join(`
|
112
112
|
|
113
|
-
`)}inferLogicalExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferIsaExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferComparisonGroupExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferSliceExpression(e){let n=this.infer(e.base);return this.path+=nn.PathType.Slice,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferConstantIdentifier(e){let n=this.context.scope;switch(this.completionItemKind=er.CompletionItemKind.Constant,e.name){case nn.ConstantIdentifier.Self:return n.getSelf();case nn.ConstantIdentifier.Globals:return n.getGlobals();case nn.ConstantIdentifier.Outer:return n.getOuter();case nn.ConstantIdentifier.Locals:return n.getLocals();case nn.ConstantIdentifier.Super:return n.getSuper();default:throw new Error(`Unknown constant identifier: ${e.name}`)}}inferUnaryExpression(e){if(e.operator===nn.UnaryType.Not)return Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);e.operator===ja.Operator.Reference&&(this.skipNextInvoke=!0);let n=this.infer(e.argument);if(n==null)return Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.operator===ja.Operator.New&&(0,wn.isMapType)(n)){let r=new jU.MapType(this.context.typeStorage.generateId(wn.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);return r.setProperty(wn.ISA_PROPERTY,new qU.EntityInfo(wn.ISA_PROPERTY,n)),r}return n}inferNilLiteral(e){let n=Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Nil,this.completionItemKind=er.CompletionItemKind.Literal,this.value="null",n}inferStringLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null),r=e.value.length>wn.MAX_STRING_LENGTH?`"${e.value.slice(0,wn.MAX_STRING_LENGTH)}..."`:`"${e.value}"`;return this.path+=r,this.completionItemKind=er.CompletionItemKind.Literal,this.value=r,n}inferNumericLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=e.value.toString(),this.completionItemKind=er.CompletionItemKind.Literal,this.value=e.value.toString(),n}inferBooleanLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Literal,this.value=e.value.toString(),n}inferFeatureFileExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureLineExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureEnvarExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureInjectExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}handleBinaryAddOperation(e,n){let r=e.getKeyType(),i=n.getKeyType();return r?.id===i?.id?(0,wn.isMapType)(e)?(0,$D.shallowMergeMap)(e,n):(0,wn.isListType)(e)?(0,$D.shallowMergeList)(e,n):(0,wn.isUnionType)(e)?new FD.UnionType(this.context.typeStorage.generateId(wn.TypeKind.UnionType),[e,n],this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(e.id,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.String||n.id===Ge.SignatureDefinitionBaseType.String?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null)}handleBinaryMultiplyOperation(e,n){return e.id===Ge.SignatureDefinitionBaseType.String&&n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null)}handleDefaultMathOperation(e,n){return e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null)}inferParenthesisExpression(e){return this.infer(e.expression)}};Hd.InferBase=JS});var Mc=f(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.InferLightExpression=void 0;var zd=Wr(),xn=Ve(),nt=Te(),QS=Qn(),$U=Ra(),jn=Tn(),UU=vr(),Xd=pc(),Ht=Ur(),vo=As(),Fa=ft(),KU=Vd(),ZS=class t extends KU.InferBase{inferCallExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);return n==null?jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):this.invoke(n)}inferBinaryExpression(e){if(vo.SIMPLE_BINARY_OPERATORS_SET.has(e.operator))return this.path+=vo.PathType.Expression,this.completionItemKind=Ht.CompletionItemKind.Expression,this.value=null,jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new t(this.context).infer(e.left)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null),r=new t(this.context).infer(e.right)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);switch(this.path+=vo.PathType.Expression,this.completionItemKind=Ht.CompletionItemKind.Expression,this.value=null,e.operator){case nt.Operator.Plus:return this.handleBinaryAddOperation(n,r);case nt.Operator.Asterik:return this.handleBinaryMultiplyOperation(n,r);default:return this.handleDefaultMathOperation(n,r)}}inferIndexExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);if(n==null)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.index.type===nt.ASTType.InvalidCodeExpression)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);if(e.index.type===nt.ASTType.StringLiteral){let u=e.index.value,c=n.getProperty(u);if(this.path+=`.${u}`,this.value=null,c!=null)return this.completionItemKind=(0,Fa.isFunctionType)(c.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,c.type;this.completionItemKind=Ht.CompletionItemKind.Property;let l=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(u,new QS.EntityInfo(u,l)),l}let r=new t(this.context).infer(e.index)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if((0,Fa.isUnionType)(r)){let a=r.variants.map(u=>n.getProperty(u.getKeyType())?.type).filter(u=>u!=null);return this.completionItemKind=Ht.CompletionItemKind.Property,a.length===0?jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):a.length===1?r.firstVariant():new UU.UnionType(this.context.typeStorage.generateId(Fa.TypeKind.UnionType,e),a,this.context.typeStorage,this.context.document,this.context.scope,null)}let i=r.getKeyType()||new $U.KeyType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),s=n.getProperty(i);if(this.path+=`[${r.id}]`,this.value=null,s!=null)return this.completionItemKind=(0,Fa.isFunctionType)(s.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,s.type;this.completionItemKind=Ht.CompletionItemKind.Property;let o=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(i,new QS.EntityInfo(i.id,o)),o}inferFunctionStatement(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Function,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.Function,this.completionItemKind=Ht.CompletionItemKind.Function,this.value=null,n}inferIdentifier(e){let n=this.checkSkipNextInvoke();if(this.path+=e.name,this.value=null,vo.ConstantIdentifierSet.has(e.name)&&!this.context.scope.hasProperty(e.name))return this.inferConstantIdentifier(e)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);let r=e.name,i=this.context.scope.getProperty(r);if(i!=null)return this.completionItemKind=(0,Fa.isFunctionType)(i.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Variable,n?i.type:this.invoke(i.type);this.completionItemKind=Ht.CompletionItemKind.Variable;let s=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return this.context.scope.setProperty(r,s),s}inferMemberExpression(e){let n=this.checkSkipNextInvoke(),r=this.infer(e.base);if(r==null)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.identifier.type===nt.ASTType.InvalidCodeExpression)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);let i=e.identifier.name,s=r.getProperty(i);if(this.path+=`.${i}`,this.value=null,s!=null)return this.completionItemKind=(0,Fa.isFunctionType)(s.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,n?s.type:this.invoke(s.type);this.completionItemKind=Ht.CompletionItemKind.Property;let o=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return r.setProperty(i,new QS.EntityInfo(i,o)),o}inferMapConstructorExpression(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Map,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.Map,this.completionItemKind=Ht.CompletionItemKind.MapConstructor,this.value=null,n}inferListConstructorExpression(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.List,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.List,this.completionItemKind=Ht.CompletionItemKind.ListConstructor,this.value=null,n}infer(e){if(e==null)return null;switch(e.type){case nt.ASTType.ParenthesisExpression:return this.inferParenthesisExpression(e);case nt.ASTType.CallExpression:return this.inferCallExpression(e);case nt.ASTType.BinaryExpression:return this.inferBinaryExpression(e);case nt.ASTType.LogicalExpression:return this.inferLogicalExpression(e);case nt.ASTType.IsaExpression:return this.inferIsaExpression(e);case nt.ASTType.ComparisonGroupExpression:return this.inferComparisonGroupExpression(e);case nt.ASTType.FunctionDeclaration:return this.inferFunctionStatement(e);case nt.ASTType.SliceExpression:return this.inferSliceExpression(e);case nt.ASTType.IndexExpression:return this.inferIndexExpression(e);case nt.ASTType.MemberExpression:return this.inferMemberExpression(e);case nt.ASTType.Identifier:return this.inferIdentifier(e);case nt.ASTType.MapConstructorExpression:return this.inferMapConstructorExpression(e);case nt.ASTType.ListConstructorExpression:return this.inferListConstructorExpression(e);case nt.ASTType.NegationExpression:case nt.ASTType.BinaryNegatedExpression:case nt.ASTType.UnaryExpression:return this.inferUnaryExpression(e);case nt.ASTType.NilLiteral:return this.inferNilLiteral(e);case nt.ASTType.StringLiteral:return this.inferStringLiteral(e);case nt.ASTType.NumericLiteral:return this.inferNumericLiteral(e);case nt.ASTType.BooleanLiteral:return this.inferBooleanLiteral(e);case zd.ASTType.FeatureFileExpression:return this.inferFeatureFileExpression(e);case zd.ASTType.FeatureLineExpression:return this.inferFeatureLineExpression(e);case zd.ASTType.FeatureEnvarExpression:return this.inferFeatureEnvarExpression(e);case zd.ASTType.FeatureInjectExpression:return this.inferFeatureInjectExpression(e);default:return null}}};Yd.InferLightExpression=ZS});var ef=f(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.InferFullExpression=void 0;var Jd=Wr(),wt=Ve(),Ue=Te(),WU=ka(),Ps=Qn(),GU=hc(),KD=Ra(),WD=uo(),eT=gi(),En=Tn(),GD=vr(),Qd=pc(),Vt=Ur(),Os=As(),Mt=ft(),HD=Oa(),HU=VS(),VU=zS(),zU=Vd(),VD=Mc(),tT=class t extends zU.InferBase{createCustomTypeFromMap(e,n){let r=this.resolveRelatedCommentLines(e);if(r==null)return;let i=r.join(`
|
114
|
-
`),s=(0,VU.parseMapDescription)(i);s!=null&&(s.properties.forEach(o=>{if(o.path===Mt.ISA_PROPERTY)return;let a=o.path.split("."),u=o.type.length>1?new GD.UnionType(this.context.typeStorage.generateId(Mt.TypeKind.UnionType,e),o.type.map(c=>(0,HD.determineTypeFromMeta)(c,this.context.typeStorage,this.context.document,this.context.scope)),this.context.typeStorage,this.context.document,this.context.scope):(0,HD.determineTypeFromMeta)(o.type[0],this.context.typeStorage,this.context.document,this.context.scope);n.setPropertyInPath(a,new Ps.EntityInfo(a[a.length-1],u))}),this.context.typeStorage.addType(new WU.ClassType(s.type,n,s.extends||wt.SignatureDefinitionBaseType.Map,this.context.typeStorage,this.context.document,this.context.scope,new Map)),this.context.typeStorage.addKeyType(new KD.KeyType(s.type,this.context.typeStorage,this.context.document,this.context.scope,!0)))}inferCallExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);return n==null?En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):this.invoke(n)}inferBinaryExpression(e){if(Os.SIMPLE_BINARY_OPERATORS_SET.has(e.operator))return this.path+=Os.PathType.Expression,this.completionItemKind=Vt.CompletionItemKind.Expression,this.value=null,En.Type.createBaseType(wt.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new t(this.context).infer(e.left)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null),r=new t(this.context).infer(e.right)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);switch(this.path+=Os.PathType.Expression,this.completionItemKind=Vt.CompletionItemKind.Expression,this.value=null,e.operator){case Ue.Operator.Plus:return this.handleBinaryAddOperation(n,r);case Ue.Operator.Asterik:return this.handleBinaryMultiplyOperation(n,r);default:return this.handleDefaultMathOperation(n,r)}}inferIndexExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);if(n==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.index.type===Ue.ASTType.InvalidCodeExpression)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);if(e.index.type===Ue.ASTType.StringLiteral){let u=e.index.value,c=n.getProperty(u);if(this.path+=`.${u}`,this.value=null,c!=null)return this.completionItemKind=(0,Mt.isFunctionType)(c.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,c.type;this.completionItemKind=Vt.CompletionItemKind.Property;let l=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(u,new Ps.EntityInfo(u,l)),l}let r=new VD.InferLightExpression(this.context).infer(e.index)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(this.path+=`[${r.id}]`,this.value=null,(0,Mt.isUnionType)(r)){let a=r.variants.map(u=>n.getProperty(u.getKeyType())?.type).filter(u=>u!=null);return this.completionItemKind=Vt.CompletionItemKind.Property,a.length===0?En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):a.length===1?r.firstVariant():new GD.UnionType(this.context.typeStorage.generateId(Mt.TypeKind.UnionType,e),a,this.context.typeStorage,this.context.document,this.context.scope,null)}let i=r.getKeyType()||new KD.KeyType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),s=n.getProperty(i);if(s!=null)return this.completionItemKind=(0,Mt.isFunctionType)(s.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,s.type;this.completionItemKind=Vt.CompletionItemKind.Property;let o=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(i,new Ps.EntityInfo(i.id,o)),o}inferFunctionStatement(e){let n=this.createFunctionDescription(e),r=wt.SignatureDefinitionFunction.parse(Mt.DEFAULT_SIGNATURE_ORIGIN,{id:this.context.typeStorage.generateId(Mt.TypeKind.FunctionType,e),type:wt.SignatureDefinitionBaseType.Function,description:n,arguments:e.parameters.map(s=>{if(s.type===Ue.ASTType.Identifier)return{label:s.name??"unknown",type:wt.SignatureDefinitionBaseType.Any};let o=s,a=new t(this.context).infer(o.init)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);return{label:o.variable?.name??"unknown",types:[a.getKeyType()?.id||wt.SignatureDefinitionBaseType.Any]}}),returns:[Mt.UNKNOWN_TYPE_ID]}),i=new GU.FunctionType(wt.SignatureDefinitionBaseType.Function,(0,HU.enrichWithMetaInformation)(this.context.typeStorage,r),this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=Os.PathType.Function,this.completionItemKind=Vt.CompletionItemKind.Function,this.value=null,i}inferIdentifier(e){let n=this.checkSkipNextInvoke();if(this.path+=e.name,this.value=null,Os.ConstantIdentifierSet.has(e.name)&&!this.context.scope.hasProperty(e.name))return this.inferConstantIdentifier(e)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);let r=e.name,i=this.context.scope.getProperty(r);if(i!=null)return this.completionItemKind=(0,Mt.isFunctionType)(i.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Variable,n?i.type:this.invoke(i.type);this.completionItemKind=Vt.CompletionItemKind.Variable;let s=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return this.context.scope.setProperty(r,s),s}inferMemberExpression(e){let n=this.checkSkipNextInvoke(),r=this.infer(e.base);if(r==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.identifier.type===Ue.ASTType.InvalidCodeExpression)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);let i=e.identifier.name,s=r.getProperty(i);if(this.path+=`.${i}`,this.value=null,s!=null)return this.completionItemKind=(0,Mt.isFunctionType)(s.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,n?s.type:this.invoke(s.type);this.completionItemKind=Vt.CompletionItemKind.Property;let o=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return r.setProperty(i,new Ps.EntityInfo(i,o)),o}inferMapConstructorExpression(e){if(this.path+=Os.PathType.Map,this.completionItemKind=Vt.CompletionItemKind.MapConstructor,this.value="{}",e.fields.length===0)return new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=new t(this.context).infer(i.value)?.copy(!1,!0,this.context.typeStorage,this.context.document,this.context.scope,i.value);if(s!=null)if(i.key.type===Ue.ASTType.StringLiteral){let o=i.key;n.setProperty(o.value,new Ps.EntityInfo(o.value,s))}else{let o=new VD.InferLightExpression(this.context).infer(i.key);if(o==null)continue;if((0,Mt.isUnionType)(o))o.variants.forEach(a=>{let u=a.getKeyType();u!=null&&n.setProperty(u,new Ps.EntityInfo(u.id,s))});else{let a=o.getKeyType();if(a==null)continue;n.setProperty(a,new Ps.EntityInfo(a.id,s))}}}return n}inferListConstructorExpression(e){if(this.path+=Os.PathType.List,this.completionItemKind=Vt.CompletionItemKind.ListConstructor,this.value="[]",e.fields.length===0)return new WD.ListType(this.context.typeStorage.generateId(Mt.TypeKind.ListType,e),En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),this.context.typeStorage,this.context.document,this.context.scope);let n=new WD.ListType(this.context.typeStorage.generateId(Mt.TypeKind.ListType,e),null,this.context.typeStorage,this.context.document,this.context.scope);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=new t(this.context).infer(i.value)?.copy(!1,!0,this.context.typeStorage,this.context.document,this.context.scope,i.value);s!=null&&n.addElementType(s)}return n}inferUnaryExpression(e){if(e.operator===Os.UnaryType.Not)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);e.operator===Ue.Operator.Reference&&(this.skipNextInvoke=!0);let n=this.infer(e.argument);if(n==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.operator===Ue.Operator.New&&(0,Mt.isMapType)(n)){let r=new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);return r.setProperty(Mt.ISA_PROPERTY,new Ps.EntityInfo(Mt.ISA_PROPERTY,n)),r}return n}infer(e){if(e==null)return null;switch(e.type){case Ue.ASTType.ParenthesisExpression:return this.inferParenthesisExpression(e);case Ue.ASTType.CallExpression:return this.inferCallExpression(e);case Ue.ASTType.BinaryExpression:return this.inferBinaryExpression(e);case Ue.ASTType.LogicalExpression:return this.inferLogicalExpression(e);case Ue.ASTType.IsaExpression:return this.inferIsaExpression(e);case Ue.ASTType.ComparisonGroupExpression:return this.inferComparisonGroupExpression(e);case Ue.ASTType.FunctionDeclaration:return this.inferFunctionStatement(e);case Ue.ASTType.SliceExpression:return this.inferSliceExpression(e);case Ue.ASTType.IndexExpression:return this.inferIndexExpression(e);case Ue.ASTType.MemberExpression:return this.inferMemberExpression(e);case Ue.ASTType.Identifier:return this.inferIdentifier(e);case Ue.ASTType.MapConstructorExpression:return this.inferMapConstructorExpression(e);case Ue.ASTType.ListConstructorExpression:return this.inferListConstructorExpression(e);case Ue.ASTType.NegationExpression:case Ue.ASTType.BinaryNegatedExpression:case Ue.ASTType.UnaryExpression:return this.inferUnaryExpression(e);case Ue.ASTType.NilLiteral:return this.inferNilLiteral(e);case Ue.ASTType.StringLiteral:return this.inferStringLiteral(e);case Ue.ASTType.NumericLiteral:return this.inferNumericLiteral(e);case Ue.ASTType.BooleanLiteral:return this.inferBooleanLiteral(e);case Jd.ASTType.FeatureFileExpression:return this.inferFeatureFileExpression(e);case Jd.ASTType.FeatureLineExpression:return this.inferFeatureLineExpression(e);case Jd.ASTType.FeatureEnvarExpression:return this.inferFeatureEnvarExpression(e);case Jd.ASTType.FeatureInjectExpression:return this.inferFeatureInjectExpression(e);default:return null}}};Zd.InferFullExpression=tT});var nT=f(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.isVariableSetterContextIndex=Hr.isVariableSetterContextProperty=Hr.isVariableSetterContextVariable=Hr.VariableSetterContextComponentKind=void 0;var tf;(function(t){t.Variable="variable",t.Property="property",t.Type="type"})(tf=Hr.VariableSetterContextComponentKind||(Hr.VariableSetterContextComponentKind={}));function XU(t){return t.kind===tf.Variable}Hr.isVariableSetterContextVariable=XU;function YU(t){return t.kind===tf.Property}Hr.isVariableSetterContextProperty=YU;function JU(t){return t.kind===tf.Type}Hr.isVariableSetterContextIndex=JU});var aT=f(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.ASTDefinitionAggregator=void 0;var QU=Wr(),rT=Ve(),Lc=Te(),Hi=Qn(),Nc=gi(),iT=Tn(),ZU=vr(),nf=pc(),zD=Fd(),XD=ef(),Ba=Mc(),rf=nT(),sT=Ur(),kn=ft(),oT=class{constructor(e,n,r,i,s){this.typeStorage=e,this.document=n,this.scope=r,this.block=i,this.onRequestScope=s}makeTypeCompatibleWithProperties(e,n){let r=this.document.chunkHelper.findAssignmentVariableSetterContext(e);if(r==null)return;if((0,rf.isVariableSetterContextVariable)(r)){this.scope.setProperty(r.property,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope));return}let i=new Ba.InferLightExpression(n).infer(r.resolvePath);if(i.containsOwnProperties()||(this.makeTypeCompatibleWithProperties(r.resolvePath,n),i=new Ba.InferLightExpression(n).infer(r.resolvePath)),(0,rf.isVariableSetterContextProperty)(r)){i.setProperty(r.lastProperty,new Hi.EntityInfo(r.lastProperty,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)));return}let s=new Ba.InferLightExpression(n).infer(r.lastComponent);if((0,kn.isUnionType)(s)){s.variants.forEach(a=>{let u=a.getKeyType();u!=null&&i.setProperty(u,new Hi.EntityInfo(u.id,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)))});return}let o=s.getKeyType();o!=null&&i.setProperty(o,new Hi.EntityInfo(o.id,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)))}aggregateAssignmentStatement(e){let n=this.document.chunkHelper.findAssignmentVariableSetterContext(e.variable);if(n==null)return;let r=new zD.InferContext(this.typeStorage,this.document,this.scope,this.onRequestScope),i=new XD.InferFullExpression(r),s=i.inferCommentDefinition(e)||i.infer(e.init)?.copy(!1,!1,this.typeStorage,this.document,this.scope,e.init)||new nf.UnknownType(this.typeStorage,this.document,this.scope,e);if((0,kn.isFunctionType)(s)&&this.document.attachFunctionTypeToScope(s.astRef,s),(0,kn.isMapType)(s)&&i.createCustomTypeFromMap(e.init,s),(0,rf.isVariableSetterContextVariable)(n)){let l=n.property;this.scope.symbols.push({name:l,path:l,kind:i.getCompletionItemKind(),source:s.getSource(),assignmentRef:e});let p=this.scope.getProperty(l);if(p!=null&&e.init.type===Lc.ASTType.Unknown)return;if(p!=null&&(0,kn.isUnknownType)(p.type)){p.type.mergeIntoType(s),this.scope.setProperty(l,s);return}else if(p!=null&&(0,kn.isUnknownType)(s)){s.mergeIntoType(p.type);return}this.scope.setProperty(l,s);return}let o=new Ba.InferLightExpression(r),a=o.infer(n.resolvePath);if(a==null)throw new Error("Cannot assign property to null origin");if(a.containsOwnProperties()||(this.makeTypeCompatibleWithProperties(n.resolvePath,r),o=new Ba.InferLightExpression(r),a=o.infer(n.resolvePath)),(0,kn.isFunctionType)(s)&&(s.context=a),(0,rf.isVariableSetterContextProperty)(n)){let l=n.lastProperty;this.scope.symbols.push({name:l,path:`${o.getPath()}.${l}`,kind:i.getCompletionItemKind(),source:s.getSource(),assignmentRef:e});let p=a.getProperty(l);if(p!=null&&e.init.type===Lc.ASTType.Unknown)return;if(p!=null&&(0,kn.isUnknownType)(p.type)){p.type.mergeIntoType(s),a.setProperty(l,new Hi.EntityInfo(l,s));return}a.setProperty(l,new Hi.EntityInfo(l,s));return}let u=new Ba.InferLightExpression(r).infer(n.lastComponent);if((0,kn.isUnionType)(u)){u.variants.forEach(l=>{let p=l.getKeyType();p!=null&&a.setProperty(p,new Hi.EntityInfo(p.id,s))});return}let c=u.getKeyType();c!=null&&a.setProperty(c,new Hi.EntityInfo(c.id,s))}getVariableTypeFromIterator(e,n){if((0,kn.isMapType)(e)){let r=new Nc.MapType(this.typeStorage.generateId(kn.TypeKind.MapType,n),e.keyType.copy(!1,!0,this.typeStorage,this.document,this.scope),e.valueType.copy(!1,!0,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope,null,n);return r.setProperty("key",new Hi.EntityInfo("key",e.keyType.copy(!1,!0,this.typeStorage,this.document,this.scope))),r.setProperty("value",new Hi.EntityInfo("value",e.valueType.copy(!1,!0,this.typeStorage,this.document,this.scope))),r}else{if((0,kn.isListType)(e))return e.elementType.copy(!1,!0,this.typeStorage,this.document,this.scope);if((0,kn.isUnionType)(e))return new ZU.UnionType(this.typeStorage.generateId(kn.TypeKind.UnionType,n),e.variants.map(r=>this.getVariableTypeFromIterator(r,n)),this.typeStorage,this.document,this.scope,n);if(e.id===rT.SignatureDefinitionBaseType.String)return iT.Type.createBaseType(rT.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope,n);if(e.id===kn.NIL_TYPE_ID)return iT.Type.createBaseType(kn.NIL_TYPE_ID,this.typeStorage,this.document,this.scope,n)}return new nf.UnknownType(this.typeStorage,this.document,this.scope)}aggregateForGenericStatement(e){let n=new zD.InferContext(this.typeStorage,this.document,this.scope,this.onRequestScope),i=new XD.InferFullExpression(n).infer(e.iterator)||new nf.UnknownType(this.typeStorage,this.document,this.scope),s=this.getVariableTypeFromIterator(i,e);if(e.variable.type!==Lc.ASTType.Identifier)return;let o=e.variable.name;this.scope.setProperty(o,s),this.scope.setProperty(`__${o}_idx`,iT.Type.createBaseType(rT.SignatureDefinitionBaseType.Number,this.typeStorage,this.document,this.scope,e.variable)),this.scope.symbols.push({name:o,path:o,kind:sT.CompletionItemKind.Variable,source:s.getSource(),assignmentRef:e},{name:`__${o}_idx`,path:`__${o}_idx`,kind:sT.CompletionItemKind.Variable,source:s.getSource(),assignmentRef:e})}aggregateImportDefinition(e){let n=e.name,r=this.scope.getProperty(n.name);if(this.scope.symbols.push({name:n.name,path:n.name,kind:sT.CompletionItemKind.Variable,source:[{document:this.document.name,astRef:e,start:n.start,end:n.end}],assignmentRef:e}),r!=null){r.type.sourceMap.add(this.document,e);return}this.scope.setProperty(n.name,new nf.UnknownType(this.typeStorage,this.document,this.scope,e))}aggregate(){for(let e=0;e<this.block.definitions.length;e++){let n=this.block.definitions[e];switch(n.type){case Lc.ASTType.AssignmentStatement:{this.aggregateAssignmentStatement(n);break}case Lc.ASTType.ForGenericStatement:{this.aggregateForGenericStatement(n);break}case QU.ASTType.FeatureImportExpression:{this.aggregateImportDefinition(n);break}}}}};sf.ASTDefinitionAggregator=oT});var JD=f(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.parseVirtualType=wr.VIRTUAL_TYPE_MAIN_TAG_REGEX=wr.VIRTUAL_TYPE_MAIN_TAG=wr.VirtualTypeTag=void 0;var eK=Ic(),Ds=Ve(),tK=Na(),xt;(function(t){t.Main="vtype",t.Extends="extends",t.Function="function",t.Param="param",t.Params="params",t.Return="return",t.Returns="returns",t.Description="description",t.Example="example",t.Property="property"})(xt=wr.VirtualTypeTag||(wr.VirtualTypeTag={}));var nK=new Set(Object.values(xt));wr.VIRTUAL_TYPE_MAIN_TAG="@"+xt.Main;wr.VIRTUAL_TYPE_MAIN_TAG_REGEX=new RegExp(`^${wr.VIRTUAL_TYPE_MAIN_TAG}\\s+([a-zA-Z0-9_]+)`);function rK(t){return nK.has(t.tag)}function YD(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var uT=class{constructor(e){this.pointer=1,this.block=e,this.virtualType=this.createInitialVirtualType()}createInitialVirtualType(){let e=this.block.tags[0];return e.tag!==xt.Main?null:{type:e.name,extends:null,definitions:{}}}parseFunction(e){let n=e.name,r={id:`${this.virtualType.type}:${n}`,type:Ds.SignatureDefinitionBaseType.Function,arguments:[],returns:[],example:[],description:""};for(;this.pointer<this.block.tags.length;){let i=this.block.tags[this.pointer];if(i.tag===xt.Function||i.tag===xt.Property||i.tag===xt.Extends)break;switch(i.tag){case xt.Description:r.description+=YD(i)+`
|
115
|
-
`;break;case xt.Example:r.example.push(
|
116
|
-
`+s.value,i=s.end.line+1}return this.pointer=r-1,n}aggregateVirtualTypeFromComment(e){let n=e.value.trimLeft();if(!n.startsWith(lT.VIRTUAL_TYPE_MAIN_TAG))return;let r=n.match(lT.VIRTUAL_TYPE_MAIN_TAG_REGEX);if(!r||r.length<2)return;let i=r[1];if(this.registry.has(i))return;let s=this.aggregateNextPayload(e),o=(0,lT.parseVirtualType)(s),a=new oK.ClassType(i,null,o.extends,this.typeStorage,this.document,this.scope);this.registry.set(i,{classRef:a,virtualTypeDef:o}),this.typeStorage.addType(a),this.typeStorage.addKeyType(new aK.KeyType(i,this.typeStorage,this.document,this.scope,!0))}aggregate(){for(;this.pointer<this.chunk.comments.length;this.pointer++){let e=this.chunk.comments[this.pointer];e.scope===this.chunk&&this.aggregateVirtualTypeFromComment(e)}}evaluate(){this.registry.forEach(e=>{let n=e.classRef,r=e.virtualTypeDef;Object.entries(r.definitions).forEach(([i,s])=>{let o=s.type===cT.SignatureDefinitionBaseType.Function?cT.SignatureDefinitionFunction.parse(this.document.name,s):cT.SignatureDefinition.parse(this.document.name,s);n.insertDefinition(i,o)})})}};of.ASTSignatureAggregator=pT});var fT=f(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.DocumentTypeStorage=void 0;var tr=Ve(),qc=Qn(),xr=Ea(),uK=Rd(),dT=class extends uK.TypeStorage{constructor(e,n){super(n),this.document=e}insertDefault(){let e=this.parent;if(!e)throw new Error("Global type storage is not defined.");let n=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.General,this.document),r=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Function,this.document),i=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Map,this.document),s=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.List,this.document),o=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Number,this.document),a=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.String,this.document),u=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Any,this.document),c=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"funcRef",r,this.document,e),l=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"map",i,this.document,e),p=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"list",s,this.document,e),h=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"number",o,this.document,e),m=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"string",a,this.document,e);n.setProperty("funcRef",new qc.EntityInfo("funcRef",c)),n.setProperty("map",new qc.EntityInfo("map",l)),n.setProperty("list",new qc.EntityInfo("list",p)),n.setProperty("number",new qc.EntityInfo("number",h)),n.setProperty("string",new qc.EntityInfo("string",m)),this.addType(n),this.addType(r),this.addType(i),this.addType(s),this.addType(o),this.addType(a),this.addType(u)}addToAny(e,n){if(typeof e!="string")return;let r=this.typeInterfaces.get(tr.SignatureDefinitionBaseType.Any);r?.properties.set(e,n)}generateId(e,n){let r=n?`<${n.type}:${n.start.toString()}-${n.end.toString()}>`:"<virtual>";return`${e}-${this.document.name}-${this.__internalHandleCounter++}-${r}`}};af.DocumentTypeStorage=dT});var gT=f(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.ScopeState=void 0;var cK;(function(t){t[t.Inititialized=0]="Inititialized",t[t.Pending=1]="Pending",t[t.Resolved=2]="Resolved"})(cK=jc.ScopeState||(jc.ScopeState={}))});var yT=f(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.ChunkHelper=void 0;var Fc=Te(),uf=nT(),mT=class{constructor(e){this._root=e}getLastASTItemOfLine(e){let n=this._root.lines[e];if(!n||n.length===0)return null;let r=n[0];for(let i=1;i<n.length;i++){let s=n[i];(s.start.line>r.start.line||s.start.line===r.start.line&&s.start.character>r.start.character)&&(r=s)}return r}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}findAssignmentVariableSetterContext(e){switch(e.type){case Fc.ASTType.MemberExpression:{let n=e;return n.identifier.type!==Fc.ASTType.Identifier?null:{resolvePath:n.base,lastProperty:n.identifier.name,kind:uf.VariableSetterContextComponentKind.Property}}case Fc.ASTType.Identifier:return{property:e.name,kind:uf.VariableSetterContextComponentKind.Variable};case Fc.ASTType.IndexExpression:{let n=e;return n.index.type===Fc.ASTType.StringLiteral?{resolvePath:n.base,lastProperty:n.index.value,kind:uf.VariableSetterContextComponentKind.Property}:{resolvePath:n.base,lastComponent:n.index,kind:uf.VariableSetterContextComponentKind.Type}}}return null}};cf.ChunkHelper=mT});var _T=f(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.Scope=void 0;var QD=Ve(),So=Ur(),An=As(),Bc=ft(),lK=Qn(),pK=gi(),bT=class{constructor(e,n){this.document=e,this.outer=n,this.locals=new pK.MapType(e.typeStorage.generateId(Bc.TypeKind.MapType),null,null,e.typeStorage,e,this,null,null,!0),this.globals=e.globals||this,this.symbols=[]}getSelf(){return this.associatedFunction?.context}getSuper(){let e=this.getSelf();if(!(e==null||!(0,Bc.isMapType)(e)))return e.getProperty(Bc.ISA_PROPERTY)?.type}getOuter(){return this.outer?.getLocals()}getLocals(){return this.locals}getGlobals(){return this.globals.getLocals()}setProperty(e,n){typeof e=="string"&&this.locals.setProperty(e,new lK.EntityInfo(e,n))}getProperty(e){return this.locals.hasProperty(e)?this.locals.getProperty(e):this.outer?.hasProperty(e)?this.outer.locals.getProperty(e):this.globals.hasProperty(e)?this.globals.locals.getProperty(e):this.document.typeStorage.getTypePropertyById(QD.SignatureDefinitionBaseType.General,e)}getAllProperties(e=1){if(e>Bc.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map;for(let[i,s]of this.locals.properties)typeof i=="string"&&(n.has(i)||n.set(i,{type:s.type,name:s.name,kind:(0,Bc.isFunctionType)(s.type)?So.CompletionItemKind.Function:So.CompletionItemKind.Variable}));let r=[...this.globals!==this?this.globals.getAllProperties(e+1):[],...this.outer?.getAllProperties(e+1)||[],...this.document.typeStorage.getTypeById(QD.SignatureDefinitionBaseType.General).getAllProperties(e+1)];for(let i of r)n.has(i.name)||n.set(i.name,i);return!n.has(An.ConstantIdentifier.Globals)&&this.getGlobals()!=null&&n.set(An.ConstantIdentifier.Globals,{type:this.getGlobals(),name:An.ConstantIdentifier.Globals,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Locals)&&this.getLocals()!=null&&n.set(An.ConstantIdentifier.Locals,{type:this.getLocals(),name:An.ConstantIdentifier.Locals,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Outer)&&this.getOuter()!=null&&n.set(An.ConstantIdentifier.Outer,{type:this.getOuter(),name:An.ConstantIdentifier.Outer,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Self)&&this.getSelf()!=null&&n.set(An.ConstantIdentifier.Self,{type:this.getSelf(),name:An.ConstantIdentifier.Self,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Super)&&this.getSuper()!=null&&n.set(An.ConstantIdentifier.Super,{type:this.getSelf(),name:An.ConstantIdentifier.Super,kind:So.CompletionItemKind.Constant}),Array.from(n.values())}resolveAllAvailableWithQuery(e){let n=[this];return this.outer&&n.push(this.outer),this!==this.globals&&n.push(this.globals),n.flatMap(r=>r.symbols.filter(i=>i.path.includes(e)))}hasProperty(e){return this.locals.hasProperty(e)}};lf.Scope=bT});var TT=f(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.Document=void 0;var ZD=Ve(),hK=Te(),eR=aT(),dK=hT(),vT=Fd(),tR=ef(),fK=Mc(),gK=fT(),mK=As(),$a=gT(),pf=ft(),yK=yT(),bK=Oa(),_K=dc(),nR=_T(),rR=Tn(),iR=vr(),ST=class t{constructor(e,n,r,i){this.scopes=[],this.name=e,this.chunk=n,this.typeManager=r,this.typeStorage=new gK.DocumentTypeStorage(this,i),this.globals=new nR.Scope(this),this.scopeRefMapping=new WeakMap,this.scopeFnMapping=new WeakMap,this.chunkHelper=new yK.ChunkHelper(n),this.typeStorage.insertDefault(),r.modifyTypeStorage?.(this,i)}createScope(e){if(this.scopeRefMapping.has(e))return;let n=this.scopeRefMapping.get(e.scope),i={scope:new nR.Scope(this,n.scope),astRef:e,state:$a.ScopeState.Inititialized};this.scopes.push(i),this.scopeRefMapping.set(e,i)}aggregateScopes(){let e=this.chunk;if(this.scopeRefMapping.has(e))return;let n={scope:this.globals,astRef:e,state:$a.ScopeState.Inititialized};this.scopes.push(n),this.scopeRefMapping.set(e,n);for(let r=0;r<e.scopes.length;r++){let i=e.scopes[r];this.createScope(i)}}attachFunctionTypeToScope(e,n){let r=this.scopeRefMapping.get(e);r!=null&&(r.scope.associatedFunction=n,this.scopeFnMapping.set(n,r))}assumeArgumentTypes(e,n,r){let i=r.getArguments(),s=n.scope.getSelf();for(let o=0;o<i.length;o++){let a=i[o],u=a.getLabel();if(u===mK.ConstantIdentifier.Self&&s!=null){n.scope.setProperty(u,s);continue}let c=a.getTypes(),l=e.parameters[o],p=c.map(h=>(0,bK.determineTypeFromMeta)(h,this.typeStorage,this,n.scope,l.type===hK.ASTType.AssignmentStatement?l.init:l));n.scope.setProperty(u,iR.UnionType.createSmartly(p,this.typeStorage,this,n.scope))}}assumeReturnType(e,n,r){if(e.returns.length===0){let o=rR.Type.createBaseType(pf.NIL_TYPE_ID,this.typeStorage,this,n.scope);n.scope.associatedFunction.returnType=o,r._returns=o.toMeta().map(ZD.SignatureDefinitionTypeMeta.parse);return}let i=new iR.UnionType(this.typeStorage.generateId(pf.TypeKind.UnionType),[],this.typeStorage,this,n.scope);for(let o=0;o<e.returns.length;o++){let a=e.returns[o];if(a.argument==null){i.addVariant(rR.Type.createBaseType(pf.NIL_TYPE_ID,this.typeStorage,this,n.scope));continue}let u=new tR.InferFullExpression(new vT.InferContext(this.typeStorage,this,n.scope)).infer(a.argument);u&&i.addVariant(u)}let s=i.variants.length===1?i.firstVariant():i;n.scope.associatedFunction.returnType=s,r._returns=s.toMeta().map(ZD.SignatureDefinitionTypeMeta.parse)}aggregateDefinition(e){let n=this.scopeRefMapping.get(e);if(n.state!==$a.ScopeState.Inititialized)return;if(n.state=$a.ScopeState.Pending,n.scope.associatedFunction==null){new eR.ASTDefinitionAggregator(this.typeStorage,this,n.scope,e,a=>this.aggregateDefinition(a)).aggregate(),n.state=$a.ScopeState.Resolved;return}let r=n.scope.associatedFunction.signature;this.assumeArgumentTypes(e,n,r),new eR.ASTDefinitionAggregator(this.typeStorage,this,n.scope,e,o=>this.aggregateDefinition(o)).aggregate();let s=r.getReturns();s.length===1&&s[0].type===pf.UNKNOWN_TYPE_ID&&this.assumeReturnType(e,n,r),n.state=$a.ScopeState.Resolved}aggregateVirtualSignatures(){let e=this.chunk,n=new dK.ASTSignatureAggregator(this.typeStorage,this,this.globals,e);n.aggregate(),n.evaluate()}aggregateDefinitions(){let e=this.chunk;this.aggregateDefinition(e);for(let n=0;n<e.scopes.length;n++){let r=e.scopes[n];this.aggregateDefinition(r)}}resolveAllAssignmentsWithQuery(e){return[...this.scopes.flatMap(n=>n.scope.symbols.filter(r=>r.path.includes(e)))]}resolveAvailableAssignments(e){let n=new vT.InferContext(this.typeStorage,this,this.globals),r=new fK.InferLightExpression(n);r.infer(e);let i=this.scopeRefMapping.get(e.scope),s=[i.scope];i.scope.outer&&s.push(i.scope.outer),i.scope!==i.scope.globals&&s.push(i.scope.globals);let o=r.getPath();return s.flatMap(a=>a.symbols.filter(u=>u.path.includes(o)))}resolvePath(e){return this.globals.locals.getPropertyInPath(e)}resolveNamespace(e,n){let r=this.scopeRefMapping.get(e.scope);if(!r)return null;let i=new vT.InferContext(this.typeStorage,this,r.scope),s=new tR.InferFullExpression(i,n),o=s.infer(e);return o==null?null:{item:o,path:s.getPath(),value:s.getValue(),completionItemKind:s.getCompletionItemKind(),sources:o.getSource()}}merge(...e){let n=new t(this.name,this.chunk,this.typeManager,this.typeStorage.parent);n.aggregateScopes();for(let r=0;r<e.length;r++){let i=e[r];i.document!=null&&(n.typeStorage.merge(i.document.typeStorage),this.typeManager.modifyTypeStorageMerge?.(n,i.document,this.typeStorage.parent))}for(let r=0;r<e.length;r++){let i=e[r];i.document!=null&&(0,_K.mergeScope)(n.typeStorage,n.globals,i.document.globals,i.namespaces)}return n.aggregateVirtualSignatures(),n.aggregateDefinitions(),n}};hf.Document=ST});var sR=f(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.TypeManager=void 0;var vK=uS(),SK=TT(),wT=class{constructor(e){this.documents=new Map,this.container=e.container,this.typeStorage=new vK.GlobalTypeStorage,this.modifyTypeStorage=e.modifyTypeStorage,this.modifyTypeStorageMerge=e.modifyTypeStorageMerge,this.initializeTypeStorage()}initializeTypeStorage(){this.typeStorage.insertPrimitives(this.container),this.typeStorage.insertNonPrimitives(this.container),this.typeStorage.insertAllAnyTypeMembers(this.container)}analyze(e,n){let r=new SK.Document(e,n,this,this.typeStorage);return r.aggregateVirtualSignatures(),r.aggregateScopes(),r.aggregateDefinitions(),this.documents.set(e,r),r}get(e){return this.documents.get(e)}};df.TypeManager=wT});var aR=f(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.isSignatureDefinitionEqual=Ua.isTypeMetaEqual=void 0;function oR(t,e){return t.isEqual(e)}Ua.isTypeMetaEqual=oR;function TK(t,e){return t===e||t.getOrigin()===e.getOrigin()&&oR(t.getType(),e.getType())&&t.isProtected()===e.isProtected()&&t.getDescription()===e.getDescription()}Ua.isSignatureDefinitionEqual=TK});var Ka=f(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.mergeScope=j.enrichWithMetaInformation=j.determineTypeFromMeta=j.createCommentBlock=j.ChunkHelper=j.CompletionItemKind=j.PathType=j.UnaryType=j.ConstantIdentifierSet=j.ConstantIdentifier=j.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=j.MAX_DEPTH=j.ScopeState=j.isUnknownType=j.isUnionType=j.isListType=j.isFunctionType=j.isClassType=j.isMapType=j.isValidKeyValue=j.isKeyType=j.BASE_TYPE_SET=j.META_DOCS_SIGNATURE_ORIGIN=j.DEFAULT_SOURCE_DOCUMENT_ID=j.DEFAULT_SIGNATURE_ORIGIN=j.ISA_PROPERTY=j.UNKNOWN_TYPE_ID=j.NIL_TYPE_ID=j.MAX_ALL_PROPERTIES_DEPTH=j.TypeKind=j.ASTSignatureAggregator=j.ASTDefinitionAggregator=j.InferLightExpression=j.InferFullExpression=j.InferContext=j.InferBase=j.DocumentTypeStorage=j.GlobalTypeStorage=j.TypeStorage=j.Scope=j.Document=j.KeyType=j.EntityInfo=j.UnionType=j.MapType=j.ListType=j.FunctionType=j.ClassType=j.Type=j.TypeManager=void 0;j.parseMapDescription=j.parseAssignDescription=j.normalizeText=j.persistTypeInNativeFunction=j.createProxyForNativeType=j.isSignatureDefinitionEqual=j.isTypeMetaEqual=j.SourceMap=j.shallowMergeMap=j.shallowMergeList=j.deepMerge=void 0;var wK=sR();Object.defineProperty(j,"TypeManager",{enumerable:!0,get:function(){return wK.TypeManager}});var xK=Tn();Object.defineProperty(j,"Type",{enumerable:!0,get:function(){return xK.Type}});var EK=ka();Object.defineProperty(j,"ClassType",{enumerable:!0,get:function(){return EK.ClassType}});var kK=hc();Object.defineProperty(j,"FunctionType",{enumerable:!0,get:function(){return kK.FunctionType}});var AK=uo();Object.defineProperty(j,"ListType",{enumerable:!0,get:function(){return AK.ListType}});var PK=gi();Object.defineProperty(j,"MapType",{enumerable:!0,get:function(){return PK.MapType}});var OK=vr();Object.defineProperty(j,"UnionType",{enumerable:!0,get:function(){return OK.UnionType}});var DK=Qn();Object.defineProperty(j,"EntityInfo",{enumerable:!0,get:function(){return DK.EntityInfo}});var RK=Ra();Object.defineProperty(j,"KeyType",{enumerable:!0,get:function(){return RK.KeyType}});var IK=TT();Object.defineProperty(j,"Document",{enumerable:!0,get:function(){return IK.Document}});var CK=_T();Object.defineProperty(j,"Scope",{enumerable:!0,get:function(){return CK.Scope}});var MK=Rd();Object.defineProperty(j,"TypeStorage",{enumerable:!0,get:function(){return MK.TypeStorage}});var LK=uS();Object.defineProperty(j,"GlobalTypeStorage",{enumerable:!0,get:function(){return LK.GlobalTypeStorage}});var NK=fT();Object.defineProperty(j,"DocumentTypeStorage",{enumerable:!0,get:function(){return NK.DocumentTypeStorage}});var qK=Vd();Object.defineProperty(j,"InferBase",{enumerable:!0,get:function(){return qK.InferBase}});var jK=Fd();Object.defineProperty(j,"InferContext",{enumerable:!0,get:function(){return jK.InferContext}});var FK=ef();Object.defineProperty(j,"InferFullExpression",{enumerable:!0,get:function(){return FK.InferFullExpression}});var BK=Mc();Object.defineProperty(j,"InferLightExpression",{enumerable:!0,get:function(){return BK.InferLightExpression}});var $K=aT();Object.defineProperty(j,"ASTDefinitionAggregator",{enumerable:!0,get:function(){return $K.ASTDefinitionAggregator}});var UK=hT();Object.defineProperty(j,"ASTSignatureAggregator",{enumerable:!0,get:function(){return UK.ASTSignatureAggregator}});var rn=ft();Object.defineProperty(j,"TypeKind",{enumerable:!0,get:function(){return rn.TypeKind}});Object.defineProperty(j,"MAX_ALL_PROPERTIES_DEPTH",{enumerable:!0,get:function(){return rn.MAX_ALL_PROPERTIES_DEPTH}});Object.defineProperty(j,"NIL_TYPE_ID",{enumerable:!0,get:function(){return rn.NIL_TYPE_ID}});Object.defineProperty(j,"UNKNOWN_TYPE_ID",{enumerable:!0,get:function(){return rn.UNKNOWN_TYPE_ID}});Object.defineProperty(j,"ISA_PROPERTY",{enumerable:!0,get:function(){return rn.ISA_PROPERTY}});Object.defineProperty(j,"DEFAULT_SIGNATURE_ORIGIN",{enumerable:!0,get:function(){return rn.DEFAULT_SIGNATURE_ORIGIN}});Object.defineProperty(j,"DEFAULT_SOURCE_DOCUMENT_ID",{enumerable:!0,get:function(){return rn.DEFAULT_SOURCE_DOCUMENT_ID}});Object.defineProperty(j,"META_DOCS_SIGNATURE_ORIGIN",{enumerable:!0,get:function(){return rn.META_DOCS_SIGNATURE_ORIGIN}});Object.defineProperty(j,"BASE_TYPE_SET",{enumerable:!0,get:function(){return rn.BASE_TYPE_SET}});Object.defineProperty(j,"isKeyType",{enumerable:!0,get:function(){return rn.isKeyType}});Object.defineProperty(j,"isValidKeyValue",{enumerable:!0,get:function(){return rn.isValidKeyValue}});Object.defineProperty(j,"isMapType",{enumerable:!0,get:function(){return rn.isMapType}});Object.defineProperty(j,"isClassType",{enumerable:!0,get:function(){return rn.isClassType}});Object.defineProperty(j,"isFunctionType",{enumerable:!0,get:function(){return rn.isFunctionType}});Object.defineProperty(j,"isListType",{enumerable:!0,get:function(){return rn.isListType}});Object.defineProperty(j,"isUnionType",{enumerable:!0,get:function(){return rn.isUnionType}});Object.defineProperty(j,"isUnknownType",{enumerable:!0,get:function(){return rn.isUnknownType}});var KK=gT();Object.defineProperty(j,"ScopeState",{enumerable:!0,get:function(){return KK.ScopeState}});var WK=xa();Object.defineProperty(j,"MAX_DEPTH",{enumerable:!0,get:function(){return WK.MAX_DEPTH}});var $c=As();Object.defineProperty(j,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return $c.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});Object.defineProperty(j,"ConstantIdentifier",{enumerable:!0,get:function(){return $c.ConstantIdentifier}});Object.defineProperty(j,"ConstantIdentifierSet",{enumerable:!0,get:function(){return $c.ConstantIdentifierSet}});Object.defineProperty(j,"UnaryType",{enumerable:!0,get:function(){return $c.UnaryType}});Object.defineProperty(j,"PathType",{enumerable:!0,get:function(){return $c.PathType}});var GK=Ur();Object.defineProperty(j,"CompletionItemKind",{enumerable:!0,get:function(){return GK.CompletionItemKind}});var HK=yT();Object.defineProperty(j,"ChunkHelper",{enumerable:!0,get:function(){return HK.ChunkHelper}});var VK=Na();Object.defineProperty(j,"createCommentBlock",{enumerable:!0,get:function(){return VK.createCommentBlock}});var zK=Oa();Object.defineProperty(j,"determineTypeFromMeta",{enumerable:!0,get:function(){return zK.determineTypeFromMeta}});var XK=VS();Object.defineProperty(j,"enrichWithMetaInformation",{enumerable:!0,get:function(){return XK.enrichWithMetaInformation}});var ff=dc();Object.defineProperty(j,"mergeScope",{enumerable:!0,get:function(){return ff.mergeScope}});Object.defineProperty(j,"deepMerge",{enumerable:!0,get:function(){return ff.deepMerge}});Object.defineProperty(j,"shallowMergeList",{enumerable:!0,get:function(){return ff.shallowMergeList}});Object.defineProperty(j,"shallowMergeMap",{enumerable:!0,get:function(){return ff.shallowMergeMap}});var YK=md();Object.defineProperty(j,"SourceMap",{enumerable:!0,get:function(){return YK.SourceMap}});var uR=aR();Object.defineProperty(j,"isTypeMetaEqual",{enumerable:!0,get:function(){return uR.isTypeMetaEqual}});Object.defineProperty(j,"isSignatureDefinitionEqual",{enumerable:!0,get:function(){return uR.isSignatureDefinitionEqual}});var cR=Ea();Object.defineProperty(j,"createProxyForNativeType",{enumerable:!0,get:function(){return cR.createProxyForNativeType}});Object.defineProperty(j,"persistTypeInNativeFunction",{enumerable:!0,get:function(){return cR.persistTypeInNativeFunction}});var JK=Kd();Object.defineProperty(j,"normalizeText",{enumerable:!0,get:function(){return JK.normalizeText}});var QK=YS();Object.defineProperty(j,"parseAssignDescription",{enumerable:!0,get:function(){return QK.parseAssignDescription}});var ZK=zS();Object.defineProperty(j,"parseMapDescription",{enumerable:!0,get:function(){return ZK.parseMapDescription}})});var xT=f(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.getSymbolItemKind=Wa.getCompletionItemKind=void 0;var lt=Ka(),eW={[lt.CompletionItemKind.Constant]:21,[lt.CompletionItemKind.Internal]:21,[lt.CompletionItemKind.InternalFunction]:21,[lt.CompletionItemKind.InternalProperty]:21,[lt.CompletionItemKind.Property]:6,[lt.CompletionItemKind.Variable]:6,[lt.CompletionItemKind.Expression]:6,[lt.CompletionItemKind.Function]:3,[lt.CompletionItemKind.ListConstructor]:12,[lt.CompletionItemKind.MapConstructor]:12,[lt.CompletionItemKind.Literal]:12,[lt.CompletionItemKind.Unknown]:12},tW=t=>eW[t]??6;Wa.getCompletionItemKind=tW;var nW={[lt.CompletionItemKind.Constant]:14,[lt.CompletionItemKind.Internal]:14,[lt.CompletionItemKind.InternalFunction]:14,[lt.CompletionItemKind.InternalProperty]:14,[lt.CompletionItemKind.Variable]:13,[lt.CompletionItemKind.Property]:13,[lt.CompletionItemKind.Expression]:13,[lt.CompletionItemKind.Function]:12,[lt.CompletionItemKind.ListConstructor]:18,[lt.CompletionItemKind.MapConstructor]:19,[lt.CompletionItemKind.Literal]:13,[lt.CompletionItemKind.Unknown]:13},rW=t=>nW[t]??13;Wa.getSymbolItemKind=rW});var lR=f(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.CompletionListBuilder=void 0;var iW=xT(),ET=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,iW.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};gf.CompletionListBuilder=ET});var yf=f(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.findEx=Ga.ScraperWalker=void 0;var sW=Te(),oW=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},mf=class{constructor(e,n={}){this.map=Object.assign(oW(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};Ga.ScraperWalker=mf;function aW(t,e){let n=[];return new mf((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==sW.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Ga.findEx=aW});var kT=f(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.lookupBase=Pn.lookupIdentifier=Pn.lookupScopes=Pn.lookupRootScope=void 0;var Vi=Te(),uW=t=>{let e=t;for(;e.scope;)e=e.scope;return e};Pn.lookupRootScope=uW;var cW=t=>{if(!t.scope)return[t];let e=(0,Pn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};Pn.lookupScopes=cW;var lW=t=>{switch(t.type){case Vi.ASTType.CallStatement:return(0,Pn.lookupIdentifier)(t.expression);case Vi.ASTType.CallExpression:return(0,Pn.lookupIdentifier)(t.base);case Vi.ASTType.Identifier:return t;case Vi.ASTType.MemberExpression:return(0,Pn.lookupIdentifier)(t.identifier);case Vi.ASTType.IndexExpression:return(0,Pn.lookupIdentifier)(t.index);default:return null}};Pn.lookupIdentifier=lW;var pW=(t=null)=>{switch(t?.type){case Vi.ASTType.MemberExpression:return t.base;case Vi.ASTType.IndexExpression:return t.base;case Vi.ASTType.CallExpression:return t.base;case Vi.ASTType.SliceExpression:return t.base;default:return null}};Pn.lookupBase=pW});var pR=f(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.isValidIdentifierLiteral=void 0;var hW=Te(),dW=t=>{if(t.type!==hW.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};bf.isValidIdentifierLiteral=dW});var Ha=f(bi=>{"use strict";var fW=bi&&bi.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),gW=bi&&bi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mW=bi&&bi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&fW(e,t,n);return gW(e,t),e};Object.defineProperty(bi,"__esModule",{value:!0});bi.LookupHelper=void 0;var hR=Te(),yW=mW(yf()),bW=kT(),_W=pR(),AT=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.scopeRefMapping.get(n);return i==null?[]:i.scope.resolveAllAvailableWithQuery(e)}async findAllAssignmentsOfItem(e){let n=await this.getTypeMap();if(n==null)return null;let r=n.resolveNamespace(e,!1);return r==null?null:r.item}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.globals.getAllProperties().reduce((n,r)=>{let i=r.type.getSource();return n.set(r.name,{kind:r.kind,line:i&&i.length>0?i[0].start.line-1:-1}),n},new Map)}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.scopeRefMapping.get(e);return r==null?new Map:r.scope.getAllProperties().reduce((i,s)=>{let o=s.type.getSource();return i.set(s.name,{kind:s.kind,line:o&&o.length>0?o[0].start.line-1:-1}),i},new Map)}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;let s=n.scopeRefMapping.get(e.scope).scope.getAllProperties(),o=[],a=[];for(let u=0;u<s.length;u++){let c=s[u],l=c.type.getSource();c.type.document!=null&&c.type.document.name===n.name&&l!=null&&l.length>0?a.push(c):o.push(c)}for(let u=0;u<o.length;u++){let c=o[u];r.set(c.name,{kind:c.kind,line:-1})}a.sort((u,c)=>u.type.getSource()[0].start.line-c.type.getSource()[0].start.line);for(let u=0;u<a.length;u++){let c=a[u],l=c.type.getSource()[0];if(l.start.line>=e.end.line)break;r.set(c.name,{kind:c.kind,line:l.start.line-1})}return r}async lookupAST(e){let i=this.document.parsedPayload.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=yW.findEx((c,l)=>{let p=c.start.line-1,h=c.start.character-1,m=c.end.line-1,b=c.end.character-1;return p>e.line?{exit:!0}:p<m?{valid:e.line>p&&e.line<m||e.line===p&&h<=e.character||e.line===m&&b>=e.character}:{valid:p<=e.line&&h<=e.character&&m>=e.line&&b>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,bW.lookupBase)(e);return r?n.resolveNamespace(r,!0):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===hR.ASTType.MemberExpression&&e===i.identifier||i?.type===hR.ASTType.IndexExpression&&e===i.index&&(0,_W.isValidIdentifierLiteral)(e)?r.resolveNamespace(i,!1):r.resolveNamespace(e,!1)}async lookupType(e){let n=this,r=await n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};bi.LookupHelper=AT});var dR=f(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.AVAILABLE_CONSTANTS=void 0;_f.AVAILABLE_CONSTANTS=["true","false","null"].map(t=>({label:t,kind:21}))});var fR=f(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.AVAILABLE_KEYWORDS=void 0;var Va=Wr(),fn=Te();vf.AVAILABLE_KEYWORDS=[fn.Keyword.If,fn.Keyword.In,fn.Keyword.Or,fn.Keyword.And,fn.Keyword.Isa,fn.Keyword.For,fn.Keyword.New,fn.Keyword.Not,fn.Keyword.End,fn.Keyword.Then,fn.Keyword.Else,fn.Keyword.Break,fn.Keyword.While,fn.Keyword.Return,fn.Keyword.Function,fn.Keyword.Continue,Va.GreybelKeyword.Envar,Va.GreybelKeyword.Import,Va.GreybelKeyword.Include,Va.GreybelKeyword.Debugger,Va.GreybelKeyword.Line,Va.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var gR=f(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.AVAILABLE_OPERATORS=void 0;var Uc=Ma(),zt=Te();Sf.AVAILABLE_OPERATORS=[zt.Operator.Plus,zt.Operator.Asterik,zt.Operator.Minus,zt.Operator.Slash,zt.Operator.Power,zt.Operator.Modulo,zt.Operator.LessThan,zt.Operator.GreaterThan,zt.Operator.LessThanOrEqual,zt.Operator.GreaterThanOrEqual,zt.Operator.NotEqual,zt.Operator.Equal,zt.Operator.AddShorthand,zt.Operator.SubtractShorthand,zt.Operator.MultiplyShorthand,zt.Operator.DivideShorthand,Uc.Operator.BitwiseAnd,Uc.Operator.BitwiseOr,Uc.Operator.LeftShift,Uc.Operator.RightShift,Uc.Operator.UnsignedRightShift,zt.Operator.Assign,zt.Operator.Reference].map(t=>({label:t,kind:24}))});var yR=f(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.activate=Er.getDefaultCompletionList=Er.getPropertyCompletionList=void 0;var mR=Te(),vW=lR(),SW=Ha(),TW=dR(),wW=fR(),xW=gR(),EW=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.item.getAllProperties().reduce((r,i)=>{let s=i.type.getSource();return r.set(i.name,{kind:i.kind,line:s&&s.length>0?s[0].start.line-1:-1}),r},new Map)};Er.getPropertyCompletionList=EW;var kW=()=>[...wW.AVAILABLE_KEYWORDS,...xW.AVAILABLE_OPERATORS,...TW.AVAILABLE_CONSTANTS];Er.getDefaultCompletionList=kW;function AW(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new SW.LookupHelper(r,t),s=await i.lookupAST(e.position),o=new vW.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof mR.ASTMemberExpression?o.addCollection(await(0,Er.getPropertyCompletionList)(i,a)):a instanceof mR.ASTIndexExpression?o.addCollection(await(0,Er.getPropertyCompletionList)(i,a)):(o.setDefault((0,Er.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,Er.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}Er.activate=AW});var _R=f((LY,bR)=>{"use strict";bR.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var PT=f((NY,SR)=>{var Kc=_R(),vR={};for(let t of Object.keys(Kc))vR[Kc[t]]=t;var ee={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};SR.exports=ee;for(let t of Object.keys(ee)){if(!("channels"in ee[t]))throw new Error("missing channels property: "+t);if(!("labels"in ee[t]))throw new Error("missing channel labels property: "+t);if(ee[t].labels.length!==ee[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=ee[t];delete ee[t].channels,delete ee[t].labels,Object.defineProperty(ee[t],"channels",{value:e}),Object.defineProperty(ee[t],"labels",{value:n})}ee.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};ee.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),p=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=p(o),n=p(a),r=p(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};ee.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=ee.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};ee.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function PW(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}ee.rgb.keyword=function(t){let e=vR[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Kc)){let s=Kc[i],o=PW(t,s);o<n&&(n=o,r=i)}return r};ee.keyword.rgb=function(t){return Kc[t]};ee.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};ee.rgb.lab=function(t){let e=ee.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};ee.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};ee.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};ee.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};ee.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};ee.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,p;switch(o){default:case 6:case 0:c=a,l=u,p=n;break;case 1:c=u,l=a,p=n;break;case 2:c=n,l=a,p=u;break;case 3:c=n,l=u,p=a;break;case 4:c=u,l=n,p=a;break;case 5:c=a,l=n,p=u;break}return[c*255,l*255,p*255]};ee.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};ee.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ee.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};ee.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ee.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};ee.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};ee.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?ee.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};ee.hsv.ansi16=function(t){return ee.rgb.ansi16(ee.hsv.rgb(t),t[2])};ee.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};ee.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};ee.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};ee.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};ee.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};ee.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};ee.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};ee.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};ee.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};ee.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};ee.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};ee.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};ee.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};ee.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ee.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ee.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ee.gray.hsl=function(t){return[0,0,t[0]]};ee.gray.hsv=ee.gray.hsl;ee.gray.hwb=function(t){return[0,100,t[0]]};ee.gray.cmyk=function(t){return[0,0,0,t[0]]};ee.gray.lab=function(t){return[t[0],0,0]};ee.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};ee.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var wR=f((qY,TR)=>{var Tf=PT();function OW(){let t={},e=Object.keys(Tf);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function DW(t){let e=OW(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Tf[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function RW(t,e){return function(n){return e(t(n))}}function IW(t,e){let n=[e[t].parent,t],r=Tf[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=RW(Tf[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}TR.exports=function(t){let e=DW(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=IW(o,e))}return n}});var ER=f((jY,xR)=>{var OT=PT(),CW=wR(),za={},MW=Object.keys(OT);function LW(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function NW(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}MW.forEach(t=>{za[t]={},Object.defineProperty(za[t],"channels",{value:OT[t].channels}),Object.defineProperty(za[t],"labels",{value:OT[t].labels});let e=CW(t);Object.keys(e).forEach(r=>{let i=e[r];za[t][r]=NW(i),za[t][r].raw=LW(i)})});xR.exports=za});var AR=f(Xa=>{"use strict";var qW=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});Xa.activate=void 0;var DT=qW(ER()),jW=Te(),kR;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(kR||(kR={}));var RT={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},FW=()=>new RegExp(`(?:mark|color)=(${Object.keys(RT).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),BW=Object.prototype.hasOwnProperty;function $W(t){t.connection.onColorPresentation(e=>[{label:`#${DT.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).parsedPayload.literals.filter(u=>u.type===jW.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:p,lineIndex:h})=>{let m=u.index+c.indexOf("=")+1,b=m+l.length,v=p.line-1+h,R=m,A=b;return h===0&&(R+=p.character,A+=p.character),{start:{line:v,character:R},end:{line:v,character:A}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,p=c.value.toString().split(`
|
117
|
-
`);for(let h=0;h<p.length;h++){let m=p[h],b=FW(),v;for(;v=b.exec(m);){let[R,A]=v,T=a({match:v,markup:R,value:A,astPosition:l,lineIndex:h});if(A.startsWith("#")){let[w,_,N]=DT.default.hex.rgb(A.slice(1));o.push({range:T,color:{red:w/255,green:_/255,blue:N/255,alpha:1}})}else if(BW.call(RT,A)){let[w,_,N]=DT.default.hex.rgb(RT[A].slice(1));o.push({range:T,color:{red:w/255,green:_/255,blue:N/255,alpha:1}})}else o.push({range:T,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}Xa.activate=$W});var OR=f(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.activate=void 0;var PR=Te(),UW=Ha(),KW=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,WW=t=>{let e=t.astRef,n,r;switch(e.type){case PR.ASTType.ForGenericStatement:{let i=e;n={line:i.variable.start.line-1,character:i.variable.start.character-1},r={line:i.variable.end.line-1,character:i.variable.end.character-1};break}default:n={line:e.start.line-1,character:e.start.character-1},r={line:e.end.line-1,character:e.end.character-1}}return{targetUri:t.document,targetRange:{start:n,end:r},targetSelectionRange:{start:n,end:r}}},GW=async(t,e)=>{let r=(await t.findAllAssignmentsOfItem(e))?.getSource();if(r==null||r.length===0)return[];let i=[],s=new Set;for(let o of r){let a=o.astRef;if(!a.start||!a.end)continue;let u=WW(o),c=KW(u);s.has(c)||(s.add(c),i.push(u))}return i};function HW(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new UW.LookupHelper(r,t),s=await i.lookupAST(e.position);if(!s)return;let{outer:o,closest:a}=s,u=o.length>0?o[o.length-1]:void 0,c=a;return u&&u instanceof PR.ASTMemberExpression&&u.identifier===a&&(c=u),await GW(i,c)})}wf.activate=HW});var DR=f(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.activate=void 0;async function VW(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.parsedPayload.start,end:n.parsedPayload.end},message:r.message,severity:1}})}function zW(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await VW(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}xf.activate=zW});var IT=f((RR,Ef)=>{(function(t){"use strict";function e(_,N){var O=(_&65535)+(N&65535),G=(_>>16)+(N>>16)+(O>>16);return G<<16|O&65535}function n(_,N){return _<<N|_>>>32-N}function r(_,N,O,G,re,ae){return e(n(e(e(N,_),e(G,ae)),re),O)}function i(_,N,O,G,re,ae,K){return r(N&O|~N&G,_,N,re,ae,K)}function s(_,N,O,G,re,ae,K){return r(N&G|O&~G,_,N,re,ae,K)}function o(_,N,O,G,re,ae,K){return r(N^O^G,_,N,re,ae,K)}function a(_,N,O,G,re,ae,K){return r(O^(N|~G),_,N,re,ae,K)}function u(_,N){_[N>>5]|=128<<N%32,_[(N+64>>>9<<4)+14]=N;var O,G,re,ae,K,P=1732584193,M=-271733879,L=-1732584194,F=271733878;for(O=0;O<_.length;O+=16)G=P,re=M,ae=L,K=F,P=i(P,M,L,F,_[O],7,-680876936),F=i(F,P,M,L,_[O+1],12,-389564586),L=i(L,F,P,M,_[O+2],17,606105819),M=i(M,L,F,P,_[O+3],22,-1044525330),P=i(P,M,L,F,_[O+4],7,-176418897),F=i(F,P,M,L,_[O+5],12,1200080426),L=i(L,F,P,M,_[O+6],17,-1473231341),M=i(M,L,F,P,_[O+7],22,-45705983),P=i(P,M,L,F,_[O+8],7,1770035416),F=i(F,P,M,L,_[O+9],12,-1958414417),L=i(L,F,P,M,_[O+10],17,-42063),M=i(M,L,F,P,_[O+11],22,-1990404162),P=i(P,M,L,F,_[O+12],7,1804603682),F=i(F,P,M,L,_[O+13],12,-40341101),L=i(L,F,P,M,_[O+14],17,-1502002290),M=i(M,L,F,P,_[O+15],22,1236535329),P=s(P,M,L,F,_[O+1],5,-165796510),F=s(F,P,M,L,_[O+6],9,-1069501632),L=s(L,F,P,M,_[O+11],14,643717713),M=s(M,L,F,P,_[O],20,-373897302),P=s(P,M,L,F,_[O+5],5,-701558691),F=s(F,P,M,L,_[O+10],9,38016083),L=s(L,F,P,M,_[O+15],14,-660478335),M=s(M,L,F,P,_[O+4],20,-405537848),P=s(P,M,L,F,_[O+9],5,568446438),F=s(F,P,M,L,_[O+14],9,-1019803690),L=s(L,F,P,M,_[O+3],14,-187363961),M=s(M,L,F,P,_[O+8],20,1163531501),P=s(P,M,L,F,_[O+13],5,-1444681467),F=s(F,P,M,L,_[O+2],9,-51403784),L=s(L,F,P,M,_[O+7],14,1735328473),M=s(M,L,F,P,_[O+12],20,-1926607734),P=o(P,M,L,F,_[O+5],4,-378558),F=o(F,P,M,L,_[O+8],11,-2022574463),L=o(L,F,P,M,_[O+11],16,1839030562),M=o(M,L,F,P,_[O+14],23,-35309556),P=o(P,M,L,F,_[O+1],4,-1530992060),F=o(F,P,M,L,_[O+4],11,1272893353),L=o(L,F,P,M,_[O+7],16,-155497632),M=o(M,L,F,P,_[O+10],23,-1094730640),P=o(P,M,L,F,_[O+13],4,681279174),F=o(F,P,M,L,_[O],11,-358537222),L=o(L,F,P,M,_[O+3],16,-722521979),M=o(M,L,F,P,_[O+6],23,76029189),P=o(P,M,L,F,_[O+9],4,-640364487),F=o(F,P,M,L,_[O+12],11,-421815835),L=o(L,F,P,M,_[O+15],16,530742520),M=o(M,L,F,P,_[O+2],23,-995338651),P=a(P,M,L,F,_[O],6,-198630844),F=a(F,P,M,L,_[O+7],10,1126891415),L=a(L,F,P,M,_[O+14],15,-1416354905),M=a(M,L,F,P,_[O+5],21,-57434055),P=a(P,M,L,F,_[O+12],6,1700485571),F=a(F,P,M,L,_[O+3],10,-1894986606),L=a(L,F,P,M,_[O+10],15,-1051523),M=a(M,L,F,P,_[O+1],21,-2054922799),P=a(P,M,L,F,_[O+8],6,1873313359),F=a(F,P,M,L,_[O+15],10,-30611744),L=a(L,F,P,M,_[O+6],15,-1560198380),M=a(M,L,F,P,_[O+13],21,1309151649),P=a(P,M,L,F,_[O+4],6,-145523070),F=a(F,P,M,L,_[O+11],10,-1120210379),L=a(L,F,P,M,_[O+2],15,718787259),M=a(M,L,F,P,_[O+9],21,-343485551),P=e(P,G),M=e(M,re),L=e(L,ae),F=e(F,K);return[P,M,L,F]}function c(_){var N,O="",G=_.length*32;for(N=0;N<G;N+=8)O+=String.fromCharCode(_[N>>5]>>>N%32&255);return O}function l(_){var N,O=[];for(O[(_.length>>2)-1]=void 0,N=0;N<O.length;N+=1)O[N]=0;var G=_.length*8;for(N=0;N<G;N+=8)O[N>>5]|=(_.charCodeAt(N/8)&255)<<N%32;return O}function p(_){return c(u(l(_),_.length*8))}function h(_,N){var O,G=l(_),re=[],ae=[],K;for(re[15]=ae[15]=void 0,G.length>16&&(G=u(G,_.length*8)),O=0;O<16;O+=1)re[O]=G[O]^909522486,ae[O]=G[O]^1549556828;return K=u(re.concat(l(N)),512+N.length*8),c(u(ae.concat(K),640))}function m(_){var N="0123456789abcdef",O="",G,re;for(re=0;re<_.length;re+=1)G=_.charCodeAt(re),O+=N.charAt(G>>>4&15)+N.charAt(G&15);return O}function b(_){return unescape(encodeURIComponent(_))}function v(_){return p(b(_))}function R(_){return m(v(_))}function A(_,N){return h(b(_),b(N))}function T(_,N){return m(A(_,N))}function w(_,N,O){return N?O?A(N,_):T(N,_):O?v(_):R(_)}typeof define=="function"&&define.amd?define(function(){return w}):typeof Ef=="object"&&Ef.exports?Ef.exports=w:t.md5=w})(RR)});var Qa=f(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.getLiteralValue=Ja.getLiteralRawValue=void 0;var Ya=Te(),XW=(t,e=!1)=>{switch(t.type){case Ya.ASTType.NilLiteral:return"null";case Ya.ASTType.NumericLiteral:{let n=t;return`${n.negated?"-":""}${n.raw}`}case Ya.ASTType.BooleanLiteral:{let n=t,r=e?n.raw==="true"?"1":"0":n.raw;return`${n.negated?"-":""}${r}`}default:return t.raw.toString()}};Ja.getLiteralRawValue=XW;var YW=t=>{switch(t.type){case Ya.ASTType.NilLiteral:return"null";case Ya.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case Ya.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};Ja.getLiteralValue=YW});var MT=f(Za=>{"use strict";var JW=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});Za.LiteralsMapper=void 0;var QW=JW(IT()),IR=Qa(),CT=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,IR.getLiteralRawValue)(e,!0);if(r.length<2)return n;if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,QW.default)(r)))}return n}get(e){let n=this,r=(0,IR.getLiteralRawValue)(e,!0);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};Za.LiteralsMapper=CT});var NT=f(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.NamespaceGenerator=void 0;var LT=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};kf.NamespaceGenerator=LT});var Wc=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.Context=To.ContextDataProperty=void 0;var ZW=Te(),e5=MT(),CR=NT(),t5;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(t5=To.ContextDataProperty||(To.ContextDataProperty={}));var qT=class{constructor(e){let n=this;n.modules=new CR.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new CR.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(ZW.Keyword),...e.variablesExcluded||[]]}),n.literals=new e5.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};To.Context=qT});var wo=f(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.DependencyType=void 0;var n5;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(n5=Gc.DependencyType||(Gc.DependencyType={}))});var Hc=f(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.BuildError=void 0;var jT=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Af.BuildError=jT});var Of=f(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.fetchNamespaces=void 0;var FT=Te();function MR(t){if(t.type===FT.ASTType.MemberExpression){let e=t;return e.identifier.type===FT.ASTType.Identifier?e.identifier.name:null}else if(t.type===FT.ASTType.Identifier)return t.name;return null}function r5(t){let e=new Set(t.namespaces.map(MR).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(MR).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}Pf.fetchNamespaces=r5});var Vc=f(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.merge=void 0;function i5(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}Df.merge=i5});var tu=f(eu=>{"use strict";var s5=eu&&eu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});eu.Dependency=void 0;var LR=s5(IT()),NR=Wr(),zc=Wc(),Xc=wo(),o5=Hc(),a5=Of(),qR=Vc(),BT=class t{static generateDependencyMappingKey(e,n){return`${n}:${e}`}constructor(e){let n=this;n.target=e.target,n.id=(0,LR.default)(e.target),n.chunk=e.chunk,n.resourceManager=e.resourceManager,n.dependencies=new Map,n.injections=new Map,n.type=e.type||Xc.DependencyType.Main,n.context=e.context;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(zc.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(zc.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n){let r=this,i=r.context,{modules:s}=i,o=i.get(zc.ContextDataProperty.ResourceDependencyMap),a=r.resourceManager,u=a.getRelativePathMapping(r.target,e),c=(0,LR.default)(u),l=s.get(c);if(o.has(l))return o.get(l);try{let p=this.resourceManager.getResource(u).chunk;return new t({target:u,resourceManager:a,chunk:p,type:n,context:i})}catch(p){throw new o5.BuildError(p.message,{target:u,range:p.range})}}findInjections(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=e.resourceManager.getRelativePathMapping(e.target,i.path),o=e.resourceManager.getInjection(s);r.set(i.path,o)}return e.injections=r,r}findDependencies(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(zc.ContextDataProperty.DependencyCallStack),o=new Map;s.push(i);let a=[...n,...r];for(let u of a){let c=u instanceof NR.ASTFeatureIncludeExpression?Xc.DependencyType.Include:Xc.DependencyType.Import,l=e.resolve(u.path,c),p=l.getNamespace();if(s.includes(p))throw new Error(`Circular dependency from ${e.target} to ${l.target} detected.`);l.findDependencies(),o.set(t.generateDependencyMappingKey(u.path,c),l)}return this.findInjections(),e.dependencies=o,s.pop(),{dependencies:o}}findDependenciesWithMetadata(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(zc.ContextDataProperty.DependencyCallStack),o=[...(0,a5.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=new Map;s.push(i);let c=[...n,...r];for(let l of c){let p=l instanceof NR.ASTFeatureIncludeExpression?Xc.DependencyType.Include:Xc.DependencyType.Import,h=e.resolve(l.path,p),m=h.getNamespace();if(s.includes(m))throw new Error(`Circular dependency from ${e.target} to ${h.target} detected.`);let b=h.findDependenciesWithMetadata();(0,qR.merge)(o,b.namespaces),(0,qR.merge)(a,b.literals),u.set(t.generateDependencyMappingKey(l.path,p),h)}return this.findInjections(),e.dependencies=u,s.pop(),{dependencies:u,namespaces:o,literals:a}}};eu.Dependency=BT});var jR=f(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.getStringHashCode=void 0;Rf.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var $T=f(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.createExpressionHash=void 0;var If=Te(),FR=jR(),Cf=(t,e)=>t.$$hash=e,u5=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function nu(t){let e=u5(t);if(e!==null)return e;let n=(0,FR.getStringHashCode)(t.type);switch(t.type){case If.ASTType.ParenthesisExpression:return nu(t.expression);case If.ASTType.MemberExpression:{let r=t;return n^=nu(r.base),n^=nu(r.identifier),Cf(t,n)}case If.ASTType.IndexExpression:{let r=t;return n^=nu(r.base),n^=nu(r.index),Cf(t,n)}case If.ASTType.Identifier:{let r=t;return n^=(0,FR.getStringHashCode)(r.name),Cf(t,n)}}return Cf(t,n)}function c5(t){return nu(t)}Mf.createExpressionHash=c5});var KT=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.BeautifyBodyIterator=Eo.FILLER_TYPE=void 0;var xo=Te();Eo.FILLER_TYPE="FILLER";var UT=class{constructor(e,n){this._base=e,this._items=n.sort((r,i)=>r.range[0]-i.range[0]),this._index=0,this._freeSpaceIndex=0,this._freeSpace=0,this._lastEndLine=0,this._checkedIndexes=new Set,this._previous=null}getBlockOpenerEndLine(e){switch(e.type){case xo.ASTType.IfClause:return e.condition.end.line;case xo.ASTType.WhileStatement:return e.condition.end.line;case xo.ASTType.ForGenericStatement:return e.iterator.end.line;case xo.ASTType.Chunk:return e.start.line-1}return e.start.line}getBlockCloseEndLine(e){switch(e.type){case xo.ASTType.Chunk:return e.end.line+1}return e.end.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===xo.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}getFreeSpaceItem(){let e={line:this._lastEndLine+this._freeSpaceIndex+1,character:0};return this._freeSpaceIndex++,this._freeSpace===this._freeSpaceIndex&&(this._lastEndLine=0,this._freeSpaceIndex=0,this._freeSpace=0),new xo.ASTBase(Eo.FILLER_TYPE,{start:e,end:e,range:[0,0],scope:this._base.scope})}next(){if(this._freeSpace>this._freeSpaceIndex)return{value:this.getFreeSpaceItem(),done:!1};if(this._index>=this._items.length){if(!this._checkedIndexes.has(this._items.length)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(this.getBlockCloseEndLine(this._base)-n-1,0);if(r>0)return this._checkedIndexes.add(this._items.length),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return{value:null,done:!0}}let e=this._items[this._index];if(!this._checkedIndexes.has(this._index)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(e.start.line-n-1,0);if(r>0)return this._checkedIndexes.add(this._index),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return this._index++,this._previous=e,{value:e,done:!1}}};Eo.BeautifyBodyIterator=UT});var GT=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.BeautifyContext=Ao.IndentationType=void 0;var ko=Te(),BR=KT(),$R;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})($R=Ao.IndentationType||(Ao.IndentationType={}));var WT=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._stack=[],this._contexts=new Map,this._isMultilineAllowed=!0,this.getIndent=n.indentation===$R.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}buildChunkContext(e){let n=new Map,r=Object.keys(e.lines),i=new Set;for(let s=0;s<r.length;s++){let o=Number(r[s]),u=e.lines[o].filter(c=>c.type===ko.ASTType.Comment);for(let c=0;c<u.length;c++){let l=u[c];if(!i.has(l))if(i.add(l),l.isMultiline){let p=l.value.split(`
|
118
|
-
`);p.forEach((h,m)=>{let b=o+m;n.has(b)||n.set(b,[]);let R=e.lines[b].filter(N=>N.type!==ko.ASTType.Comment).map(N=>N.start.character),A=R.length>0?Math.min(...R):-1,T=b===o,w=b===o+p.length-1,_=w?l.end.character<A:!1;n.get(b).push({isMultiline:!0,isStart:T,isEnd:w,isBefore:_,value:h})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof ko.ASTIfClause||e instanceof ko.ASTWhileStatement?e.condition.end.line:e instanceof ko.ASTForGenericStatement?e.iterator.end.line:e instanceof ko.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===ko.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new BR.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===BR.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Ao.BeautifyContext=WT});var HT=f(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.commentToText=Bt.hasEmptyBody=Bt.containsMultilineItemInShortcutClauses=Bt.getLastComment=Bt.unwrap=Bt.countRightBinaryExpressions=Bt.SHORTHAND_OPERATORS=void 0;var Fn=Te();Bt.SHORTHAND_OPERATORS=[Fn.Operator.Plus,Fn.Operator.Minus,Fn.Operator.Asterik,Fn.Operator.Slash,Fn.Operator.Modulo,Fn.Operator.Power];var l5=t=>{if(t=(0,Bt.unwrap)(t),t instanceof Fn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof Fn.ASTBinaryExpression&&n++,(r instanceof Fn.ASTBinaryExpression||r instanceof Fn.ASTLogicalExpression||r instanceof Fn.ASTIsaExpression)&&(e.push((0,Bt.unwrap)(r.left)),e.push((0,Bt.unwrap)(r.right)))}return n};Bt.countRightBinaryExpressions=l5;var p5=t=>{for(;t instanceof Fn.ASTParenthesisExpression;)t=t.expression;return t};Bt.unwrap=p5;var h5=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===Fn.ASTType.Comment)return n}return null};Bt.getLastComment=h5;var d5=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Bt.containsMultilineItemInShortcutClauses=d5;var f5=t=>!t.some(e=>!(e instanceof Fn.ASTComment));Bt.hasEmptyBody=f5;var g5=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();Bt.commentToText=g5});var zT=f(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.Stack=void 0;var VT=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};Lf.Stack=VT});var Yc=f(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.Factory=void 0;var m5=zT(),XT=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get originDependency(){return this._originDependency}get activeDependency(){return this._activeDependency}set activeDependency(e){this._activeDependency=e}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._originDependency=null,this._activeDependency=null,this._currentStack=new m5.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};Nf.Factory=XT});var JT=f(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.BeautifyFactory=void 0;var Jc=Te(),y5=require("path"),UR=tu(),KR=wo(),WR=$T(),qf=Qa(),jf=KT(),GR=GT(),Vr=HT(),b5=Yc(),YT=class extends b5.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof Jc.ASTIdentifier||u instanceof Jc.ASTMemberExpression)&&c instanceof Jc.ASTBinaryExpression&&(c.left instanceof Jc.ASTIdentifier||c.left instanceof Jc.ASTMemberExpression)&&Vr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,WR.createExpressionHash)(u)===(0,WR.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,Vr.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new jf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===jf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,qf.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let l=0;l<o.arguments.length;l++){let p=o.arguments[l];this.pushSegment(this.context.getIndent(),p),this.process(p),l!==o.arguments.length-1&&(this.pushSegment(",",p),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let l=0;l<o.arguments.length;l++){let p=o.arguments[l];this.process(p),l!==o.arguments.length-1&&this.pushSegment(", ",p)}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.activeDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.activeDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){var u;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}let c=(u=this.activeDependency)===null||u===void 0?void 0:u.dependencies.get(UR.Dependency.generateDependencyMappingKey(o.path,KR.DependencyType.Import));if(!c){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+c.getNamespace()+'")',o)},FeatureIncludeExpression:function(o,a){var u;if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}let c=(u=this.activeDependency)===null||u===void 0?void 0:u.dependencies.get(UR.Dependency.generateDependencyMappingKey(o.path,KR.DependencyType.Include));if(!c){this.pushSegment(`#include "${o.path}";`,o);return}let l=this.activeDependency;this.activeDependency=c,this.process(c.chunk),this.activeDependency=l},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,y5.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new jf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===jf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Vr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=GR.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new GR.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._originDependency=n,this._activeDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(Vr.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(Vr.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
|
119
|
-
`)}generateOptimizations(){return[]}};Ff.BeautifyFactory=YT});var ZT=f($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.DefaultFactory=void 0;var _5=require("path"),
|
113
|
+
`)}inferLogicalExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferIsaExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferComparisonGroupExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferSliceExpression(e){let n=this.infer(e.base);return this.path+=nn.PathType.Slice,this.completionItemKind=er.CompletionItemKind.Expression,this.value=null,n}inferConstantIdentifier(e){let n=this.context.scope;switch(this.completionItemKind=er.CompletionItemKind.Constant,e.name){case nn.ConstantIdentifier.Self:return n.getSelf();case nn.ConstantIdentifier.Globals:return n.getGlobals();case nn.ConstantIdentifier.Outer:return n.getOuter();case nn.ConstantIdentifier.Locals:return n.getLocals();case nn.ConstantIdentifier.Super:return n.getSuper();default:throw new Error(`Unknown constant identifier: ${e.name}`)}}inferUnaryExpression(e){if(e.operator===nn.UnaryType.Not)return Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);e.operator===ja.Operator.Reference&&(this.skipNextInvoke=!0);let n=this.infer(e.argument);if(n==null)return Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.operator===ja.Operator.New&&(0,wn.isMapType)(n)){let r=new jU.MapType(this.context.typeStorage.generateId(wn.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);return r.setProperty(wn.ISA_PROPERTY,new qU.EntityInfo(wn.ISA_PROPERTY,n)),r}return n}inferNilLiteral(e){let n=Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Nil,this.completionItemKind=er.CompletionItemKind.Literal,this.value="null",n}inferStringLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null),r=e.value.length>wn.MAX_STRING_LENGTH?`"${e.value.slice(0,wn.MAX_STRING_LENGTH)}..."`:`"${e.value}"`;return this.path+=r,this.completionItemKind=er.CompletionItemKind.Literal,this.value=r,n}inferNumericLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=e.value.toString(),this.completionItemKind=er.CompletionItemKind.Literal,this.value=e.value.toString(),n}inferBooleanLiteral(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Literal,this.value=e.value.toString(),n}inferFeatureFileExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureLineExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.Number,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureEnvarExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}inferFeatureInjectExpression(e){let n=Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=nn.PathType.String,this.completionItemKind=er.CompletionItemKind.Literal,this.value=null,n}handleBinaryAddOperation(e,n){let r=e.getKeyType(),i=n.getKeyType();return r?.id===i?.id?(0,wn.isMapType)(e)?(0,$R.shallowMergeMap)(e,n):(0,wn.isListType)(e)?(0,$R.shallowMergeList)(e,n):(0,wn.isUnionType)(e)?new FR.UnionType(this.context.typeStorage.generateId(wn.TypeKind.UnionType),[e,n],this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(e.id,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.String||n.id===Ge.SignatureDefinitionBaseType.String?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null)}handleBinaryMultiplyOperation(e,n){return e.id===Ge.SignatureDefinitionBaseType.String&&n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.String,this.context.typeStorage,this.context.document,this.context.scope,null):e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(wn.NIL_TYPE_ID,this.context.typeStorage,this.context.document,this.context.scope,null)}handleDefaultMathOperation(e,n){return e.id===Ge.SignatureDefinitionBaseType.Number||n.id===Ge.SignatureDefinitionBaseType.Number?Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null):Tt.Type.createBaseType(Ge.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null)}inferParenthesisExpression(e){return this.infer(e.expression)}};Hd.InferBase=JS});var Mc=f(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.InferLightExpression=void 0;var zd=Wr(),xn=Ve(),nt=Te(),QS=Qn(),$U=Da(),jn=Tn(),UU=vr(),Xd=pc(),Ht=Ur(),vo=As(),Fa=ft(),KU=Vd(),ZS=class t extends KU.InferBase{inferCallExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);return n==null?jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):this.invoke(n)}inferBinaryExpression(e){if(vo.SIMPLE_BINARY_OPERATORS_SET.has(e.operator))return this.path+=vo.PathType.Expression,this.completionItemKind=Ht.CompletionItemKind.Expression,this.value=null,jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new t(this.context).infer(e.left)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null),r=new t(this.context).infer(e.right)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);switch(this.path+=vo.PathType.Expression,this.completionItemKind=Ht.CompletionItemKind.Expression,this.value=null,e.operator){case nt.Operator.Plus:return this.handleBinaryAddOperation(n,r);case nt.Operator.Asterik:return this.handleBinaryMultiplyOperation(n,r);default:return this.handleDefaultMathOperation(n,r)}}inferIndexExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);if(n==null)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.index.type===nt.ASTType.InvalidCodeExpression)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);if(e.index.type===nt.ASTType.StringLiteral){let u=e.index.value,c=n.getProperty(u);if(this.path+=`.${u}`,this.value=null,c!=null)return this.completionItemKind=(0,Fa.isFunctionType)(c.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,c.type;this.completionItemKind=Ht.CompletionItemKind.Property;let l=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(u,new QS.EntityInfo(u,l)),l}let r=new t(this.context).infer(e.index)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if((0,Fa.isUnionType)(r)){let a=r.variants.map(u=>n.getProperty(u.getKeyType())?.type).filter(u=>u!=null);return this.completionItemKind=Ht.CompletionItemKind.Property,a.length===0?jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):a.length===1?r.firstVariant():new UU.UnionType(this.context.typeStorage.generateId(Fa.TypeKind.UnionType,e),a,this.context.typeStorage,this.context.document,this.context.scope,null)}let i=r.getKeyType()||new $U.KeyType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),s=n.getProperty(i);if(this.path+=`[${r.id}]`,this.value=null,s!=null)return this.completionItemKind=(0,Fa.isFunctionType)(s.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,s.type;this.completionItemKind=Ht.CompletionItemKind.Property;let o=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(i,new QS.EntityInfo(i.id,o)),o}inferFunctionStatement(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Function,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.Function,this.completionItemKind=Ht.CompletionItemKind.Function,this.value=null,n}inferIdentifier(e){let n=this.checkSkipNextInvoke();if(this.path+=e.name,this.value=null,vo.ConstantIdentifierSet.has(e.name)&&!this.context.scope.hasProperty(e.name))return this.inferConstantIdentifier(e)||jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);let r=e.name,i=this.context.scope.getProperty(r);if(i!=null)return this.completionItemKind=(0,Fa.isFunctionType)(i.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Variable,n?i.type:this.invoke(i.type);this.completionItemKind=Ht.CompletionItemKind.Variable;let s=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return this.context.scope.setProperty(r,s),s}inferMemberExpression(e){let n=this.checkSkipNextInvoke(),r=this.infer(e.base);if(r==null)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.identifier.type===nt.ASTType.InvalidCodeExpression)return jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);let i=e.identifier.name,s=r.getProperty(i);if(this.path+=`.${i}`,this.value=null,s!=null)return this.completionItemKind=(0,Fa.isFunctionType)(s.type)?Ht.CompletionItemKind.Function:Ht.CompletionItemKind.Property,n?s.type:this.invoke(s.type);this.completionItemKind=Ht.CompletionItemKind.Property;let o=new Xd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return r.setProperty(i,new QS.EntityInfo(i,o)),o}inferMapConstructorExpression(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.Map,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.Map,this.completionItemKind=Ht.CompletionItemKind.MapConstructor,this.value=null,n}inferListConstructorExpression(e){let n=jn.Type.createBaseType(xn.SignatureDefinitionBaseType.List,this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=vo.PathType.List,this.completionItemKind=Ht.CompletionItemKind.ListConstructor,this.value=null,n}infer(e){if(e==null)return null;switch(e.type){case nt.ASTType.ParenthesisExpression:return this.inferParenthesisExpression(e);case nt.ASTType.CallExpression:return this.inferCallExpression(e);case nt.ASTType.BinaryExpression:return this.inferBinaryExpression(e);case nt.ASTType.LogicalExpression:return this.inferLogicalExpression(e);case nt.ASTType.IsaExpression:return this.inferIsaExpression(e);case nt.ASTType.ComparisonGroupExpression:return this.inferComparisonGroupExpression(e);case nt.ASTType.FunctionDeclaration:return this.inferFunctionStatement(e);case nt.ASTType.SliceExpression:return this.inferSliceExpression(e);case nt.ASTType.IndexExpression:return this.inferIndexExpression(e);case nt.ASTType.MemberExpression:return this.inferMemberExpression(e);case nt.ASTType.Identifier:return this.inferIdentifier(e);case nt.ASTType.MapConstructorExpression:return this.inferMapConstructorExpression(e);case nt.ASTType.ListConstructorExpression:return this.inferListConstructorExpression(e);case nt.ASTType.NegationExpression:case nt.ASTType.BinaryNegatedExpression:case nt.ASTType.UnaryExpression:return this.inferUnaryExpression(e);case nt.ASTType.NilLiteral:return this.inferNilLiteral(e);case nt.ASTType.StringLiteral:return this.inferStringLiteral(e);case nt.ASTType.NumericLiteral:return this.inferNumericLiteral(e);case nt.ASTType.BooleanLiteral:return this.inferBooleanLiteral(e);case zd.ASTType.FeatureFileExpression:return this.inferFeatureFileExpression(e);case zd.ASTType.FeatureLineExpression:return this.inferFeatureLineExpression(e);case zd.ASTType.FeatureEnvarExpression:return this.inferFeatureEnvarExpression(e);case zd.ASTType.FeatureInjectExpression:return this.inferFeatureInjectExpression(e);default:return null}}};Yd.InferLightExpression=ZS});var ef=f(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.InferFullExpression=void 0;var Jd=Wr(),wt=Ve(),Ue=Te(),WU=ka(),Ps=Qn(),GU=hc(),KR=Da(),WR=uo(),eT=gi(),En=Tn(),GR=vr(),Qd=pc(),Vt=Ur(),Os=As(),Mt=ft(),HR=Oa(),HU=VS(),VU=zS(),zU=Vd(),VR=Mc(),tT=class t extends zU.InferBase{createCustomTypeFromMap(e,n){let r=this.resolveRelatedCommentLines(e);if(r==null)return;let i=r.join(`
|
114
|
+
`),s=(0,VU.parseMapDescription)(i);s!=null&&(s.properties.forEach(o=>{if(o.path===Mt.ISA_PROPERTY)return;let a=o.path.split("."),u=o.type.length>1?new GR.UnionType(this.context.typeStorage.generateId(Mt.TypeKind.UnionType,e),o.type.map(c=>(0,HR.determineTypeFromMeta)(c,this.context.typeStorage,this.context.document,this.context.scope)),this.context.typeStorage,this.context.document,this.context.scope):(0,HR.determineTypeFromMeta)(o.type[0],this.context.typeStorage,this.context.document,this.context.scope);n.setPropertyInPath(a,new Ps.EntityInfo(a[a.length-1],u))}),this.context.typeStorage.addType(new WU.ClassType(s.type,n,s.extends||wt.SignatureDefinitionBaseType.Map,this.context.typeStorage,this.context.document,this.context.scope,new Map)),this.context.typeStorage.addKeyType(new KR.KeyType(s.type,this.context.typeStorage,this.context.document,this.context.scope,!0)))}inferCallExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);return n==null?En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):this.invoke(n)}inferBinaryExpression(e){if(Os.SIMPLE_BINARY_OPERATORS_SET.has(e.operator))return this.path+=Os.PathType.Expression,this.completionItemKind=Vt.CompletionItemKind.Expression,this.value=null,En.Type.createBaseType(wt.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new t(this.context).infer(e.left)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null),r=new t(this.context).infer(e.right)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);switch(this.path+=Os.PathType.Expression,this.completionItemKind=Vt.CompletionItemKind.Expression,this.value=null,e.operator){case Ue.Operator.Plus:return this.handleBinaryAddOperation(n,r);case Ue.Operator.Asterik:return this.handleBinaryMultiplyOperation(n,r);default:return this.handleDefaultMathOperation(n,r)}}inferIndexExpression(e){this.checkSkipNextInvoke();let n=this.infer(e.base);if(n==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.index.type===Ue.ASTType.InvalidCodeExpression)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);if(e.index.type===Ue.ASTType.StringLiteral){let u=e.index.value,c=n.getProperty(u);if(this.path+=`.${u}`,this.value=null,c!=null)return this.completionItemKind=(0,Mt.isFunctionType)(c.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,c.type;this.completionItemKind=Vt.CompletionItemKind.Property;let l=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(u,new Ps.EntityInfo(u,l)),l}let r=new VR.InferLightExpression(this.context).infer(e.index)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(this.path+=`[${r.id}]`,this.value=null,(0,Mt.isUnionType)(r)){let a=r.variants.map(u=>n.getProperty(u.getKeyType())?.type).filter(u=>u!=null);return this.completionItemKind=Vt.CompletionItemKind.Property,a.length===0?En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null):a.length===1?r.firstVariant():new GR.UnionType(this.context.typeStorage.generateId(Mt.TypeKind.UnionType,e),a,this.context.typeStorage,this.context.document,this.context.scope,null)}let i=r.getKeyType()||new KR.KeyType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),s=n.getProperty(i);if(s!=null)return this.completionItemKind=(0,Mt.isFunctionType)(s.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,s.type;this.completionItemKind=Vt.CompletionItemKind.Property;let o=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return n.setProperty(i,new Ps.EntityInfo(i.id,o)),o}inferFunctionStatement(e){let n=this.createFunctionDescription(e),r=wt.SignatureDefinitionFunction.parse(Mt.DEFAULT_SIGNATURE_ORIGIN,{id:this.context.typeStorage.generateId(Mt.TypeKind.FunctionType,e),type:wt.SignatureDefinitionBaseType.Function,description:n,arguments:e.parameters.map(s=>{if(s.type===Ue.ASTType.Identifier)return{label:s.name??"unknown",type:wt.SignatureDefinitionBaseType.Any};let o=s,a=new t(this.context).infer(o.init)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);return{label:o.variable?.name??"unknown",types:[a.getKeyType()?.id||wt.SignatureDefinitionBaseType.Any]}}),returns:[Mt.UNKNOWN_TYPE_ID]}),i=new GU.FunctionType(wt.SignatureDefinitionBaseType.Function,(0,HU.enrichWithMetaInformation)(this.context.typeStorage,r),this.context.typeStorage,this.context.document,this.context.scope,null);return this.path+=Os.PathType.Function,this.completionItemKind=Vt.CompletionItemKind.Function,this.value=null,i}inferIdentifier(e){let n=this.checkSkipNextInvoke();if(this.path+=e.name,this.value=null,Os.ConstantIdentifierSet.has(e.name)&&!this.context.scope.hasProperty(e.name))return this.inferConstantIdentifier(e)||En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);let r=e.name,i=this.context.scope.getProperty(r);if(i!=null)return this.completionItemKind=(0,Mt.isFunctionType)(i.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Variable,n?i.type:this.invoke(i.type);this.completionItemKind=Vt.CompletionItemKind.Variable;let s=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return this.context.scope.setProperty(r,s),s}inferMemberExpression(e){let n=this.checkSkipNextInvoke(),r=this.infer(e.base);if(r==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.identifier.type===Ue.ASTType.InvalidCodeExpression)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope);let i=e.identifier.name,s=r.getProperty(i);if(this.path+=`.${i}`,this.value=null,s!=null)return this.completionItemKind=(0,Mt.isFunctionType)(s.type)?Vt.CompletionItemKind.Function:Vt.CompletionItemKind.Property,n?s.type:this.invoke(s.type);this.completionItemKind=Vt.CompletionItemKind.Property;let o=new Qd.UnknownType(this.context.typeStorage,this.context.document,this.context.scope);return r.setProperty(i,new Ps.EntityInfo(i,o)),o}inferMapConstructorExpression(e){if(this.path+=Os.PathType.Map,this.completionItemKind=Vt.CompletionItemKind.MapConstructor,this.value="{}",e.fields.length===0)return new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);let n=new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=new t(this.context).infer(i.value)?.copy(!1,!0,this.context.typeStorage,this.context.document,this.context.scope,i.value);if(s!=null)if(i.key.type===Ue.ASTType.StringLiteral){let o=i.key;n.setProperty(o.value,new Ps.EntityInfo(o.value,s))}else{let o=new VR.InferLightExpression(this.context).infer(i.key);if(o==null)continue;if((0,Mt.isUnionType)(o))o.variants.forEach(a=>{let u=a.getKeyType();u!=null&&n.setProperty(u,new Ps.EntityInfo(u.id,s))});else{let a=o.getKeyType();if(a==null)continue;n.setProperty(a,new Ps.EntityInfo(a.id,s))}}}return n}inferListConstructorExpression(e){if(this.path+=Os.PathType.List,this.completionItemKind=Vt.CompletionItemKind.ListConstructor,this.value="[]",e.fields.length===0)return new WR.ListType(this.context.typeStorage.generateId(Mt.TypeKind.ListType,e),En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope),this.context.typeStorage,this.context.document,this.context.scope);let n=new WR.ListType(this.context.typeStorage.generateId(Mt.TypeKind.ListType,e),null,this.context.typeStorage,this.context.document,this.context.scope);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=new t(this.context).infer(i.value)?.copy(!1,!0,this.context.typeStorage,this.context.document,this.context.scope,i.value);s!=null&&n.addElementType(s)}return n}inferUnaryExpression(e){if(e.operator===Os.UnaryType.Not)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Number,this.context.typeStorage,this.context.document,this.context.scope,null);e.operator===Ue.Operator.Reference&&(this.skipNextInvoke=!0);let n=this.infer(e.argument);if(n==null)return En.Type.createBaseType(wt.SignatureDefinitionBaseType.Any,this.context.typeStorage,this.context.document,this.context.scope,null);if(e.operator===Ue.Operator.New&&(0,Mt.isMapType)(n)){let r=new eT.MapType(this.context.typeStorage.generateId(Mt.TypeKind.MapType,e),null,null,this.context.typeStorage,this.context.document,this.context.scope,null);return r.setProperty(Mt.ISA_PROPERTY,new Ps.EntityInfo(Mt.ISA_PROPERTY,n)),r}return n}infer(e){if(e==null)return null;switch(e.type){case Ue.ASTType.ParenthesisExpression:return this.inferParenthesisExpression(e);case Ue.ASTType.CallExpression:return this.inferCallExpression(e);case Ue.ASTType.BinaryExpression:return this.inferBinaryExpression(e);case Ue.ASTType.LogicalExpression:return this.inferLogicalExpression(e);case Ue.ASTType.IsaExpression:return this.inferIsaExpression(e);case Ue.ASTType.ComparisonGroupExpression:return this.inferComparisonGroupExpression(e);case Ue.ASTType.FunctionDeclaration:return this.inferFunctionStatement(e);case Ue.ASTType.SliceExpression:return this.inferSliceExpression(e);case Ue.ASTType.IndexExpression:return this.inferIndexExpression(e);case Ue.ASTType.MemberExpression:return this.inferMemberExpression(e);case Ue.ASTType.Identifier:return this.inferIdentifier(e);case Ue.ASTType.MapConstructorExpression:return this.inferMapConstructorExpression(e);case Ue.ASTType.ListConstructorExpression:return this.inferListConstructorExpression(e);case Ue.ASTType.NegationExpression:case Ue.ASTType.BinaryNegatedExpression:case Ue.ASTType.UnaryExpression:return this.inferUnaryExpression(e);case Ue.ASTType.NilLiteral:return this.inferNilLiteral(e);case Ue.ASTType.StringLiteral:return this.inferStringLiteral(e);case Ue.ASTType.NumericLiteral:return this.inferNumericLiteral(e);case Ue.ASTType.BooleanLiteral:return this.inferBooleanLiteral(e);case Jd.ASTType.FeatureFileExpression:return this.inferFeatureFileExpression(e);case Jd.ASTType.FeatureLineExpression:return this.inferFeatureLineExpression(e);case Jd.ASTType.FeatureEnvarExpression:return this.inferFeatureEnvarExpression(e);case Jd.ASTType.FeatureInjectExpression:return this.inferFeatureInjectExpression(e);default:return null}}};Zd.InferFullExpression=tT});var nT=f(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.isVariableSetterContextIndex=Hr.isVariableSetterContextProperty=Hr.isVariableSetterContextVariable=Hr.VariableSetterContextComponentKind=void 0;var tf;(function(t){t.Variable="variable",t.Property="property",t.Type="type"})(tf=Hr.VariableSetterContextComponentKind||(Hr.VariableSetterContextComponentKind={}));function XU(t){return t.kind===tf.Variable}Hr.isVariableSetterContextVariable=XU;function YU(t){return t.kind===tf.Property}Hr.isVariableSetterContextProperty=YU;function JU(t){return t.kind===tf.Type}Hr.isVariableSetterContextIndex=JU});var aT=f(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.ASTDefinitionAggregator=void 0;var QU=Wr(),rT=Ve(),Lc=Te(),Hi=Qn(),Nc=gi(),iT=Tn(),ZU=vr(),nf=pc(),zR=Fd(),XR=ef(),Ba=Mc(),rf=nT(),sT=Ur(),kn=ft(),oT=class{constructor(e,n,r,i,s){this.typeStorage=e,this.document=n,this.scope=r,this.block=i,this.onRequestScope=s}makeTypeCompatibleWithProperties(e,n){let r=this.document.chunkHelper.findAssignmentVariableSetterContext(e);if(r==null)return;if((0,rf.isVariableSetterContextVariable)(r)){this.scope.setProperty(r.property,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope));return}let i=new Ba.InferLightExpression(n).infer(r.resolvePath);if(i.containsOwnProperties()||(this.makeTypeCompatibleWithProperties(r.resolvePath,n),i=new Ba.InferLightExpression(n).infer(r.resolvePath)),(0,rf.isVariableSetterContextProperty)(r)){i.setProperty(r.lastProperty,new Hi.EntityInfo(r.lastProperty,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)));return}let s=new Ba.InferLightExpression(n).infer(r.lastComponent);if((0,kn.isUnionType)(s)){s.variants.forEach(a=>{let u=a.getKeyType();u!=null&&i.setProperty(u,new Hi.EntityInfo(u.id,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)))});return}let o=s.getKeyType();o!=null&&i.setProperty(o,new Hi.EntityInfo(o.id,Nc.MapType.createDefault(this.typeStorage,this.document,this.scope)))}aggregateAssignmentStatement(e){let n=this.document.chunkHelper.findAssignmentVariableSetterContext(e.variable);if(n==null)return;let r=new zR.InferContext(this.typeStorage,this.document,this.scope,this.onRequestScope),i=new XR.InferFullExpression(r),s=i.inferCommentDefinition(e)||i.infer(e.init)?.copy(!1,!1,this.typeStorage,this.document,this.scope,e.init)||new nf.UnknownType(this.typeStorage,this.document,this.scope,e);if((0,kn.isFunctionType)(s)&&this.document.attachFunctionTypeToScope(s.astRef,s),(0,kn.isMapType)(s)&&i.createCustomTypeFromMap(e.init,s),(0,rf.isVariableSetterContextVariable)(n)){let l=n.property;this.scope.symbols.push({name:l,path:l,kind:i.getCompletionItemKind(),source:s.getSource(),assignmentRef:e});let p=this.scope.getProperty(l);if(p!=null&&e.init.type===Lc.ASTType.Unknown)return;if(p!=null&&(0,kn.isUnknownType)(p.type)){p.type.mergeIntoType(s),this.scope.setProperty(l,s);return}else if(p!=null&&(0,kn.isUnknownType)(s)){s.mergeIntoType(p.type);return}this.scope.setProperty(l,s);return}let o=new Ba.InferLightExpression(r),a=o.infer(n.resolvePath);if(a==null)throw new Error("Cannot assign property to null origin");if(a.containsOwnProperties()||(this.makeTypeCompatibleWithProperties(n.resolvePath,r),o=new Ba.InferLightExpression(r),a=o.infer(n.resolvePath)),(0,kn.isFunctionType)(s)&&(s.context=a),(0,rf.isVariableSetterContextProperty)(n)){let l=n.lastProperty;this.scope.symbols.push({name:l,path:`${o.getPath()}.${l}`,kind:i.getCompletionItemKind(),source:s.getSource(),assignmentRef:e});let p=a.getProperty(l);if(p!=null&&e.init.type===Lc.ASTType.Unknown)return;if(p!=null&&(0,kn.isUnknownType)(p.type)){p.type.mergeIntoType(s),a.setProperty(l,new Hi.EntityInfo(l,s));return}a.setProperty(l,new Hi.EntityInfo(l,s));return}let u=new Ba.InferLightExpression(r).infer(n.lastComponent);if((0,kn.isUnionType)(u)){u.variants.forEach(l=>{let p=l.getKeyType();p!=null&&a.setProperty(p,new Hi.EntityInfo(p.id,s))});return}let c=u.getKeyType();c!=null&&a.setProperty(c,new Hi.EntityInfo(c.id,s))}getVariableTypeFromIterator(e,n){if((0,kn.isMapType)(e)){let r=new Nc.MapType(this.typeStorage.generateId(kn.TypeKind.MapType,n),e.keyType.copy(!1,!0,this.typeStorage,this.document,this.scope),e.valueType.copy(!1,!0,this.typeStorage,this.document,this.scope),this.typeStorage,this.document,this.scope,null,n);return r.setProperty("key",new Hi.EntityInfo("key",e.keyType.copy(!1,!0,this.typeStorage,this.document,this.scope))),r.setProperty("value",new Hi.EntityInfo("value",e.valueType.copy(!1,!0,this.typeStorage,this.document,this.scope))),r}else{if((0,kn.isListType)(e))return e.elementType.copy(!1,!0,this.typeStorage,this.document,this.scope);if((0,kn.isUnionType)(e))return new ZU.UnionType(this.typeStorage.generateId(kn.TypeKind.UnionType,n),e.variants.map(r=>this.getVariableTypeFromIterator(r,n)),this.typeStorage,this.document,this.scope,n);if(e.id===rT.SignatureDefinitionBaseType.String)return iT.Type.createBaseType(rT.SignatureDefinitionBaseType.String,this.typeStorage,this.document,this.scope,n);if(e.id===kn.NIL_TYPE_ID)return iT.Type.createBaseType(kn.NIL_TYPE_ID,this.typeStorage,this.document,this.scope,n)}return new nf.UnknownType(this.typeStorage,this.document,this.scope)}aggregateForGenericStatement(e){let n=new zR.InferContext(this.typeStorage,this.document,this.scope,this.onRequestScope),i=new XR.InferFullExpression(n).infer(e.iterator)||new nf.UnknownType(this.typeStorage,this.document,this.scope),s=this.getVariableTypeFromIterator(i,e);if(e.variable.type!==Lc.ASTType.Identifier)return;let o=e.variable.name;this.scope.setProperty(o,s),this.scope.setProperty(`__${o}_idx`,iT.Type.createBaseType(rT.SignatureDefinitionBaseType.Number,this.typeStorage,this.document,this.scope,e.variable)),this.scope.symbols.push({name:o,path:o,kind:sT.CompletionItemKind.Variable,source:s.getSource(),assignmentRef:e},{name:`__${o}_idx`,path:`__${o}_idx`,kind:sT.CompletionItemKind.Variable,source:s.getSource(),assignmentRef:e})}aggregateImportDefinition(e){let n=e.name,r=this.scope.getProperty(n.name);if(this.scope.symbols.push({name:n.name,path:n.name,kind:sT.CompletionItemKind.Variable,source:[{document:this.document.name,astRef:e,start:n.start,end:n.end}],assignmentRef:e}),r!=null){r.type.sourceMap.add(this.document,e);return}this.scope.setProperty(n.name,new nf.UnknownType(this.typeStorage,this.document,this.scope,e))}aggregate(){for(let e=0;e<this.block.definitions.length;e++){let n=this.block.definitions[e];switch(n.type){case Lc.ASTType.AssignmentStatement:{this.aggregateAssignmentStatement(n);break}case Lc.ASTType.ForGenericStatement:{this.aggregateForGenericStatement(n);break}case QU.ASTType.FeatureImportExpression:{this.aggregateImportDefinition(n);break}}}}};sf.ASTDefinitionAggregator=oT});var JR=f(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.parseVirtualType=wr.VIRTUAL_TYPE_MAIN_TAG_REGEX=wr.VIRTUAL_TYPE_MAIN_TAG=wr.VirtualTypeTag=void 0;var eK=Ic(),Rs=Ve(),tK=Na(),xt;(function(t){t.Main="vtype",t.Extends="extends",t.Function="function",t.Param="param",t.Params="params",t.Return="return",t.Returns="returns",t.Description="description",t.Example="example",t.Property="property"})(xt=wr.VirtualTypeTag||(wr.VirtualTypeTag={}));var nK=new Set(Object.values(xt));wr.VIRTUAL_TYPE_MAIN_TAG="@"+xt.Main;wr.VIRTUAL_TYPE_MAIN_TAG_REGEX=new RegExp(`^${wr.VIRTUAL_TYPE_MAIN_TAG}\\s+([a-zA-Z0-9_]+)`);function rK(t){return nK.has(t.tag)}function YR(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var uT=class{constructor(e){this.pointer=1,this.block=e,this.virtualType=this.createInitialVirtualType()}createInitialVirtualType(){let e=this.block.tags[0];return e.tag!==xt.Main?null:{type:e.name,extends:null,definitions:{}}}parseFunction(e){let n=e.name,r={id:`${this.virtualType.type}:${n}`,type:Rs.SignatureDefinitionBaseType.Function,arguments:[],returns:[],example:[],description:""};for(;this.pointer<this.block.tags.length;){let i=this.block.tags[this.pointer];if(i.tag===xt.Function||i.tag===xt.Property||i.tag===xt.Extends)break;switch(i.tag){case xt.Description:r.description+=YR(i)+`
|
115
|
+
`;break;case xt.Example:r.example.push(YR(i));break;case xt.Param:case xt.Params:r.arguments.push({label:i.name,type:i.type?new Rs.TypeParser(i.type).parse():Rs.SignatureDefinitionBaseType.Any});break;case xt.Return:case xt.Returns:r.returns.push(i.type?new Rs.TypeParser(i.type).parse():Rs.SignatureDefinitionBaseType.Any);break}this.pointer++}r.example.length===0&&(r.example=null),r.description.length===0&&(r.description=null),r.returns.length===0&&r.returns.push(Rs.SignatureDefinitionBaseType.Any),this.virtualType.definitions[n]=r}parseProperty(e){let n=e.name;this.virtualType.definitions[n]={type:e.type?new Rs.TypeParser(e.type).parse():Rs.SignatureDefinitionBaseType.Any}}process(){if(!this.virtualType)return null;for(;this.pointer<this.block.tags.length;){let e=this.block.tags[this.pointer++];switch(e.tag){case xt.Extends:this.virtualType.extends=e.name;break;case xt.Function:this.parseFunction(e);break;case xt.Property:this.parseProperty(e);break;case xt.Description:case xt.Example:case xt.Param:case xt.Params:case xt.Return:case xt.Returns:break;default:break}}return this.virtualType}};function iK(t){return new uT(t).process()}function sK(t){let e=(0,eK.parse)((0,tK.createCommentBlock)(t)),[n]=e;return n.tags.filter(rK).length>0?iK(n):null}wr.parseVirtualType=sK});var hT=f(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.ASTSignatureAggregator=void 0;var cT=Ve(),oK=ka(),aK=Da(),lT=JR(),pT=class{constructor(e,n,r,i){this.typeStorage=e,this.document=n,this.scope=r,this.pointer=0,this.chunk=i,this.registry=new Map}aggregateNextPayload(e){let n=e.value,r=this.pointer+1,i=e.end.line+1;for(;r<this.chunk.comments.length;r++){let s=this.chunk.comments[r];if(i<s.start.line)break;n+=`
|
116
|
+
`+s.value,i=s.end.line+1}return this.pointer=r-1,n}aggregateVirtualTypeFromComment(e){let n=e.value.trimLeft();if(!n.startsWith(lT.VIRTUAL_TYPE_MAIN_TAG))return;let r=n.match(lT.VIRTUAL_TYPE_MAIN_TAG_REGEX);if(!r||r.length<2)return;let i=r[1];if(this.registry.has(i))return;let s=this.aggregateNextPayload(e),o=(0,lT.parseVirtualType)(s),a=new oK.ClassType(i,null,o.extends,this.typeStorage,this.document,this.scope);this.registry.set(i,{classRef:a,virtualTypeDef:o}),this.typeStorage.addType(a),this.typeStorage.addKeyType(new aK.KeyType(i,this.typeStorage,this.document,this.scope,!0))}aggregate(){for(;this.pointer<this.chunk.comments.length;this.pointer++){let e=this.chunk.comments[this.pointer];e.scope===this.chunk&&this.aggregateVirtualTypeFromComment(e)}}evaluate(){this.registry.forEach(e=>{let n=e.classRef,r=e.virtualTypeDef;Object.entries(r.definitions).forEach(([i,s])=>{let o=s.type===cT.SignatureDefinitionBaseType.Function?cT.SignatureDefinitionFunction.parse(this.document.name,s):cT.SignatureDefinition.parse(this.document.name,s);n.insertDefinition(i,o)})})}};of.ASTSignatureAggregator=pT});var fT=f(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.DocumentTypeStorage=void 0;var tr=Ve(),qc=Qn(),xr=Ea(),uK=Dd(),dT=class extends uK.TypeStorage{constructor(e,n){super(n),this.document=e}insertDefault(){let e=this.parent;if(!e)throw new Error("Global type storage is not defined.");let n=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.General,this.document),r=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Function,this.document),i=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Map,this.document),s=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.List,this.document),o=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Number,this.document),a=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.String,this.document),u=(0,xr.createProxyForNativeType)(tr.SignatureDefinitionBaseType.Any,this.document),c=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"funcRef",r,this.document,e),l=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"map",i,this.document,e),p=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"list",s,this.document,e),h=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"number",o,this.document,e),m=(0,xr.persistTypeInNativeFunction)(tr.SignatureDefinitionBaseType.General,"string",a,this.document,e);n.setProperty("funcRef",new qc.EntityInfo("funcRef",c)),n.setProperty("map",new qc.EntityInfo("map",l)),n.setProperty("list",new qc.EntityInfo("list",p)),n.setProperty("number",new qc.EntityInfo("number",h)),n.setProperty("string",new qc.EntityInfo("string",m)),this.addType(n),this.addType(r),this.addType(i),this.addType(s),this.addType(o),this.addType(a),this.addType(u)}addToAny(e,n){if(typeof e!="string")return;let r=this.typeInterfaces.get(tr.SignatureDefinitionBaseType.Any);r?.properties.set(e,n)}generateId(e,n){let r=n?`<${n.type}:${n.start.toString()}-${n.end.toString()}>`:"<virtual>";return`${e}-${this.document.name}-${this.__internalHandleCounter++}-${r}`}};af.DocumentTypeStorage=dT});var gT=f(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.ScopeState=void 0;var cK;(function(t){t[t.Inititialized=0]="Inititialized",t[t.Pending=1]="Pending",t[t.Resolved=2]="Resolved"})(cK=jc.ScopeState||(jc.ScopeState={}))});var yT=f(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.ChunkHelper=void 0;var Fc=Te(),uf=nT(),mT=class{constructor(e){this._root=e}getLastASTItemOfLine(e){let n=this._root.lines[e];if(!n||n.length===0)return null;let r=n[0];for(let i=1;i<n.length;i++){let s=n[i];(s.start.line>r.start.line||s.start.line===r.start.line&&s.start.character>r.start.character)&&(r=s)}return r}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}findAssignmentVariableSetterContext(e){switch(e.type){case Fc.ASTType.MemberExpression:{let n=e;return n.identifier.type!==Fc.ASTType.Identifier?null:{resolvePath:n.base,lastProperty:n.identifier.name,kind:uf.VariableSetterContextComponentKind.Property}}case Fc.ASTType.Identifier:return{property:e.name,kind:uf.VariableSetterContextComponentKind.Variable};case Fc.ASTType.IndexExpression:{let n=e;return n.index.type===Fc.ASTType.StringLiteral?{resolvePath:n.base,lastProperty:n.index.value,kind:uf.VariableSetterContextComponentKind.Property}:{resolvePath:n.base,lastComponent:n.index,kind:uf.VariableSetterContextComponentKind.Type}}}return null}};cf.ChunkHelper=mT});var _T=f(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.Scope=void 0;var QR=Ve(),So=Ur(),An=As(),Bc=ft(),lK=Qn(),pK=gi(),bT=class{constructor(e,n){this.document=e,this.outer=n,this.locals=new pK.MapType(e.typeStorage.generateId(Bc.TypeKind.MapType),null,null,e.typeStorage,e,this,null,null,!0),this.globals=e.globals||this,this.symbols=[]}getSelf(){return this.associatedFunction?.context}getSuper(){let e=this.getSelf();if(!(e==null||!(0,Bc.isMapType)(e)))return e.getProperty(Bc.ISA_PROPERTY)?.type}getOuter(){return this.outer?.getLocals()}getLocals(){return this.locals}getGlobals(){return this.globals.getLocals()}setProperty(e,n){typeof e=="string"&&this.locals.setProperty(e,new lK.EntityInfo(e,n))}getProperty(e){return this.locals.hasProperty(e)?this.locals.getProperty(e):this.outer?.hasProperty(e)?this.outer.locals.getProperty(e):this.globals.hasProperty(e)?this.globals.locals.getProperty(e):this.document.typeStorage.getTypePropertyById(QR.SignatureDefinitionBaseType.General,e)}getAllProperties(e=1){if(e>Bc.MAX_ALL_PROPERTIES_DEPTH)return[];let n=new Map;for(let[i,s]of this.locals.properties)typeof i=="string"&&(n.has(i)||n.set(i,{type:s.type,name:s.name,kind:(0,Bc.isFunctionType)(s.type)?So.CompletionItemKind.Function:So.CompletionItemKind.Variable}));let r=[...this.globals!==this?this.globals.getAllProperties(e+1):[],...this.outer?.getAllProperties(e+1)||[],...this.document.typeStorage.getTypeById(QR.SignatureDefinitionBaseType.General).getAllProperties(e+1)];for(let i of r)n.has(i.name)||n.set(i.name,i);return!n.has(An.ConstantIdentifier.Globals)&&this.getGlobals()!=null&&n.set(An.ConstantIdentifier.Globals,{type:this.getGlobals(),name:An.ConstantIdentifier.Globals,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Locals)&&this.getLocals()!=null&&n.set(An.ConstantIdentifier.Locals,{type:this.getLocals(),name:An.ConstantIdentifier.Locals,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Outer)&&this.getOuter()!=null&&n.set(An.ConstantIdentifier.Outer,{type:this.getOuter(),name:An.ConstantIdentifier.Outer,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Self)&&this.getSelf()!=null&&n.set(An.ConstantIdentifier.Self,{type:this.getSelf(),name:An.ConstantIdentifier.Self,kind:So.CompletionItemKind.Constant}),!n.has(An.ConstantIdentifier.Super)&&this.getSuper()!=null&&n.set(An.ConstantIdentifier.Super,{type:this.getSelf(),name:An.ConstantIdentifier.Super,kind:So.CompletionItemKind.Constant}),Array.from(n.values())}resolveAllAvailableWithQuery(e){let n=[this];return this.outer&&n.push(this.outer),this!==this.globals&&n.push(this.globals),n.flatMap(r=>r.symbols.filter(i=>i.path.includes(e)))}hasProperty(e){return this.locals.hasProperty(e)}};lf.Scope=bT});var TT=f(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.Document=void 0;var ZR=Ve(),hK=Te(),eD=aT(),dK=hT(),vT=Fd(),tD=ef(),fK=Mc(),gK=fT(),mK=As(),$a=gT(),pf=ft(),yK=yT(),bK=Oa(),_K=dc(),nD=_T(),rD=Tn(),iD=vr(),ST=class t{constructor(e,n,r,i){this.scopes=[],this.name=e,this.chunk=n,this.typeManager=r,this.typeStorage=new gK.DocumentTypeStorage(this,i),this.globals=new nD.Scope(this),this.scopeRefMapping=new WeakMap,this.scopeFnMapping=new WeakMap,this.chunkHelper=new yK.ChunkHelper(n),this.typeStorage.insertDefault(),r.modifyTypeStorage?.(this,i)}createScope(e){if(this.scopeRefMapping.has(e))return;let n=this.scopeRefMapping.get(e.scope),i={scope:new nD.Scope(this,n.scope),astRef:e,state:$a.ScopeState.Inititialized};this.scopes.push(i),this.scopeRefMapping.set(e,i)}aggregateScopes(){let e=this.chunk;if(this.scopeRefMapping.has(e))return;let n={scope:this.globals,astRef:e,state:$a.ScopeState.Inititialized};this.scopes.push(n),this.scopeRefMapping.set(e,n);for(let r=0;r<e.scopes.length;r++){let i=e.scopes[r];this.createScope(i)}}attachFunctionTypeToScope(e,n){let r=this.scopeRefMapping.get(e);r!=null&&(r.scope.associatedFunction=n,this.scopeFnMapping.set(n,r))}assumeArgumentTypes(e,n,r){let i=r.getArguments(),s=n.scope.getSelf();for(let o=0;o<i.length;o++){let a=i[o],u=a.getLabel();if(u===mK.ConstantIdentifier.Self&&s!=null){n.scope.setProperty(u,s);continue}let c=a.getTypes(),l=e.parameters[o],p=c.map(h=>(0,bK.determineTypeFromMeta)(h,this.typeStorage,this,n.scope,l.type===hK.ASTType.AssignmentStatement?l.init:l));n.scope.setProperty(u,iD.UnionType.createSmartly(p,this.typeStorage,this,n.scope))}}assumeReturnType(e,n,r){if(e.returns.length===0){let o=rD.Type.createBaseType(pf.NIL_TYPE_ID,this.typeStorage,this,n.scope);n.scope.associatedFunction.returnType=o,r._returns=o.toMeta().map(ZR.SignatureDefinitionTypeMeta.parse);return}let i=new iD.UnionType(this.typeStorage.generateId(pf.TypeKind.UnionType),[],this.typeStorage,this,n.scope);for(let o=0;o<e.returns.length;o++){let a=e.returns[o];if(a.argument==null){i.addVariant(rD.Type.createBaseType(pf.NIL_TYPE_ID,this.typeStorage,this,n.scope));continue}let u=new tD.InferFullExpression(new vT.InferContext(this.typeStorage,this,n.scope)).infer(a.argument);u&&i.addVariant(u)}let s=i.variants.length===1?i.firstVariant():i;n.scope.associatedFunction.returnType=s,r._returns=s.toMeta().map(ZR.SignatureDefinitionTypeMeta.parse)}aggregateDefinition(e){let n=this.scopeRefMapping.get(e);if(n.state!==$a.ScopeState.Inititialized)return;if(n.state=$a.ScopeState.Pending,n.scope.associatedFunction==null){new eD.ASTDefinitionAggregator(this.typeStorage,this,n.scope,e,a=>this.aggregateDefinition(a)).aggregate(),n.state=$a.ScopeState.Resolved;return}let r=n.scope.associatedFunction.signature;this.assumeArgumentTypes(e,n,r),new eD.ASTDefinitionAggregator(this.typeStorage,this,n.scope,e,o=>this.aggregateDefinition(o)).aggregate();let s=r.getReturns();s.length===1&&s[0].type===pf.UNKNOWN_TYPE_ID&&this.assumeReturnType(e,n,r),n.state=$a.ScopeState.Resolved}aggregateVirtualSignatures(){let e=this.chunk,n=new dK.ASTSignatureAggregator(this.typeStorage,this,this.globals,e);n.aggregate(),n.evaluate()}aggregateDefinitions(){let e=this.chunk;this.aggregateDefinition(e);for(let n=0;n<e.scopes.length;n++){let r=e.scopes[n];this.aggregateDefinition(r)}}resolveAllAssignmentsWithQuery(e){return[...this.scopes.flatMap(n=>n.scope.symbols.filter(r=>r.path.includes(e)))]}resolveAvailableAssignments(e){let n=new vT.InferContext(this.typeStorage,this,this.globals),r=new fK.InferLightExpression(n);r.infer(e);let i=this.scopeRefMapping.get(e.scope),s=[i.scope];i.scope.outer&&s.push(i.scope.outer),i.scope!==i.scope.globals&&s.push(i.scope.globals);let o=r.getPath();return s.flatMap(a=>a.symbols.filter(u=>u.path.includes(o)))}resolvePath(e){return this.globals.locals.getPropertyInPath(e)}resolveNamespace(e,n){let r=this.scopeRefMapping.get(e.scope);if(!r)return null;let i=new vT.InferContext(this.typeStorage,this,r.scope),s=new tD.InferFullExpression(i,n),o=s.infer(e);return o==null?null:{item:o,path:s.getPath(),value:s.getValue(),completionItemKind:s.getCompletionItemKind(),sources:o.getSource()}}merge(...e){let n=new t(this.name,this.chunk,this.typeManager,this.typeStorage.parent);n.aggregateScopes();for(let r=0;r<e.length;r++){let i=e[r];i.document!=null&&(n.typeStorage.merge(i.document.typeStorage),this.typeManager.modifyTypeStorageMerge?.(n,i.document,this.typeStorage.parent))}for(let r=0;r<e.length;r++){let i=e[r];i.document!=null&&(0,_K.mergeScope)(n.typeStorage,n.globals,i.document.globals,i.namespaces)}return n.aggregateVirtualSignatures(),n.aggregateDefinitions(),n}};hf.Document=ST});var sD=f(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.TypeManager=void 0;var vK=uS(),SK=TT(),wT=class{constructor(e){this.documents=new Map,this.container=e.container,this.typeStorage=new vK.GlobalTypeStorage,this.modifyTypeStorage=e.modifyTypeStorage,this.modifyTypeStorageMerge=e.modifyTypeStorageMerge,this.initializeTypeStorage()}initializeTypeStorage(){this.typeStorage.insertPrimitives(this.container),this.typeStorage.insertNonPrimitives(this.container),this.typeStorage.insertAllAnyTypeMembers(this.container)}analyze(e,n){let r=new SK.Document(e,n,this,this.typeStorage);return r.aggregateVirtualSignatures(),r.aggregateScopes(),r.aggregateDefinitions(),this.documents.set(e,r),r}get(e){return this.documents.get(e)}};df.TypeManager=wT});var aD=f(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.isSignatureDefinitionEqual=Ua.isTypeMetaEqual=void 0;function oD(t,e){return t.isEqual(e)}Ua.isTypeMetaEqual=oD;function TK(t,e){return t===e||t.getOrigin()===e.getOrigin()&&oD(t.getType(),e.getType())&&t.isProtected()===e.isProtected()&&t.getDescription()===e.getDescription()}Ua.isSignatureDefinitionEqual=TK});var Ka=f(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.mergeScope=j.enrichWithMetaInformation=j.determineTypeFromMeta=j.createCommentBlock=j.ChunkHelper=j.CompletionItemKind=j.PathType=j.UnaryType=j.ConstantIdentifierSet=j.ConstantIdentifier=j.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=j.MAX_DEPTH=j.ScopeState=j.isUnknownType=j.isUnionType=j.isListType=j.isFunctionType=j.isClassType=j.isMapType=j.isValidKeyValue=j.isKeyType=j.BASE_TYPE_SET=j.META_DOCS_SIGNATURE_ORIGIN=j.DEFAULT_SOURCE_DOCUMENT_ID=j.DEFAULT_SIGNATURE_ORIGIN=j.ISA_PROPERTY=j.UNKNOWN_TYPE_ID=j.NIL_TYPE_ID=j.MAX_ALL_PROPERTIES_DEPTH=j.TypeKind=j.ASTSignatureAggregator=j.ASTDefinitionAggregator=j.InferLightExpression=j.InferFullExpression=j.InferContext=j.InferBase=j.DocumentTypeStorage=j.GlobalTypeStorage=j.TypeStorage=j.Scope=j.Document=j.KeyType=j.EntityInfo=j.UnionType=j.MapType=j.ListType=j.FunctionType=j.ClassType=j.Type=j.TypeManager=void 0;j.parseMapDescription=j.parseAssignDescription=j.normalizeText=j.persistTypeInNativeFunction=j.createProxyForNativeType=j.isSignatureDefinitionEqual=j.isTypeMetaEqual=j.SourceMap=j.shallowMergeMap=j.shallowMergeList=j.deepMerge=void 0;var wK=sD();Object.defineProperty(j,"TypeManager",{enumerable:!0,get:function(){return wK.TypeManager}});var xK=Tn();Object.defineProperty(j,"Type",{enumerable:!0,get:function(){return xK.Type}});var EK=ka();Object.defineProperty(j,"ClassType",{enumerable:!0,get:function(){return EK.ClassType}});var kK=hc();Object.defineProperty(j,"FunctionType",{enumerable:!0,get:function(){return kK.FunctionType}});var AK=uo();Object.defineProperty(j,"ListType",{enumerable:!0,get:function(){return AK.ListType}});var PK=gi();Object.defineProperty(j,"MapType",{enumerable:!0,get:function(){return PK.MapType}});var OK=vr();Object.defineProperty(j,"UnionType",{enumerable:!0,get:function(){return OK.UnionType}});var RK=Qn();Object.defineProperty(j,"EntityInfo",{enumerable:!0,get:function(){return RK.EntityInfo}});var DK=Da();Object.defineProperty(j,"KeyType",{enumerable:!0,get:function(){return DK.KeyType}});var IK=TT();Object.defineProperty(j,"Document",{enumerable:!0,get:function(){return IK.Document}});var CK=_T();Object.defineProperty(j,"Scope",{enumerable:!0,get:function(){return CK.Scope}});var MK=Dd();Object.defineProperty(j,"TypeStorage",{enumerable:!0,get:function(){return MK.TypeStorage}});var LK=uS();Object.defineProperty(j,"GlobalTypeStorage",{enumerable:!0,get:function(){return LK.GlobalTypeStorage}});var NK=fT();Object.defineProperty(j,"DocumentTypeStorage",{enumerable:!0,get:function(){return NK.DocumentTypeStorage}});var qK=Vd();Object.defineProperty(j,"InferBase",{enumerable:!0,get:function(){return qK.InferBase}});var jK=Fd();Object.defineProperty(j,"InferContext",{enumerable:!0,get:function(){return jK.InferContext}});var FK=ef();Object.defineProperty(j,"InferFullExpression",{enumerable:!0,get:function(){return FK.InferFullExpression}});var BK=Mc();Object.defineProperty(j,"InferLightExpression",{enumerable:!0,get:function(){return BK.InferLightExpression}});var $K=aT();Object.defineProperty(j,"ASTDefinitionAggregator",{enumerable:!0,get:function(){return $K.ASTDefinitionAggregator}});var UK=hT();Object.defineProperty(j,"ASTSignatureAggregator",{enumerable:!0,get:function(){return UK.ASTSignatureAggregator}});var rn=ft();Object.defineProperty(j,"TypeKind",{enumerable:!0,get:function(){return rn.TypeKind}});Object.defineProperty(j,"MAX_ALL_PROPERTIES_DEPTH",{enumerable:!0,get:function(){return rn.MAX_ALL_PROPERTIES_DEPTH}});Object.defineProperty(j,"NIL_TYPE_ID",{enumerable:!0,get:function(){return rn.NIL_TYPE_ID}});Object.defineProperty(j,"UNKNOWN_TYPE_ID",{enumerable:!0,get:function(){return rn.UNKNOWN_TYPE_ID}});Object.defineProperty(j,"ISA_PROPERTY",{enumerable:!0,get:function(){return rn.ISA_PROPERTY}});Object.defineProperty(j,"DEFAULT_SIGNATURE_ORIGIN",{enumerable:!0,get:function(){return rn.DEFAULT_SIGNATURE_ORIGIN}});Object.defineProperty(j,"DEFAULT_SOURCE_DOCUMENT_ID",{enumerable:!0,get:function(){return rn.DEFAULT_SOURCE_DOCUMENT_ID}});Object.defineProperty(j,"META_DOCS_SIGNATURE_ORIGIN",{enumerable:!0,get:function(){return rn.META_DOCS_SIGNATURE_ORIGIN}});Object.defineProperty(j,"BASE_TYPE_SET",{enumerable:!0,get:function(){return rn.BASE_TYPE_SET}});Object.defineProperty(j,"isKeyType",{enumerable:!0,get:function(){return rn.isKeyType}});Object.defineProperty(j,"isValidKeyValue",{enumerable:!0,get:function(){return rn.isValidKeyValue}});Object.defineProperty(j,"isMapType",{enumerable:!0,get:function(){return rn.isMapType}});Object.defineProperty(j,"isClassType",{enumerable:!0,get:function(){return rn.isClassType}});Object.defineProperty(j,"isFunctionType",{enumerable:!0,get:function(){return rn.isFunctionType}});Object.defineProperty(j,"isListType",{enumerable:!0,get:function(){return rn.isListType}});Object.defineProperty(j,"isUnionType",{enumerable:!0,get:function(){return rn.isUnionType}});Object.defineProperty(j,"isUnknownType",{enumerable:!0,get:function(){return rn.isUnknownType}});var KK=gT();Object.defineProperty(j,"ScopeState",{enumerable:!0,get:function(){return KK.ScopeState}});var WK=xa();Object.defineProperty(j,"MAX_DEPTH",{enumerable:!0,get:function(){return WK.MAX_DEPTH}});var $c=As();Object.defineProperty(j,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return $c.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});Object.defineProperty(j,"ConstantIdentifier",{enumerable:!0,get:function(){return $c.ConstantIdentifier}});Object.defineProperty(j,"ConstantIdentifierSet",{enumerable:!0,get:function(){return $c.ConstantIdentifierSet}});Object.defineProperty(j,"UnaryType",{enumerable:!0,get:function(){return $c.UnaryType}});Object.defineProperty(j,"PathType",{enumerable:!0,get:function(){return $c.PathType}});var GK=Ur();Object.defineProperty(j,"CompletionItemKind",{enumerable:!0,get:function(){return GK.CompletionItemKind}});var HK=yT();Object.defineProperty(j,"ChunkHelper",{enumerable:!0,get:function(){return HK.ChunkHelper}});var VK=Na();Object.defineProperty(j,"createCommentBlock",{enumerable:!0,get:function(){return VK.createCommentBlock}});var zK=Oa();Object.defineProperty(j,"determineTypeFromMeta",{enumerable:!0,get:function(){return zK.determineTypeFromMeta}});var XK=VS();Object.defineProperty(j,"enrichWithMetaInformation",{enumerable:!0,get:function(){return XK.enrichWithMetaInformation}});var ff=dc();Object.defineProperty(j,"mergeScope",{enumerable:!0,get:function(){return ff.mergeScope}});Object.defineProperty(j,"deepMerge",{enumerable:!0,get:function(){return ff.deepMerge}});Object.defineProperty(j,"shallowMergeList",{enumerable:!0,get:function(){return ff.shallowMergeList}});Object.defineProperty(j,"shallowMergeMap",{enumerable:!0,get:function(){return ff.shallowMergeMap}});var YK=md();Object.defineProperty(j,"SourceMap",{enumerable:!0,get:function(){return YK.SourceMap}});var uD=aD();Object.defineProperty(j,"isTypeMetaEqual",{enumerable:!0,get:function(){return uD.isTypeMetaEqual}});Object.defineProperty(j,"isSignatureDefinitionEqual",{enumerable:!0,get:function(){return uD.isSignatureDefinitionEqual}});var cD=Ea();Object.defineProperty(j,"createProxyForNativeType",{enumerable:!0,get:function(){return cD.createProxyForNativeType}});Object.defineProperty(j,"persistTypeInNativeFunction",{enumerable:!0,get:function(){return cD.persistTypeInNativeFunction}});var JK=Kd();Object.defineProperty(j,"normalizeText",{enumerable:!0,get:function(){return JK.normalizeText}});var QK=YS();Object.defineProperty(j,"parseAssignDescription",{enumerable:!0,get:function(){return QK.parseAssignDescription}});var ZK=zS();Object.defineProperty(j,"parseMapDescription",{enumerable:!0,get:function(){return ZK.parseMapDescription}})});var xT=f(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.getSymbolItemKind=Wa.getCompletionItemKind=void 0;var lt=Ka(),eW={[lt.CompletionItemKind.Constant]:21,[lt.CompletionItemKind.Internal]:21,[lt.CompletionItemKind.InternalFunction]:21,[lt.CompletionItemKind.InternalProperty]:21,[lt.CompletionItemKind.Property]:6,[lt.CompletionItemKind.Variable]:6,[lt.CompletionItemKind.Expression]:6,[lt.CompletionItemKind.Function]:3,[lt.CompletionItemKind.ListConstructor]:12,[lt.CompletionItemKind.MapConstructor]:12,[lt.CompletionItemKind.Literal]:12,[lt.CompletionItemKind.Unknown]:12},tW=t=>eW[t]??6;Wa.getCompletionItemKind=tW;var nW={[lt.CompletionItemKind.Constant]:14,[lt.CompletionItemKind.Internal]:14,[lt.CompletionItemKind.InternalFunction]:14,[lt.CompletionItemKind.InternalProperty]:14,[lt.CompletionItemKind.Variable]:13,[lt.CompletionItemKind.Property]:13,[lt.CompletionItemKind.Expression]:13,[lt.CompletionItemKind.Function]:12,[lt.CompletionItemKind.ListConstructor]:18,[lt.CompletionItemKind.MapConstructor]:19,[lt.CompletionItemKind.Literal]:13,[lt.CompletionItemKind.Unknown]:13},rW=t=>nW[t]??13;Wa.getSymbolItemKind=rW});var lD=f(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.CompletionListBuilder=void 0;var iW=xT(),ET=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,iW.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};gf.CompletionListBuilder=ET});var yf=f(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.findEx=Ga.ScraperWalker=void 0;var sW=Te(),oW=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},mf=class{constructor(e,n={}){this.map=Object.assign(oW(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};Ga.ScraperWalker=mf;function aW(t,e){let n=[];return new mf((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==sW.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Ga.findEx=aW});var kT=f(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.lookupBase=Pn.lookupIdentifier=Pn.lookupScopes=Pn.lookupRootScope=void 0;var Vi=Te(),uW=t=>{let e=t;for(;e.scope;)e=e.scope;return e};Pn.lookupRootScope=uW;var cW=t=>{if(!t.scope)return[t];let e=(0,Pn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};Pn.lookupScopes=cW;var lW=t=>{switch(t.type){case Vi.ASTType.CallStatement:return(0,Pn.lookupIdentifier)(t.expression);case Vi.ASTType.CallExpression:return(0,Pn.lookupIdentifier)(t.base);case Vi.ASTType.Identifier:return t;case Vi.ASTType.MemberExpression:return(0,Pn.lookupIdentifier)(t.identifier);case Vi.ASTType.IndexExpression:return(0,Pn.lookupIdentifier)(t.index);default:return null}};Pn.lookupIdentifier=lW;var pW=(t=null)=>{switch(t?.type){case Vi.ASTType.MemberExpression:return t.base;case Vi.ASTType.IndexExpression:return t.base;case Vi.ASTType.CallExpression:return t.base;case Vi.ASTType.SliceExpression:return t.base;default:return null}};Pn.lookupBase=pW});var pD=f(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.isValidIdentifierLiteral=void 0;var hW=Te(),dW=t=>{if(t.type!==hW.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};bf.isValidIdentifierLiteral=dW});var Ha=f(bi=>{"use strict";var fW=bi&&bi.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),gW=bi&&bi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mW=bi&&bi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&fW(e,t,n);return gW(e,t),e};Object.defineProperty(bi,"__esModule",{value:!0});bi.LookupHelper=void 0;var hD=Te(),yW=mW(yf()),bW=kT(),_W=pD(),AT=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.scopeRefMapping.get(n);return i==null?[]:i.scope.resolveAllAvailableWithQuery(e)}async findAllAssignmentsOfItem(e){let n=await this.getTypeMap();if(n==null)return null;let r=n.resolveNamespace(e,!1);return r==null?null:r.item}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.globals.getAllProperties().reduce((n,r)=>{let i=r.type.getSource();return n.set(r.name,{kind:r.kind,line:i&&i.length>0?i[0].start.line-1:-1}),n},new Map)}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.scopeRefMapping.get(e);return r==null?new Map:r.scope.getAllProperties().reduce((i,s)=>{let o=s.type.getSource();return i.set(s.name,{kind:s.kind,line:o&&o.length>0?o[0].start.line-1:-1}),i},new Map)}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;let s=n.scopeRefMapping.get(e.scope).scope.getAllProperties(),o=[],a=[];for(let u=0;u<s.length;u++){let c=s[u],l=c.type.getSource();c.type.document!=null&&c.type.document.name===n.name&&l!=null&&l.length>0?a.push(c):o.push(c)}for(let u=0;u<o.length;u++){let c=o[u];r.set(c.name,{kind:c.kind,line:-1})}a.sort((u,c)=>u.type.getSource()[0].start.line-c.type.getSource()[0].start.line);for(let u=0;u<a.length;u++){let c=a[u],l=c.type.getSource()[0];if(l.start.line>=e.end.line)break;r.set(c.name,{kind:c.kind,line:l.start.line-1})}return r}async lookupAST(e){let i=this.document.parsedPayload.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=yW.findEx((c,l)=>{let p=c.start.line-1,h=c.start.character-1,m=c.end.line-1,b=c.end.character-1;return p>e.line?{exit:!0}:p<m?{valid:e.line>p&&e.line<m||e.line===p&&h<=e.character||e.line===m&&b>=e.character}:{valid:p<=e.line&&h<=e.character&&m>=e.line&&b>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,bW.lookupBase)(e);return r?n.resolveNamespace(r,!0):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===hD.ASTType.MemberExpression&&e===i.identifier||i?.type===hD.ASTType.IndexExpression&&e===i.index&&(0,_W.isValidIdentifierLiteral)(e)?r.resolveNamespace(i,!1):r.resolveNamespace(e,!1)}async lookupType(e){let n=this,r=await n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};bi.LookupHelper=AT});var dD=f(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.AVAILABLE_CONSTANTS=void 0;_f.AVAILABLE_CONSTANTS=["true","false","null"].map(t=>({label:t,kind:21}))});var fD=f(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.AVAILABLE_KEYWORDS=void 0;var Va=Wr(),fn=Te();vf.AVAILABLE_KEYWORDS=[fn.Keyword.If,fn.Keyword.In,fn.Keyword.Or,fn.Keyword.And,fn.Keyword.Isa,fn.Keyword.For,fn.Keyword.New,fn.Keyword.Not,fn.Keyword.End,fn.Keyword.Then,fn.Keyword.Else,fn.Keyword.Break,fn.Keyword.While,fn.Keyword.Return,fn.Keyword.Function,fn.Keyword.Continue,Va.GreybelKeyword.Envar,Va.GreybelKeyword.Import,Va.GreybelKeyword.Include,Va.GreybelKeyword.Debugger,Va.GreybelKeyword.Line,Va.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var gD=f(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.AVAILABLE_OPERATORS=void 0;var Uc=Ma(),zt=Te();Sf.AVAILABLE_OPERATORS=[zt.Operator.Plus,zt.Operator.Asterik,zt.Operator.Minus,zt.Operator.Slash,zt.Operator.Power,zt.Operator.Modulo,zt.Operator.LessThan,zt.Operator.GreaterThan,zt.Operator.LessThanOrEqual,zt.Operator.GreaterThanOrEqual,zt.Operator.NotEqual,zt.Operator.Equal,zt.Operator.AddShorthand,zt.Operator.SubtractShorthand,zt.Operator.MultiplyShorthand,zt.Operator.DivideShorthand,Uc.Operator.BitwiseAnd,Uc.Operator.BitwiseOr,Uc.Operator.LeftShift,Uc.Operator.RightShift,Uc.Operator.UnsignedRightShift,zt.Operator.Assign,zt.Operator.Reference].map(t=>({label:t,kind:24}))});var yD=f(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.activate=Er.getDefaultCompletionList=Er.getPropertyCompletionList=void 0;var mD=Te(),vW=lD(),SW=Ha(),TW=dD(),wW=fD(),xW=gD(),EW=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.item.getAllProperties().reduce((r,i)=>{let s=i.type.getSource();return r.set(i.name,{kind:i.kind,line:s&&s.length>0?s[0].start.line-1:-1}),r},new Map)};Er.getPropertyCompletionList=EW;var kW=()=>[...wW.AVAILABLE_KEYWORDS,...xW.AVAILABLE_OPERATORS,...TW.AVAILABLE_CONSTANTS];Er.getDefaultCompletionList=kW;function AW(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new SW.LookupHelper(r,t),s=await i.lookupAST(e.position),o=new vW.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof mD.ASTMemberExpression?o.addCollection(await(0,Er.getPropertyCompletionList)(i,a)):a instanceof mD.ASTIndexExpression?o.addCollection(await(0,Er.getPropertyCompletionList)(i,a)):(o.setDefault((0,Er.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,Er.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}Er.activate=AW});var _D=f((LY,bD)=>{"use strict";bD.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var PT=f((NY,SD)=>{var Kc=_D(),vD={};for(let t of Object.keys(Kc))vD[Kc[t]]=t;var ee={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};SD.exports=ee;for(let t of Object.keys(ee)){if(!("channels"in ee[t]))throw new Error("missing channels property: "+t);if(!("labels"in ee[t]))throw new Error("missing channel labels property: "+t);if(ee[t].labels.length!==ee[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=ee[t];delete ee[t].channels,delete ee[t].labels,Object.defineProperty(ee[t],"channels",{value:e}),Object.defineProperty(ee[t],"labels",{value:n})}ee.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};ee.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),p=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=p(o),n=p(a),r=p(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};ee.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=ee.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};ee.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function PW(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}ee.rgb.keyword=function(t){let e=vD[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Kc)){let s=Kc[i],o=PW(t,s);o<n&&(n=o,r=i)}return r};ee.keyword.rgb=function(t){return Kc[t]};ee.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};ee.rgb.lab=function(t){let e=ee.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};ee.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};ee.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};ee.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};ee.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};ee.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,p;switch(o){default:case 6:case 0:c=a,l=u,p=n;break;case 1:c=u,l=a,p=n;break;case 2:c=n,l=a,p=u;break;case 3:c=n,l=u,p=a;break;case 4:c=u,l=n,p=a;break;case 5:c=a,l=n,p=u;break}return[c*255,l*255,p*255]};ee.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};ee.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ee.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};ee.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ee.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};ee.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};ee.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?ee.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};ee.hsv.ansi16=function(t){return ee.rgb.ansi16(ee.hsv.rgb(t),t[2])};ee.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};ee.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};ee.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};ee.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};ee.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};ee.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};ee.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};ee.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};ee.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};ee.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};ee.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};ee.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};ee.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};ee.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ee.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ee.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ee.gray.hsl=function(t){return[0,0,t[0]]};ee.gray.hsv=ee.gray.hsl;ee.gray.hwb=function(t){return[0,100,t[0]]};ee.gray.cmyk=function(t){return[0,0,0,t[0]]};ee.gray.lab=function(t){return[t[0],0,0]};ee.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};ee.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var wD=f((qY,TD)=>{var Tf=PT();function OW(){let t={},e=Object.keys(Tf);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function RW(t){let e=OW(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Tf[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function DW(t,e){return function(n){return e(t(n))}}function IW(t,e){let n=[e[t].parent,t],r=Tf[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=DW(Tf[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}TD.exports=function(t){let e=RW(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=IW(o,e))}return n}});var ED=f((jY,xD)=>{var OT=PT(),CW=wD(),za={},MW=Object.keys(OT);function LW(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function NW(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}MW.forEach(t=>{za[t]={},Object.defineProperty(za[t],"channels",{value:OT[t].channels}),Object.defineProperty(za[t],"labels",{value:OT[t].labels});let e=CW(t);Object.keys(e).forEach(r=>{let i=e[r];za[t][r]=NW(i),za[t][r].raw=LW(i)})});xD.exports=za});var AD=f(Xa=>{"use strict";var qW=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});Xa.activate=void 0;var RT=qW(ED()),jW=Te(),kD;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(kD||(kD={}));var DT={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},FW=()=>new RegExp(`(?:mark|color)=(${Object.keys(DT).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),BW=Object.prototype.hasOwnProperty;function $W(t){t.connection.onColorPresentation(e=>[{label:`#${RT.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).parsedPayload.literals.filter(u=>u.type===jW.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:p,lineIndex:h})=>{let m=u.index+c.indexOf("=")+1,b=m+l.length,v=p.line-1+h,D=m,A=b;return h===0&&(D+=p.character,A+=p.character),{start:{line:v,character:D},end:{line:v,character:A}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,p=c.value.toString().split(`
|
117
|
+
`);for(let h=0;h<p.length;h++){let m=p[h],b=FW(),v;for(;v=b.exec(m);){let[D,A]=v,T=a({match:v,markup:D,value:A,astPosition:l,lineIndex:h});if(A.startsWith("#")){let[w,_,N]=RT.default.hex.rgb(A.slice(1));o.push({range:T,color:{red:w/255,green:_/255,blue:N/255,alpha:1}})}else if(BW.call(DT,A)){let[w,_,N]=RT.default.hex.rgb(DT[A].slice(1));o.push({range:T,color:{red:w/255,green:_/255,blue:N/255,alpha:1}})}else o.push({range:T,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}Xa.activate=$W});var OD=f(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.activate=void 0;var PD=Te(),UW=Ha(),KW=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,WW=t=>{let e=t.astRef,n,r;switch(e.type){case PD.ASTType.ForGenericStatement:{let i=e;n={line:i.variable.start.line-1,character:i.variable.start.character-1},r={line:i.variable.end.line-1,character:i.variable.end.character-1};break}default:n={line:e.start.line-1,character:e.start.character-1},r={line:e.end.line-1,character:e.end.character-1}}return{targetUri:t.document,targetRange:{start:n,end:r},targetSelectionRange:{start:n,end:r}}},GW=async(t,e)=>{let r=(await t.findAllAssignmentsOfItem(e))?.getSource();if(r==null||r.length===0)return[];let i=[],s=new Set;for(let o of r){let a=o.astRef;if(!a.start||!a.end)continue;let u=WW(o),c=KW(u);s.has(c)||(s.add(c),i.push(u))}return i};function HW(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new UW.LookupHelper(r,t),s=await i.lookupAST(e.position);if(!s)return;let{outer:o,closest:a}=s,u=o.length>0?o[o.length-1]:void 0,c=a;return u&&u instanceof PD.ASTMemberExpression&&u.identifier===a&&(c=u),await GW(i,c)})}wf.activate=HW});var RD=f(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.activate=void 0;async function VW(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.parsedPayload.start,end:n.parsedPayload.end},message:r.message,severity:1}})}function zW(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await VW(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}xf.activate=zW});var IT=f((DD,Ef)=>{(function(t){"use strict";function e(_,N){var O=(_&65535)+(N&65535),G=(_>>16)+(N>>16)+(O>>16);return G<<16|O&65535}function n(_,N){return _<<N|_>>>32-N}function r(_,N,O,G,re,ae){return e(n(e(e(N,_),e(G,ae)),re),O)}function i(_,N,O,G,re,ae,K){return r(N&O|~N&G,_,N,re,ae,K)}function s(_,N,O,G,re,ae,K){return r(N&G|O&~G,_,N,re,ae,K)}function o(_,N,O,G,re,ae,K){return r(N^O^G,_,N,re,ae,K)}function a(_,N,O,G,re,ae,K){return r(O^(N|~G),_,N,re,ae,K)}function u(_,N){_[N>>5]|=128<<N%32,_[(N+64>>>9<<4)+14]=N;var O,G,re,ae,K,P=1732584193,M=-271733879,L=-1732584194,F=271733878;for(O=0;O<_.length;O+=16)G=P,re=M,ae=L,K=F,P=i(P,M,L,F,_[O],7,-680876936),F=i(F,P,M,L,_[O+1],12,-389564586),L=i(L,F,P,M,_[O+2],17,606105819),M=i(M,L,F,P,_[O+3],22,-1044525330),P=i(P,M,L,F,_[O+4],7,-176418897),F=i(F,P,M,L,_[O+5],12,1200080426),L=i(L,F,P,M,_[O+6],17,-1473231341),M=i(M,L,F,P,_[O+7],22,-45705983),P=i(P,M,L,F,_[O+8],7,1770035416),F=i(F,P,M,L,_[O+9],12,-1958414417),L=i(L,F,P,M,_[O+10],17,-42063),M=i(M,L,F,P,_[O+11],22,-1990404162),P=i(P,M,L,F,_[O+12],7,1804603682),F=i(F,P,M,L,_[O+13],12,-40341101),L=i(L,F,P,M,_[O+14],17,-1502002290),M=i(M,L,F,P,_[O+15],22,1236535329),P=s(P,M,L,F,_[O+1],5,-165796510),F=s(F,P,M,L,_[O+6],9,-1069501632),L=s(L,F,P,M,_[O+11],14,643717713),M=s(M,L,F,P,_[O],20,-373897302),P=s(P,M,L,F,_[O+5],5,-701558691),F=s(F,P,M,L,_[O+10],9,38016083),L=s(L,F,P,M,_[O+15],14,-660478335),M=s(M,L,F,P,_[O+4],20,-405537848),P=s(P,M,L,F,_[O+9],5,568446438),F=s(F,P,M,L,_[O+14],9,-1019803690),L=s(L,F,P,M,_[O+3],14,-187363961),M=s(M,L,F,P,_[O+8],20,1163531501),P=s(P,M,L,F,_[O+13],5,-1444681467),F=s(F,P,M,L,_[O+2],9,-51403784),L=s(L,F,P,M,_[O+7],14,1735328473),M=s(M,L,F,P,_[O+12],20,-1926607734),P=o(P,M,L,F,_[O+5],4,-378558),F=o(F,P,M,L,_[O+8],11,-2022574463),L=o(L,F,P,M,_[O+11],16,1839030562),M=o(M,L,F,P,_[O+14],23,-35309556),P=o(P,M,L,F,_[O+1],4,-1530992060),F=o(F,P,M,L,_[O+4],11,1272893353),L=o(L,F,P,M,_[O+7],16,-155497632),M=o(M,L,F,P,_[O+10],23,-1094730640),P=o(P,M,L,F,_[O+13],4,681279174),F=o(F,P,M,L,_[O],11,-358537222),L=o(L,F,P,M,_[O+3],16,-722521979),M=o(M,L,F,P,_[O+6],23,76029189),P=o(P,M,L,F,_[O+9],4,-640364487),F=o(F,P,M,L,_[O+12],11,-421815835),L=o(L,F,P,M,_[O+15],16,530742520),M=o(M,L,F,P,_[O+2],23,-995338651),P=a(P,M,L,F,_[O],6,-198630844),F=a(F,P,M,L,_[O+7],10,1126891415),L=a(L,F,P,M,_[O+14],15,-1416354905),M=a(M,L,F,P,_[O+5],21,-57434055),P=a(P,M,L,F,_[O+12],6,1700485571),F=a(F,P,M,L,_[O+3],10,-1894986606),L=a(L,F,P,M,_[O+10],15,-1051523),M=a(M,L,F,P,_[O+1],21,-2054922799),P=a(P,M,L,F,_[O+8],6,1873313359),F=a(F,P,M,L,_[O+15],10,-30611744),L=a(L,F,P,M,_[O+6],15,-1560198380),M=a(M,L,F,P,_[O+13],21,1309151649),P=a(P,M,L,F,_[O+4],6,-145523070),F=a(F,P,M,L,_[O+11],10,-1120210379),L=a(L,F,P,M,_[O+2],15,718787259),M=a(M,L,F,P,_[O+9],21,-343485551),P=e(P,G),M=e(M,re),L=e(L,ae),F=e(F,K);return[P,M,L,F]}function c(_){var N,O="",G=_.length*32;for(N=0;N<G;N+=8)O+=String.fromCharCode(_[N>>5]>>>N%32&255);return O}function l(_){var N,O=[];for(O[(_.length>>2)-1]=void 0,N=0;N<O.length;N+=1)O[N]=0;var G=_.length*8;for(N=0;N<G;N+=8)O[N>>5]|=(_.charCodeAt(N/8)&255)<<N%32;return O}function p(_){return c(u(l(_),_.length*8))}function h(_,N){var O,G=l(_),re=[],ae=[],K;for(re[15]=ae[15]=void 0,G.length>16&&(G=u(G,_.length*8)),O=0;O<16;O+=1)re[O]=G[O]^909522486,ae[O]=G[O]^1549556828;return K=u(re.concat(l(N)),512+N.length*8),c(u(ae.concat(K),640))}function m(_){var N="0123456789abcdef",O="",G,re;for(re=0;re<_.length;re+=1)G=_.charCodeAt(re),O+=N.charAt(G>>>4&15)+N.charAt(G&15);return O}function b(_){return unescape(encodeURIComponent(_))}function v(_){return p(b(_))}function D(_){return m(v(_))}function A(_,N){return h(b(_),b(N))}function T(_,N){return m(A(_,N))}function w(_,N,O){return N?O?A(N,_):T(N,_):O?v(_):D(_)}typeof define=="function"&&define.amd?define(function(){return w}):typeof Ef=="object"&&Ef.exports?Ef.exports=w:t.md5=w})(DD)});var Qa=f(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.getLiteralValue=Ja.getLiteralRawValue=void 0;var Ya=Te(),XW=(t,e=!1)=>{switch(t.type){case Ya.ASTType.NilLiteral:return"null";case Ya.ASTType.NumericLiteral:{let n=t;return`${n.negated?"-":""}${n.raw}`}case Ya.ASTType.BooleanLiteral:{let n=t,r=e?n.raw==="true"?"1":"0":n.raw;return`${n.negated?"-":""}${r}`}default:return t.raw.toString()}};Ja.getLiteralRawValue=XW;var YW=t=>{switch(t.type){case Ya.ASTType.NilLiteral:return"null";case Ya.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case Ya.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};Ja.getLiteralValue=YW});var MT=f(Za=>{"use strict";var JW=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});Za.LiteralsMapper=void 0;var QW=JW(IT()),ID=Qa(),CT=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,ID.getLiteralRawValue)(e,!0);if(r.length<2)return n;if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,QW.default)(r)))}return n}get(e){let n=this,r=(0,ID.getLiteralRawValue)(e,!0);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};Za.LiteralsMapper=CT});var NT=f(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.NamespaceGenerator=void 0;var LT=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};kf.NamespaceGenerator=LT});var Wc=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.Context=To.ContextDataProperty=void 0;var ZW=Te(),e5=MT(),CD=NT(),t5;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(t5=To.ContextDataProperty||(To.ContextDataProperty={}));var qT=class{constructor(e){let n=this;n.modules=new CD.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new CD.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","__REQUIRE_EVAL","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(ZW.Keyword),...e.variablesExcluded||[]]}),n.literals=new e5.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};To.Context=qT});var wo=f(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.DependencyType=void 0;var n5;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(n5=Gc.DependencyType||(Gc.DependencyType={}))});var Hc=f(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.BuildError=void 0;var jT=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};Af.BuildError=jT});var Of=f(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.fetchNamespaces=void 0;var FT=Te();function MD(t){if(t.type===FT.ASTType.MemberExpression){let e=t;return e.identifier.type===FT.ASTType.Identifier?e.identifier.name:null}else if(t.type===FT.ASTType.Identifier)return t.name;return null}function r5(t){let e=new Set(t.namespaces.map(MD).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(MD).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}Pf.fetchNamespaces=r5});var Vc=f(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.merge=void 0;function i5(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}Rf.merge=i5});var tu=f(eu=>{"use strict";var s5=eu&&eu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});eu.Dependency=void 0;var LD=s5(IT()),ND=Wr(),zc=Wc(),Xc=wo(),o5=Hc(),a5=Of(),qD=Vc(),BT=class t{static generateDependencyMappingKey(e,n){return`${n}:${e}`}constructor(e){let n=this;n.target=e.target,n.id=(0,LD.default)(e.target),n.chunk=e.chunk,n.resourceManager=e.resourceManager,n.dependencies=new Map,n.injections=new Map,n.type=e.type||Xc.DependencyType.Main,n.context=e.context;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(zc.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(zc.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n){let r=this,i=r.context,{modules:s}=i,o=i.get(zc.ContextDataProperty.ResourceDependencyMap),a=r.resourceManager,u=a.getRelativePathMapping(r.target,e),c=(0,LD.default)(u),l=s.get(c);if(o.has(l))return o.get(l);try{let p=this.resourceManager.getResource(u).chunk;return new t({target:u,resourceManager:a,chunk:p,type:n,context:i})}catch(p){throw new o5.BuildError(p.message,{target:u,range:p.range})}}findInjections(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=e.resourceManager.getRelativePathMapping(e.target,i.path),o=e.resourceManager.getInjection(s);r.set(i.path,o)}return e.injections=r,r}findDependencies(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(zc.ContextDataProperty.DependencyCallStack),o=new Map;s.push(i);let a=[...n,...r];for(let u of a){let c=u instanceof ND.ASTFeatureIncludeExpression?Xc.DependencyType.Include:Xc.DependencyType.Import,l=e.resolve(u.path,c),p=l.getNamespace();if(s.includes(p))throw new Error(`Circular dependency from ${e.target} to ${l.target} detected.`);l.findDependencies(),o.set(t.generateDependencyMappingKey(u.path,c),l)}return this.findInjections(),e.dependencies=o,s.pop(),{dependencies:o}}findDependenciesWithMetadata(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(zc.ContextDataProperty.DependencyCallStack),o=[...(0,a5.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=new Map;s.push(i);let c=[...n,...r];for(let l of c){let p=l instanceof ND.ASTFeatureIncludeExpression?Xc.DependencyType.Include:Xc.DependencyType.Import,h=e.resolve(l.path,p),m=h.getNamespace();if(s.includes(m))throw new Error(`Circular dependency from ${e.target} to ${h.target} detected.`);let b=h.findDependenciesWithMetadata();(0,qD.merge)(o,b.namespaces),(0,qD.merge)(a,b.literals),u.set(t.generateDependencyMappingKey(l.path,p),h)}return this.findInjections(),e.dependencies=u,s.pop(),{dependencies:u,namespaces:o,literals:a}}};eu.Dependency=BT});var jD=f(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.getStringHashCode=void 0;Df.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var $T=f(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.createExpressionHash=void 0;var If=Te(),FD=jD(),Cf=(t,e)=>t.$$hash=e,u5=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function nu(t){let e=u5(t);if(e!==null)return e;let n=(0,FD.getStringHashCode)(t.type);switch(t.type){case If.ASTType.ParenthesisExpression:return nu(t.expression);case If.ASTType.MemberExpression:{let r=t;return n^=nu(r.base),n^=nu(r.identifier),Cf(t,n)}case If.ASTType.IndexExpression:{let r=t;return n^=nu(r.base),n^=nu(r.index),Cf(t,n)}case If.ASTType.Identifier:{let r=t;return n^=(0,FD.getStringHashCode)(r.name),Cf(t,n)}}return Cf(t,n)}function c5(t){return nu(t)}Mf.createExpressionHash=c5});var KT=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.BeautifyBodyIterator=Eo.FILLER_TYPE=void 0;var xo=Te();Eo.FILLER_TYPE="FILLER";var UT=class{constructor(e,n){this._base=e,this._items=n.sort((r,i)=>r.range[0]-i.range[0]),this._index=0,this._freeSpaceIndex=0,this._freeSpace=0,this._lastEndLine=0,this._checkedIndexes=new Set,this._previous=null}getBlockOpenerEndLine(e){switch(e.type){case xo.ASTType.IfClause:return e.condition.end.line;case xo.ASTType.WhileStatement:return e.condition.end.line;case xo.ASTType.ForGenericStatement:return e.iterator.end.line;case xo.ASTType.Chunk:return e.start.line-1}return e.start.line}getBlockCloseEndLine(e){switch(e.type){case xo.ASTType.Chunk:return e.end.line+1}return e.end.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===xo.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}getFreeSpaceItem(){let e={line:this._lastEndLine+this._freeSpaceIndex+1,character:0};return this._freeSpaceIndex++,this._freeSpace===this._freeSpaceIndex&&(this._lastEndLine=0,this._freeSpaceIndex=0,this._freeSpace=0),new xo.ASTBase(Eo.FILLER_TYPE,{start:e,end:e,range:[0,0],scope:this._base.scope})}next(){if(this._freeSpace>this._freeSpaceIndex)return{value:this.getFreeSpaceItem(),done:!1};if(this._index>=this._items.length){if(!this._checkedIndexes.has(this._items.length)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(this.getBlockCloseEndLine(this._base)-n-1,0);if(r>0)return this._checkedIndexes.add(this._items.length),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return{value:null,done:!0}}let e=this._items[this._index];if(!this._checkedIndexes.has(this._index)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(e.start.line-n-1,0);if(r>0)return this._checkedIndexes.add(this._index),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return this._index++,this._previous=e,{value:e,done:!1}}};Eo.BeautifyBodyIterator=UT});var GT=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.BeautifyContext=Ao.IndentationType=void 0;var ko=Te(),BD=KT(),$D;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})($D=Ao.IndentationType||(Ao.IndentationType={}));var WT=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._stack=[],this._contexts=new Map,this._isMultilineAllowed=!0,this.getIndent=n.indentation===$D.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}buildChunkContext(e){let n=new Map,r=Object.keys(e.lines),i=new Set;for(let s=0;s<r.length;s++){let o=Number(r[s]),u=e.lines[o].filter(c=>c.type===ko.ASTType.Comment);for(let c=0;c<u.length;c++){let l=u[c];if(!i.has(l))if(i.add(l),l.isMultiline){let p=l.value.split(`
|
118
|
+
`);p.forEach((h,m)=>{let b=o+m;n.has(b)||n.set(b,[]);let D=e.lines[b].filter(N=>N.type!==ko.ASTType.Comment).map(N=>N.start.character),A=D.length>0?Math.min(...D):-1,T=b===o,w=b===o+p.length-1,_=w?l.end.character<A:!1;n.get(b).push({isMultiline:!0,isStart:T,isEnd:w,isBefore:_,value:h})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof ko.ASTIfClause||e instanceof ko.ASTWhileStatement?e.condition.end.line:e instanceof ko.ASTForGenericStatement?e.iterator.end.line:e instanceof ko.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===ko.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new BD.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===BD.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Ao.BeautifyContext=WT});var HT=f(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.commentToText=Bt.hasEmptyBody=Bt.containsMultilineItemInShortcutClauses=Bt.getLastComment=Bt.unwrap=Bt.countRightBinaryExpressions=Bt.SHORTHAND_OPERATORS=void 0;var Fn=Te();Bt.SHORTHAND_OPERATORS=[Fn.Operator.Plus,Fn.Operator.Minus,Fn.Operator.Asterik,Fn.Operator.Slash,Fn.Operator.Modulo,Fn.Operator.Power];var l5=t=>{if(t=(0,Bt.unwrap)(t),t instanceof Fn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof Fn.ASTBinaryExpression&&n++,(r instanceof Fn.ASTBinaryExpression||r instanceof Fn.ASTLogicalExpression||r instanceof Fn.ASTIsaExpression)&&(e.push((0,Bt.unwrap)(r.left)),e.push((0,Bt.unwrap)(r.right)))}return n};Bt.countRightBinaryExpressions=l5;var p5=t=>{for(;t instanceof Fn.ASTParenthesisExpression;)t=t.expression;return t};Bt.unwrap=p5;var h5=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===Fn.ASTType.Comment)return n}return null};Bt.getLastComment=h5;var d5=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Bt.containsMultilineItemInShortcutClauses=d5;var f5=t=>!t.some(e=>!(e instanceof Fn.ASTComment));Bt.hasEmptyBody=f5;var g5=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();Bt.commentToText=g5});var zT=f(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.Stack=void 0;var VT=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};Lf.Stack=VT});var Yc=f(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.Factory=void 0;var m5=zT(),XT=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get originDependency(){return this._originDependency}get activeDependency(){return this._activeDependency}set activeDependency(e){this._activeDependency=e}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._originDependency=null,this._activeDependency=null,this._currentStack=new m5.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};Nf.Factory=XT});var JT=f(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.BeautifyFactory=void 0;var Jc=Te(),y5=require("path"),UD=tu(),KD=wo(),WD=$T(),qf=Qa(),jf=KT(),GD=GT(),Vr=HT(),b5=Yc(),YT=class extends b5.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof Jc.ASTIdentifier||u instanceof Jc.ASTMemberExpression)&&c instanceof Jc.ASTBinaryExpression&&(c.left instanceof Jc.ASTIdentifier||c.left instanceof Jc.ASTMemberExpression)&&Vr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,WD.createExpressionHash)(u)===(0,WD.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,Vr.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new jf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===jf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,qf.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let l=0;l<o.arguments.length;l++){let p=o.arguments[l];this.pushSegment(this.context.getIndent(),p),this.process(p),l!==o.arguments.length-1&&(this.pushSegment(",",p),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let l=0;l<o.arguments.length;l++){let p=o.arguments[l];this.process(p),l!==o.arguments.length-1&&this.pushSegment(", ",p)}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,Vr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.activeDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.activeDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){var u;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}let c=(u=this.activeDependency)===null||u===void 0?void 0:u.dependencies.get(UD.Dependency.generateDependencyMappingKey(o.path,KD.DependencyType.Import));if(!c){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+c.getNamespace()+'")',o)},FeatureIncludeExpression:function(o,a){var u;if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}let c=(u=this.activeDependency)===null||u===void 0?void 0:u.dependencies.get(UD.Dependency.generateDependencyMappingKey(o.path,KD.DependencyType.Include));if(!c){this.pushSegment(`#include "${o.path}";`,o);return}let l=this.activeDependency;this.activeDependency=c,this.process(c.chunk),this.activeDependency=l},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,y5.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new jf.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===jf.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,qf.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Vr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=GD.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new GD.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._originDependency=n,this._activeDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(Vr.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(Vr.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
|
119
|
+
`)}generateOptimizations(){return[]}};Ff.BeautifyFactory=YT});var ZT=f($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.DefaultFactory=void 0;var _5=require("path"),HD=tu(),VD=wo(),Bf=Qa(),v5=Yc(),QT=class extends v5.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.pushSegment("("),this.process(e.expression),this.pushSegment(")")},Comment:function(e,n){if(e.isMultiline){this.pushSegment(e.value.split(`
|
120
120
|
`).map(r=>`//${r}`).join(`
|
121
|
-
`));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralValue)(e))},WhileStatement:function(e,n){this.pushSegment("while "),this.process(e.condition),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end while")},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.pushSegment("(");for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralRawValue)(e))},SliceExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.left),this.pushSegment(":"),this.process(e.right),this.pushSegment("]")},IndexExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.index),this.pushSegment("]")},UnaryExpression:function(e,n){e.operator==="new"?this.pushSegment(e.operator+" "):this.pushSegment(e.operator),this.process(e.argument)},NegationExpression:function(e,n){this.pushSegment(e.operator+" "),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${e.name}`);return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.pushSegment("null");return}this.pushSegment(`"${r}"`)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++){let i=e.clauses[r];this.process(i),r!==e.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.pushSegment("else "),this.process(e.body[0])},NilLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralRawValue)(e))},ForGenericStatement:function(e,n){this.pushSegment("for "),this.process(e.variable),this.pushSegment(" in "),this.process(e.iterator),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end for")},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.pushSegment("end if")},IfClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseifClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseClause:function(e,n){this.pushSegment("else"),this.eol();for(let r of e.body)this.process(r),this.eol()},ContinueStatement:function(e,n){this.pushSegment("continue")},BreakStatement:function(e,n){this.pushSegment("break")},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${e.path}"`);return}if(this.activeDependency===null){this.pushSegment(`#inject "${e.path}";`);return}let r=this.activeDependency.injections.get(e.path);if(r==null){this.pushSegment("null");return}this.pushSegment(`"${r.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(e,n){var r;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}let i=(r=this.activeDependency)===null||r===void 0?void 0:r.dependencies.get(
|
122
|
-
`)}generateOptimizations(){return[]}};$f.DefaultFactory=QT});var ew=f(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.createExpressionString=void 0;var Uf=Te();function Qc(t){switch(t.type){case Uf.ASTType.ParenthesisExpression:return Qc(t.expression);case Uf.ASTType.MemberExpression:{let e=t;return`${Qc(e.base)}.${Qc(e.identifier)}`}case Uf.ASTType.IndexExpression:return`${Qc(t.base)}[]`;case Uf.ASTType.Identifier:return t.name}}function S5(t){return Qc(t)}Kf.createExpressionString=S5});var nw=f(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.UglifyFactory=void 0;var T5=require("path"),zR=tu(),XR=wo(),YR=ew(),_i=Qa(),w5=Vc(),x5=Yc(),tw=class extends x5.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,YR.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,YR.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,_i.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,T5.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.activeDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.activeDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){var o;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}let a=(o=this.activeDependency)===null||o===void 0?void 0:o.dependencies.get(zR.Dependency.generateDependencyMappingKey(i.path,XR.DependencyType.Import));if(!a){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let u=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${u}("${a.getNamespace()}")`)},FeatureIncludeExpression:function(i,s){var o;if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}let a=(o=this.activeDependency)===null||o===void 0?void 0:o.dependencies.get(zR.Dependency.generateDependencyMappingKey(i.path,XR.DependencyType.Include));if(!a){this.pushSegment(`#include "${i.path}";`);return}let u=this.activeDependency;this.activeDependency=a,this.process(a.chunk),this.activeDependency=u},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i,!0));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i,!0))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._originDependency=n,this._activeDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
123
|
-
`)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,_i.getLiteralRawValue)(o.literal)}`);(0,w5.merge)(i,s)}return i}};Wf.UglifyFactory=tw});var Gf=f(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getFactory=Po.BuildType=void 0;var E5=JT(),k5=ZT(),A5=nw(),Zc;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Zc=Po.BuildType||(Po.BuildType={}));var P5={[Zc.DEFAULT]:k5.DefaultFactory,[Zc.UGLIFY]:A5.UglifyFactory,[Zc.BEAUTIFY]:E5.BeautifyFactory};function O5(t=Zc.DEFAULT){let e=P5[t];if(!e)throw new Error("Unknown build type.");return e}Po.getFactory=O5});var Vf=f(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.Transformer=void 0;var rw=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Hf.Transformer=rw});var Yf=f(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.generateCharsetMap=void 0;function zf(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function
|
121
|
+
`));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralValue)(e))},WhileStatement:function(e,n){this.pushSegment("while "),this.process(e.condition),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end while")},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.pushSegment("(");for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralRawValue)(e))},SliceExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.left),this.pushSegment(":"),this.process(e.right),this.pushSegment("]")},IndexExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.index),this.pushSegment("]")},UnaryExpression:function(e,n){e.operator==="new"?this.pushSegment(e.operator+" "):this.pushSegment(e.operator),this.process(e.argument)},NegationExpression:function(e,n){this.pushSegment(e.operator+" "),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${e.name}`);return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.pushSegment("null");return}this.pushSegment(`"${r}"`)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++){let i=e.clauses[r];this.process(i),r!==e.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.pushSegment("else "),this.process(e.body[0])},NilLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralRawValue)(e))},ForGenericStatement:function(e,n){this.pushSegment("for "),this.process(e.variable),this.pushSegment(" in "),this.process(e.iterator),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end for")},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.pushSegment("end if")},IfClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseifClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseClause:function(e,n){this.pushSegment("else"),this.eol();for(let r of e.body)this.process(r),this.eol()},ContinueStatement:function(e,n){this.pushSegment("continue")},BreakStatement:function(e,n){this.pushSegment("break")},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${e.path}"`);return}if(this.activeDependency===null){this.pushSegment(`#inject "${e.path}";`);return}let r=this.activeDependency.injections.get(e.path);if(r==null){this.pushSegment("null");return}this.pushSegment(`"${r.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(e,n){var r;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}let i=(r=this.activeDependency)===null||r===void 0?void 0:r.dependencies.get(HD.Dependency.generateDependencyMappingKey(e.path,VD.DependencyType.Import));if(!i){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}this.process(e.name),this.pushSegment(' = __REQUIRE("'+i.getNamespace()+'")')},FeatureIncludeExpression:function(e,n){var r;if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${e.path}";`);return}let i=(r=this.activeDependency)===null||r===void 0?void 0:r.dependencies.get(HD.Dependency.generateDependencyMappingKey(e.path,VD.DependencyType.Include));if(!i){this.pushSegment(`#include "${e.path}";`);return}let s=this.activeDependency;this.activeDependency=i,this.process(i.chunk),this.activeDependency=s},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${e.start.line}`)},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,_5.basename)(e.filename).replace(/"/g,()=>'"')}"`)},ListConstructorExpression:function(e,n){this.pushSegment("[");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.pushSegment((0,Bf.getLiteralRawValue)(e,!0))},EmptyExpression:function(e,n){this.pushSegment("")},IsaExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.pushSegment("bitOr("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="&"){this.pushSegment("bitAnd("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.pushSegment(e.operator),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.pushSegment(e.operator),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.pushSegment(e.operators[r]),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body)this.process(r),this.eol()}}}transform(e,n){return this.reset(),this._originDependency=n,this._activeDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
122
|
+
`)}generateOptimizations(){return[]}};$f.DefaultFactory=QT});var ew=f(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.createExpressionString=void 0;var Uf=Te();function Qc(t){switch(t.type){case Uf.ASTType.ParenthesisExpression:return Qc(t.expression);case Uf.ASTType.MemberExpression:{let e=t;return`${Qc(e.base)}.${Qc(e.identifier)}`}case Uf.ASTType.IndexExpression:return`${Qc(t.base)}[]`;case Uf.ASTType.Identifier:return t.name}}function S5(t){return Qc(t)}Kf.createExpressionString=S5});var nw=f(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.UglifyFactory=void 0;var T5=require("path"),zD=tu(),XD=wo(),YD=ew(),_i=Qa(),w5=Vc(),x5=Yc(),tw=class extends x5.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,YD.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,YD.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,_i.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,T5.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.activeDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.activeDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){var o;if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}let a=(o=this.activeDependency)===null||o===void 0?void 0:o.dependencies.get(zD.Dependency.generateDependencyMappingKey(i.path,XD.DependencyType.Import));if(!a){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let u=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${u}("${a.getNamespace()}")`)},FeatureIncludeExpression:function(i,s){var o;if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}let a=(o=this.activeDependency)===null||o===void 0?void 0:o.dependencies.get(zD.Dependency.generateDependencyMappingKey(i.path,XD.DependencyType.Include));if(!a){this.pushSegment(`#include "${i.path}";`);return}let u=this.activeDependency;this.activeDependency=a,this.process(a.chunk),this.activeDependency=u},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,_i.getLiteralRawValue)(i,!0));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,_i.getLiteralRawValue)(i,!0))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._originDependency=n,this._activeDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
|
123
|
+
`)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,_i.getLiteralRawValue)(o.literal)}`);(0,w5.merge)(i,s)}return i}};Wf.UglifyFactory=tw});var Gf=f(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getFactory=Po.BuildType=void 0;var E5=JT(),k5=ZT(),A5=nw(),Zc;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Zc=Po.BuildType||(Po.BuildType={}));var P5={[Zc.DEFAULT]:k5.DefaultFactory,[Zc.UGLIFY]:A5.UglifyFactory,[Zc.BEAUTIFY]:E5.BeautifyFactory};function O5(t=Zc.DEFAULT){let e=P5[t];if(!e)throw new Error("Unknown build type.");return e}Po.getFactory=O5});var Vf=f(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.Transformer=void 0;var rw=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};Hf.Transformer=rw});var Yf=f(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.generateCharsetMap=void 0;function zf(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function R5(t=!1){let e=zf(65,90),n=zf(97,122),r=zf(48,57),i="_";return t&&(i=i+zf(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}Xf.generateCharsetMap=R5});var Qf=f(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.ChunkProvider=void 0;var D5=Wr(),iw=class{constructor(){this.cache=new Map}parse(e,n){let r=this.cache.get(e);if(r)return r;let s=new D5.Parser(n,{filename:e}).parseChunk();return this.cache.set(e,s),s}};Jf.ChunkProvider=iw});var ow=f(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.MAIN_BOILERPLATE=Ds.MODULE_BOILERPLATE=Ds.HEADER_BOILERPLATE=void 0;var sw=Wr();Ds.HEADER_BOILERPLATE=new sw.Parser(`MODULES={}
|
124
124
|
EXPORTED={}
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
__REQUIRE_EVAL=function(cb, ns)
|
126
|
+
if EXPORTED.hasIndex(ns) then return EXPORTED[ns]
|
127
|
+
result=cb(ns)
|
128
|
+
if result == null then result = { "exports": null }
|
129
|
+
if not result.hasIndex("exports") then result.exports = null
|
130
|
+
EXPORTED[ns]=result
|
131
|
+
return result
|
132
|
+
end function
|
133
|
+
__REQUIRE=function(ns)
|
134
|
+
if not MODULES.hasIndex(ns) then
|
135
|
+
print("Module "+ns+" cannot be found...")
|
128
136
|
return null
|
129
137
|
end if
|
130
|
-
|
131
|
-
|
132
|
-
end function`).parseChunk();Rs.MODULE_BOILERPLATE=new sw.Parser(`MODULES["$0"]=function(r)
|
138
|
+
return @__REQUIRE_EVAL(@MODULES[ns],ns).exports
|
139
|
+
end function`).parseChunk();Ds.MODULE_BOILERPLATE=new sw.Parser(`MODULES["$0"]=function(r)
|
133
140
|
module={}
|
134
|
-
if (EXPORTED.hasIndex(r)) then
|
135
|
-
module=EXPORTED[r]
|
136
|
-
end if
|
137
|
-
if (not module.hasIndex("exports")) then
|
138
141
|
"$1"
|
139
|
-
|
140
|
-
|
141
|
-
return EXPORTED[r]
|
142
|
-
|
143
|
-
`)}};Zf.OutputProcessor=aw});var ZR=f(ru=>{"use strict";var C5=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,"__esModule",{value:!0});ru.DirectTranspiler=void 0;var M5=C5(require("events")),QR=Gf(),L5=Wc(),N5=Vf(),q5=Yf(),j5=Qf(),F5=Of(),B5=eg(),$5=Object.prototype.hasOwnProperty,uw=class extends M5.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=$5.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||QR.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,QR.getFactory)(e.buildType),i=new j5.ChunkProvider().parse("unknown",e.code),s=(0,F5.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,q5.generateCharsetMap)(e.obfuscation),u=new L5.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(m=>u.variables.createNamespace(m)),o.forEach(m=>u.literals.add(m));let l=new N5.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),p=new B5.OutputProcessor(u,l);p.addOptimizations();let h=l.transform(i);return p.addCode(h),p.build()}};ru.DirectTranspiler=uw});var cw=f(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ResourceLoadState=void 0;var U5;(function(t){t[t.Pending=1]="Pending",t[t.Ready=2]="Ready"})(U5=el.ResourceLoadState||(el.ResourceLoadState={}))});var hw=f(Is=>{"use strict";var zi=Is&&Is.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},K5=Is&&Is.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Is,"__esModule",{value:!0});Is.ResourceManager=void 0;var W5=K5(require("events")),eI=Te(),lw=cw(),tg=Hc(),pw=class extends W5.default{constructor(e){super(),this.resourceHandler=e.resourceHandler,this.chunkProvider=e.chunkProvider,this.entryPointResource=null,this.loadStates=new Map,this.loadRequests=new Map,this.resources=new Map,this.injections=new Map,this.relativePathMappings=new Map}getResourceHandler(){return this.resourceHandler}getChunkProvider(){return this.chunkProvider}createMapping(e,n){return zi(this,void 0,void 0,function*(){let r=`${e}:${n}`,i=this.relativePathMappings.get(r);if(i!==void 0)return i;let s=yield this.resourceHandler.getTargetRelativeTo(e,n);return this.relativePathMappings.set(r,s),s})}createInjection(e,n){return zi(this,void 0,void 0,function*(){let r=this.injections.get(e);if(r!==void 0)return r;if(!(yield this.resourceHandler.has(e)))throw new tg.BuildError("Injection "+e+" does not exist...",{target:n.target,range:n.ref?new eI.ASTRange(n.ref.start,n.ref.end):null});let i=yield this.resourceHandler.get(e);this.injections.set(e,i)})}createResource(e,n){return zi(this,void 0,void 0,function*(){if(!(yield this.resourceHandler.has(e)))throw new tg.BuildError("Dependency "+e+" does not exist...",{target:n.target,range:n.ref?new eI.ASTRange(n.ref.start,n.ref.end):null});let i=yield this.resourceHandler.get(e);this.emit("parse-before",e);let s=this.chunkProvider.parse(e,i),o={target:e,chunk:s};return this.emit("parse-after",o),o})}enrichResource(e){return zi(this,void 0,void 0,function*(){let{imports:n,includes:r,injects:i}=e.chunk,s=yield Promise.all([...n.map(o=>zi(this,void 0,void 0,function*(){return{ref:o,resolved:yield this.createMapping(e.target,o.path)}})),...r.map(o=>zi(this,void 0,void 0,function*(){return{ref:o,resolved:yield this.createMapping(e.target,o.path)}}))]);yield Promise.all([...s.map(o=>zi(this,void 0,void 0,function*(){yield this.loadResource(o.resolved,{target:e.target,ref:o.ref})})),...i.map(o=>zi(this,void 0,void 0,function*(){let a=yield this.createMapping(e.target,o.path);yield this.createInjection(a,{target:e.target,ref:o})}))])})}loadResource(e,n){return zi(this,void 0,void 0,function*(){let r=this.loadRequests.get(e);if(r!==void 0)return r;let i=this.resources.get(e);if(i!==void 0)return i;this.loadStates.set(e,lw.ResourceLoadState.Pending);let s=this.createResource(e,n);this.loadRequests.set(e,s);let o;try{o=yield s}catch(a){throw a instanceof tg.BuildError?a:new tg.BuildError(a.message,{target:e,range:a.range})}return this.resources.set(e,o),this.loadRequests.delete(e),this.enrichResource(o).then(()=>{this.loadStates.set(e,lw.ResourceLoadState.Ready),this.emit("loaded",o)}).catch(a=>{this.emit("error",a)}),o})}isSuccess(){return Array.from(this.loadStates.values()).every(e=>e===lw.ResourceLoadState.Ready)}getEntryPointResource(){return this.entryPointResource}getResource(e){return this.resources.get(e)||null}getInjection(e){return this.injections.get(e)||null}getRelativePathMapping(e,n){let r=`${e}:${n}`;return this.relativePathMappings.get(r)||null}load(e){return new Promise((n,r)=>{let i=a=>{if(this.off("loaded",s),this.off("error",o),this.loadStates.clear(),this.loadRequests.clear(),a)return r(a);n()},s=a=>{a.target===e&&(this.entryPointResource=a),this.isSuccess()&&i()},o=a=>{i(a)};this.on("loaded",s),this.on("error",o),this.loadResource(e,{target:e,ref:null}).catch(a=>i(a))})}};Is.ResourceManager=pw});var fw=f(Cs=>{"use strict";var G5=Cs&&Cs.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},H5=Cs&&Cs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Target=void 0;var V5=H5(require("events")),z5=tu(),X5=Qf(),tI=Hc(),Y5=hw(),dw=class extends V5.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return G5(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=new X5.ChunkProvider,a=new Y5.ResourceManager({resourceHandler:r,chunkProvider:o});try{yield a.load(i);let u=new z5.Dependency({target:i,resourceManager:a,chunk:a.getEntryPointResource().chunk,context:s});if(e){let{namespaces:c,literals:l}=u.findDependenciesWithMetadata(),p=new Set(c);for(let h of p)s.variables.createNamespace(h);for(let h of l)s.literals.add(h)}else u.findDependencies();return{main:{chunk:a.getEntryPointResource().chunk,dependency:u}}}catch(u){throw u instanceof tI.BuildError?u:new tI.BuildError(u.message,{target:this.target,range:u.range})}})}};Cs.Target=dw});var mw=f(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ResourceProvider=void 0;var gw=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};ng.ResourceProvider=gw});var nI=f(iu=>{"use strict";var J5=iu&&iu.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(iu,"__esModule",{value:!0});iu.Transpiler=void 0;var Q5=ow(),yw=Gf(),Z5=Wc(),eG=fw(),tG=Vf(),nG=wo(),rG=Yf(),iG=eg(),sG=mw(),oG=Object.prototype.hasOwnProperty,bw=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new sG.ResourceProvider().getHandler(),n.obfuscation=oG.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,rG.generateCharsetMap)(n.obfuscation);n.context=new Z5.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||yw.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return J5(this,void 0,void 0,function*(){let e=this,n=(0,yw.getFactory)(e.buildType),r=e.context,s=yield new eG.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(e.buildType===yw.BuildType.UGLIFY),o=new tG.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(Q5.MODULE_BOILERPLATE),c=l=>{let p=r.modules.get(l.getId()),h={},m=0,b=function(A){let T=A.getNamespace();if(!(T in h)){if(T!==p&&A.type===nG.DependencyType.Import){let w=o.transform(A.chunk,A);h[T]=u.replace('"$0"',()=>'"'+T+'"').replace('"$1"',()=>w),m++}for(let w of A.dependencies.values())b(w)}};b(l);let v=new iG.OutputProcessor(r,o);v.addOptimizations(),m>0&&v.addHeader(),Object.keys(h).forEach(A=>v.addCode(h[A]));let R=o.transform(l.chunk,l);return v.addCode(R,!0),v.build()};return{[e.target]:c(a.dependency)}})}};iu.Transpiler=bw});var rI=f(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.unwrap=void 0;var aG=Te();function uG(t){for(;t instanceof aG.ASTParenthesisExpression;)t=t.expression;return t}rg.unwrap=uG});var aI=f(Y=>{"use strict";var cG=Y&&Y.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),lG=Y&&Y.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pG=Y&&Y.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cG(e,t,n);return lG(e,t),e};Object.defineProperty(Y,"__esModule",{value:!0});Y.unwrap=Y.Stack=Y.ResourceProvider=Y.ResourceManager=Y.OutputProcessor=Y.NamespaceGenerator=Y.merge=Y.LiteralsMapper=Y.getLiteralValue=Y.getLiteralRawValue=Y.fetchNamespaces=Y.BuildError=Y.createExpressionString=Y.createExpressionHash=Y.ChunkProvider=Y.generateCharsetMap=Y.ResourceLoadState=Y.DependencyType=Y.Transpiler=Y.Transformer=Y.Target=Y.DirectTranspiler=Y.Dependency=Y.ContextDataProperty=Y.Context=Y.UglifyFactory=Y.Factory=Y.DefaultFactory=Y.BeautifyUtils=Y.BeautifyContext=Y.BeautifyFactory=Y.getFactory=Y.BuildType=void 0;var iI=Gf();Object.defineProperty(Y,"BuildType",{enumerable:!0,get:function(){return iI.BuildType}});Object.defineProperty(Y,"getFactory",{enumerable:!0,get:function(){return iI.getFactory}});var hG=JT();Object.defineProperty(Y,"BeautifyFactory",{enumerable:!0,get:function(){return hG.BeautifyFactory}});var dG=GT();Object.defineProperty(Y,"BeautifyContext",{enumerable:!0,get:function(){return dG.BeautifyContext}});Y.BeautifyUtils=pG(HT());var fG=ZT();Object.defineProperty(Y,"DefaultFactory",{enumerable:!0,get:function(){return fG.DefaultFactory}});var gG=Yc();Object.defineProperty(Y,"Factory",{enumerable:!0,get:function(){return gG.Factory}});var mG=nw();Object.defineProperty(Y,"UglifyFactory",{enumerable:!0,get:function(){return mG.UglifyFactory}});var sI=Wc();Object.defineProperty(Y,"Context",{enumerable:!0,get:function(){return sI.Context}});Object.defineProperty(Y,"ContextDataProperty",{enumerable:!0,get:function(){return sI.ContextDataProperty}});var yG=tu();Object.defineProperty(Y,"Dependency",{enumerable:!0,get:function(){return yG.Dependency}});var bG=ZR();Object.defineProperty(Y,"DirectTranspiler",{enumerable:!0,get:function(){return bG.DirectTranspiler}});var _G=fw();Object.defineProperty(Y,"Target",{enumerable:!0,get:function(){return _G.Target}});var vG=Vf();Object.defineProperty(Y,"Transformer",{enumerable:!0,get:function(){return vG.Transformer}});var SG=nI();Object.defineProperty(Y,"Transpiler",{enumerable:!0,get:function(){return SG.Transpiler}});var TG=wo();Object.defineProperty(Y,"DependencyType",{enumerable:!0,get:function(){return TG.DependencyType}});var wG=cw();Object.defineProperty(Y,"ResourceLoadState",{enumerable:!0,get:function(){return wG.ResourceLoadState}});var xG=Yf();Object.defineProperty(Y,"generateCharsetMap",{enumerable:!0,get:function(){return xG.generateCharsetMap}});var EG=Qf();Object.defineProperty(Y,"ChunkProvider",{enumerable:!0,get:function(){return EG.ChunkProvider}});var kG=$T();Object.defineProperty(Y,"createExpressionHash",{enumerable:!0,get:function(){return kG.createExpressionHash}});var AG=ew();Object.defineProperty(Y,"createExpressionString",{enumerable:!0,get:function(){return AG.createExpressionString}});var PG=Hc();Object.defineProperty(Y,"BuildError",{enumerable:!0,get:function(){return PG.BuildError}});var OG=Of();Object.defineProperty(Y,"fetchNamespaces",{enumerable:!0,get:function(){return OG.fetchNamespaces}});var oI=Qa();Object.defineProperty(Y,"getLiteralRawValue",{enumerable:!0,get:function(){return oI.getLiteralRawValue}});Object.defineProperty(Y,"getLiteralValue",{enumerable:!0,get:function(){return oI.getLiteralValue}});var DG=MT();Object.defineProperty(Y,"LiteralsMapper",{enumerable:!0,get:function(){return DG.LiteralsMapper}});var RG=Vc();Object.defineProperty(Y,"merge",{enumerable:!0,get:function(){return RG.merge}});var IG=NT();Object.defineProperty(Y,"NamespaceGenerator",{enumerable:!0,get:function(){return IG.NamespaceGenerator}});var CG=eg();Object.defineProperty(Y,"OutputProcessor",{enumerable:!0,get:function(){return CG.OutputProcessor}});var MG=hw();Object.defineProperty(Y,"ResourceManager",{enumerable:!0,get:function(){return MG.ResourceManager}});var LG=mw();Object.defineProperty(Y,"ResourceProvider",{enumerable:!0,get:function(){return LG.ResourceProvider}});var NG=zT();Object.defineProperty(Y,"Stack",{enumerable:!0,get:function(){return NG.Stack}});var qG=rI();Object.defineProperty(Y,"unwrap",{enumerable:!0,get:function(){return qG.unwrap}})});var cI=f(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.activate=void 0;var uI=aI();function jG(t){async function e(n){try{let r=t.getConfiguration();return new uI.DirectTranspiler({code:n,buildType:uI.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.parsedPayload.end},newText:s}]})}ig.activate=jG});var og=f(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.MarkdownString=void 0;var _w=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
144
|
-
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};sg.MarkdownString=_w});var ug=f(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.createTypeBody=ze.createHover=ze.createSignatureInfo=ze.appendTooltipBody=ze.appendTooltipHeader=ze.createTooltipHeader=ze.formatDefaultValue=ze.formatTypes=ze.sortTypes=ze.formatKind=void 0;var Ke=Ka(),FG=Ve(),BG=Di(),pI=Lr(),hI=og(),$G={[Ke.CompletionItemKind.Constant]:"constant",[Ke.CompletionItemKind.Expression]:"expr",[Ke.CompletionItemKind.Function]:"function",[Ke.CompletionItemKind.Internal]:"internal",[Ke.CompletionItemKind.InternalFunction]:"function",[Ke.CompletionItemKind.InternalProperty]:"var",[Ke.CompletionItemKind.ListConstructor]:"list",[Ke.CompletionItemKind.Literal]:"literal",[Ke.CompletionItemKind.MapConstructor]:"map",[Ke.CompletionItemKind.Property]:"var",[Ke.CompletionItemKind.Unknown]:"unknown",[Ke.CompletionItemKind.Variable]:"var"};function vw(t){return $G[t]||"unknown"}ze.formatKind=vw;var lI={[BG.SignatureDefinitionBaseType.Any]:1e3,[Ke.UNKNOWN_TYPE_ID]:1001,[Ke.NIL_TYPE_ID]:1002};function dI(t){return t.sort((e,n)=>{let r=lI[e]||0,i=lI[n]||0;return r!==i?r-i:e.localeCompare(n)})}ze.sortTypes=dI;function ag(t){return t==null?"":dI(t.map(e=>e.toString().replace(",","\u066B"))).join(" or ")}ze.formatTypes=ag;function fI(t){return typeof t=="string"?`"${t}"`:t.toString()}ze.formatDefaultValue=fI;var UG=(t,e)=>{let n=e.getArguments()||[],r=ag(e.getReturns())||"null";if(n.length===0)return`(${vw(t.completionItemKind)}) ${t.path} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${ag(s.getTypes())}${s.getDefault()?` = ${fI(s.getDefault().value)}`:""}`).join(", ");return`(${vw(t.completionItemKind)}) ${t.path} (${i}): ${r}`};ze.createTooltipHeader=UG;var KG=(t,e,n)=>{t.appendCodeblock(pI.LanguageId,(0,ze.createTooltipHeader)(e,n)),t.appendMarkdown(`***
|
142
|
+
return module
|
143
|
+
end function`).parseChunk();Ds.MAIN_BOILERPLATE=new sw.Parser('"$0"').parseChunk()});var eg=f(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.OutputProcessor=void 0;var JD=ow(),I5=Vc(),aw=class{constructor(e,n,{header:r=JD.HEADER_BOILERPLATE,main:i=JD.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addOptimizations(){return(0,I5.merge)(this.processed,this.transformer.factory.generateOptimizations()),this}addHeader(){return this.processed.push(this.headerBoilerplate),this}addCode(e,n=!1){if(n){let r=this.mainBoilerplate.replace('"$0"',()=>e);this.processed.push(r)}else this.processed.push(e);return this}build(){return this.processed.join(`
|
144
|
+
`)}};Zf.OutputProcessor=aw});var ZD=f(ru=>{"use strict";var C5=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,"__esModule",{value:!0});ru.DirectTranspiler=void 0;var M5=C5(require("events")),QD=Gf(),L5=Wc(),N5=Vf(),q5=Yf(),j5=Qf(),F5=Of(),B5=eg(),$5=Object.prototype.hasOwnProperty,uw=class extends M5.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=$5.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||QD.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,QD.getFactory)(e.buildType),i=new j5.ChunkProvider().parse("unknown",e.code),s=(0,F5.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,q5.generateCharsetMap)(e.obfuscation),u=new L5.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(m=>u.variables.createNamespace(m)),o.forEach(m=>u.literals.add(m));let l=new N5.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),p=new B5.OutputProcessor(u,l);p.addOptimizations();let h=l.transform(i);return p.addCode(h),p.build()}};ru.DirectTranspiler=uw});var cw=f(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ResourceLoadState=void 0;var U5;(function(t){t[t.Pending=1]="Pending",t[t.Ready=2]="Ready"})(U5=el.ResourceLoadState||(el.ResourceLoadState={}))});var hw=f(Is=>{"use strict";var zi=Is&&Is.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},K5=Is&&Is.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Is,"__esModule",{value:!0});Is.ResourceManager=void 0;var W5=K5(require("events")),eI=Te(),lw=cw(),tg=Hc(),pw=class extends W5.default{constructor(e){super(),this.resourceHandler=e.resourceHandler,this.chunkProvider=e.chunkProvider,this.entryPointResource=null,this.loadStates=new Map,this.loadRequests=new Map,this.resources=new Map,this.injections=new Map,this.relativePathMappings=new Map}getResourceHandler(){return this.resourceHandler}getChunkProvider(){return this.chunkProvider}createMapping(e,n){return zi(this,void 0,void 0,function*(){let r=`${e}:${n}`,i=this.relativePathMappings.get(r);if(i!==void 0)return i;let s=yield this.resourceHandler.getTargetRelativeTo(e,n);return this.relativePathMappings.set(r,s),s})}createInjection(e,n){return zi(this,void 0,void 0,function*(){let r=this.injections.get(e);if(r!==void 0)return r;if(!(yield this.resourceHandler.has(e)))throw new tg.BuildError("Injection "+e+" does not exist...",{target:n.target,range:n.ref?new eI.ASTRange(n.ref.start,n.ref.end):null});let i=yield this.resourceHandler.get(e);this.injections.set(e,i)})}createResource(e,n){return zi(this,void 0,void 0,function*(){if(!(yield this.resourceHandler.has(e)))throw new tg.BuildError("Dependency "+e+" does not exist...",{target:n.target,range:n.ref?new eI.ASTRange(n.ref.start,n.ref.end):null});let i=yield this.resourceHandler.get(e);this.emit("parse-before",e);let s=this.chunkProvider.parse(e,i),o={target:e,chunk:s};return this.emit("parse-after",o),o})}enrichResource(e){return zi(this,void 0,void 0,function*(){let{imports:n,includes:r,injects:i}=e.chunk,s=yield Promise.all([...n.map(o=>zi(this,void 0,void 0,function*(){return{ref:o,resolved:yield this.createMapping(e.target,o.path)}})),...r.map(o=>zi(this,void 0,void 0,function*(){return{ref:o,resolved:yield this.createMapping(e.target,o.path)}}))]);yield Promise.all([...s.map(o=>zi(this,void 0,void 0,function*(){yield this.loadResource(o.resolved,{target:e.target,ref:o.ref})})),...i.map(o=>zi(this,void 0,void 0,function*(){let a=yield this.createMapping(e.target,o.path);yield this.createInjection(a,{target:e.target,ref:o})}))])})}loadResource(e,n){return zi(this,void 0,void 0,function*(){let r=this.loadRequests.get(e);if(r!==void 0)return r;let i=this.resources.get(e);if(i!==void 0)return i;this.loadStates.set(e,lw.ResourceLoadState.Pending);let s=this.createResource(e,n);this.loadRequests.set(e,s);let o;try{o=yield s}catch(a){throw a instanceof tg.BuildError?a:new tg.BuildError(a.message,{target:e,range:a.range})}return this.resources.set(e,o),this.loadRequests.delete(e),this.enrichResource(o).then(()=>{this.loadStates.set(e,lw.ResourceLoadState.Ready),this.emit("loaded",o)}).catch(a=>{this.emit("error",a)}),o})}isSuccess(){return Array.from(this.loadStates.values()).every(e=>e===lw.ResourceLoadState.Ready)}getEntryPointResource(){return this.entryPointResource}getResource(e){return this.resources.get(e)||null}getInjection(e){return this.injections.get(e)||null}getRelativePathMapping(e,n){let r=`${e}:${n}`;return this.relativePathMappings.get(r)||null}load(e){return new Promise((n,r)=>{let i=a=>{if(this.off("loaded",s),this.off("error",o),this.loadStates.clear(),this.loadRequests.clear(),a)return r(a);n()},s=a=>{a.target===e&&(this.entryPointResource=a),this.isSuccess()&&i()},o=a=>{i(a)};this.on("loaded",s),this.on("error",o),this.loadResource(e,{target:e,ref:null}).catch(a=>i(a))})}};Is.ResourceManager=pw});var fw=f(Cs=>{"use strict";var G5=Cs&&Cs.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},H5=Cs&&Cs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Target=void 0;var V5=H5(require("events")),z5=tu(),X5=Qf(),tI=Hc(),Y5=hw(),dw=class extends V5.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return G5(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=new X5.ChunkProvider,a=new Y5.ResourceManager({resourceHandler:r,chunkProvider:o});try{yield a.load(i);let u=new z5.Dependency({target:i,resourceManager:a,chunk:a.getEntryPointResource().chunk,context:s});if(e){let{namespaces:c,literals:l}=u.findDependenciesWithMetadata(),p=new Set(c);for(let h of p)s.variables.createNamespace(h);for(let h of l)s.literals.add(h)}else u.findDependencies();return{main:{chunk:a.getEntryPointResource().chunk,dependency:u}}}catch(u){throw u instanceof tI.BuildError?u:new tI.BuildError(u.message,{target:this.target,range:u.range})}})}};Cs.Target=dw});var mw=f(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ResourceProvider=void 0;var gw=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};ng.ResourceProvider=gw});var nI=f(iu=>{"use strict";var J5=iu&&iu.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(p){o(p)}}function u(l){try{c(r.throw(l))}catch(p){o(p)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(iu,"__esModule",{value:!0});iu.Transpiler=void 0;var Q5=ow(),yw=Gf(),Z5=Wc(),eG=fw(),tG=Vf(),nG=wo(),rG=Yf(),iG=eg(),sG=mw(),oG=Object.prototype.hasOwnProperty,bw=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new sG.ResourceProvider().getHandler(),n.obfuscation=oG.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,rG.generateCharsetMap)(n.obfuscation);n.context=new Z5.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||yw.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return J5(this,void 0,void 0,function*(){let e=this,n=(0,yw.getFactory)(e.buildType),r=e.context,s=yield new eG.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(e.buildType===yw.BuildType.UGLIFY),o=new tG.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(Q5.MODULE_BOILERPLATE),c=l=>{let p=r.modules.get(l.getId()),h={},m=0,b=function(A){let T=A.getNamespace();if(!(T in h)){if(T!==p&&A.type===nG.DependencyType.Import){let w=o.transform(A.chunk,A);h[T]=u.replace('"$0"',()=>'"'+T+'"').replace('"$1"',()=>w),m++}for(let w of A.dependencies.values())b(w)}};b(l);let v=new iG.OutputProcessor(r,o);v.addOptimizations(),m>0&&v.addHeader(),Object.keys(h).forEach(A=>v.addCode(h[A]));let D=o.transform(l.chunk,l);return v.addCode(D,!0),v.build()};return{[e.target]:c(a.dependency)}})}};iu.Transpiler=bw});var rI=f(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.unwrap=void 0;var aG=Te();function uG(t){for(;t instanceof aG.ASTParenthesisExpression;)t=t.expression;return t}rg.unwrap=uG});var aI=f(Y=>{"use strict";var cG=Y&&Y.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),lG=Y&&Y.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pG=Y&&Y.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cG(e,t,n);return lG(e,t),e};Object.defineProperty(Y,"__esModule",{value:!0});Y.unwrap=Y.Stack=Y.ResourceProvider=Y.ResourceManager=Y.OutputProcessor=Y.NamespaceGenerator=Y.merge=Y.LiteralsMapper=Y.getLiteralValue=Y.getLiteralRawValue=Y.fetchNamespaces=Y.BuildError=Y.createExpressionString=Y.createExpressionHash=Y.ChunkProvider=Y.generateCharsetMap=Y.ResourceLoadState=Y.DependencyType=Y.Transpiler=Y.Transformer=Y.Target=Y.DirectTranspiler=Y.Dependency=Y.ContextDataProperty=Y.Context=Y.UglifyFactory=Y.Factory=Y.DefaultFactory=Y.BeautifyUtils=Y.BeautifyContext=Y.BeautifyFactory=Y.getFactory=Y.BuildType=void 0;var iI=Gf();Object.defineProperty(Y,"BuildType",{enumerable:!0,get:function(){return iI.BuildType}});Object.defineProperty(Y,"getFactory",{enumerable:!0,get:function(){return iI.getFactory}});var hG=JT();Object.defineProperty(Y,"BeautifyFactory",{enumerable:!0,get:function(){return hG.BeautifyFactory}});var dG=GT();Object.defineProperty(Y,"BeautifyContext",{enumerable:!0,get:function(){return dG.BeautifyContext}});Y.BeautifyUtils=pG(HT());var fG=ZT();Object.defineProperty(Y,"DefaultFactory",{enumerable:!0,get:function(){return fG.DefaultFactory}});var gG=Yc();Object.defineProperty(Y,"Factory",{enumerable:!0,get:function(){return gG.Factory}});var mG=nw();Object.defineProperty(Y,"UglifyFactory",{enumerable:!0,get:function(){return mG.UglifyFactory}});var sI=Wc();Object.defineProperty(Y,"Context",{enumerable:!0,get:function(){return sI.Context}});Object.defineProperty(Y,"ContextDataProperty",{enumerable:!0,get:function(){return sI.ContextDataProperty}});var yG=tu();Object.defineProperty(Y,"Dependency",{enumerable:!0,get:function(){return yG.Dependency}});var bG=ZD();Object.defineProperty(Y,"DirectTranspiler",{enumerable:!0,get:function(){return bG.DirectTranspiler}});var _G=fw();Object.defineProperty(Y,"Target",{enumerable:!0,get:function(){return _G.Target}});var vG=Vf();Object.defineProperty(Y,"Transformer",{enumerable:!0,get:function(){return vG.Transformer}});var SG=nI();Object.defineProperty(Y,"Transpiler",{enumerable:!0,get:function(){return SG.Transpiler}});var TG=wo();Object.defineProperty(Y,"DependencyType",{enumerable:!0,get:function(){return TG.DependencyType}});var wG=cw();Object.defineProperty(Y,"ResourceLoadState",{enumerable:!0,get:function(){return wG.ResourceLoadState}});var xG=Yf();Object.defineProperty(Y,"generateCharsetMap",{enumerable:!0,get:function(){return xG.generateCharsetMap}});var EG=Qf();Object.defineProperty(Y,"ChunkProvider",{enumerable:!0,get:function(){return EG.ChunkProvider}});var kG=$T();Object.defineProperty(Y,"createExpressionHash",{enumerable:!0,get:function(){return kG.createExpressionHash}});var AG=ew();Object.defineProperty(Y,"createExpressionString",{enumerable:!0,get:function(){return AG.createExpressionString}});var PG=Hc();Object.defineProperty(Y,"BuildError",{enumerable:!0,get:function(){return PG.BuildError}});var OG=Of();Object.defineProperty(Y,"fetchNamespaces",{enumerable:!0,get:function(){return OG.fetchNamespaces}});var oI=Qa();Object.defineProperty(Y,"getLiteralRawValue",{enumerable:!0,get:function(){return oI.getLiteralRawValue}});Object.defineProperty(Y,"getLiteralValue",{enumerable:!0,get:function(){return oI.getLiteralValue}});var RG=MT();Object.defineProperty(Y,"LiteralsMapper",{enumerable:!0,get:function(){return RG.LiteralsMapper}});var DG=Vc();Object.defineProperty(Y,"merge",{enumerable:!0,get:function(){return DG.merge}});var IG=NT();Object.defineProperty(Y,"NamespaceGenerator",{enumerable:!0,get:function(){return IG.NamespaceGenerator}});var CG=eg();Object.defineProperty(Y,"OutputProcessor",{enumerable:!0,get:function(){return CG.OutputProcessor}});var MG=hw();Object.defineProperty(Y,"ResourceManager",{enumerable:!0,get:function(){return MG.ResourceManager}});var LG=mw();Object.defineProperty(Y,"ResourceProvider",{enumerable:!0,get:function(){return LG.ResourceProvider}});var NG=zT();Object.defineProperty(Y,"Stack",{enumerable:!0,get:function(){return NG.Stack}});var qG=rI();Object.defineProperty(Y,"unwrap",{enumerable:!0,get:function(){return qG.unwrap}})});var cI=f(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.activate=void 0;var uI=aI();function jG(t){async function e(n){try{let r=t.getConfiguration();return new uI.DirectTranspiler({code:n,buildType:uI.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.parsedPayload.end},newText:s}]})}ig.activate=jG});var og=f(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.MarkdownString=void 0;var _w=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
145
|
+
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};sg.MarkdownString=_w});var ug=f(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.createTypeBody=ze.createHover=ze.createSignatureInfo=ze.appendTooltipBody=ze.appendTooltipHeader=ze.createTooltipHeader=ze.formatDefaultValue=ze.formatTypes=ze.sortTypes=ze.formatKind=void 0;var Ke=Ka(),FG=Ve(),BG=Ri(),pI=Lr(),hI=og(),$G={[Ke.CompletionItemKind.Constant]:"constant",[Ke.CompletionItemKind.Expression]:"expr",[Ke.CompletionItemKind.Function]:"function",[Ke.CompletionItemKind.Internal]:"internal",[Ke.CompletionItemKind.InternalFunction]:"function",[Ke.CompletionItemKind.InternalProperty]:"var",[Ke.CompletionItemKind.ListConstructor]:"list",[Ke.CompletionItemKind.Literal]:"literal",[Ke.CompletionItemKind.MapConstructor]:"map",[Ke.CompletionItemKind.Property]:"var",[Ke.CompletionItemKind.Unknown]:"unknown",[Ke.CompletionItemKind.Variable]:"var"};function vw(t){return $G[t]||"unknown"}ze.formatKind=vw;var lI={[BG.SignatureDefinitionBaseType.Any]:1e3,[Ke.UNKNOWN_TYPE_ID]:1001,[Ke.NIL_TYPE_ID]:1002};function dI(t){return t.sort((e,n)=>{let r=lI[e]||0,i=lI[n]||0;return r!==i?r-i:e.localeCompare(n)})}ze.sortTypes=dI;function ag(t){return t==null?"":dI(t.map(e=>e.toString().replace(",","\u066B"))).join(" or ")}ze.formatTypes=ag;function fI(t){return typeof t=="string"?`"${t}"`:t.toString()}ze.formatDefaultValue=fI;var UG=(t,e)=>{let n=e.getArguments()||[],r=ag(e.getReturns())||"null";if(n.length===0)return`(${vw(t.completionItemKind)}) ${t.path} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${ag(s.getTypes())}${s.getDefault()?` = ${fI(s.getDefault().value)}`:""}`).join(", ");return`(${vw(t.completionItemKind)}) ${t.path} (${i}): ${r}`};ze.createTooltipHeader=UG;var KG=(t,e,n)=>{t.appendCodeblock(pI.LanguageId,(0,ze.createTooltipHeader)(e,n)),t.appendMarkdown(`***
|
145
146
|
`)};ze.appendTooltipHeader=KG;var WG=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
|
146
147
|
`),n.length>0&&(t.appendMarkdown(`#### Examples:
|
147
148
|
`),t.appendCodeblock(pI.LanguageId,n.join(`
|
148
|
-
`)))};ze.appendTooltipBody=WG;var GG=t=>{if(!(0,Ke.isFunctionType)(t.item)&&!(0,Ke.isUnionType)(t.item))return null;let e=(0,Ke.isFunctionType)(t.item)?[t.item]:t.item.variants.filter(Ke.isFunctionType),n=[];for(let r of e){let i=r.signature,o={label:(0,ze.createTooltipHeader)(t,i)},a=i.getArguments()??[],u=new hI.MarkdownString("");(0,ze.appendTooltipBody)(u,i),o.parameters=a.map(c=>({label:`${c.getLabel()}${c.isOptional()?"?":""}: ${c.getTypes().join(" or ")}`})),o.documentation=u.toString(),n.push(o)}return n};ze.createSignatureInfo=GG;var HG=t=>{if(!(0,Ke.isFunctionType)(t.item)&&!(0,Ke.isUnionType)(t.item))return null;let e=(0,Ke.isFunctionType)(t.item)?[t.item]:t.item.variants.filter(Ke.isFunctionType),n=[];for(let r of e){let i=new hI.MarkdownString(""),s=r.signature;(0,ze.appendTooltipHeader)(i,t,s),(0,ze.appendTooltipBody)(i,s),n.push(i)}return{contents:n.map(r=>r.toString())}};ze.createHover=HG;var VG=t=>{let e=[];(0,Ke.isMapType)(t)||(0,Ke.isUnknownType)(t)||(0,Ke.isClassType)(t)?e.push(t):(0,Ke.isUnionType)(t)&&e.push(...t.variants.filter(i=>(0,Ke.isMapType)(i)||(0,Ke.isUnknownType)(i)||(0,Ke.isClassType)(i)));let n=new Map;for(let i of e)if(i.properties!=null)for(let[s,o]of i.properties){if(typeof s!="string")continue;let a=o.type.toMeta().map(FG.SignatureDefinitionTypeMeta.parse);n.set(s,ag(a))}if(n.size===0)return null;let r=Array.from(n.entries()).sort(([i],[s])=>i.localeCompare(s));return Object.fromEntries(r)};ze.createTypeBody=VG});var cg=f((tl,Sw)=>{(function(t,e){if(typeof tl=="object"&&typeof Sw=="object")Sw.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof tl=="object"?tl:t)[r]=n[r]}})(tl,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,p="",h=0,m=-1,b=0,v=0;v<=u.length;++v){if(v<u.length)l=u.charCodeAt(v);else{if(l===47)break;l=47}if(l===47){if(!(m===v-1||b===1))if(m!==v-1&&b===2){if(p.length<2||h!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var R=p.lastIndexOf("/");if(R!==p.length-1){R===-1?(p="",h=0):h=(p=p.slice(0,R)).length-1-p.lastIndexOf("/"),m=v,b=0;continue}}else if(p.length===2||p.length===1){p="",h=0,m=v,b=0;continue}}c&&(p.length>0?p+="/..":p="..",h=2)}else p.length>0?p+="/"+u.slice(m+1,v):p=u.slice(m+1,v),h=v-m-1;m=v,b=0}else l===46&&b!==-1?++b:b=-1}return p}var a={resolve:function(){for(var u,c="",l=!1,p=arguments.length-1;p>=-1&&!l;p--){var h;p>=0?h=arguments[p]:(u===void 0&&(u=process.cwd()),h=u),s(h),h.length!==0&&(c=h+"/"+c,l=h.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var p=u.length,h=p-l,m=1;m<c.length&&c.charCodeAt(m)===47;++m);for(var b=c.length-m,v=h<b?h:b,R=-1,A=0;A<=v;++A){if(A===v){if(b>v){if(c.charCodeAt(m+A)===47)return c.slice(m+A+1);if(A===0)return c.slice(m+A)}else h>v&&(u.charCodeAt(l+A)===47?R=A:A===0&&(R=0));break}var T=u.charCodeAt(l+A);if(T!==c.charCodeAt(m+A))break;T===47&&(R=A)}var w="";for(A=l+R+1;A<=p;++A)A!==p&&u.charCodeAt(A)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+c.slice(m+R):(m+=R,c.charCodeAt(m)===47&&++m,c.slice(m))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,p=-1,h=!0,m=u.length-1;m>=1;--m)if((c=u.charCodeAt(m))===47){if(!h){p=m;break}}else h=!1;return p===-1?l?"/":".":l&&p===1?"//":u.slice(0,p)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,p=0,h=-1,m=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var b=c.length-1,v=-1;for(l=u.length-1;l>=0;--l){var R=u.charCodeAt(l);if(R===47){if(!m){p=l+1;break}}else v===-1&&(m=!1,v=l+1),b>=0&&(R===c.charCodeAt(b)?--b==-1&&(h=l):(b=-1,h=v))}return p===h?h=v:h===-1&&(h=u.length),u.slice(p,h)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!m){p=l+1;break}}else h===-1&&(m=!1,h=l+1);return h===-1?"":u.slice(p,h)},extname:function(u){s(u);for(var c=-1,l=0,p=-1,h=!0,m=0,b=u.length-1;b>=0;--b){var v=u.charCodeAt(b);if(v!==47)p===-1&&(h=!1,p=b+1),v===46?c===-1?c=b:m!==1&&(m=1):c!==-1&&(m=-1);else if(!h){l=b+1;break}}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===l+1?"":u.slice(c,p)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var p=l.dir||l.root,h=l.base||(l.name||"")+(l.ext||"");return p?p===l.root?p+h:p+"/"+h:h}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,p=u.charCodeAt(0),h=p===47;h?(c.root="/",l=1):l=0;for(var m=-1,b=0,v=-1,R=!0,A=u.length-1,T=0;A>=l;--A)if((p=u.charCodeAt(A))!==47)v===-1&&(R=!1,v=A+1),p===46?m===-1?m=A:T!==1&&(T=1):m!==-1&&(T=-1);else if(!R){b=A+1;break}return m===-1||v===-1||T===0||T===1&&m===v-1&&m===b+1?v!==-1&&(c.base=c.name=b===0&&h?u.slice(1,v):u.slice(b,v)):(b===0&&h?(c.name=u.slice(1,m),c.base=u.slice(1,v)):(c.name=u.slice(b,m),c.base=u.slice(b,v)),c.ext=u.slice(m,v)),b>0?c.dir=u.slice(0,b-1):h&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function p(K,P){if(!K.scheme&&P)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${K.authority}", path: "${K.path}", query: "${K.query}", fragment: "${K.fragment}"}`);if(K.scheme&&!u.test(K.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(K.path){if(K.authority){if(!c.test(K.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(K.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let h="",m="/",b=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class v{static isUri(P){return P instanceof v||!!P&&typeof P.authority=="string"&&typeof P.fragment=="string"&&typeof P.path=="string"&&typeof P.query=="string"&&typeof P.scheme=="string"&&typeof P.fsPath=="string"&&typeof P.with=="function"&&typeof P.toString=="function"}scheme;authority;path;query;fragment;constructor(P,M,L,F,he,ce=!1){typeof P=="object"?(this.scheme=P.scheme||h,this.authority=P.authority||h,this.path=P.path||h,this.query=P.query||h,this.fragment=P.fragment||h):(this.scheme=function($t,Et){return $t||Et?$t:"file"}(P,ce),this.authority=M||h,this.path=function($t,Et){switch($t){case"https":case"http":case"file":Et?Et[0]!==m&&(Et=m+Et):Et=m}return Et}(this.scheme,L||h),this.query=F||h,this.fragment=he||h,p(this,ce))}get fsPath(){return N(this,!1)}with(P){if(!P)return this;let{scheme:M,authority:L,path:F,query:he,fragment:ce}=P;return M===void 0?M=this.scheme:M===null&&(M=h),L===void 0?L=this.authority:L===null&&(L=h),F===void 0?F=this.path:F===null&&(F=h),he===void 0?he=this.query:he===null&&(he=h),ce===void 0?ce=this.fragment:ce===null&&(ce=h),M===this.scheme&&L===this.authority&&F===this.path&&he===this.query&&ce===this.fragment?this:new A(M,L,F,he,ce)}static parse(P,M=!1){let L=b.exec(P);return L?new A(L[2]||h,ae(L[4]||h),ae(L[5]||h),ae(L[7]||h),ae(L[9]||h),M):new A(h,h,h,h,h)}static file(P){let M=h;if(a.isWindows&&(P=P.replace(/\\/g,m)),P[0]===m&&P[1]===m){let L=P.indexOf(m,2);L===-1?(M=P.substring(2),P=m):(M=P.substring(2,L),P=P.substring(L)||m)}return new A("file",M,P,h,h)}static from(P){let M=new A(P.scheme,P.authority,P.path,P.query,P.fragment);return p(M,!0),M}toString(P=!1){return O(this,P)}toJSON(){return this}static revive(P){if(P){if(P instanceof v)return P;{let M=new A(P);return M._formatted=P.external,M._fsPath=P._sep===R?P.fsPath:null,M}}return P}}s.URI=v;let R=a.isWindows?1:void 0;class A extends v{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this,!1)),this._fsPath}toString(P=!1){return P?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let P={$mid:1};return this._fsPath&&(P.fsPath=this._fsPath,P._sep=R),this._formatted&&(P.external=this._formatted),this.path&&(P.path=this.path),this.scheme&&(P.scheme=this.scheme),this.authority&&(P.authority=this.authority),this.query&&(P.query=this.query),this.fragment&&(P.fragment=this.fragment),P}}let T={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(K,P,M){let L,F=-1;for(let he=0;he<K.length;he++){let ce=K.charCodeAt(he);if(ce>=97&&ce<=122||ce>=65&&ce<=90||ce>=48&&ce<=57||ce===45||ce===46||ce===95||ce===126||P&&ce===47||M&&ce===91||M&&ce===93||M&&ce===58)F!==-1&&(L+=encodeURIComponent(K.substring(F,he)),F=-1),L!==void 0&&(L+=K.charAt(he));else{L===void 0&&(L=K.substr(0,he));let $t=T[ce];$t!==void 0?(F!==-1&&(L+=encodeURIComponent(K.substring(F,he)),F=-1),L+=$t):F===-1&&(F=he)}}return F!==-1&&(L+=encodeURIComponent(K.substring(F))),L!==void 0?L:K}function _(K){let P;for(let M=0;M<K.length;M++){let L=K.charCodeAt(M);L===35||L===63?(P===void 0&&(P=K.substr(0,M)),P+=T[L]):P!==void 0&&(P+=K[M])}return P!==void 0?P:K}function N(K,P){let M;return M=K.authority&&K.path.length>1&&K.scheme==="file"?`//${K.authority}${K.path}`:K.path.charCodeAt(0)===47&&(K.path.charCodeAt(1)>=65&&K.path.charCodeAt(1)<=90||K.path.charCodeAt(1)>=97&&K.path.charCodeAt(1)<=122)&&K.path.charCodeAt(2)===58?P?K.path.substr(1):K.path[1].toLowerCase()+K.path.substr(2):K.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(K,P){let M=P?_:w,L="",{scheme:F,authority:he,path:ce,query:$t,fragment:Et}=K;if(F&&(L+=F,L+=":"),(he||F==="file")&&(L+=m,L+=m),he){let je=he.indexOf("@");if(je!==-1){let Rn=he.substr(0,je);he=he.substr(je+1),je=Rn.lastIndexOf(":"),je===-1?L+=M(Rn,!1,!1):(L+=M(Rn.substr(0,je),!1,!1),L+=":",L+=M(Rn.substr(je+1),!1,!0)),L+="@"}he=he.toLowerCase(),je=he.lastIndexOf(":"),je===-1?L+=M(he,!1,!0):(L+=M(he.substr(0,je),!1,!0),L+=he.substr(je))}if(ce){if(ce.length>=3&&ce.charCodeAt(0)===47&&ce.charCodeAt(2)===58){let je=ce.charCodeAt(1);je>=65&&je<=90&&(ce=`/${String.fromCharCode(je+32)}:${ce.substr(3)}`)}else if(ce.length>=2&&ce.charCodeAt(1)===58){let je=ce.charCodeAt(0);je>=65&&je<=90&&(ce=`${String.fromCharCode(je+32)}:${ce.substr(2)}`)}L+=M(ce,!0,!1)}return $t&&(L+="?",L+=M($t,!1,!1)),Et&&(L+="#",L+=P?Et:w(Et,!1,!1)),L}function G(K){try{return decodeURIComponent(K)}catch{return K.length>3?K.substr(0,3)+G(K.substr(3)):K}}s.uriToFsPath=N;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ae(K){return K.match(re)?K.replace(re,P=>G(P)):K}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(b,v,R,A){A===void 0&&(A=R);var T=Object.getOwnPropertyDescriptor(v,R);T&&!("get"in T?!v.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return v[R]}}),Object.defineProperty(b,A,T)}:function(b,v,R,A){A===void 0&&(A=R),b[A]=v[R]}),u=this&&this.__setModuleDefault||(Object.create?function(b,v){Object.defineProperty(b,"default",{enumerable:!0,value:v})}:function(b,v){b.default=v}),c=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var v={};if(b!=null)for(var R in b)R!=="default"&&Object.prototype.hasOwnProperty.call(b,R)&&a(v,b,R);return u(v,b),v};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),p=l.posix||l,h="/";var m;(function(b){b.joinPath=function(v,...R){return v.with({path:p.join(v.path,...R)})},b.resolvePath=function(v,...R){let A=v.path,T=!1;A[0]!==h&&(A=h+A,T=!0);let w=p.resolve(A,...R);return T&&w[0]===h&&!v.authority&&(w=w.substring(1)),v.with({path:w})},b.dirname=function(v){if(v.path.length===0||v.path===h)return v;let R=p.dirname(v.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),v.with({path:R})},b.basename=function(v){return p.basename(v.path)},b.extname=function(v){return p.extname(v.path)}})(m||(s.Utils=m={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var pg=f(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.DocumentURIBuilder=void 0;var nl=cg(),Tw=class t{static async fromTextDocument(e,n){let r=nl.URI.parse(e.uri),i=await n.fs.getWorkspaceFolderUri(r);return new t(nl.Utils.joinPath(r,".."),i)}constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),nl.Utils.joinPath(this.rootPath,e).toString()):nl.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return nl.Utils.joinPath(this.rootPath,e).toString()}getAlternativePathsWithContext(e,n){return e.startsWith("/")?n.getConfiguration().fileExtensions.map(r=>this.getFromWorkspaceFolder(`${e}.${r}`)):n.getConfiguration().fileExtensions.map(r=>this.getFromRootPath(`${e}.${r}`))}getOriginalPath(e){return e.startsWith("/")?this.getFromWorkspaceFolder(e):this.getFromRootPath(e)}async getPathWithContext(e,n){return n.fs.findExistingPath(this.getOriginalPath(e),...this.getAlternativePathsWithContext(e,n))}};lg.DocumentURIBuilder=Tw});var yI=f(su=>{"use strict";var zG=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});su.activate=void 0;var gI=Wr(),ww=Ka(),XG=Ve(),YG=zG(require("path")),JG=Ha(),mI=og(),hg=ug(),QG=Lr(),ZG=pg();function eH(t){async function e(n,r){let i=new mI.MarkdownString(""),o=r.closest.path,u=await(await ZG.DocumentURIBuilder.fromTextDocument(n,t)).getPathWithContext(o,t),c=u==null?["Cannot open file."]:[`[Inserts file "${YG.default.basename(u)}" inside this code when building](${u.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(c.join(`
|
149
|
-
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=t.documentManager.get(r),s=new JG.LookupHelper(i,t),o=await s.lookupAST(n.position);if(!o)return;if(o.closest.type===gI.ASTType.FeatureImportExpression||o.closest.type===gI.ASTType.FeatureIncludeExpression)return await e(r,o);let a=await s.lookupTypeInfo(o);if(!a)return;if((0,ww.isFunctionType)(a.item)||(0,ww.isUnionType)(a.item)&&a.item.variants.some(ww.isFunctionType))return(0,hg.createHover)(a);let u=new mI.MarkdownString(""),c=a.item.toMeta().map(XG.SignatureDefinitionTypeMeta.parse),l=a.value?a.value:a.path,p=`(${(0,hg.formatKind)(a.completionItemKind)}) ${l}: ${(0,hg.formatTypes)(c)}`,h=(0,hg.createTypeBody)(a.item);return h&&(p+=` ${JSON.stringify(h,null,2)}`),u.appendCodeblock(QG.LanguageId,p),{contents:u.toString()}})}su.activate=eH});var _I=f(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.activate=void 0;var bI=Te(),xw=Ka(),tH=Ha(),nH=ug(),rH=t=>{if(t.closest.type===bI.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===bI.ASTType.CallExpression)return n}return null};function iH(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new tH.LookupHelper(r,t),s=await i.lookupAST(e.position);if(!s)return;let{closest:o}=s,a=rH(s);if(a===null)return;let u=await i.lookupTypeInfo({closest:a.base,outer:o.scope?[o.scope]:[]});if(!u||!(0,xw.isFunctionType)(u.item)&&(!(0,xw.isUnionType)(u.item)||!u.item.variants.some(xw.isFunctionType)))return;let l=a.arguments.findIndex(h=>{let m=h.start.character-1,b=h.end.character;return m<=e.position.character&&b>=e.position.character}),p={activeParameter:l===-1?0:l,signatures:[],activeSignature:0};return p.signatures.push(...(0,nH.createSignatureInfo)(u)),p})}dg.activate=iH});var SI=f(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.activate=void 0;var vI=Lr();function sH(t){let e=r=>r.languageId!==vI.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===vI.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}fg.activate=sH});var wI=f(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.activate=void 0;var oH=xT(),aH=(t,e)=>{if(e.source==null)return[];let n=e.kind?(0,oH.getSymbolItemKind)(e.kind):13,r=[];for(let i of e.source){let s={line:i.start.line-1,character:i.start.character-1},o={line:i.end.line-1,character:i.end.character-1};r.push({name:e.name,kind:n,location:{uri:t.textDocument.uri,range:{start:s,end:o}}})}return r},TI=(t,e)=>{let r=t.typeDocument.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r)i.push(...aH(t,s));return i};function uH(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.parsedPayload)return TI(r,"")}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments()){let i=t.documentManager.get(r);i.parsedPayload&&n.push(...TI(i,e.query))}return n})}gg.activate=uH});var xI=f((D7,cH)=>{cH.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var EI=f((R7,lH)=>{lH.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Generates a `list` where each item is a `number`. By default, if only one argument is provided, the list starts at the given value and decrements by one for each item. You can optionally define a start and end value, as well as customize the incremental value. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
|
149
|
+
`)))};ze.appendTooltipBody=WG;var GG=t=>{if(!(0,Ke.isFunctionType)(t.item)&&!(0,Ke.isUnionType)(t.item))return null;let e=(0,Ke.isFunctionType)(t.item)?[t.item]:t.item.variants.filter(Ke.isFunctionType),n=[];for(let r of e){let i=r.signature,o={label:(0,ze.createTooltipHeader)(t,i)},a=i.getArguments()??[],u=new hI.MarkdownString("");(0,ze.appendTooltipBody)(u,i),o.parameters=a.map(c=>({label:`${c.getLabel()}${c.isOptional()?"?":""}: ${c.getTypes().join(" or ")}`})),o.documentation=u.toString(),n.push(o)}return n};ze.createSignatureInfo=GG;var HG=t=>{if(!(0,Ke.isFunctionType)(t.item)&&!(0,Ke.isUnionType)(t.item))return null;let e=(0,Ke.isFunctionType)(t.item)?[t.item]:t.item.variants.filter(Ke.isFunctionType),n=[];for(let r of e){let i=new hI.MarkdownString(""),s=r.signature;(0,ze.appendTooltipHeader)(i,t,s),(0,ze.appendTooltipBody)(i,s),n.push(i)}return{contents:n.map(r=>r.toString())}};ze.createHover=HG;var VG=t=>{let e=[];(0,Ke.isMapType)(t)||(0,Ke.isUnknownType)(t)||(0,Ke.isClassType)(t)?e.push(t):(0,Ke.isUnionType)(t)&&e.push(...t.variants.filter(i=>(0,Ke.isMapType)(i)||(0,Ke.isUnknownType)(i)||(0,Ke.isClassType)(i)));let n=new Map;for(let i of e)if(i.properties!=null)for(let[s,o]of i.properties){if(typeof s!="string")continue;let a=o.type.toMeta().map(FG.SignatureDefinitionTypeMeta.parse);n.set(s,ag(a))}if(n.size===0)return null;let r=Array.from(n.entries()).sort(([i],[s])=>i.localeCompare(s));return Object.fromEntries(r)};ze.createTypeBody=VG});var cg=f((tl,Sw)=>{(function(t,e){if(typeof tl=="object"&&typeof Sw=="object")Sw.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof tl=="object"?tl:t)[r]=n[r]}})(tl,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,p="",h=0,m=-1,b=0,v=0;v<=u.length;++v){if(v<u.length)l=u.charCodeAt(v);else{if(l===47)break;l=47}if(l===47){if(!(m===v-1||b===1))if(m!==v-1&&b===2){if(p.length<2||h!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var D=p.lastIndexOf("/");if(D!==p.length-1){D===-1?(p="",h=0):h=(p=p.slice(0,D)).length-1-p.lastIndexOf("/"),m=v,b=0;continue}}else if(p.length===2||p.length===1){p="",h=0,m=v,b=0;continue}}c&&(p.length>0?p+="/..":p="..",h=2)}else p.length>0?p+="/"+u.slice(m+1,v):p=u.slice(m+1,v),h=v-m-1;m=v,b=0}else l===46&&b!==-1?++b:b=-1}return p}var a={resolve:function(){for(var u,c="",l=!1,p=arguments.length-1;p>=-1&&!l;p--){var h;p>=0?h=arguments[p]:(u===void 0&&(u=process.cwd()),h=u),s(h),h.length!==0&&(c=h+"/"+c,l=h.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var p=u.length,h=p-l,m=1;m<c.length&&c.charCodeAt(m)===47;++m);for(var b=c.length-m,v=h<b?h:b,D=-1,A=0;A<=v;++A){if(A===v){if(b>v){if(c.charCodeAt(m+A)===47)return c.slice(m+A+1);if(A===0)return c.slice(m+A)}else h>v&&(u.charCodeAt(l+A)===47?D=A:A===0&&(D=0));break}var T=u.charCodeAt(l+A);if(T!==c.charCodeAt(m+A))break;T===47&&(D=A)}var w="";for(A=l+D+1;A<=p;++A)A!==p&&u.charCodeAt(A)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+c.slice(m+D):(m+=D,c.charCodeAt(m)===47&&++m,c.slice(m))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,p=-1,h=!0,m=u.length-1;m>=1;--m)if((c=u.charCodeAt(m))===47){if(!h){p=m;break}}else h=!1;return p===-1?l?"/":".":l&&p===1?"//":u.slice(0,p)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,p=0,h=-1,m=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var b=c.length-1,v=-1;for(l=u.length-1;l>=0;--l){var D=u.charCodeAt(l);if(D===47){if(!m){p=l+1;break}}else v===-1&&(m=!1,v=l+1),b>=0&&(D===c.charCodeAt(b)?--b==-1&&(h=l):(b=-1,h=v))}return p===h?h=v:h===-1&&(h=u.length),u.slice(p,h)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!m){p=l+1;break}}else h===-1&&(m=!1,h=l+1);return h===-1?"":u.slice(p,h)},extname:function(u){s(u);for(var c=-1,l=0,p=-1,h=!0,m=0,b=u.length-1;b>=0;--b){var v=u.charCodeAt(b);if(v!==47)p===-1&&(h=!1,p=b+1),v===46?c===-1?c=b:m!==1&&(m=1):c!==-1&&(m=-1);else if(!h){l=b+1;break}}return c===-1||p===-1||m===0||m===1&&c===p-1&&c===l+1?"":u.slice(c,p)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var p=l.dir||l.root,h=l.base||(l.name||"")+(l.ext||"");return p?p===l.root?p+h:p+"/"+h:h}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,p=u.charCodeAt(0),h=p===47;h?(c.root="/",l=1):l=0;for(var m=-1,b=0,v=-1,D=!0,A=u.length-1,T=0;A>=l;--A)if((p=u.charCodeAt(A))!==47)v===-1&&(D=!1,v=A+1),p===46?m===-1?m=A:T!==1&&(T=1):m!==-1&&(T=-1);else if(!D){b=A+1;break}return m===-1||v===-1||T===0||T===1&&m===v-1&&m===b+1?v!==-1&&(c.base=c.name=b===0&&h?u.slice(1,v):u.slice(b,v)):(b===0&&h?(c.name=u.slice(1,m),c.base=u.slice(1,v)):(c.name=u.slice(b,m),c.base=u.slice(b,v)),c.ext=u.slice(m,v)),b>0?c.dir=u.slice(0,b-1):h&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function p(K,P){if(!K.scheme&&P)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${K.authority}", path: "${K.path}", query: "${K.query}", fragment: "${K.fragment}"}`);if(K.scheme&&!u.test(K.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(K.path){if(K.authority){if(!c.test(K.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(K.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let h="",m="/",b=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class v{static isUri(P){return P instanceof v||!!P&&typeof P.authority=="string"&&typeof P.fragment=="string"&&typeof P.path=="string"&&typeof P.query=="string"&&typeof P.scheme=="string"&&typeof P.fsPath=="string"&&typeof P.with=="function"&&typeof P.toString=="function"}scheme;authority;path;query;fragment;constructor(P,M,L,F,he,ce=!1){typeof P=="object"?(this.scheme=P.scheme||h,this.authority=P.authority||h,this.path=P.path||h,this.query=P.query||h,this.fragment=P.fragment||h):(this.scheme=function($t,Et){return $t||Et?$t:"file"}(P,ce),this.authority=M||h,this.path=function($t,Et){switch($t){case"https":case"http":case"file":Et?Et[0]!==m&&(Et=m+Et):Et=m}return Et}(this.scheme,L||h),this.query=F||h,this.fragment=he||h,p(this,ce))}get fsPath(){return N(this,!1)}with(P){if(!P)return this;let{scheme:M,authority:L,path:F,query:he,fragment:ce}=P;return M===void 0?M=this.scheme:M===null&&(M=h),L===void 0?L=this.authority:L===null&&(L=h),F===void 0?F=this.path:F===null&&(F=h),he===void 0?he=this.query:he===null&&(he=h),ce===void 0?ce=this.fragment:ce===null&&(ce=h),M===this.scheme&&L===this.authority&&F===this.path&&he===this.query&&ce===this.fragment?this:new A(M,L,F,he,ce)}static parse(P,M=!1){let L=b.exec(P);return L?new A(L[2]||h,ae(L[4]||h),ae(L[5]||h),ae(L[7]||h),ae(L[9]||h),M):new A(h,h,h,h,h)}static file(P){let M=h;if(a.isWindows&&(P=P.replace(/\\/g,m)),P[0]===m&&P[1]===m){let L=P.indexOf(m,2);L===-1?(M=P.substring(2),P=m):(M=P.substring(2,L),P=P.substring(L)||m)}return new A("file",M,P,h,h)}static from(P){let M=new A(P.scheme,P.authority,P.path,P.query,P.fragment);return p(M,!0),M}toString(P=!1){return O(this,P)}toJSON(){return this}static revive(P){if(P){if(P instanceof v)return P;{let M=new A(P);return M._formatted=P.external,M._fsPath=P._sep===D?P.fsPath:null,M}}return P}}s.URI=v;let D=a.isWindows?1:void 0;class A extends v{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this,!1)),this._fsPath}toString(P=!1){return P?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let P={$mid:1};return this._fsPath&&(P.fsPath=this._fsPath,P._sep=D),this._formatted&&(P.external=this._formatted),this.path&&(P.path=this.path),this.scheme&&(P.scheme=this.scheme),this.authority&&(P.authority=this.authority),this.query&&(P.query=this.query),this.fragment&&(P.fragment=this.fragment),P}}let T={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(K,P,M){let L,F=-1;for(let he=0;he<K.length;he++){let ce=K.charCodeAt(he);if(ce>=97&&ce<=122||ce>=65&&ce<=90||ce>=48&&ce<=57||ce===45||ce===46||ce===95||ce===126||P&&ce===47||M&&ce===91||M&&ce===93||M&&ce===58)F!==-1&&(L+=encodeURIComponent(K.substring(F,he)),F=-1),L!==void 0&&(L+=K.charAt(he));else{L===void 0&&(L=K.substr(0,he));let $t=T[ce];$t!==void 0?(F!==-1&&(L+=encodeURIComponent(K.substring(F,he)),F=-1),L+=$t):F===-1&&(F=he)}}return F!==-1&&(L+=encodeURIComponent(K.substring(F))),L!==void 0?L:K}function _(K){let P;for(let M=0;M<K.length;M++){let L=K.charCodeAt(M);L===35||L===63?(P===void 0&&(P=K.substr(0,M)),P+=T[L]):P!==void 0&&(P+=K[M])}return P!==void 0?P:K}function N(K,P){let M;return M=K.authority&&K.path.length>1&&K.scheme==="file"?`//${K.authority}${K.path}`:K.path.charCodeAt(0)===47&&(K.path.charCodeAt(1)>=65&&K.path.charCodeAt(1)<=90||K.path.charCodeAt(1)>=97&&K.path.charCodeAt(1)<=122)&&K.path.charCodeAt(2)===58?P?K.path.substr(1):K.path[1].toLowerCase()+K.path.substr(2):K.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(K,P){let M=P?_:w,L="",{scheme:F,authority:he,path:ce,query:$t,fragment:Et}=K;if(F&&(L+=F,L+=":"),(he||F==="file")&&(L+=m,L+=m),he){let je=he.indexOf("@");if(je!==-1){let Dn=he.substr(0,je);he=he.substr(je+1),je=Dn.lastIndexOf(":"),je===-1?L+=M(Dn,!1,!1):(L+=M(Dn.substr(0,je),!1,!1),L+=":",L+=M(Dn.substr(je+1),!1,!0)),L+="@"}he=he.toLowerCase(),je=he.lastIndexOf(":"),je===-1?L+=M(he,!1,!0):(L+=M(he.substr(0,je),!1,!0),L+=he.substr(je))}if(ce){if(ce.length>=3&&ce.charCodeAt(0)===47&&ce.charCodeAt(2)===58){let je=ce.charCodeAt(1);je>=65&&je<=90&&(ce=`/${String.fromCharCode(je+32)}:${ce.substr(3)}`)}else if(ce.length>=2&&ce.charCodeAt(1)===58){let je=ce.charCodeAt(0);je>=65&&je<=90&&(ce=`${String.fromCharCode(je+32)}:${ce.substr(2)}`)}L+=M(ce,!0,!1)}return $t&&(L+="?",L+=M($t,!1,!1)),Et&&(L+="#",L+=P?Et:w(Et,!1,!1)),L}function G(K){try{return decodeURIComponent(K)}catch{return K.length>3?K.substr(0,3)+G(K.substr(3)):K}}s.uriToFsPath=N;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ae(K){return K.match(re)?K.replace(re,P=>G(P)):K}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(b,v,D,A){A===void 0&&(A=D);var T=Object.getOwnPropertyDescriptor(v,D);T&&!("get"in T?!v.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return v[D]}}),Object.defineProperty(b,A,T)}:function(b,v,D,A){A===void 0&&(A=D),b[A]=v[D]}),u=this&&this.__setModuleDefault||(Object.create?function(b,v){Object.defineProperty(b,"default",{enumerable:!0,value:v})}:function(b,v){b.default=v}),c=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var v={};if(b!=null)for(var D in b)D!=="default"&&Object.prototype.hasOwnProperty.call(b,D)&&a(v,b,D);return u(v,b),v};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),p=l.posix||l,h="/";var m;(function(b){b.joinPath=function(v,...D){return v.with({path:p.join(v.path,...D)})},b.resolvePath=function(v,...D){let A=v.path,T=!1;A[0]!==h&&(A=h+A,T=!0);let w=p.resolve(A,...D);return T&&w[0]===h&&!v.authority&&(w=w.substring(1)),v.with({path:w})},b.dirname=function(v){if(v.path.length===0||v.path===h)return v;let D=p.dirname(v.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),v.with({path:D})},b.basename=function(v){return p.basename(v.path)},b.extname=function(v){return p.extname(v.path)}})(m||(s.Utils=m={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var pg=f(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.DocumentURIBuilder=void 0;var nl=cg(),Tw=class t{static async fromTextDocument(e,n){let r=nl.URI.parse(e.uri),i=await n.fs.getWorkspaceFolderUri(r);return new t(nl.Utils.joinPath(r,".."),i)}constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),nl.Utils.joinPath(this.rootPath,e).toString()):nl.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return nl.Utils.joinPath(this.rootPath,e).toString()}getAlternativePathsWithContext(e,n){return e.startsWith("/")?n.getConfiguration().fileExtensions.map(r=>this.getFromWorkspaceFolder(`${e}.${r}`)):n.getConfiguration().fileExtensions.map(r=>this.getFromRootPath(`${e}.${r}`))}getOriginalPath(e){return e.startsWith("/")?this.getFromWorkspaceFolder(e):this.getFromRootPath(e)}async getPathWithContext(e,n){return n.fs.findExistingPath(this.getOriginalPath(e),...this.getAlternativePathsWithContext(e,n))}};lg.DocumentURIBuilder=Tw});var yI=f(su=>{"use strict";var zG=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});su.activate=void 0;var gI=Wr(),ww=Ka(),XG=Ve(),YG=zG(require("path")),JG=Ha(),mI=og(),hg=ug(),QG=Lr(),ZG=pg();function eH(t){async function e(n,r){let i=new mI.MarkdownString(""),o=r.closest.path,u=await(await ZG.DocumentURIBuilder.fromTextDocument(n,t)).getPathWithContext(o,t),c=u==null?["Cannot open file."]:[`[Inserts file "${YG.default.basename(u)}" inside this code when building](${u.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(c.join(`
|
150
|
+
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=t.documentManager.get(r),s=new JG.LookupHelper(i,t),o=await s.lookupAST(n.position);if(!o)return;if(o.closest.type===gI.ASTType.FeatureImportExpression||o.closest.type===gI.ASTType.FeatureIncludeExpression)return await e(r,o);let a=await s.lookupTypeInfo(o);if(!a)return;if((0,ww.isFunctionType)(a.item)||(0,ww.isUnionType)(a.item)&&a.item.variants.some(ww.isFunctionType))return(0,hg.createHover)(a);let u=new mI.MarkdownString(""),c=a.item.toMeta().map(XG.SignatureDefinitionTypeMeta.parse),l=a.value?a.value:a.path,p=`(${(0,hg.formatKind)(a.completionItemKind)}) ${l}: ${(0,hg.formatTypes)(c)}`,h=(0,hg.createTypeBody)(a.item);return h&&(p+=` ${JSON.stringify(h,null,2)}`),u.appendCodeblock(QG.LanguageId,p),{contents:u.toString()}})}su.activate=eH});var _I=f(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.activate=void 0;var bI=Te(),xw=Ka(),tH=Ha(),nH=ug(),rH=t=>{if(t.closest.type===bI.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===bI.ASTType.CallExpression)return n}return null};function iH(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new tH.LookupHelper(r,t),s=await i.lookupAST(e.position);if(!s)return;let{closest:o}=s,a=rH(s);if(a===null)return;let u=await i.lookupTypeInfo({closest:a.base,outer:o.scope?[o.scope]:[]});if(!u||!(0,xw.isFunctionType)(u.item)&&(!(0,xw.isUnionType)(u.item)||!u.item.variants.some(xw.isFunctionType)))return;let l=a.arguments.findIndex(h=>{let m=h.start.character-1,b=h.end.character;return m<=e.position.character&&b>=e.position.character}),p={activeParameter:l===-1?0:l,signatures:[],activeSignature:0};return p.signatures.push(...(0,nH.createSignatureInfo)(u)),p})}dg.activate=iH});var SI=f(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.activate=void 0;var vI=Lr();function sH(t){let e=r=>r.languageId!==vI.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===vI.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}fg.activate=sH});var wI=f(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.activate=void 0;var oH=xT(),aH=(t,e)=>{if(e.source==null)return[];let n=e.kind?(0,oH.getSymbolItemKind)(e.kind):13,r=[];for(let i of e.source){let s={line:i.start.line-1,character:i.start.character-1},o={line:i.end.line-1,character:i.end.character-1};r.push({name:e.name,kind:n,location:{uri:t.textDocument.uri,range:{start:s,end:o}}})}return r},TI=(t,e)=>{let r=t.typeDocument.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r)i.push(...aH(t,s));return i};function uH(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.parsedPayload)return TI(r,"")}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments()){let i=t.documentManager.get(r);i.parsedPayload&&n.push(...TI(i,e.query))}return n})}gg.activate=uH});var xI=f((R7,cH)=>{cH.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var EI=f((D7,lH)=>{lH.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Generates a `list` where each item is a `number`. By default, if only one argument is provided, the list starts at the given value and decrements by one for each item. You can optionally define a start and end value, as well as customize the incremental value. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
|
150
151
|
miniscript: a string such as "1.5"
|
151
152
|
buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
|
152
153
|
host: a number for the host major and minor version, like 0.9
|
153
154
|
hostName: name of the host application, e.g. "Mini Micro"
|
154
|
-
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."},funcRef:{description:"Returns a `map` which enables to extend function references with custom methods.",example:["funcRef.signature = function"," return str(@self)","end function","print (@print).signature"]},list:{description:"Returns a `map` which enables to extend list types with custom methods.",example:["list.map = function(callback)"," newList = []"," for item in self"," newList.push(callback(item, __item_idx))"," end for"," return newList","end function","myMapFunction = function(item, index)",' print "Mapping value at index: " + index'," return item.myValue","end function",'print [{ "myValue": 24 }].map(@myMapFunction)']},number:{description:"Returns a `map` which enables to extend number types with custom methods.",example:["number.add = function(right)"," return self + right","end function","print (1234).add(1)"]},string:{description:"Returns a `map` which enables to extend string types with custom methods.",example:['string.color = function(colorValue = "red")',' return "<color=" + colorValue + ">" + self + "</color>"',"end function",'print "My text: ".color + "Hello world".color("yellow")']},map:{description:"Returns a `map` which enables to extend map types with custom methods.",example:["map.extend = function(value)"," for item in value"," self[item.key] = item.value"," end for"," return self","end function",'test = {"123":123}','test.extend({"bar": "foo"})','print "My extended value: " + test.bar']}}});var kI=f((I7,pH)=>{pH.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var AI=f((C7,hH)=>{hH.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var PI=f((M7,dH)=>{dH.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var OI=f((L7,fH)=>{fH.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var DI=f(rl=>{"use strict";var ou=rl&&rl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rl,"__esModule",{value:!0});var gH=ou(xI()),mH=ou(EI()),yH=ou(kI()),bH=ou(AI()),_H=ou(PI()),vH=ou(OI()),SH={any:gH.default,general:mH.default,list:yH.default,map:bH.default,string:vH.default,number:_H.default};rl.default=SH});var RI=f((q7,TH)=>{TH.exports={type:"any",definitions:{insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["null"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]}}}});var II=f((j7,wH)=>{wH.exports={type:"general",definitions:{hasIndex:{id:"hasIndex",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{id:"print",type:"function",tags:["function"],arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{id:"indexes",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{id:"values",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{id:"indexOf",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{id:"len",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{id:"shuffle",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{id:"val",type:"function",tags:["function"],arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{id:"lower",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{id:"upper",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{id:"sum",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{id:"pop",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{id:"pull",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{id:"push",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{id:"sort",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{id:"remove",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{id:"wait",type:"function",tags:["function"],arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{id:"abs",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{id:"acos",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{id:"asin",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{id:"atan",type:"function",tags:["function"],arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{id:"tan",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{id:"cos",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{id:"code",type:"function",tags:["function"],arguments:[{label:"value",type:"string"}],returns:["number"]},char:{id:"char",type:"function",tags:["function"],arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{id:"sin",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{id:"floor",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{id:"range",type:"function",tags:["function"],arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{id:"round",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{id:"rnd",type:"function",tags:["function"],arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{id:"sign",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{id:"sqrt",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{id:"str",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{id:"ceil",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{id:"pi",type:"function",tags:["function"],returns:["number"]},slice:{id:"slice",type:"function",tags:["function"],arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{id:"hash",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["number"]},time:{id:"time",type:"function",tags:["function"],returns:["number"]},bitAnd:{id:"bitAnd",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{id:"bitOr",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{id:"bitXor",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{id:"log",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{id:"yield",type:"function",tags:["function"],returns:["null"]},insert:{id:"insert",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{id:"join",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{id:"split",type:"function",tags:["function"],arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{id:"funcRef",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},list:{id:"list",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},map:{id:"map",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},number:{id:"number",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},string:{id:"string",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},refEquals:{id:"refEquals",type:"function",tags:["function"],arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{id:"stackTrace",type:"function",tags:["function"],returns:[{type:"list",valueType:"string"}]},version:{id:"version",type:"function",tags:["function"],returns:["version"]}}}});var CI=f((F7,xH)=>{xH.exports={type:"list",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{id:"sort",type:"function",tags:["method"],arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{id:"join",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var MI=f((B7,EH)=>{EH.exports={type:"map",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var LI=f(($7,kH)=>{kH.exports={type:"number",definitions:{}}});var NI=f((U7,AH)=>{AH.exports={type:"string",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{id:"split",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},code:{id:"code",type:"function",tags:["method"],returns:["number"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},lower:{id:"lower",type:"function",tags:["method"],returns:["string"]},upper:{id:"upper",type:"function",tags:["method"],returns:["string"]},val:{id:"val",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:[{type:"list",valueType:"string"}]}}}});var qI=f((K7,PH)=>{PH.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string",tags:[]},buildDate:{type:"string",tags:[]},host:{type:"number",tags:[]},hostName:{type:"string",tags:[]},hostInfo:{type:"string",tags:[]}}}});var Ew=f(Bn=>{"use strict";var Ms=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.miniscriptMeta=void 0;var OH=Ve(),DH=Ms(DI()),RH=Ms(RI()),IH=Ms(II()),CH=Ms(CI()),MH=Ms(MI()),LH=Ms(LI()),NH=Ms(NI()),qH=Ms(qI());Bn.miniscriptMeta=new OH.Container;Bn.miniscriptMeta.addTypeSignatureFromPayload(RH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(IH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(CH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(MH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(LH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(NH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(qH.default);Bn.miniscriptMeta.addMetaFromPayload("en",DH.default)});var yg=f($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.buildTokens=$n.TokenHandler=$n.semanticTokensLegend=$n.SemanticTokenModifier=$n.SemanticTokenType=void 0;var zr=Wr(),pe=Te(),jH=Ew(),jI=(t,e)=>!!jH.miniscriptMeta.getDefinition(t,e),gt;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(gt=$n.SemanticTokenType||($n.SemanticTokenType={}));var kw;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(kw=$n.SemanticTokenModifier||($n.SemanticTokenModifier={}));$n.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var FI=t=>1<<t,mg=class{constructor(e,n){this._lexer=e,this._builder=n}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}processMultilineToken(e,n,r){if(n.length>1){this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0);for(let i=1;i<n.length;i++)this._builder.push(e.start.line+i-1,0,n[i].length,r,0)}else this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0)}processFunction(){let e=this;if(!pe.SelectorGroups.BlockEndOfLine(e.token)){if(!e.consume(pe.Selectors.LParenthesis))return;for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0);!pe.SelectorGroups.FunctionDeclarationArgEnd(e.token);){if(e.token.type!==pe.TokenType.Identifier)return;if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Parameter,0),e.next(),e.consume(pe.Selectors.Assign))for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Operator,0);!pe.Selectors.ArgumentSeperator(e.token)&&!pe.Selectors.RParenthesis(e.token)&&!pe.Selectors.EndOfLine(e.token);)e.process();if(!pe.Selectors.RParenthesis(e.token)){if(!pe.Selectors.ArgumentSeperator(e.token))return;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Punctuator,0),e.next()}}if(e.consume(pe.Selectors.RParenthesis)){e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0);return}}}processPathSegment(){let e=this;if(this.token.type===pe.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,gt.String,0),this.next();return}let n="";for(;!zr.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.String,0),n=n+e.token.value,e.next();return e.consumeMany(zr.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e.token.type===pe.TokenType.StringLiteral&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.String,0),e.next())}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.token.type===pe.TokenType.Identifier&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Variable,0),e.next(),e.consume(zr.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Keyword,0),e.processPathSegment()))}processFeatureIncludeStatement(){this.processPathSegment()}processKeyword(){let e=this.token;switch(this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Keyword,0),this.next(),e.value){case pe.Keyword.Function:{this.processFunction();return}case zr.GreybelKeyword.Include:case zr.GreybelKeyword.IncludeWithComment:{this.processFeatureIncludeStatement();return}case zr.GreybelKeyword.Import:case zr.GreybelKeyword.ImportWithComment:{this.processFeatureImportStatement();return}case zr.GreybelKeyword.Envar:{this.processFeatureEnvarExpression();return}case zr.GreybelKeyword.Inject:{this.processFeatureInjectExpression();return}case zr.GreybelKeyword.Debugger:return}}processStringLiteral(){let e=this.token;this.processMultilineToken(e,e.raw.split(`
|
155
|
+
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."},funcRef:{description:"Returns a `map` which enables to extend function references with custom methods.",example:["funcRef.signature = function"," return str(@self)","end function","print (@print).signature"]},list:{description:"Returns a `map` which enables to extend list types with custom methods.",example:["list.map = function(callback)"," newList = []"," for item in self"," newList.push(callback(item, __item_idx))"," end for"," return newList","end function","myMapFunction = function(item, index)",' print "Mapping value at index: " + index'," return item.myValue","end function",'print [{ "myValue": 24 }].map(@myMapFunction)']},number:{description:"Returns a `map` which enables to extend number types with custom methods.",example:["number.add = function(right)"," return self + right","end function","print (1234).add(1)"]},string:{description:"Returns a `map` which enables to extend string types with custom methods.",example:['string.color = function(colorValue = "red")',' return "<color=" + colorValue + ">" + self + "</color>"',"end function",'print "My text: ".color + "Hello world".color("yellow")']},map:{description:"Returns a `map` which enables to extend map types with custom methods.",example:["map.extend = function(value)"," for item in value"," self[item.key] = item.value"," end for"," return self","end function",'test = {"123":123}','test.extend({"bar": "foo"})','print "My extended value: " + test.bar']}}});var kI=f((I7,pH)=>{pH.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var AI=f((C7,hH)=>{hH.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var PI=f((M7,dH)=>{dH.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var OI=f((L7,fH)=>{fH.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var RI=f(rl=>{"use strict";var ou=rl&&rl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rl,"__esModule",{value:!0});var gH=ou(xI()),mH=ou(EI()),yH=ou(kI()),bH=ou(AI()),_H=ou(PI()),vH=ou(OI()),SH={any:gH.default,general:mH.default,list:yH.default,map:bH.default,string:vH.default,number:_H.default};rl.default=SH});var DI=f((q7,TH)=>{TH.exports={type:"any",definitions:{insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["null"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]}}}});var II=f((j7,wH)=>{wH.exports={type:"general",definitions:{hasIndex:{id:"hasIndex",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{id:"print",type:"function",tags:["function"],arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{id:"indexes",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{id:"values",type:"function",tags:["function"],arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{id:"indexOf",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{id:"len",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{id:"shuffle",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{id:"val",type:"function",tags:["function"],arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{id:"lower",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{id:"upper",type:"function",tags:["function"],arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{id:"sum",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{id:"pop",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{id:"pull",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{id:"push",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{id:"sort",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{id:"remove",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{id:"wait",type:"function",tags:["function"],arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{id:"abs",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{id:"acos",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{id:"asin",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{id:"atan",type:"function",tags:["function"],arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{id:"tan",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{id:"cos",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{id:"code",type:"function",tags:["function"],arguments:[{label:"value",type:"string"}],returns:["number"]},char:{id:"char",type:"function",tags:["function"],arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{id:"sin",type:"function",tags:["function"],arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{id:"floor",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{id:"range",type:"function",tags:["function"],arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{id:"round",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{id:"rnd",type:"function",tags:["function"],arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{id:"sign",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{id:"sqrt",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{id:"str",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{id:"ceil",type:"function",tags:["function"],arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{id:"pi",type:"function",tags:["function"],returns:["number"]},slice:{id:"slice",type:"function",tags:["function"],arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{id:"hash",type:"function",tags:["function"],arguments:[{label:"value",type:"any"}],returns:["number"]},time:{id:"time",type:"function",tags:["function"],returns:["number"]},bitAnd:{id:"bitAnd",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{id:"bitOr",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{id:"bitXor",type:"function",tags:["function"],arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{id:"log",type:"function",tags:["function"],arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{id:"yield",type:"function",tags:["function"],returns:["null"]},insert:{id:"insert",type:"function",tags:["function"],arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{id:"join",type:"function",tags:["function"],arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{id:"split",type:"function",tags:["function"],arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["function"],arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{id:"funcRef",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},list:{id:"list",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},map:{id:"map",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},number:{id:"number",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},string:{id:"string",type:"function",tags:["function"],returns:[{type:"map",keyType:"string"}]},refEquals:{id:"refEquals",type:"function",tags:["function"],arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{id:"stackTrace",type:"function",tags:["function"],returns:[{type:"list",valueType:"string"}]},version:{id:"version",type:"function",tags:["function"],returns:["version"]}}}});var CI=f((F7,xH)=>{xH.exports={type:"list",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{id:"sort",type:"function",tags:["method"],arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{id:"join",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var MI=f((B7,EH)=>{EH.exports={type:"map",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},push:{id:"push",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{id:"pull",type:"function",tags:["method"],returns:["any"]},pop:{id:"pop",type:"function",tags:["method"],returns:["any"]},shuffle:{id:"shuffle",type:"function",tags:["method"],returns:["null"]},sum:{id:"sum",type:"function",tags:["method"],returns:["number"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:["list"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:["list"]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var LI=f(($7,kH)=>{kH.exports={type:"number",definitions:{}}});var NI=f((U7,AH)=>{AH.exports={type:"string",definitions:{remove:{id:"remove",type:"function",tags:["method"],arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{id:"hasIndex",type:"function",tags:["method"],arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{id:"insert",type:"function",tags:["method"],arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{id:"indexOf",type:"function",tags:["method"],arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{id:"split",type:"function",tags:["method"],arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{id:"replace",type:"function",tags:["method"],arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{id:"indexes",type:"function",tags:["method"],returns:[{type:"list",valueType:"number"}]},code:{id:"code",type:"function",tags:["method"],returns:["number"]},len:{id:"len",type:"function",tags:["method"],returns:["number"]},lower:{id:"lower",type:"function",tags:["method"],returns:["string"]},upper:{id:"upper",type:"function",tags:["method"],returns:["string"]},val:{id:"val",type:"function",tags:["method"],returns:["number"]},values:{id:"values",type:"function",tags:["method"],returns:[{type:"list",valueType:"string"}]}}}});var qI=f((K7,PH)=>{PH.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string",tags:[]},buildDate:{type:"string",tags:[]},host:{type:"number",tags:[]},hostName:{type:"string",tags:[]},hostInfo:{type:"string",tags:[]}}}});var Ew=f(Bn=>{"use strict";var Ms=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.miniscriptMeta=void 0;var OH=Ve(),RH=Ms(RI()),DH=Ms(DI()),IH=Ms(II()),CH=Ms(CI()),MH=Ms(MI()),LH=Ms(LI()),NH=Ms(NI()),qH=Ms(qI());Bn.miniscriptMeta=new OH.Container;Bn.miniscriptMeta.addTypeSignatureFromPayload(DH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(IH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(CH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(MH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(LH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(NH.default);Bn.miniscriptMeta.addTypeSignatureFromPayload(qH.default);Bn.miniscriptMeta.addMetaFromPayload("en",RH.default)});var yg=f($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.buildTokens=$n.TokenHandler=$n.semanticTokensLegend=$n.SemanticTokenModifier=$n.SemanticTokenType=void 0;var zr=Wr(),pe=Te(),jH=Ew(),jI=(t,e)=>!!jH.miniscriptMeta.getDefinition(t,e),gt;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(gt=$n.SemanticTokenType||($n.SemanticTokenType={}));var kw;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(kw=$n.SemanticTokenModifier||($n.SemanticTokenModifier={}));$n.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var FI=t=>1<<t,mg=class{constructor(e,n){this._lexer=e,this._builder=n}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}processMultilineToken(e,n,r){if(n.length>1){this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0);for(let i=1;i<n.length;i++)this._builder.push(e.start.line+i-1,0,n[i].length,r,0)}else this._builder.push(e.start.line-1,e.start.character-1,n[0].length,r,0)}processFunction(){let e=this;if(!pe.SelectorGroups.BlockEndOfLine(e.token)){if(!e.consume(pe.Selectors.LParenthesis))return;for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0);!pe.SelectorGroups.FunctionDeclarationArgEnd(e.token);){if(e.token.type!==pe.TokenType.Identifier)return;if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Parameter,0),e.next(),e.consume(pe.Selectors.Assign))for(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Operator,0);!pe.Selectors.ArgumentSeperator(e.token)&&!pe.Selectors.RParenthesis(e.token)&&!pe.Selectors.EndOfLine(e.token);)e.process();if(!pe.Selectors.RParenthesis(e.token)){if(!pe.Selectors.ArgumentSeperator(e.token))return;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Punctuator,0),e.next()}}if(e.consume(pe.Selectors.RParenthesis)){e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0);return}}}processPathSegment(){let e=this;if(this.token.type===pe.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,gt.String,0),this.next();return}let n="";for(;!zr.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.String,0),n=n+e.token.value,e.next();return e.consumeMany(zr.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e.token.type===pe.TokenType.StringLiteral&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.String,0),e.next())}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.token.type===pe.TokenType.Identifier&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,gt.Variable,0),e.next(),e.consume(zr.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,gt.Keyword,0),e.processPathSegment()))}processFeatureIncludeStatement(){this.processPathSegment()}processKeyword(){let e=this.token;switch(this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Keyword,0),this.next(),e.value){case pe.Keyword.Function:{this.processFunction();return}case zr.GreybelKeyword.Include:case zr.GreybelKeyword.IncludeWithComment:{this.processFeatureIncludeStatement();return}case zr.GreybelKeyword.Import:case zr.GreybelKeyword.ImportWithComment:{this.processFeatureImportStatement();return}case zr.GreybelKeyword.Envar:{this.processFeatureEnvarExpression();return}case zr.GreybelKeyword.Inject:{this.processFeatureInjectExpression();return}case zr.GreybelKeyword.Debugger:return}}processStringLiteral(){let e=this.token;this.processMultilineToken(e,e.raw.split(`
|
155
156
|
`),gt.String),this.next()}processNumericLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,gt.Number,0),this.next()}processBooleanLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,gt.Constant,0),this.next()}processNilLiteral(){let e=this.token;this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,gt.Constant,0),this.next()}processIdentifier(){let e=this.token;if(pe.Selectors.MemberSeperator(this.previousToken)){let s=jI(["any"],e.value)?FI(kw.DefaultLibrary):0;this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Property,s),this.next();return}let r=jI(["general"],e.value)?FI(kw.DefaultLibrary):0;this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Variable,r),this.next()}processPunctuator(){let e=this.token;switch(e.value){case pe.Operator.Plus:case pe.Operator.Asterik:case pe.Operator.Minus:case pe.Operator.Slash:case pe.Operator.Power:case pe.Operator.Modulo:case pe.Operator.LessThan:case pe.Operator.LessThanOrEqual:case pe.Operator.GreaterThan:case pe.Operator.GreaterThanOrEqual:case pe.Operator.Equal:case pe.Operator.NotEqual:case pe.Operator.Assign:case pe.Operator.AddShorthand:case pe.Operator.SubtractShorthand:case pe.Operator.MultiplyShorthand:case pe.Operator.DivideShorthand:case pe.Operator.ModuloShorthand:case pe.Operator.PowerShorthand:case pe.Operator.Reference:{this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Operator,0);break}default:{this._builder.push(e.start.line-1,e.start.character-1,e.value.length,gt.Punctuator,0);break}}this.next()}processComment(){this.token.lastLine!=null?this.processMultilineToken(this.token,`/*${this.token.value}*/`.split(`
|
156
157
|
`),gt.Comment):this.processMultilineToken(this.token,`//${this.token.value}`.split(`
|
157
|
-
`),gt.Comment),this.next()}process(){let e=this;switch(e.token.type){case pe.TokenType.Keyword:{this.processKeyword();break}case pe.TokenType.StringLiteral:{this.processStringLiteral();break}case pe.TokenType.Identifier:{this.processIdentifier();break}case pe.TokenType.NumericLiteral:{this.processNumericLiteral();break}case pe.TokenType.Punctuator:case pe.TokenType.SliceOperator:{this.processPunctuator();break}case pe.TokenType.BooleanLiteral:{this.processBooleanLiteral();break}case pe.TokenType.NilLiteral:{this.processNilLiteral();break}case pe.TokenType.Comment:{this.processComment();break}default:e.next()}}digest(){let e=this;for(e.next();!pe.Selectors.EndOfFile(e.token);)e.process()}};$n.TokenHandler=mg;function FH(t,e){let n=new zr.Lexer(e.textDocument.getText(),{unsafe:!0});return new mg(n,t).digest(),t}$n.buildTokens=FH});var BI=f(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});bg.activate=void 0;var BH=yg();function $H(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(!r.parsedPayload)return;let i=t.createSemanticTokensBuilder();return(0,BH.buildTokens)(i,r),i.build()})}bg.activate=$H});var $I=f(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.buildFoldingRanges=void 0;var vi=Te(),Aw=db(),UH=yf();function KH(t){let e=[];return new UH.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case vi.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Aw.FoldingRangeKind.Comment}),null;case vi.ASTType.MapConstructorExpression:case vi.ASTType.ListConstructorExpression:case vi.ASTType.StringLiteral:case vi.ASTType.WhileStatement:case vi.ASTType.ForGenericStatement:case vi.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Aw.FoldingRangeKind.Region}),null;case vi.ASTType.IfClause:case vi.ASTType.ElseifClause:case vi.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Aw.FoldingRangeKind.Region}),null}return null}).visit(t.parsedPayload),e}_g.buildFoldingRanges=KH});var UI=f(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.activate=void 0;var WH=$I();function GH(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(r.parsedPayload)return(0,WH.buildFoldingRanges)(r)})}vg.activate=GH});var Ow=f(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});Sg.DocumentGraphBuilder=void 0;var HH=Lr(),Pw=class{constructor(e){this.documentManager=e.documentManager,this.entrypoint=e.entrypoint,this.nodeCache=new Map,this.pendingDocument=new Map}async getDocument(e){if(this.pendingDocument.has(e))return this.pendingDocument.get(e);let n=this.documentManager.getOrOpen(e);this.pendingDocument.set(e,n);let r=await n;return this.pendingDocument.delete(e),r}async build(){let e={item:{document:this.entrypoint,location:{type:HH.DependencyType.Root,location:this.entrypoint.textDocument.uri}},children:[]};if(this.entrypoint.parsedPayload===null)return e;this.nodeCache.set(this.entrypoint.textDocument.uri,e);let n=async(r,i)=>{let s=await r.getDependencies();await Promise.all(s.map(async o=>{let a=this.nodeCache.get(o.location);if(a!=null){i.children.push(a);return}let u=await this.getDocument(o.location);if(u===null)return;let c={item:{document:u,location:o},children:[]};this.nodeCache.set(o.location,c),i.children.push(c),u.parsedPayload!==null&&await n(u,c)}))};return await n(this.entrypoint,e),e}};Sg.DocumentGraphBuilder=Pw});var il=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.aggregateImportsWithNamespaceFromGraph=Oo.aggregateImportsWithNamespaceFromLocations=void 0;var VH=Ka(),zH=Lr(),XH=Ew(),YH=new VH.TypeManager({container:XH.miniscriptMeta});Oo.default=YH;function JH(t,e){let n=[];return t==null||t.forEach(r=>{let i=r.args[0];if(i==null)return;let s=e.get(r.location)?.typeDocument;s!=null&&n.push({namespace:i,typeDoc:s})}),n}Oo.aggregateImportsWithNamespaceFromLocations=JH;function QH(t,e){let n=[];return t==null||t.children.filter(i=>i.item.location.type===zH.DependencyType.Import).map(i=>i.item.location).forEach(i=>{let s=i.args[0];if(s==null)return;let o=e.get(i.location);o!=null&&n.push({namespace:s,typeDoc:o})}),n}Oo.aggregateImportsWithNamespaceFromGraph=QH});var WI=f(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.DocumentDependencyMerger=au.DocumentDependencyMergerJob=void 0;var KI=Lr(),ZH=Ow(),e3=il(),Tg=class{constructor(e){this.cache=e,this.refs=new Map}mergeDocuments(e,n){let r=(0,e3.aggregateImportsWithNamespaceFromGraph)(e,this.refs),i=e.item.document;return r.length===0?i.typeDocument.merge(...n.map(s=>({document:s}))):i.typeDocument.merge(...r.map(s=>({document:s.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:s.namespace}]})),...n.map(s=>({document:s})))}process(e,n){let r=e.item.document,i=r.textDocument.uri,s=this.refs.get(i);if(s!==void 0)return s;this.refs.set(i,null);let o=[],a=this.cache.createCacheKey(r,(0,KI.getAllDependencyLocationsFromGraph)(e,new Set(r.textDocument.uri)));if(this.cache.typeDocuments.has(a)){let c=this.cache.typeDocuments.get(a);return this.refs.set(i,c),c}if(this.cache.registerCacheKey(a,i),e.children.length===0)return this.refs.set(i,r.typeDocument),this.cache.typeDocuments.set(a,r.typeDocument),r.typeDocument;for(let c=0;c<e.children.length;c++){let l=e.children[c],p=this.process(l,n);if(l.item.location.type!==KI.DependencyType.Import){if(p===null)return;o.push(p)}}let u=this.mergeDocuments(e,o);return this.refs.set(i,u),this.cache.typeDocuments.set(a,u),u}};au.DocumentDependencyMergerJob=Tg;var Dw=class{constructor(e){this.cache=e,this.pendingJobs=new Map}async process(e,n){let i=await new ZH.DocumentGraphBuilder({documentManager:n.documentManager,entrypoint:e}).build();return new Tg(this.cache).process(i,n)}async build(e,n){let r=this.pendingJobs.get(e.textDocument.uri);if(r)return r;let i=this.process(e,n);this.pendingJobs.set(e.textDocument.uri,i);let s=await i;return this.pendingJobs.delete(e.textDocument.uri),s}};au.DocumentDependencyMerger=Dw});var sl=f(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.LRUCache=void 0;var uu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,HI=new Set,Rw=typeof process=="object"&&process?process:{},VI=(t,e,n,r)=>{typeof Rw.emitWarning=="function"?Rw.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},wg=globalThis.AbortController,GI=globalThis.AbortSignal;if(typeof wg>"u"){GI=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},wg=class{constructor(){e()}signal=new GI;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=Rw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,VI("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 t3=t=>!HI.has(t),eJ=Symbol("type"),Ls=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),zI=t=>Ls(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cu:null:null,cu=class extends Array{constructor(e){super(e),this.fill(0)}},Iw=class t{heap;length;static#e=!1;static create(e){let n=zI(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Cw=class t{#e;#t;#s;#i;#o;#v;#y;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#p;#u;#c;#n;#h;#b;#f;#g;#A;#m;#P;#T;#S;#_;#E;#d;#D;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#P,keyMap:e.#u,keyList:e.#c,valList:e.#n,next:e.#h,prev:e.#b,get head(){return e.#f},get tail(){return e.#g},free:e.#A,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#L(n,r,i,s),moveToTail:n=>e.#j(n),indexes:n=>e.#k(n),rindexes:n=>e.#O(n),isStale:n=>e.#x(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#a}get fetchMethod(){return this.#v}get memoMethod(){return this.#y}get dispose(){return this.#s}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,onInsert:l,disposeAfter:p,noDisposeOnSet:h,noUpdateTTL:m,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:R,fetchMethod:A,memoMethod:T,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:O,ignoreFetchAbort:G}=e;if(n!==0&&!Ls(n))throw new TypeError("max option must be a nonnegative integer");let re=n?zI(n):Array;if(!re)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=b,this.maxEntrySize=v||this.#t,this.sizeCalculation=R,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(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=T,A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#v=A,this.#E=!!A,this.#u=new Map,this.#c=new Array(n).fill(void 0),this.#n=new Array(n).fill(void 0),this.#h=new re(n),this.#b=new re(n),this.#f=0,this.#g=0,this.#A=Iw.create(n),this.#a=0,this.#p=0,typeof c=="function"&&(this.#s=c),typeof l=="function"&&(this.#i=l),typeof p=="function"?(this.#o=p,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#_=!!this.#s,this.#D=!!this.#i,this.#d=!!this.#o,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#t!==0&&!Ls(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ls(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ls(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ls(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#r()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ae="LRU_CACHE_UNBOUNDED";t3(ae)&&(HI.add(ae),VI("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ae,t))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#r(){let e=new cu(this.#e),n=new cu(this.#e);this.#S=e,this.#T=n,this.#R=(s,o,a=uu.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#x(s)&&this.#I(this.#c[s],"expire")},o+1);u.unref&&u.unref()}},this.#C=s=>{n[s]=e[s]!==0?uu.now():0},this.#w=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=uu.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#u.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#x=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#C=()=>{};#w=()=>{};#R=()=>{};#x=()=>!1;#B(){let e=new cu(this.#e);this.#p=0,this.#P=e,this.#M=n=>{this.#p-=e[n],e[n]=0},this.#$=(n,r,i,s)=>{if(this.#l(r))return 0;if(!Ls(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Ls(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#p>s;)this.#q(!0)}this.#p+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#M=e=>{};#N=(e,n,r)=>{};#$=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#a)for(let n=this.#g;!(!this.#U(n)||((e||!this.#x(n))&&(yield n),n===this.#f));)n=this.#b[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let n=this.#f;!(!this.#U(n)||((e||!this.#x(n))&&(yield n),n===this.#g));)n=this.#h[n]}#U(e){return e!==void 0&&this.#u.get(this.#c[e])===e}*entries(){for(let e of this.#k())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*keys(){for(let e of this.#k()){let n=this.#c[e];n!==void 0&&!this.#l(this.#n[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#c[e];n!==void 0&&!this.#l(this.#n[e])&&(yield n)}}*values(){for(let e of this.#k())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#k()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#k()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#x(n)&&(this.#I(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#u.get(e);if(n===void 0)return;let r=this.#n[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let o=this.#S[n],a=this.#T[n];if(o&&a){let u=o-(uu.now()-a);s.ttl=u,s.start=Date.now()}}return this.#P&&(s.size=this.#P[n]),s}dump(){let e=[];for(let n of this.#k({allowStale:!0})){let r=this.#c[n],i=this.#n[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#S&&this.#T){o.ttl=this.#S[n];let a=uu.now()-this.#T[n];o.start=Math.floor(Date.now()-a)}this.#P&&(o.size=this.#P[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=uu.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#$(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#I(e,"set"),this;let p=this.#a===0?void 0:this.#u.get(e);if(p===void 0)p=this.#a===0?this.#g:this.#A.length!==0?this.#A.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#c[p]=e,this.#n[p]=n,this.#u.set(e,p),this.#h[this.#g]=p,this.#b[p]=this.#g,this.#g=p,this.#a++,this.#N(p,l,u),u&&(u.set="add"),c=!1,this.#D&&this.#i?.(n,e,"add");else{this.#j(p);let h=this.#n[p];if(n!==h){if(this.#E&&this.#l(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=h;m!==void 0&&!o&&(this.#_&&this.#s?.(m,e,"set"),this.#d&&this.#m?.push([m,e,"set"]))}else o||(this.#_&&this.#s?.(h,e,"set"),this.#d&&this.#m?.push([h,e,"set"]));if(this.#M(p),this.#N(p,l,u),this.#n[p]=n,u){u.set="replace";let m=h&&this.#l(h)?h.__staleWhileFetching:h;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#D&&this.onInsert?.(n,e,n===h?"update":"replace")}if(i!==0&&!this.#S&&this.#r(),this.#S&&(c||this.#R(p,i,s),u&&this.#w(u,p)),!o&&this.#d&&this.#m){let h=this.#m,m;for(;m=h?.shift();)this.#o?.(...m)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#d&&this.#m){let e=this.#m,n;for(;n=e?.shift();)this.#o?.(...n)}}}#q(e){let n=this.#f,r=this.#c[n],i=this.#n[n];return this.#E&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#d)&&(this.#_&&this.#s?.(i,r,"evict"),this.#d&&this.#m?.push([i,r,"evict"])),this.#M(n),e&&(this.#c[n]=void 0,this.#n[n]=void 0,this.#A.push(n)),this.#a===1?(this.#f=this.#g=0,this.#A.length=0):this.#f=this.#h[n],this.#u.delete(r),this.#a--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#u.get(e);if(s!==void 0){let o=this.#n[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#x(s))i&&(i.has="stale",this.#w(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#w(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#u.get(e);if(i===void 0||!r&&this.#x(i))return;let s=this.#n[i];return this.#l(s)?s.__staleWhileFetching:s}#L(e,n,r,i){let s=n===void 0?void 0:this.#n[n];if(this.#l(s))return s;let o=new wg,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(v,R=!1)=>{let{aborted:A}=o.signal,T=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(A&&!R?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!T&&!R)return p(o.signal.reason);let w=m;return this.#n[n]===m&&(v===void 0?w.__staleWhileFetching?this.#n[n]=w.__staleWhileFetching:this.#I(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,u.options))),v},l=v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),p(v)),p=v=>{let{aborted:R}=o.signal,A=R&&r.allowStaleOnFetchAbort,T=A||r.allowStaleOnFetchRejection,w=T||r.noDeleteOnFetchRejection,_=m;if(this.#n[n]===m&&(!w||_.__staleWhileFetching===void 0?this.#I(e,"fetch"):A||(this.#n[n]=_.__staleWhileFetching)),T)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw v},h=(v,R)=>{let A=this.#v?.(e,s,u);A&&A instanceof Promise&&A.then(T=>v(T===void 0?void 0:T),R),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=T=>c(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let m=new Promise(h).then(c,l),b=Object.assign(m,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,b,{...u.options,status:void 0}),n=this.#u.get(e)):this.#n[n]=b,b}#l(e){if(!this.#E)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof wg}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:R=!1,status:A,signal:T}=n;if(!this.#E)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:b,ignoreFetchAbort:m,status:A,signal:T},_=this.#u.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#L(e,_,w,v);return N.__returned=N}else{let N=this.#n[_];if(this.#l(N)){let K=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?N.__staleWhileFetching:N.__returned=N}let O=this.#x(_);if(!R&&!O)return A&&(A.fetch="hit"),this.#j(_),i&&this.#C(_),A&&this.#w(A,_),N;let G=this.#L(e,_,w,v),ae=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=O?"stale":"refresh",ae&&O&&(A.returnedStale=!0)),ae?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#y;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#u.get(e);if(a!==void 0){let u=this.#n[a],c=this.#l(u);return o&&this.#w(o,a),this.#x(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#I(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#j(a),i&&this.#C(a),u))}else o&&(o.get="miss")}#K(e,n){this.#b[n]=e,this.#h[e]=n}#j(e){e!==this.#g&&(e===this.#f?this.#f=this.#h[e]:this.#K(this.#b[e],this.#h[e]),this.#K(this.#g,e),this.#g=e)}delete(e){return this.#I(e,"delete")}#I(e,n){let r=!1;if(this.#a!==0){let i=this.#u.get(e);if(i!==void 0)if(r=!0,this.#a===1)this.#F(n);else{this.#M(i);let s=this.#n[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#d)&&(this.#_&&this.#s?.(s,e,n),this.#d&&this.#m?.push([s,e,n])),this.#u.delete(e),this.#c[i]=void 0,this.#n[i]=void 0,i===this.#g)this.#g=this.#b[i];else if(i===this.#f)this.#f=this.#h[i];else{let o=this.#b[i];this.#h[o]=this.#h[i];let a=this.#h[i];this.#b[a]=this.#b[i]}this.#a--,this.#A.push(i)}}if(this.#d&&this.#m?.length){let i=this.#m,s;for(;s=i?.shift();)this.#o?.(...s)}return r}clear(){return this.#F("delete")}#F(e){for(let n of this.#O({allowStale:!0})){let r=this.#n[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[n];this.#_&&this.#s?.(r,i,e),this.#d&&this.#m?.push([r,i,e])}}if(this.#u.clear(),this.#n.fill(void 0),this.#c.fill(void 0),this.#S&&this.#T&&(this.#S.fill(0),this.#T.fill(0)),this.#P&&this.#P.fill(0),this.#f=0,this.#g=0,this.#A.length=0,this.#p=0,this.#a=0,this.#d&&this.#m){let n=this.#m,r;for(;r=n?.shift();)this.#o?.(...r)}}};xg.LRUCache=Cw});var XI=f(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.hash=void 0;function n3(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Eg.hash=n3});var JI=f(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.DocumentMergerCache=void 0;var r3=sl(),YI=XI(),Mw=class{constructor(){this.typeDocuments=new r3.LRUCache({max:100,ttl:1e3*60*5}),this.keyToDocumentUriMap=new Map}createCacheKey(e,n){let r=(0,YI.hash)(`main-${e.textDocument.uri}-${e.textDocument.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,YI.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.typeDocuments.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.typeDocuments.clear()}};kg.DocumentMergerCache=Mw});var tC=f((iJ,eC)=>{var Lw=Object.defineProperty,i3=Object.getOwnPropertyDescriptor,s3=Object.getOwnPropertyNames,o3=Object.prototype.hasOwnProperty,a3=(t,e)=>{for(var n in e)Lw(t,n,{get:e[n],enumerable:!0})},u3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s3(e))!o3.call(t,i)&&i!==n&&Lw(t,i,{get:()=>e[i],enumerable:!(r=i3(e,i))||r.enumerable});return t},c3=t=>u3(Lw({},"__esModule",{value:!0}),t),ZI={};a3(ZI,{toposort:()=>Nw,toposortWithEdges:()=>h3,toposortWithGraph:()=>d3});eC.exports=c3(ZI);function l3(t,e){let n=new Array(t.size);for(let r=0,i=t.size;r<i;r++)n[r]=new Set;for(let r=0,i=e.length;r<i;r++){let[s,o]=e[r],a=t.get(s),u=t.get(o);a==null||u==null||n[a].add(u)}return n}function p3(t){let e=new Map;for(let n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}function h3(t){let e=Array.from(new Set(t.flat()));return Nw(e,t)}function d3(t){let e=Array.from(new Set(Object.keys(t))),n=new Set(e),r=[];for(let i=0,s=e.length;i<s;i++){let o=e[i],a=Array.from(new Set(t[o]));for(let u=0,c=a.length;u<c;u++)r.push([o,a[u]]),n.add(a[u])}return Nw(Array.from(n),r)}function QI(t,e){let n={value:e};t.first==null?t.first=n:t.last.next=n,t.last=n}function f3(t){let e=t.first;return t.first=e.next,e.value}function g3(t){return t.first==null}function Nw(t,e){let n=p3(t),r=l3(n,e),i=new Array(t.length).fill(0);for(let a=0,u=r.length;a<u;a++)r[a].forEach(c=>{i[c]+=1});let s={first:null,last:null};i.forEach((a,u)=>{a===0&&QI(s,u)});let o=[];for(;!g3(s);){let a=f3(s);o.push(t[a]),r[a].forEach(u=>{--i[u]===0&&QI(s,u)})}if(o.length!==r.length)throw new Error(`Cyclic dependency detected: ${m3(o,n,r)?.map(a=>t[a]).join(" -> ")}`);return o}function m3(t,e,n){let r=new Set(t.map(a=>e.get(a))),i=null;function s(a,u){if(u.has(a))return!0;if(r.has(a))return!1;r.add(a),u.add(a);let c=Array.from(n[a]);for(let l=0,p=c.length;l<p;l++)if(s(c[l],u))return i==null&&(i=[a,c[l]]),!0;return u.delete(a),!1}let o=Array.from(n.keys());for(let a=0,u=o.length;a<u;a++)if(!r.has(o[a])&&s(o[a],new Set))return i;return null}});var nC=f(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.DocumentWorkspaceBuilder=lu.DocumentWorkspaceContext=void 0;var Ag=class{constructor(){this.documents=[],this.refs=new Map,this.dependencies=new Map}async loadDependencies(){await Promise.all(this.documents.map(async e=>{let n=await e.getDependencies();this.dependencies.set(e.textDocument.uri,n)}))}getDependencies(e){return this.dependencies.get(e)||[]}getRefMap(){return this.refs}getRef(e){return this.refs.get(e)||null}setRef(e,n){this.refs.set(e,n),this.documents.push(n)}};lu.DocumentWorkspaceContext=Ag;var qw=class{constructor(e){this.context=e.context}async build(){let e=new Ag,n=await this.context.fs.getWorkspaceRelatedFiles();return await Promise.all(n.map(async r=>{let i=await this.context.documentManager.getOrOpen(r.toString());return e.setRef(i.textDocument.uri,i),i})),e}};lu.DocumentWorkspaceBuilder=qw});var iC=f(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.DocumentWorkspaceMerger=pu.DocumentWorkspaceMergerJob=void 0;var y3=tC(),rC=il(),b3=nC(),Pg=class{constructor(e){this.cache=e}getTypeDocument(e,n){let r=n.getRef(e);if(r!=null){let i=(0,rC.aggregateImportsWithNamespaceFromLocations)(n.getDependencies(e),n.getRefMap());return i.length===0?r.typeDocument:r.typeDocument.merge(...i.map(o=>({document:o.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:o.namespace}]})))}return r.typeDocument}getExternalTypeDocumentsRelatedToDocument(e,n){let r=e.textDocument.uri,i=n.documents.map(c=>c.textDocument.uri),s=n.documents.map(c=>n.getDependencies(c.textDocument.uri).map(p=>[c.textDocument.uri,p.location])),o=(0,y3.toposort)(i,s.flat()),a=new Array(o.length);for(let c=o.length-1;c>=0;c--){let l=o[c];if(l===r)continue;let p=this.getTypeDocument(l,n);p!=null&&(a[c]=p)}return a.filter(c=>c!=null)}async process(e,n){let r=e.textDocument.uri,i=this.cache.createCacheKey(e,n.documents);if(this.cache.typeDocuments.has(i))return this.cache.typeDocuments.get(i);this.cache.registerCacheKey(i,r),await n.loadDependencies();let s=this.getExternalTypeDocumentsRelatedToDocument(e,n),o=(0,rC.aggregateImportsWithNamespaceFromLocations)(n.getDependencies(r),n.getRefMap()),a=e.typeDocument.merge(...o.map(u=>({document:u.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:u.namespace}]})),...s.map(u=>({document:u})));return this.cache.typeDocuments.set(i,a),a}};pu.DocumentWorkspaceMergerJob=Pg;var jw=class{constructor(e){this.cache=e,this.pendingJobs=new Map}async process(e,n){let i=await new b3.DocumentWorkspaceBuilder({context:n}).build();return new Pg(this.cache).process(e,i)}async build(e,n){let r=this.pendingJobs.get(e.textDocument.uri);if(r)return r;let i=this.process(e,n);this.pendingJobs.set(e.textDocument.uri,i);let s=await i;return this.pendingJobs.delete(e.textDocument.uri),s}};pu.DocumentWorkspaceMerger=jw});var sC=f(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.DocumentMerger=void 0;var _3=Lr(),v3=WI(),S3=JI(),T3=iC(),Fw=class{constructor(){this.cache=new S3.DocumentMergerCache,this.dependencyMerger=new v3.DocumentDependencyMerger(this.cache),this.workspaceMerger=new T3.DocumentWorkspaceMerger(this.cache)}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===_3.TypeAnalyzerStrategy.Workspace?this.workspaceMerger.build(e,n):this.dependencyMerger.build(e,n)}};Og.DocumentMerger=Fw});var uC=f(hu=>{"use strict";var w3=hu&&hu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hu,"__esModule",{value:!0});hu.CoreContext=void 0;var x3=w3(require("events")),ol=Lr(),oC=yg();function aC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):ol.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??ol.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??ol.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var Bw=class extends x3.default{constructor(){super(),this._configuration=aC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(ol.ConfigurationNamespace),n=aC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.cache.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:ol.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:oC.semanticTokensLegend.tokenTypes,tokenModifiers:oC.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};hu.CoreContext=Bw});var Kw=f(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.ActiveDocument=void 0;var $w=cg(),al=Lr(),cC=pg(),Uw=class{constructor(e){this.context=e.context,this.version=e.version,this.textDocument=e.textDocument,this.typeDocument=e.typeDocument,this.parsedPayload=e.parsedPayload,this.errors=e.errors}getDirectory(){return $w.Utils.joinPath($w.URI.parse(this.textDocument.uri),"..")}async getImportUris(e=null){if(this.parsedPayload==null)return[];let n=this.parsedPayload;if(n.imports.length===0)return[];let r=this.getDirectory(),i=this.context,s=new cC.DocumentURIBuilder(r,e);return(await Promise.all([...n.imports.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,al.parseDependencyLocation)({type:al.DependencyType.Import,location:u,args:[a.name?.name]})})])).filter(a=>a!=null)}async getIncludeUris(e=null){if(this.parsedPayload==null)return[];let n=this.parsedPayload;if(n.includes.length===0)return[];let r=this.getDirectory(),i=this.context,s=new cC.DocumentURIBuilder(r,e);return(await Promise.all([...n.includes.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,al.parseDependencyLocation)({type:al.DependencyType.Include,location:u})})])).filter(a=>a!=null)}async getDependencies(){if(this.parsedPayload==null)return[];if(this.dependencies)return this.dependencies;let e=await this.context.fs.getWorkspaceFolderUri($w.URI.parse(this.textDocument.uri)),[n,r]=await Promise.all([this.getImportUris(e),this.getIncludeUris(e)]),i=new Set([...n,...r]);return this.dependencies=Array.from(i).map(al.parseDependencyRawLocation),this.dependencies}};Dg.ActiveDocument=Uw});var Gw=f(Xi=>{"use strict";var E3=Xi&&Xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.DocumentScheduler=Xi.PROCESSING_TIMEOUT=void 0;var k3=E3(require("events"));Xi.PROCESSING_TIMEOUT=50;var Ww=class extends k3.default{constructor(e=Xi.PROCESSING_TIMEOUT){super(),this._timer=null,this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now();this.scheduledItems.forEach((n,r)=>{e-n.createdAt>this.processingTimeout&&(this.emit("process",n.document),this.scheduledItems.delete(r))}),this._timer=setTimeout(this.tickRef,0)}schedule(e){let n=e.uri;return this.scheduledItems.has(n)?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}isScheduled(e){return this.scheduledItems.has(e.uri)}cancel(e){return this.scheduledItems.delete(e.uri)}};Xi.DocumentScheduler=Ww});var mC=f((pJ,gC)=>{var Xw=Object.defineProperty,A3=Object.getOwnPropertyDescriptor,P3=Object.getOwnPropertyNames,O3=Object.prototype.hasOwnProperty,D3=(t,e)=>{for(var n in e)Xw(t,n,{get:e[n],enumerable:!0})},R3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of P3(e))!O3.call(t,i)&&i!==n&&Xw(t,i,{get:()=>e[i],enumerable:!(r=A3(e,i))||r.enumerable});return t},I3=t=>R3(Xw({},"__esModule",{value:!0}),t),lC={};D3(lC,{ScheduleIntervalHelper:()=>Hw,SchedulePostMessageHelper:()=>Vw,ScheduleSetImmmediateHelper:()=>zw,schedule:()=>L3,scheduleProvider:()=>fC});gC.exports=I3(lC);var C3=Promise.prototype.then.bind(Promise.resolve()),Yw=class Rg{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Rg.QUEUE_LIMIT);this.queue=this.queue.slice(Rg.QUEUE_LIMIT);for(let r=0;r<n;C3(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rg.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Hw=class pC extends Yw{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new pC;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},M3=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Vw=class hC extends Yw{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!M3()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new hC;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},zw=class dC extends Yw{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new dC;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function fC(){if(zw.isApplicable())return zw.createCallback();if(Vw.isApplicable())return Vw.createCallback();if(Hw.isApplicable())return Hw.createCallback();throw new Error("No schedule helper fulfills requirements!")}var L3=fC()});var bC=f(du=>{"use strict";var yC=du&&du.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(du,"__esModule",{value:!0});du.DocumentManager=void 0;var N3=yC(require("events")),q3=Wr(),j3=sl(),F3=mC(),B3=Kw(),$3=Gw(),U3=yC(il()),Jw=class extends N3.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e){super(),this._context=null,this._pendingFiles=new Map,this.documents=new j3.LRUCache({ttl:1e3*60*20,ttlAutopurge:!0}),this._documentScheduler=new $3.DocumentScheduler(e),this.initEvents()}initEvents(){this._documentScheduler.on("process",e=>{this.processAndPersist(e)})}processAndPersist(e){let n=e.uri;this._documentScheduler.cancel(e);let r=this.process(e);return this.documents.set(n,r),this.emit("processed",e,r),r}process(e){this._context.documentMerger.cache.flushCacheKey(e.uri);let n=e.getText(),r=new q3.Parser(n,{unsafe:!0}),i=r.parseChunk(),s=U3.default.analyze(e.uri,i);return new B3.ActiveDocument({context:this._context,version:e.version,textDocument:e,typeDocument:s,parsedPayload:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){return this.documents.get(e.uri)?.version===e.version?!1:this._documentScheduler.schedule(e)}async open(e){try{let n=this._pendingFiles.get(e),r;if(n)r=await n;else{let i=this.context.fs.getTextDocument(e);this._pendingFiles.set(e,i),r=await i}return r==null?null:this.documents.get(r.uri)||this.processAndPersist(r)}catch(n){return console.error(`Error opening document ${e}:`,n),null}finally{this._pendingFiles.delete(e)}}async getOrOpen(e){let n=this.documents.get(e);return n||this.open(e)}get(e){return this.documents.get(e.uri)||this.processAndPersist(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,F3.schedule)(()=>{if(!this._documentScheduler.isScheduled(e))return r(this.get(e));let i=()=>{this.removeListener("processed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("processed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("processed",s)})})}clear(e){this.documents.delete(e.uri),this.emit("cleared",e)}};du.DocumentManager=Jw});var Ig=f(W=>{"use strict";var K3=W&&W.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),W3=W&&W.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G3=W&&W.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&K3(e,t,n);return W3(e,t),e},H3=W&&W.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0});W.DocumentManager=W.DocumentGraphBuilder=W.DocumentURIBuilder=W.DocumentScheduler=W.ActiveDocument=W.CoreContext=W.buildTokens=W.semanticTokensLegend=W.lookupBase=W.lookupIdentifier=W.typeAnalyzer=W.appendTooltipHeader=W.appendTooltipBody=W.formatTypes=W.formatDefaultValue=W.createTooltipHeader=W.createSignatureInfo=W.createHover=W.MarkdownString=W.LookupHelper=W.DocumentMerger=W.ASTScraper=W.activateFoldingRange=W.activateSemantic=W.activateSymbol=W.activateSubscriptions=W.activateSignature=W.activateHover=W.activateFormatter=W.activateDiagnostic=W.activateDefinition=W.activateColor=W.activateAutocomplete=W.DefaultFileExtensions=W.TypeAnalyzerStrategy=W.ConfigurationNamespace=W.LanguageId=W.IndentationType=void 0;var ul=Lr();Object.defineProperty(W,"IndentationType",{enumerable:!0,get:function(){return ul.IndentationType}});Object.defineProperty(W,"LanguageId",{enumerable:!0,get:function(){return ul.LanguageId}});Object.defineProperty(W,"ConfigurationNamespace",{enumerable:!0,get:function(){return ul.ConfigurationNamespace}});Object.defineProperty(W,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return ul.TypeAnalyzerStrategy}});Object.defineProperty(W,"DefaultFileExtensions",{enumerable:!0,get:function(){return ul.DefaultFileExtensions}});var V3=yR();Object.defineProperty(W,"activateAutocomplete",{enumerable:!0,get:function(){return V3.activate}});var z3=AR();Object.defineProperty(W,"activateColor",{enumerable:!0,get:function(){return z3.activate}});var X3=OR();Object.defineProperty(W,"activateDefinition",{enumerable:!0,get:function(){return X3.activate}});var Y3=DR();Object.defineProperty(W,"activateDiagnostic",{enumerable:!0,get:function(){return Y3.activate}});var J3=cI();Object.defineProperty(W,"activateFormatter",{enumerable:!0,get:function(){return J3.activate}});var Q3=yI();Object.defineProperty(W,"activateHover",{enumerable:!0,get:function(){return Q3.activate}});var Z3=_I();Object.defineProperty(W,"activateSignature",{enumerable:!0,get:function(){return Z3.activate}});var eV=SI();Object.defineProperty(W,"activateSubscriptions",{enumerable:!0,get:function(){return eV.activate}});var tV=wI();Object.defineProperty(W,"activateSymbol",{enumerable:!0,get:function(){return tV.activate}});var nV=BI();Object.defineProperty(W,"activateSemantic",{enumerable:!0,get:function(){return nV.activate}});var rV=UI();Object.defineProperty(W,"activateFoldingRange",{enumerable:!0,get:function(){return rV.activate}});W.ASTScraper=G3(yf());var iV=sC();Object.defineProperty(W,"DocumentMerger",{enumerable:!0,get:function(){return iV.DocumentMerger}});var sV=Ha();Object.defineProperty(W,"LookupHelper",{enumerable:!0,get:function(){return sV.LookupHelper}});var oV=og();Object.defineProperty(W,"MarkdownString",{enumerable:!0,get:function(){return oV.MarkdownString}});var Do=ug();Object.defineProperty(W,"createHover",{enumerable:!0,get:function(){return Do.createHover}});Object.defineProperty(W,"createSignatureInfo",{enumerable:!0,get:function(){return Do.createSignatureInfo}});Object.defineProperty(W,"createTooltipHeader",{enumerable:!0,get:function(){return Do.createTooltipHeader}});Object.defineProperty(W,"formatDefaultValue",{enumerable:!0,get:function(){return Do.formatDefaultValue}});Object.defineProperty(W,"formatTypes",{enumerable:!0,get:function(){return Do.formatTypes}});Object.defineProperty(W,"appendTooltipBody",{enumerable:!0,get:function(){return Do.appendTooltipBody}});Object.defineProperty(W,"appendTooltipHeader",{enumerable:!0,get:function(){return Do.appendTooltipHeader}});var aV=il();Object.defineProperty(W,"typeAnalyzer",{enumerable:!0,get:function(){return H3(aV).default}});var _C=kT();Object.defineProperty(W,"lookupIdentifier",{enumerable:!0,get:function(){return _C.lookupIdentifier}});Object.defineProperty(W,"lookupBase",{enumerable:!0,get:function(){return _C.lookupBase}});var vC=yg();Object.defineProperty(W,"semanticTokensLegend",{enumerable:!0,get:function(){return vC.semanticTokensLegend}});Object.defineProperty(W,"buildTokens",{enumerable:!0,get:function(){return vC.buildTokens}});var uV=uC();Object.defineProperty(W,"CoreContext",{enumerable:!0,get:function(){return uV.CoreContext}});var cV=Kw();Object.defineProperty(W,"ActiveDocument",{enumerable:!0,get:function(){return cV.ActiveDocument}});var lV=Gw();Object.defineProperty(W,"DocumentScheduler",{enumerable:!0,get:function(){return lV.DocumentScheduler}});var pV=pg();Object.defineProperty(W,"DocumentURIBuilder",{enumerable:!0,get:function(){return pV.DocumentURIBuilder}});var hV=Ow();Object.defineProperty(W,"DocumentGraphBuilder",{enumerable:!0,get:function(){return hV.DocumentGraphBuilder}});var dV=bC();Object.defineProperty(W,"DocumentManager",{enumerable:!0,get:function(){return dV.DocumentManager}})});var xC={};qM(xC,{TextDocument:()=>Qw});function Zw(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Zw(r,e),Zw(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function SC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);TC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function TC(t){return t===13||t===10}function wC(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function fV(t){let e=wC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Cg,Qw,EC=NM(()=>{"use strict";Cg=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=wC(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=SC(r.text,!1,s);if(u-a===l.length)for(let h=0,m=l.length;h<m;h++)c[h+a+1]=l[h];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let p=r.text.length-(o-s);if(p!==0)for(let h=a+1+l.length,m=c.length;h<m;h++)c[h]=c[h]+p}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=SC(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&TC(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Cg(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Cg)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Zw(s.map(fV),(l,p)=>{let h=l.range.start.line-p.range.start.line;return h===0?l.range.start.character-p.range.start.character:h}),u=0,c=[];for(let l of a){let p=i.offsetAt(l.range.start);if(p<u)throw new Error("Overlapping edit");p>u&&c.push(o.substring(u,p)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Qw||(Qw={}))});var DC=f((fJ,OC)=>{"use strict";OC.exports=AC;function AC(t,e,n){t instanceof RegExp&&(t=kC(t,n)),e instanceof RegExp&&(e=kC(e,n));var r=PC(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function kC(t,e){var n=e.match(t);return n?n[0]:null}AC.range=PC;function PC(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var jC=f((gJ,qC)=>{var RC=DC();qC.exports=yV;var IC="\0SLASH"+Math.random()+"\0",CC="\0OPEN"+Math.random()+"\0",t0="\0CLOSE"+Math.random()+"\0",MC="\0COMMA"+Math.random()+"\0",LC="\0PERIOD"+Math.random()+"\0";function e0(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function gV(t){return t.split("\\\\").join(IC).split("\\{").join(CC).split("\\}").join(t0).split("\\,").join(MC).split("\\.").join(LC)}function mV(t){return t.split(IC).join("\\").split(CC).join("{").split(t0).join("}").split(MC).join(",").split(LC).join(".")}function NC(t){if(!t)return[""];var e=[],n=RC("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=NC(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function yV(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),cl(gV(t),!0).map(mV)):[]}function bV(t){return"{"+t+"}"}function _V(t){return/^-?0\d/.test(t)}function vV(t,e){return t<=e}function SV(t,e){return t>=e}function cl(t,e){var n=[],r=RC("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?cl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,p=r.body.indexOf(",")>=0;if(!l&&!p)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+t0+r.post,cl(t)):[t];var h;if(l)h=r.body.split(/\.\./);else if(h=NC(r.body),h.length===1&&(h=cl(h[0],!1).map(bV),h.length===1))return s.map(function(K){return r.pre+h[0]+K});var m;if(l){var b=e0(h[0]),v=e0(h[1]),R=Math.max(h[0].length,h[1].length),A=h.length==3?Math.abs(e0(h[2])):1,T=vV,w=v<b;w&&(A*=-1,T=SV);var _=h.some(_V);m=[];for(var N=b;T(N,v);N+=A){var O;if(c)O=String.fromCharCode(N),O==="\\"&&(O="");else if(O=String(N),_){var G=R-O.length;if(G>0){var re=new Array(G+1).join("0");N<0?O="-"+re+O.slice(1):O=re+O}}m.push(O)}}else{m=[];for(var ae=0;ae<h.length;ae++)m.push.apply(m,cl(h[ae],!1))}for(var ae=0;ae<m.length;ae++)for(var o=0;o<s.length;o++){var a=i+m[ae]+s[o];(!e||l||a)&&n.push(a)}}return n}});var FC=f(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.assertValidPattern=void 0;var TV=1024*64,wV=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>TV)throw new TypeError("pattern is too long")};Mg.assertValidPattern=wV});var $C=f(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.parseClass=void 0;var xV={"[: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]},ll=t=>t.replace(/[[\]\\-]/g,"\\$&"),EV=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),BC=t=>t.join(""),kV=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,p="";e:for(;s<t.length;){let v=t.charAt(s);if((v==="!"||v==="^")&&s===n+1){c=!0,s++;continue}if(v==="]"&&o&&!u){l=s+1;break}if(o=!0,v==="\\"&&!u){u=!0,s++;continue}if(v==="["&&!u){for(let[R,[A,T,w]]of Object.entries(xV))if(t.startsWith(R,s)){if(p)return["$.",!1,t.length-n,!0];s+=R.length,w?i.push(A):r.push(A),a=a||T;continue e}}if(u=!1,p){v>p?r.push(ll(p)+"-"+ll(v)):v===p&&r.push(ll(v)),p="",s++;continue}if(t.startsWith("-]",s+1)){r.push(ll(v+"-")),s+=2;continue}if(t.startsWith("-",s+1)){p=v,s+=2;continue}r.push(ll(v)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let v=r[0].length===2?r[0].slice(-1):r[0];return[EV(v),!1,l-n,!1]}let h="["+(c?"^":"")+BC(r)+"]",m="["+(c?"":"^")+BC(i)+"]";return[r.length&&i.length?"("+h+"|"+m+")":r.length?h:m,a,l-n,!0]};Lg.parseClass=kV});var qg=f(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.unescape=void 0;var AV=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Ng.unescape=AV});var i0=f(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.AST=void 0;var PV=$C(),jg=qg(),OV=new Set(["!","?","+","*","@"]),UC=t=>OV.has(t),DV="(?!(?:^|/)\\.\\.?(?:$|/))",Fg="(?!\\.)",RV=new Set(["[","."]),IV=new Set(["..","."]),CV=new Set("().*{}+?[]^$\\!"),MV=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),r0="[^/]",KC=r0+"*?",WC=r0+"+?",n0=class t{type;#e;#t;#s=!1;#i=[];#o;#v;#y;#a=!1;#p;#u;#c=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#p=this.#e===this?r:this.#e.#p,this.#y=this.#e===this?[]:this.#e.#y,e==="!"&&!this.#e.#a&&this.#y.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#u=this.#i.map(e=>String(e)).join("")}#n(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#i.length;i++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#i[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#i.push(n)}}toJSON(){let e=this.type===null?this.#i.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#i.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#i[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#i)n.copyIn(r);return n}static#h(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let m=r,b="";for(;m<e.length;){let v=e.charAt(m++);if(s||v==="\\"){s=!s,b+=v;continue}if(o){m===a+1?(v==="^"||v==="!")&&(u=!0):v==="]"&&!(m===a+2&&u)&&(o=!1),b+=v;continue}else if(v==="["){o=!0,a=m,u=!1,b+=v;continue}if(!i.noext&&UC(v)&&e.charAt(m)==="("){n.push(b),b="";let R=new t(v,n);m=t.#h(e,R,m,i),n.push(R);continue}b+=v}return n.push(b),m}let c=r+1,l=new t(null,n),p=[],h="";for(;c<e.length;){let m=e.charAt(c++);if(s||m==="\\"){s=!s,h+=m;continue}if(o){c===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(c===a+2&&u)&&(o=!1),h+=m;continue}else if(m==="["){o=!0,a=c,u=!1,h+=m;continue}if(UC(m)&&e.charAt(c)==="("){l.push(h),h="";let b=new t(m,l);l.push(b),c=t.#h(e,b,c,i);continue}if(m==="|"){l.push(h),h="",p.push(l),l=new t(null,n);continue}if(m===")")return h===""&&n.#i.length===0&&(n.#c=!0),l.push(h),h="",n.push(...p,l),c;h+=m}return n.type=null,n.#t=void 0,n.#i=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#h(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#p.nocase&&!this.#p.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#p.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#p}toRegExpSource(e){let n=e??!!this.#p.dot;if(this.#e===this&&this.#n(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#i.map(m=>{let[b,v,R,A]=typeof m=="string"?t.#f(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||R,this.#s=this.#s||A,b}).join(""),l="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&IV.has(this.#i[0]))){let b=RV,v=n&&b.has(c.charAt(0))||c.startsWith("\\.")&&b.has(c.charAt(2))||c.startsWith("\\.\\.")&&b.has(c.charAt(4)),R=!n&&!e&&b.has(c.charAt(0));l=v?DV:R?Fg:""}let p="";return this.isEnd()&&this.#e.#a&&this.#o?.type==="!"&&(p="(?:$|\\/)"),[l+c+p,(0,jg.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#i=[u],this.type=null,this.#t=void 0,[u,(0,jg.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Fg?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!n?Fg:"")+WC;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Fg:"")+KC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,jg.unescape)(s),this.#t=!!this.#t,this.#s]}#b(e){return this.#i.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#f(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(CV.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,p,h]=(0,PV.parseClass)(e,a);if(p){s+=c,o=o||l,a+=p-1,n=n||h;continue}}if(u==="*"){r&&e==="*"?s+=WC:s+=KC,n=!0;continue}if(u==="?"){s+=r0,n=!0;continue}s+=MV(u)}return[s,(0,jg.unescape)(e),!!n,o]}};Bg.AST=n0});var s0=f($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.escape=void 0;var LV=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");$g.escape=LV});var Ns=f(Z=>{"use strict";var NV=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.unescape=Z.escape=Z.AST=Z.Minimatch=Z.match=Z.makeRe=Z.braceExpand=Z.defaults=Z.filter=Z.GLOBSTAR=Z.sep=Z.minimatch=void 0;var qV=NV(jC()),Ug=FC(),VC=i0(),jV=s0(),FV=qg(),BV=(t,e,n={})=>((0,Ug.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Ro(e,n).match(t));Z.minimatch=BV;var $V=/^\*+([^+@!?\*\[\(]*)$/,UV=t=>e=>!e.startsWith(".")&&e.endsWith(t),KV=t=>e=>e.endsWith(t),WV=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),GV=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),HV=/^\*+\.\*+$/,VV=t=>!t.startsWith(".")&&t.includes("."),zV=t=>t!=="."&&t!==".."&&t.includes("."),XV=/^\.\*+$/,YV=t=>t!=="."&&t!==".."&&t.startsWith("."),JV=/^\*+$/,QV=t=>t.length!==0&&!t.startsWith("."),ZV=t=>t.length!==0&&t!=="."&&t!=="..",e4=/^\?+([^+@!?\*\[\(]*)?$/,t4=([t,e=""])=>{let n=zC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},n4=([t,e=""])=>{let n=XC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},r4=([t,e=""])=>{let n=XC([t]);return e?r=>n(r)&&r.endsWith(e):n},i4=([t,e=""])=>{let n=zC([t]);return e?r=>n(r)&&r.endsWith(e):n},zC=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},XC=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},YC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",GC={win32:{sep:"\\"},posix:{sep:"/"}};Z.sep=YC==="win32"?GC.win32.sep:GC.posix.sep;Z.minimatch.sep=Z.sep;Z.GLOBSTAR=Symbol("globstar **");Z.minimatch.GLOBSTAR=Z.GLOBSTAR;var s4="[^/]",o4=s4+"*?",a4="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",u4="(?:(?!(?:\\/|^)\\.).)*?",c4=(t,e={})=>n=>(0,Z.minimatch)(n,t,e);Z.filter=c4;Z.minimatch.filter=Z.filter;var kr=(t,e={})=>Object.assign({},t,e),l4=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Z.minimatch;let e=Z.minimatch;return Object.assign((r,i,s={})=>e(r,i,kr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,kr(t,s))}static defaults(i){return e.defaults(kr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,kr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,kr(t,s))}},unescape:(r,i={})=>e.unescape(r,kr(t,i)),escape:(r,i={})=>e.escape(r,kr(t,i)),filter:(r,i={})=>e.filter(r,kr(t,i)),defaults:r=>e.defaults(kr(t,r)),makeRe:(r,i={})=>e.makeRe(r,kr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,kr(t,i)),match:(r,i,s={})=>e.match(r,i,kr(t,s)),sep:e.sep,GLOBSTAR:Z.GLOBSTAR})};Z.defaults=l4;Z.minimatch.defaults=Z.defaults;var p4=(t,e={})=>((0,Ug.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,qV.default)(t));Z.braceExpand=p4;Z.minimatch.braceExpand=Z.braceExpand;var h4=(t,e={})=>new Ro(t,e).makeRe();Z.makeRe=h4;Z.minimatch.makeRe=Z.makeRe;var d4=(t,e,n={})=>{let r=new Ro(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};Z.match=d4;Z.minimatch.match=Z.match;var HC=/[?*]|[+@!]\(.*?\)|\[|\]/,f4=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ro=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Ug.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||YC,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!HC.test(s[2]))&&!HC.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let v=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),R=!v&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),T=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),w=R?3:v?0:void 0,_=T?3:A?0:void 0;if(typeof w=="number"&&typeof _=="number"){let[N,O]=[e[w],n[_]];N.toLowerCase()===O.toLowerCase()&&(n[_]=N,_>w?n=n.slice(_):w>_&&(e=e.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],p=e[o];if(this.debug(n,l,p),l===!1)return!1;if(l===Z.GLOBSTAR){this.debug("GLOBSTAR",[n,l,p]);var h=o,m=a+1;if(m===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;h<u;){var b=e[h];if(this.debug(`
|
158
|
+
`),gt.Comment),this.next()}process(){let e=this;switch(e.token.type){case pe.TokenType.Keyword:{this.processKeyword();break}case pe.TokenType.StringLiteral:{this.processStringLiteral();break}case pe.TokenType.Identifier:{this.processIdentifier();break}case pe.TokenType.NumericLiteral:{this.processNumericLiteral();break}case pe.TokenType.Punctuator:case pe.TokenType.SliceOperator:{this.processPunctuator();break}case pe.TokenType.BooleanLiteral:{this.processBooleanLiteral();break}case pe.TokenType.NilLiteral:{this.processNilLiteral();break}case pe.TokenType.Comment:{this.processComment();break}default:e.next()}}digest(){let e=this;for(e.next();!pe.Selectors.EndOfFile(e.token);)e.process()}};$n.TokenHandler=mg;function FH(t,e){let n=new zr.Lexer(e.textDocument.getText(),{unsafe:!0});return new mg(n,t).digest(),t}$n.buildTokens=FH});var BI=f(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});bg.activate=void 0;var BH=yg();function $H(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(!r.parsedPayload)return;let i=t.createSemanticTokensBuilder();return(0,BH.buildTokens)(i,r),i.build()})}bg.activate=$H});var $I=f(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.buildFoldingRanges=void 0;var vi=Te(),Aw=db(),UH=yf();function KH(t){let e=[];return new UH.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case vi.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Aw.FoldingRangeKind.Comment}),null;case vi.ASTType.MapConstructorExpression:case vi.ASTType.ListConstructorExpression:case vi.ASTType.StringLiteral:case vi.ASTType.WhileStatement:case vi.ASTType.ForGenericStatement:case vi.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Aw.FoldingRangeKind.Region}),null;case vi.ASTType.IfClause:case vi.ASTType.ElseifClause:case vi.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Aw.FoldingRangeKind.Region}),null}return null}).visit(t.parsedPayload),e}_g.buildFoldingRanges=KH});var UI=f(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.activate=void 0;var WH=$I();function GH(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n);if(r.parsedPayload)return(0,WH.buildFoldingRanges)(r)})}vg.activate=GH});var Ow=f(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});Sg.DocumentGraphBuilder=void 0;var HH=Lr(),Pw=class{constructor(e){this.documentManager=e.documentManager,this.entrypoint=e.entrypoint,this.nodeCache=new Map,this.pendingDocument=new Map}async getDocument(e){if(this.pendingDocument.has(e))return this.pendingDocument.get(e);let n=this.documentManager.getOrOpen(e);this.pendingDocument.set(e,n);let r=await n;return this.pendingDocument.delete(e),r}async build(){let e={item:{document:this.entrypoint,location:{type:HH.DependencyType.Root,location:this.entrypoint.textDocument.uri}},children:[]};if(this.entrypoint.parsedPayload===null)return e;this.nodeCache.set(this.entrypoint.textDocument.uri,e);let n=async(r,i)=>{let s=await r.getDependencies();await Promise.all(s.map(async o=>{let a=this.nodeCache.get(o.location);if(a!=null){i.children.push(a);return}let u=await this.getDocument(o.location);if(u===null)return;let c={item:{document:u,location:o},children:[]};this.nodeCache.set(o.location,c),i.children.push(c),u.parsedPayload!==null&&await n(u,c)}))};return await n(this.entrypoint,e),e}};Sg.DocumentGraphBuilder=Pw});var il=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.aggregateImportsWithNamespaceFromGraph=Oo.aggregateImportsWithNamespaceFromLocations=void 0;var VH=Ka(),zH=Lr(),XH=Ew(),YH=new VH.TypeManager({container:XH.miniscriptMeta});Oo.default=YH;function JH(t,e){let n=[];return t==null||t.forEach(r=>{let i=r.args[0];if(i==null)return;let s=e.get(r.location)?.typeDocument;s!=null&&n.push({namespace:i,typeDoc:s})}),n}Oo.aggregateImportsWithNamespaceFromLocations=JH;function QH(t,e){let n=[];return t==null||t.children.filter(i=>i.item.location.type===zH.DependencyType.Import).map(i=>i.item.location).forEach(i=>{let s=i.args[0];if(s==null)return;let o=e.get(i.location);o!=null&&n.push({namespace:s,typeDoc:o})}),n}Oo.aggregateImportsWithNamespaceFromGraph=QH});var WI=f(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.DocumentDependencyMerger=au.DocumentDependencyMergerJob=void 0;var KI=Lr(),ZH=Ow(),e3=il(),Tg=class{constructor(e){this.cache=e,this.refs=new Map}mergeDocuments(e,n){let r=(0,e3.aggregateImportsWithNamespaceFromGraph)(e,this.refs),i=e.item.document;return r.length===0?i.typeDocument.merge(...n.map(s=>({document:s}))):i.typeDocument.merge(...r.map(s=>({document:s.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:s.namespace}]})),...n.map(s=>({document:s})))}process(e,n){let r=e.item.document,i=r.textDocument.uri,s=this.refs.get(i);if(s!==void 0)return s;this.refs.set(i,null);let o=[],a=this.cache.createCacheKey(r,(0,KI.getAllDependencyLocationsFromGraph)(e,new Set(r.textDocument.uri)));if(this.cache.typeDocuments.has(a)){let c=this.cache.typeDocuments.get(a);return this.refs.set(i,c),c}if(this.cache.registerCacheKey(a,i),e.children.length===0)return this.refs.set(i,r.typeDocument),this.cache.typeDocuments.set(a,r.typeDocument),r.typeDocument;for(let c=0;c<e.children.length;c++){let l=e.children[c],p=this.process(l,n);if(l.item.location.type!==KI.DependencyType.Import){if(p===null)return;o.push(p)}}let u=this.mergeDocuments(e,o);return this.refs.set(i,u),this.cache.typeDocuments.set(a,u),u}};au.DocumentDependencyMergerJob=Tg;var Rw=class{constructor(e){this.cache=e,this.pendingJobs=new Map}async process(e,n){let i=await new ZH.DocumentGraphBuilder({documentManager:n.documentManager,entrypoint:e}).build();return new Tg(this.cache).process(i,n)}async build(e,n){let r=this.pendingJobs.get(e.textDocument.uri);if(r)return r;let i=this.process(e,n);this.pendingJobs.set(e.textDocument.uri,i);let s=await i;return this.pendingJobs.delete(e.textDocument.uri),s}};au.DocumentDependencyMerger=Rw});var sl=f(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.LRUCache=void 0;var uu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,HI=new Set,Dw=typeof process=="object"&&process?process:{},VI=(t,e,n,r)=>{typeof Dw.emitWarning=="function"?Dw.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},wg=globalThis.AbortController,GI=globalThis.AbortSignal;if(typeof wg>"u"){GI=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},wg=class{constructor(){e()}signal=new GI;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=Dw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,VI("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 t3=t=>!HI.has(t),eJ=Symbol("type"),Ls=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),zI=t=>Ls(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cu:null:null,cu=class extends Array{constructor(e){super(e),this.fill(0)}},Iw=class t{heap;length;static#e=!1;static create(e){let n=zI(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Cw=class t{#e;#t;#s;#i;#o;#v;#y;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#p;#u;#c;#n;#h;#b;#f;#g;#A;#m;#P;#T;#S;#_;#E;#d;#R;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#P,keyMap:e.#u,keyList:e.#c,valList:e.#n,next:e.#h,prev:e.#b,get head(){return e.#f},get tail(){return e.#g},free:e.#A,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#L(n,r,i,s),moveToTail:n=>e.#j(n),indexes:n=>e.#k(n),rindexes:n=>e.#O(n),isStale:n=>e.#x(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#a}get fetchMethod(){return this.#v}get memoMethod(){return this.#y}get dispose(){return this.#s}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,onInsert:l,disposeAfter:p,noDisposeOnSet:h,noUpdateTTL:m,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:D,fetchMethod:A,memoMethod:T,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:O,ignoreFetchAbort:G}=e;if(n!==0&&!Ls(n))throw new TypeError("max option must be a nonnegative integer");let re=n?zI(n):Array;if(!re)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=b,this.maxEntrySize=v||this.#t,this.sizeCalculation=D,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(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=T,A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#v=A,this.#E=!!A,this.#u=new Map,this.#c=new Array(n).fill(void 0),this.#n=new Array(n).fill(void 0),this.#h=new re(n),this.#b=new re(n),this.#f=0,this.#g=0,this.#A=Iw.create(n),this.#a=0,this.#p=0,typeof c=="function"&&(this.#s=c),typeof l=="function"&&(this.#i=l),typeof p=="function"?(this.#o=p,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#_=!!this.#s,this.#R=!!this.#i,this.#d=!!this.#o,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#t!==0&&!Ls(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ls(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ls(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ls(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#r()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ae="LRU_CACHE_UNBOUNDED";t3(ae)&&(HI.add(ae),VI("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ae,t))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#r(){let e=new cu(this.#e),n=new cu(this.#e);this.#S=e,this.#T=n,this.#D=(s,o,a=uu.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#x(s)&&this.#I(this.#c[s],"expire")},o+1);u.unref&&u.unref()}},this.#C=s=>{n[s]=e[s]!==0?uu.now():0},this.#w=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=uu.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#u.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#x=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#C=()=>{};#w=()=>{};#D=()=>{};#x=()=>!1;#B(){let e=new cu(this.#e);this.#p=0,this.#P=e,this.#M=n=>{this.#p-=e[n],e[n]=0},this.#$=(n,r,i,s)=>{if(this.#l(r))return 0;if(!Ls(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!Ls(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#p>s;)this.#q(!0)}this.#p+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#M=e=>{};#N=(e,n,r)=>{};#$=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#a)for(let n=this.#g;!(!this.#U(n)||((e||!this.#x(n))&&(yield n),n===this.#f));)n=this.#b[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let n=this.#f;!(!this.#U(n)||((e||!this.#x(n))&&(yield n),n===this.#g));)n=this.#h[n]}#U(e){return e!==void 0&&this.#u.get(this.#c[e])===e}*entries(){for(let e of this.#k())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*keys(){for(let e of this.#k()){let n=this.#c[e];n!==void 0&&!this.#l(this.#n[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#c[e];n!==void 0&&!this.#l(this.#n[e])&&(yield n)}}*values(){for(let e of this.#k())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#k()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#k()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let i=this.#n[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#x(n)&&(this.#I(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#u.get(e);if(n===void 0)return;let r=this.#n[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let o=this.#S[n],a=this.#T[n];if(o&&a){let u=o-(uu.now()-a);s.ttl=u,s.start=Date.now()}}return this.#P&&(s.size=this.#P[n]),s}dump(){let e=[];for(let n of this.#k({allowStale:!0})){let r=this.#c[n],i=this.#n[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#S&&this.#T){o.ttl=this.#S[n];let a=uu.now()-this.#T[n];o.start=Math.floor(Date.now()-a)}this.#P&&(o.size=this.#P[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=uu.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#$(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#I(e,"set"),this;let p=this.#a===0?void 0:this.#u.get(e);if(p===void 0)p=this.#a===0?this.#g:this.#A.length!==0?this.#A.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#c[p]=e,this.#n[p]=n,this.#u.set(e,p),this.#h[this.#g]=p,this.#b[p]=this.#g,this.#g=p,this.#a++,this.#N(p,l,u),u&&(u.set="add"),c=!1,this.#R&&this.#i?.(n,e,"add");else{this.#j(p);let h=this.#n[p];if(n!==h){if(this.#E&&this.#l(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=h;m!==void 0&&!o&&(this.#_&&this.#s?.(m,e,"set"),this.#d&&this.#m?.push([m,e,"set"]))}else o||(this.#_&&this.#s?.(h,e,"set"),this.#d&&this.#m?.push([h,e,"set"]));if(this.#M(p),this.#N(p,l,u),this.#n[p]=n,u){u.set="replace";let m=h&&this.#l(h)?h.__staleWhileFetching:h;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#R&&this.onInsert?.(n,e,n===h?"update":"replace")}if(i!==0&&!this.#S&&this.#r(),this.#S&&(c||this.#D(p,i,s),u&&this.#w(u,p)),!o&&this.#d&&this.#m){let h=this.#m,m;for(;m=h?.shift();)this.#o?.(...m)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#d&&this.#m){let e=this.#m,n;for(;n=e?.shift();)this.#o?.(...n)}}}#q(e){let n=this.#f,r=this.#c[n],i=this.#n[n];return this.#E&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#d)&&(this.#_&&this.#s?.(i,r,"evict"),this.#d&&this.#m?.push([i,r,"evict"])),this.#M(n),e&&(this.#c[n]=void 0,this.#n[n]=void 0,this.#A.push(n)),this.#a===1?(this.#f=this.#g=0,this.#A.length=0):this.#f=this.#h[n],this.#u.delete(r),this.#a--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#u.get(e);if(s!==void 0){let o=this.#n[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#x(s))i&&(i.has="stale",this.#w(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#w(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#u.get(e);if(i===void 0||!r&&this.#x(i))return;let s=this.#n[i];return this.#l(s)?s.__staleWhileFetching:s}#L(e,n,r,i){let s=n===void 0?void 0:this.#n[n];if(this.#l(s))return s;let o=new wg,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(v,D=!1)=>{let{aborted:A}=o.signal,T=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(A&&!D?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!T&&!D)return p(o.signal.reason);let w=m;return this.#n[n]===m&&(v===void 0?w.__staleWhileFetching?this.#n[n]=w.__staleWhileFetching:this.#I(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,u.options))),v},l=v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),p(v)),p=v=>{let{aborted:D}=o.signal,A=D&&r.allowStaleOnFetchAbort,T=A||r.allowStaleOnFetchRejection,w=T||r.noDeleteOnFetchRejection,_=m;if(this.#n[n]===m&&(!w||_.__staleWhileFetching===void 0?this.#I(e,"fetch"):A||(this.#n[n]=_.__staleWhileFetching)),T)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw v},h=(v,D)=>{let A=this.#v?.(e,s,u);A&&A instanceof Promise&&A.then(T=>v(T===void 0?void 0:T),D),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=T=>c(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let m=new Promise(h).then(c,l),b=Object.assign(m,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,b,{...u.options,status:void 0}),n=this.#u.get(e)):this.#n[n]=b,b}#l(e){if(!this.#E)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof wg}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:D=!1,status:A,signal:T}=n;if(!this.#E)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:b,ignoreFetchAbort:m,status:A,signal:T},_=this.#u.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#L(e,_,w,v);return N.__returned=N}else{let N=this.#n[_];if(this.#l(N)){let K=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?N.__staleWhileFetching:N.__returned=N}let O=this.#x(_);if(!D&&!O)return A&&(A.fetch="hit"),this.#j(_),i&&this.#C(_),A&&this.#w(A,_),N;let G=this.#L(e,_,w,v),ae=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=O?"stale":"refresh",ae&&O&&(A.returnedStale=!0)),ae?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#y;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#u.get(e);if(a!==void 0){let u=this.#n[a],c=this.#l(u);return o&&this.#w(o,a),this.#x(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#I(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#j(a),i&&this.#C(a),u))}else o&&(o.get="miss")}#K(e,n){this.#b[n]=e,this.#h[e]=n}#j(e){e!==this.#g&&(e===this.#f?this.#f=this.#h[e]:this.#K(this.#b[e],this.#h[e]),this.#K(this.#g,e),this.#g=e)}delete(e){return this.#I(e,"delete")}#I(e,n){let r=!1;if(this.#a!==0){let i=this.#u.get(e);if(i!==void 0)if(r=!0,this.#a===1)this.#F(n);else{this.#M(i);let s=this.#n[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#d)&&(this.#_&&this.#s?.(s,e,n),this.#d&&this.#m?.push([s,e,n])),this.#u.delete(e),this.#c[i]=void 0,this.#n[i]=void 0,i===this.#g)this.#g=this.#b[i];else if(i===this.#f)this.#f=this.#h[i];else{let o=this.#b[i];this.#h[o]=this.#h[i];let a=this.#h[i];this.#b[a]=this.#b[i]}this.#a--,this.#A.push(i)}}if(this.#d&&this.#m?.length){let i=this.#m,s;for(;s=i?.shift();)this.#o?.(...s)}return r}clear(){return this.#F("delete")}#F(e){for(let n of this.#O({allowStale:!0})){let r=this.#n[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[n];this.#_&&this.#s?.(r,i,e),this.#d&&this.#m?.push([r,i,e])}}if(this.#u.clear(),this.#n.fill(void 0),this.#c.fill(void 0),this.#S&&this.#T&&(this.#S.fill(0),this.#T.fill(0)),this.#P&&this.#P.fill(0),this.#f=0,this.#g=0,this.#A.length=0,this.#p=0,this.#a=0,this.#d&&this.#m){let n=this.#m,r;for(;r=n?.shift();)this.#o?.(...r)}}};xg.LRUCache=Cw});var XI=f(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.hash=void 0;function n3(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Eg.hash=n3});var JI=f(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.DocumentMergerCache=void 0;var r3=sl(),YI=XI(),Mw=class{constructor(){this.typeDocuments=new r3.LRUCache({max:100,ttl:1e3*60*5}),this.keyToDocumentUriMap=new Map}createCacheKey(e,n){let r=(0,YI.hash)(`main-${e.textDocument.uri}-${e.textDocument.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,YI.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.typeDocuments.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.typeDocuments.clear()}};kg.DocumentMergerCache=Mw});var tC=f((iJ,eC)=>{var Lw=Object.defineProperty,i3=Object.getOwnPropertyDescriptor,s3=Object.getOwnPropertyNames,o3=Object.prototype.hasOwnProperty,a3=(t,e)=>{for(var n in e)Lw(t,n,{get:e[n],enumerable:!0})},u3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s3(e))!o3.call(t,i)&&i!==n&&Lw(t,i,{get:()=>e[i],enumerable:!(r=i3(e,i))||r.enumerable});return t},c3=t=>u3(Lw({},"__esModule",{value:!0}),t),ZI={};a3(ZI,{toposort:()=>Nw,toposortWithEdges:()=>h3,toposortWithGraph:()=>d3});eC.exports=c3(ZI);function l3(t,e){let n=new Array(t.size);for(let r=0,i=t.size;r<i;r++)n[r]=new Set;for(let r=0,i=e.length;r<i;r++){let[s,o]=e[r],a=t.get(s),u=t.get(o);a==null||u==null||n[a].add(u)}return n}function p3(t){let e=new Map;for(let n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}function h3(t){let e=Array.from(new Set(t.flat()));return Nw(e,t)}function d3(t){let e=Array.from(new Set(Object.keys(t))),n=new Set(e),r=[];for(let i=0,s=e.length;i<s;i++){let o=e[i],a=Array.from(new Set(t[o]));for(let u=0,c=a.length;u<c;u++)r.push([o,a[u]]),n.add(a[u])}return Nw(Array.from(n),r)}function QI(t,e){let n={value:e};t.first==null?t.first=n:t.last.next=n,t.last=n}function f3(t){let e=t.first;return t.first=e.next,e.value}function g3(t){return t.first==null}function Nw(t,e){let n=p3(t),r=l3(n,e),i=new Array(t.length).fill(0);for(let a=0,u=r.length;a<u;a++)r[a].forEach(c=>{i[c]+=1});let s={first:null,last:null};i.forEach((a,u)=>{a===0&&QI(s,u)});let o=[];for(;!g3(s);){let a=f3(s);o.push(t[a]),r[a].forEach(u=>{--i[u]===0&&QI(s,u)})}if(o.length!==r.length)throw new Error(`Cyclic dependency detected: ${m3(o,n,r)?.map(a=>t[a]).join(" -> ")}`);return o}function m3(t,e,n){let r=new Set(t.map(a=>e.get(a))),i=null;function s(a,u){if(u.has(a))return!0;if(r.has(a))return!1;r.add(a),u.add(a);let c=Array.from(n[a]);for(let l=0,p=c.length;l<p;l++)if(s(c[l],u))return i==null&&(i=[a,c[l]]),!0;return u.delete(a),!1}let o=Array.from(n.keys());for(let a=0,u=o.length;a<u;a++)if(!r.has(o[a])&&s(o[a],new Set))return i;return null}});var nC=f(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.DocumentWorkspaceBuilder=lu.DocumentWorkspaceContext=void 0;var Ag=class{constructor(){this.documents=[],this.refs=new Map,this.dependencies=new Map}async loadDependencies(){await Promise.all(this.documents.map(async e=>{let n=await e.getDependencies();this.dependencies.set(e.textDocument.uri,n)}))}getDependencies(e){return this.dependencies.get(e)||[]}getRefMap(){return this.refs}getRef(e){return this.refs.get(e)||null}setRef(e,n){this.refs.set(e,n),this.documents.push(n)}};lu.DocumentWorkspaceContext=Ag;var qw=class{constructor(e){this.context=e.context}async build(){let e=new Ag,n=await this.context.fs.getWorkspaceRelatedFiles();return await Promise.all(n.map(async r=>{let i=await this.context.documentManager.getOrOpen(r.toString());return e.setRef(i.textDocument.uri,i),i})),e}};lu.DocumentWorkspaceBuilder=qw});var iC=f(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.DocumentWorkspaceMerger=pu.DocumentWorkspaceMergerJob=void 0;var y3=tC(),rC=il(),b3=nC(),Pg=class{constructor(e){this.cache=e}getTypeDocument(e,n){let r=n.getRef(e);if(r!=null){let i=(0,rC.aggregateImportsWithNamespaceFromLocations)(n.getDependencies(e),n.getRefMap());return i.length===0?r.typeDocument:r.typeDocument.merge(...i.map(o=>({document:o.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:o.namespace}]})))}return r.typeDocument}getExternalTypeDocumentsRelatedToDocument(e,n){let r=e.textDocument.uri,i=n.documents.map(c=>c.textDocument.uri),s=n.documents.map(c=>n.getDependencies(c.textDocument.uri).map(p=>[c.textDocument.uri,p.location])),o=(0,y3.toposort)(i,s.flat()),a=new Array(o.length);for(let c=o.length-1;c>=0;c--){let l=o[c];if(l===r)continue;let p=this.getTypeDocument(l,n);p!=null&&(a[c]=p)}return a.filter(c=>c!=null)}async process(e,n){let r=e.textDocument.uri,i=this.cache.createCacheKey(e,n.documents);if(this.cache.typeDocuments.has(i))return this.cache.typeDocuments.get(i);this.cache.registerCacheKey(i,r),await n.loadDependencies();let s=this.getExternalTypeDocumentsRelatedToDocument(e,n),o=(0,rC.aggregateImportsWithNamespaceFromLocations)(n.getDependencies(r),n.getRefMap()),a=e.typeDocument.merge(...o.map(u=>({document:u.typeDoc,namespaces:[{exportFrom:"module.exports",namespace:u.namespace}]})),...s.map(u=>({document:u})));return this.cache.typeDocuments.set(i,a),a}};pu.DocumentWorkspaceMergerJob=Pg;var jw=class{constructor(e){this.cache=e,this.pendingJobs=new Map}async process(e,n){let i=await new b3.DocumentWorkspaceBuilder({context:n}).build();return new Pg(this.cache).process(e,i)}async build(e,n){let r=this.pendingJobs.get(e.textDocument.uri);if(r)return r;let i=this.process(e,n);this.pendingJobs.set(e.textDocument.uri,i);let s=await i;return this.pendingJobs.delete(e.textDocument.uri),s}};pu.DocumentWorkspaceMerger=jw});var sC=f(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.DocumentMerger=void 0;var _3=Lr(),v3=WI(),S3=JI(),T3=iC(),Fw=class{constructor(){this.cache=new S3.DocumentMergerCache,this.dependencyMerger=new v3.DocumentDependencyMerger(this.cache),this.workspaceMerger=new T3.DocumentWorkspaceMerger(this.cache)}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===_3.TypeAnalyzerStrategy.Workspace?this.workspaceMerger.build(e,n):this.dependencyMerger.build(e,n)}};Og.DocumentMerger=Fw});var uC=f(hu=>{"use strict";var w3=hu&&hu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hu,"__esModule",{value:!0});hu.CoreContext=void 0;var x3=w3(require("events")),ol=Lr(),oC=yg();function aC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):ol.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??ol.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??ol.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var Bw=class extends x3.default{constructor(){super(),this._configuration=aC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(ol.ConfigurationNamespace),n=aC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.cache.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:ol.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:oC.semanticTokensLegend.tokenTypes,tokenModifiers:oC.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};hu.CoreContext=Bw});var Kw=f(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.ActiveDocument=void 0;var $w=cg(),al=Lr(),cC=pg(),Uw=class{constructor(e){this.context=e.context,this.version=e.version,this.textDocument=e.textDocument,this.typeDocument=e.typeDocument,this.parsedPayload=e.parsedPayload,this.errors=e.errors}getDirectory(){return $w.Utils.joinPath($w.URI.parse(this.textDocument.uri),"..")}async getImportUris(e=null){if(this.parsedPayload==null)return[];let n=this.parsedPayload;if(n.imports.length===0)return[];let r=this.getDirectory(),i=this.context,s=new cC.DocumentURIBuilder(r,e);return(await Promise.all([...n.imports.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,al.parseDependencyLocation)({type:al.DependencyType.Import,location:u,args:[a.name?.name]})})])).filter(a=>a!=null)}async getIncludeUris(e=null){if(this.parsedPayload==null)return[];let n=this.parsedPayload;if(n.includes.length===0)return[];let r=this.getDirectory(),i=this.context,s=new cC.DocumentURIBuilder(r,e);return(await Promise.all([...n.includes.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,al.parseDependencyLocation)({type:al.DependencyType.Include,location:u})})])).filter(a=>a!=null)}async getDependencies(){if(this.parsedPayload==null)return[];if(this.dependencies)return this.dependencies;let e=await this.context.fs.getWorkspaceFolderUri($w.URI.parse(this.textDocument.uri)),[n,r]=await Promise.all([this.getImportUris(e),this.getIncludeUris(e)]),i=new Set([...n,...r]);return this.dependencies=Array.from(i).map(al.parseDependencyRawLocation),this.dependencies}};Rg.ActiveDocument=Uw});var Gw=f(Xi=>{"use strict";var E3=Xi&&Xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.DocumentScheduler=Xi.PROCESSING_TIMEOUT=void 0;var k3=E3(require("events"));Xi.PROCESSING_TIMEOUT=50;var Ww=class extends k3.default{constructor(e=Xi.PROCESSING_TIMEOUT){super(),this._timer=null,this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now();this.scheduledItems.forEach((n,r)=>{e-n.createdAt>this.processingTimeout&&(this.emit("process",n.document),this.scheduledItems.delete(r))}),this._timer=setTimeout(this.tickRef,0)}schedule(e){let n=e.uri;return this.scheduledItems.has(n)?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}isScheduled(e){return this.scheduledItems.has(e.uri)}cancel(e){return this.scheduledItems.delete(e.uri)}};Xi.DocumentScheduler=Ww});var mC=f((pJ,gC)=>{var Xw=Object.defineProperty,A3=Object.getOwnPropertyDescriptor,P3=Object.getOwnPropertyNames,O3=Object.prototype.hasOwnProperty,R3=(t,e)=>{for(var n in e)Xw(t,n,{get:e[n],enumerable:!0})},D3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of P3(e))!O3.call(t,i)&&i!==n&&Xw(t,i,{get:()=>e[i],enumerable:!(r=A3(e,i))||r.enumerable});return t},I3=t=>D3(Xw({},"__esModule",{value:!0}),t),lC={};R3(lC,{ScheduleIntervalHelper:()=>Hw,SchedulePostMessageHelper:()=>Vw,ScheduleSetImmmediateHelper:()=>zw,schedule:()=>L3,scheduleProvider:()=>fC});gC.exports=I3(lC);var C3=Promise.prototype.then.bind(Promise.resolve()),Yw=class Dg{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Dg.QUEUE_LIMIT);this.queue=this.queue.slice(Dg.QUEUE_LIMIT);for(let r=0;r<n;C3(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Dg.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Hw=class pC extends Yw{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new pC;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},M3=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Vw=class hC extends Yw{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!M3()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new hC;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},zw=class dC extends Yw{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new dC;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function fC(){if(zw.isApplicable())return zw.createCallback();if(Vw.isApplicable())return Vw.createCallback();if(Hw.isApplicable())return Hw.createCallback();throw new Error("No schedule helper fulfills requirements!")}var L3=fC()});var bC=f(du=>{"use strict";var yC=du&&du.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(du,"__esModule",{value:!0});du.DocumentManager=void 0;var N3=yC(require("events")),q3=Wr(),j3=sl(),F3=mC(),B3=Kw(),$3=Gw(),U3=yC(il()),Jw=class extends N3.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e){super(),this._context=null,this._pendingFiles=new Map,this.documents=new j3.LRUCache({ttl:1e3*60*20,ttlAutopurge:!0}),this._documentScheduler=new $3.DocumentScheduler(e),this.initEvents()}initEvents(){this._documentScheduler.on("process",e=>{this.processAndPersist(e)})}processAndPersist(e){let n=e.uri;this._documentScheduler.cancel(e);let r=this.process(e);return this.documents.set(n,r),this.emit("processed",e,r),r}process(e){this._context.documentMerger.cache.flushCacheKey(e.uri);let n=e.getText(),r=new q3.Parser(n,{unsafe:!0}),i=r.parseChunk(),s=U3.default.analyze(e.uri,i);return new B3.ActiveDocument({context:this._context,version:e.version,textDocument:e,typeDocument:s,parsedPayload:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){return this.documents.get(e.uri)?.version===e.version?!1:this._documentScheduler.schedule(e)}async open(e){try{let n=this._pendingFiles.get(e),r;if(n)r=await n;else{let i=this.context.fs.getTextDocument(e);this._pendingFiles.set(e,i),r=await i}return r==null?null:this.documents.get(r.uri)||this.processAndPersist(r)}catch(n){return console.error(`Error opening document ${e}:`,n),null}finally{this._pendingFiles.delete(e)}}async getOrOpen(e){let n=this.documents.get(e);return n||this.open(e)}get(e){return this.documents.get(e.uri)||this.processAndPersist(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,F3.schedule)(()=>{if(!this._documentScheduler.isScheduled(e))return r(this.get(e));let i=()=>{this.removeListener("processed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("processed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("processed",s)})})}clear(e){this.documents.delete(e.uri),this.emit("cleared",e)}};du.DocumentManager=Jw});var Ig=f(W=>{"use strict";var K3=W&&W.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),W3=W&&W.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G3=W&&W.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&K3(e,t,n);return W3(e,t),e},H3=W&&W.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0});W.DocumentManager=W.DocumentGraphBuilder=W.DocumentURIBuilder=W.DocumentScheduler=W.ActiveDocument=W.CoreContext=W.buildTokens=W.semanticTokensLegend=W.lookupBase=W.lookupIdentifier=W.typeAnalyzer=W.appendTooltipHeader=W.appendTooltipBody=W.formatTypes=W.formatDefaultValue=W.createTooltipHeader=W.createSignatureInfo=W.createHover=W.MarkdownString=W.LookupHelper=W.DocumentMerger=W.ASTScraper=W.activateFoldingRange=W.activateSemantic=W.activateSymbol=W.activateSubscriptions=W.activateSignature=W.activateHover=W.activateFormatter=W.activateDiagnostic=W.activateDefinition=W.activateColor=W.activateAutocomplete=W.DefaultFileExtensions=W.TypeAnalyzerStrategy=W.ConfigurationNamespace=W.LanguageId=W.IndentationType=void 0;var ul=Lr();Object.defineProperty(W,"IndentationType",{enumerable:!0,get:function(){return ul.IndentationType}});Object.defineProperty(W,"LanguageId",{enumerable:!0,get:function(){return ul.LanguageId}});Object.defineProperty(W,"ConfigurationNamespace",{enumerable:!0,get:function(){return ul.ConfigurationNamespace}});Object.defineProperty(W,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return ul.TypeAnalyzerStrategy}});Object.defineProperty(W,"DefaultFileExtensions",{enumerable:!0,get:function(){return ul.DefaultFileExtensions}});var V3=yD();Object.defineProperty(W,"activateAutocomplete",{enumerable:!0,get:function(){return V3.activate}});var z3=AD();Object.defineProperty(W,"activateColor",{enumerable:!0,get:function(){return z3.activate}});var X3=OD();Object.defineProperty(W,"activateDefinition",{enumerable:!0,get:function(){return X3.activate}});var Y3=RD();Object.defineProperty(W,"activateDiagnostic",{enumerable:!0,get:function(){return Y3.activate}});var J3=cI();Object.defineProperty(W,"activateFormatter",{enumerable:!0,get:function(){return J3.activate}});var Q3=yI();Object.defineProperty(W,"activateHover",{enumerable:!0,get:function(){return Q3.activate}});var Z3=_I();Object.defineProperty(W,"activateSignature",{enumerable:!0,get:function(){return Z3.activate}});var eV=SI();Object.defineProperty(W,"activateSubscriptions",{enumerable:!0,get:function(){return eV.activate}});var tV=wI();Object.defineProperty(W,"activateSymbol",{enumerable:!0,get:function(){return tV.activate}});var nV=BI();Object.defineProperty(W,"activateSemantic",{enumerable:!0,get:function(){return nV.activate}});var rV=UI();Object.defineProperty(W,"activateFoldingRange",{enumerable:!0,get:function(){return rV.activate}});W.ASTScraper=G3(yf());var iV=sC();Object.defineProperty(W,"DocumentMerger",{enumerable:!0,get:function(){return iV.DocumentMerger}});var sV=Ha();Object.defineProperty(W,"LookupHelper",{enumerable:!0,get:function(){return sV.LookupHelper}});var oV=og();Object.defineProperty(W,"MarkdownString",{enumerable:!0,get:function(){return oV.MarkdownString}});var Ro=ug();Object.defineProperty(W,"createHover",{enumerable:!0,get:function(){return Ro.createHover}});Object.defineProperty(W,"createSignatureInfo",{enumerable:!0,get:function(){return Ro.createSignatureInfo}});Object.defineProperty(W,"createTooltipHeader",{enumerable:!0,get:function(){return Ro.createTooltipHeader}});Object.defineProperty(W,"formatDefaultValue",{enumerable:!0,get:function(){return Ro.formatDefaultValue}});Object.defineProperty(W,"formatTypes",{enumerable:!0,get:function(){return Ro.formatTypes}});Object.defineProperty(W,"appendTooltipBody",{enumerable:!0,get:function(){return Ro.appendTooltipBody}});Object.defineProperty(W,"appendTooltipHeader",{enumerable:!0,get:function(){return Ro.appendTooltipHeader}});var aV=il();Object.defineProperty(W,"typeAnalyzer",{enumerable:!0,get:function(){return H3(aV).default}});var _C=kT();Object.defineProperty(W,"lookupIdentifier",{enumerable:!0,get:function(){return _C.lookupIdentifier}});Object.defineProperty(W,"lookupBase",{enumerable:!0,get:function(){return _C.lookupBase}});var vC=yg();Object.defineProperty(W,"semanticTokensLegend",{enumerable:!0,get:function(){return vC.semanticTokensLegend}});Object.defineProperty(W,"buildTokens",{enumerable:!0,get:function(){return vC.buildTokens}});var uV=uC();Object.defineProperty(W,"CoreContext",{enumerable:!0,get:function(){return uV.CoreContext}});var cV=Kw();Object.defineProperty(W,"ActiveDocument",{enumerable:!0,get:function(){return cV.ActiveDocument}});var lV=Gw();Object.defineProperty(W,"DocumentScheduler",{enumerable:!0,get:function(){return lV.DocumentScheduler}});var pV=pg();Object.defineProperty(W,"DocumentURIBuilder",{enumerable:!0,get:function(){return pV.DocumentURIBuilder}});var hV=Ow();Object.defineProperty(W,"DocumentGraphBuilder",{enumerable:!0,get:function(){return hV.DocumentGraphBuilder}});var dV=bC();Object.defineProperty(W,"DocumentManager",{enumerable:!0,get:function(){return dV.DocumentManager}})});var xC={};qM(xC,{TextDocument:()=>Qw});function Zw(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Zw(r,e),Zw(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function SC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);TC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function TC(t){return t===13||t===10}function wC(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function fV(t){let e=wC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Cg,Qw,EC=NM(()=>{"use strict";Cg=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=wC(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=SC(r.text,!1,s);if(u-a===l.length)for(let h=0,m=l.length;h<m;h++)c[h+a+1]=l[h];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let p=r.text.length-(o-s);if(p!==0)for(let h=a+1+l.length,m=c.length;h<m;h++)c[h]=c[h]+p}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=SC(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&TC(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Cg(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Cg)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Zw(s.map(fV),(l,p)=>{let h=l.range.start.line-p.range.start.line;return h===0?l.range.start.character-p.range.start.character:h}),u=0,c=[];for(let l of a){let p=i.offsetAt(l.range.start);if(p<u)throw new Error("Overlapping edit");p>u&&c.push(o.substring(u,p)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Qw||(Qw={}))});var RC=f((fJ,OC)=>{"use strict";OC.exports=AC;function AC(t,e,n){t instanceof RegExp&&(t=kC(t,n)),e instanceof RegExp&&(e=kC(e,n));var r=PC(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function kC(t,e){var n=e.match(t);return n?n[0]:null}AC.range=PC;function PC(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var jC=f((gJ,qC)=>{var DC=RC();qC.exports=yV;var IC="\0SLASH"+Math.random()+"\0",CC="\0OPEN"+Math.random()+"\0",t0="\0CLOSE"+Math.random()+"\0",MC="\0COMMA"+Math.random()+"\0",LC="\0PERIOD"+Math.random()+"\0";function e0(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function gV(t){return t.split("\\\\").join(IC).split("\\{").join(CC).split("\\}").join(t0).split("\\,").join(MC).split("\\.").join(LC)}function mV(t){return t.split(IC).join("\\").split(CC).join("{").split(t0).join("}").split(MC).join(",").split(LC).join(".")}function NC(t){if(!t)return[""];var e=[],n=DC("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=NC(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function yV(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),cl(gV(t),!0).map(mV)):[]}function bV(t){return"{"+t+"}"}function _V(t){return/^-?0\d/.test(t)}function vV(t,e){return t<=e}function SV(t,e){return t>=e}function cl(t,e){var n=[],r=DC("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?cl(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,p=r.body.indexOf(",")>=0;if(!l&&!p)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+t0+r.post,cl(t)):[t];var h;if(l)h=r.body.split(/\.\./);else if(h=NC(r.body),h.length===1&&(h=cl(h[0],!1).map(bV),h.length===1))return s.map(function(K){return r.pre+h[0]+K});var m;if(l){var b=e0(h[0]),v=e0(h[1]),D=Math.max(h[0].length,h[1].length),A=h.length==3?Math.abs(e0(h[2])):1,T=vV,w=v<b;w&&(A*=-1,T=SV);var _=h.some(_V);m=[];for(var N=b;T(N,v);N+=A){var O;if(c)O=String.fromCharCode(N),O==="\\"&&(O="");else if(O=String(N),_){var G=D-O.length;if(G>0){var re=new Array(G+1).join("0");N<0?O="-"+re+O.slice(1):O=re+O}}m.push(O)}}else{m=[];for(var ae=0;ae<h.length;ae++)m.push.apply(m,cl(h[ae],!1))}for(var ae=0;ae<m.length;ae++)for(var o=0;o<s.length;o++){var a=i+m[ae]+s[o];(!e||l||a)&&n.push(a)}}return n}});var FC=f(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.assertValidPattern=void 0;var TV=1024*64,wV=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>TV)throw new TypeError("pattern is too long")};Mg.assertValidPattern=wV});var $C=f(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.parseClass=void 0;var xV={"[: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]},ll=t=>t.replace(/[[\]\\-]/g,"\\$&"),EV=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),BC=t=>t.join(""),kV=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,p="";e:for(;s<t.length;){let v=t.charAt(s);if((v==="!"||v==="^")&&s===n+1){c=!0,s++;continue}if(v==="]"&&o&&!u){l=s+1;break}if(o=!0,v==="\\"&&!u){u=!0,s++;continue}if(v==="["&&!u){for(let[D,[A,T,w]]of Object.entries(xV))if(t.startsWith(D,s)){if(p)return["$.",!1,t.length-n,!0];s+=D.length,w?i.push(A):r.push(A),a=a||T;continue e}}if(u=!1,p){v>p?r.push(ll(p)+"-"+ll(v)):v===p&&r.push(ll(v)),p="",s++;continue}if(t.startsWith("-]",s+1)){r.push(ll(v+"-")),s+=2;continue}if(t.startsWith("-",s+1)){p=v,s+=2;continue}r.push(ll(v)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let v=r[0].length===2?r[0].slice(-1):r[0];return[EV(v),!1,l-n,!1]}let h="["+(c?"^":"")+BC(r)+"]",m="["+(c?"":"^")+BC(i)+"]";return[r.length&&i.length?"("+h+"|"+m+")":r.length?h:m,a,l-n,!0]};Lg.parseClass=kV});var qg=f(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.unescape=void 0;var AV=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Ng.unescape=AV});var i0=f(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.AST=void 0;var PV=$C(),jg=qg(),OV=new Set(["!","?","+","*","@"]),UC=t=>OV.has(t),RV="(?!(?:^|/)\\.\\.?(?:$|/))",Fg="(?!\\.)",DV=new Set(["[","."]),IV=new Set(["..","."]),CV=new Set("().*{}+?[]^$\\!"),MV=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),r0="[^/]",KC=r0+"*?",WC=r0+"+?",n0=class t{type;#e;#t;#s=!1;#i=[];#o;#v;#y;#a=!1;#p;#u;#c=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#p=this.#e===this?r:this.#e.#p,this.#y=this.#e===this?[]:this.#e.#y,e==="!"&&!this.#e.#a&&this.#y.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#u=this.#i.map(e=>String(e)).join("")}#n(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#i.length;i++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#i[i])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#i.push(n)}}toJSON(){let e=this.type===null?this.#i.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#i.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#i[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#i)n.copyIn(r);return n}static#h(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let m=r,b="";for(;m<e.length;){let v=e.charAt(m++);if(s||v==="\\"){s=!s,b+=v;continue}if(o){m===a+1?(v==="^"||v==="!")&&(u=!0):v==="]"&&!(m===a+2&&u)&&(o=!1),b+=v;continue}else if(v==="["){o=!0,a=m,u=!1,b+=v;continue}if(!i.noext&&UC(v)&&e.charAt(m)==="("){n.push(b),b="";let D=new t(v,n);m=t.#h(e,D,m,i),n.push(D);continue}b+=v}return n.push(b),m}let c=r+1,l=new t(null,n),p=[],h="";for(;c<e.length;){let m=e.charAt(c++);if(s||m==="\\"){s=!s,h+=m;continue}if(o){c===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(c===a+2&&u)&&(o=!1),h+=m;continue}else if(m==="["){o=!0,a=c,u=!1,h+=m;continue}if(UC(m)&&e.charAt(c)==="("){l.push(h),h="";let b=new t(m,l);l.push(b),c=t.#h(e,b,c,i);continue}if(m==="|"){l.push(h),h="",p.push(l),l=new t(null,n);continue}if(m===")")return h===""&&n.#i.length===0&&(n.#c=!0),l.push(h),h="",n.push(...p,l),c;h+=m}return n.type=null,n.#t=void 0,n.#i=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#h(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#p.nocase&&!this.#p.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#p.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#p}toRegExpSource(e){let n=e??!!this.#p.dot;if(this.#e===this&&this.#n(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#i.map(m=>{let[b,v,D,A]=typeof m=="string"?t.#f(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||D,this.#s=this.#s||A,b}).join(""),l="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&IV.has(this.#i[0]))){let b=DV,v=n&&b.has(c.charAt(0))||c.startsWith("\\.")&&b.has(c.charAt(2))||c.startsWith("\\.\\.")&&b.has(c.charAt(4)),D=!n&&!e&&b.has(c.charAt(0));l=v?RV:D?Fg:""}let p="";return this.isEnd()&&this.#e.#a&&this.#o?.type==="!"&&(p="(?:$|\\/)"),[l+c+p,(0,jg.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#i=[u],this.type=null,this.#t=void 0,[u,(0,jg.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Fg?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!n?Fg:"")+WC;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Fg:"")+KC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,jg.unescape)(s),this.#t=!!this.#t,this.#s]}#b(e){return this.#i.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#f(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(CV.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,p,h]=(0,PV.parseClass)(e,a);if(p){s+=c,o=o||l,a+=p-1,n=n||h;continue}}if(u==="*"){r&&e==="*"?s+=WC:s+=KC,n=!0;continue}if(u==="?"){s+=r0,n=!0;continue}s+=MV(u)}return[s,(0,jg.unescape)(e),!!n,o]}};Bg.AST=n0});var s0=f($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.escape=void 0;var LV=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");$g.escape=LV});var Ns=f(Z=>{"use strict";var NV=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.unescape=Z.escape=Z.AST=Z.Minimatch=Z.match=Z.makeRe=Z.braceExpand=Z.defaults=Z.filter=Z.GLOBSTAR=Z.sep=Z.minimatch=void 0;var qV=NV(jC()),Ug=FC(),VC=i0(),jV=s0(),FV=qg(),BV=(t,e,n={})=>((0,Ug.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Do(e,n).match(t));Z.minimatch=BV;var $V=/^\*+([^+@!?\*\[\(]*)$/,UV=t=>e=>!e.startsWith(".")&&e.endsWith(t),KV=t=>e=>e.endsWith(t),WV=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),GV=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),HV=/^\*+\.\*+$/,VV=t=>!t.startsWith(".")&&t.includes("."),zV=t=>t!=="."&&t!==".."&&t.includes("."),XV=/^\.\*+$/,YV=t=>t!=="."&&t!==".."&&t.startsWith("."),JV=/^\*+$/,QV=t=>t.length!==0&&!t.startsWith("."),ZV=t=>t.length!==0&&t!=="."&&t!=="..",e4=/^\?+([^+@!?\*\[\(]*)?$/,t4=([t,e=""])=>{let n=zC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},n4=([t,e=""])=>{let n=XC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},r4=([t,e=""])=>{let n=XC([t]);return e?r=>n(r)&&r.endsWith(e):n},i4=([t,e=""])=>{let n=zC([t]);return e?r=>n(r)&&r.endsWith(e):n},zC=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},XC=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},YC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",GC={win32:{sep:"\\"},posix:{sep:"/"}};Z.sep=YC==="win32"?GC.win32.sep:GC.posix.sep;Z.minimatch.sep=Z.sep;Z.GLOBSTAR=Symbol("globstar **");Z.minimatch.GLOBSTAR=Z.GLOBSTAR;var s4="[^/]",o4=s4+"*?",a4="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",u4="(?:(?!(?:\\/|^)\\.).)*?",c4=(t,e={})=>n=>(0,Z.minimatch)(n,t,e);Z.filter=c4;Z.minimatch.filter=Z.filter;var kr=(t,e={})=>Object.assign({},t,e),l4=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Z.minimatch;let e=Z.minimatch;return Object.assign((r,i,s={})=>e(r,i,kr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,kr(t,s))}static defaults(i){return e.defaults(kr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,kr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,kr(t,s))}},unescape:(r,i={})=>e.unescape(r,kr(t,i)),escape:(r,i={})=>e.escape(r,kr(t,i)),filter:(r,i={})=>e.filter(r,kr(t,i)),defaults:r=>e.defaults(kr(t,r)),makeRe:(r,i={})=>e.makeRe(r,kr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,kr(t,i)),match:(r,i,s={})=>e.match(r,i,kr(t,s)),sep:e.sep,GLOBSTAR:Z.GLOBSTAR})};Z.defaults=l4;Z.minimatch.defaults=Z.defaults;var p4=(t,e={})=>((0,Ug.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,qV.default)(t));Z.braceExpand=p4;Z.minimatch.braceExpand=Z.braceExpand;var h4=(t,e={})=>new Do(t,e).makeRe();Z.makeRe=h4;Z.minimatch.makeRe=Z.makeRe;var d4=(t,e,n={})=>{let r=new Do(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};Z.match=d4;Z.minimatch.match=Z.match;var HC=/[?*]|[+@!]\(.*?\)|\[|\]/,f4=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Do=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Ug.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||YC,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!HC.test(s[2]))&&!HC.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let v=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),D=!v&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),T=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),w=D?3:v?0:void 0,_=T?3:A?0:void 0;if(typeof w=="number"&&typeof _=="number"){let[N,O]=[e[w],n[_]];N.toLowerCase()===O.toLowerCase()&&(n[_]=N,_>w?n=n.slice(_):w>_&&(e=e.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],p=e[o];if(this.debug(n,l,p),l===!1)return!1;if(l===Z.GLOBSTAR){this.debug("GLOBSTAR",[n,l,p]);var h=o,m=a+1;if(m===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;h<u;){var b=e[h];if(this.debug(`
|
158
159
|
globstar while`,e,h,n,m,b),this.matchOne(e.slice(h),n.slice(m),r))return this.debug("globstar found match!",h,u,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",e,h,n,m);break}this.debug("globstar swallow a segment, and continue"),h++}return!!(r&&(this.debug(`
|
159
|
-
>>> no match, partial?`,e,h,n,m),h===u))}let v;if(typeof l=="string"?(v=p===l,this.debug("string match",l,p,v)):(v=l.test(p),this.debug("pattern match",l,p,v)),!v)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,Z.braceExpand)(this.pattern,this.options)}parse(e){(0,Ug.assertValidPattern)(e);let n=this.options;if(e==="**")return Z.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(JV))?i=n.dot?ZV:QV:(r=e.match($V))?i=(n.nocase?n.dot?GV:WV:n.dot?KV:UV)(r[1]):(r=e.match(e4))?i=(n.nocase?n.dot?n4:t4:n.dot?r4:i4)(r):(r=e.match(HV))?i=n.dot?zV:VV:(r=e.match(XV))&&(i=YV);let s=VC.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?o4:n.dot?a4:u4,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let p of l.flags.split(""))i.add(p);return typeof l=="string"?f4(l):l===Z.GLOBSTAR?Z.GLOBSTAR:l._src});return c.forEach((l,p)=>{let h=c[p+1],m=c[p-1];l!==Z.GLOBSTAR||m===Z.GLOBSTAR||(m===void 0?h!==void 0&&h!==Z.GLOBSTAR?c[p+1]="(?:\\/|"+r+"\\/)?"+h:c[p]=r:h===void 0?c[p-1]=m+"(?:\\/|"+r+")?":h!==Z.GLOBSTAR&&(c[p-1]=m+"(?:\\/|\\/"+r+"\\/)"+h,c[p+1]=Z.GLOBSTAR))}),c.filter(l=>l!==Z.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Z.minimatch.defaults(e).Minimatch}};Z.Minimatch=Ro;var g4=i0();Object.defineProperty(Z,"AST",{enumerable:!0,get:function(){return g4.AST}});var m4=s0();Object.defineProperty(Z,"escape",{enumerable:!0,get:function(){return m4.escape}});var y4=qg();Object.defineProperty(Z,"unescape",{enumerable:!0,get:function(){return y4.unescape}});Z.minimatch.AST=VC.AST;Z.minimatch.Minimatch=Ro;Z.minimatch.escape=jV.escape;Z.minimatch.unescape=FV.unescape});var d0=f(Dn=>{"use strict";var b4=Dn&&Dn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.Minipass=Dn.isWritable=Dn.isReadable=Dn.isStream=void 0;var JC=typeof process=="object"&&process?process:{stdout:null,stderr:null},h0=require("node:events"),tM=b4(require("node:stream")),_4=require("node:string_decoder"),v4=t=>!!t&&typeof t=="object"&&(t instanceof Xg||t instanceof tM.default||(0,Dn.isReadable)(t)||(0,Dn.isWritable)(t));Dn.isStream=v4;var S4=t=>!!t&&typeof t=="object"&&t instanceof h0.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==tM.default.Writable.prototype.pipe;Dn.isReadable=S4;var T4=t=>!!t&&typeof t=="object"&&t instanceof h0.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";Dn.isWritable=T4;var Yi=Symbol("EOF"),Ji=Symbol("maybeEmitEnd"),qs=Symbol("emittedEnd"),Kg=Symbol("emittingEnd"),pl=Symbol("emittedError"),Wg=Symbol("closed"),QC=Symbol("read"),Gg=Symbol("flush"),ZC=Symbol("flushChunk"),Xr=Symbol("encoding"),fu=Symbol("decoder"),Xt=Symbol("flowing"),hl=Symbol("paused"),gu=Symbol("resume"),Yt=Symbol("buffer"),On=Symbol("pipes"),Jt=Symbol("bufferLength"),o0=Symbol("bufferPush"),Hg=Symbol("bufferShift"),gn=Symbol("objectMode"),Dt=Symbol("destroyed"),a0=Symbol("error"),u0=Symbol("emitData"),eM=Symbol("emitEnd"),c0=Symbol("emitEnd2"),Si=Symbol("async"),l0=Symbol("abort"),Vg=Symbol("aborted"),dl=Symbol("signal"),Io=Symbol("dataListeners"),nr=Symbol("discarded"),fl=t=>Promise.resolve().then(t),w4=t=>t(),x4=t=>t==="end"||t==="finish"||t==="prefinish",E4=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,k4=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),zg=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[gu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},p0=class extends zg{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},A4=t=>!!t.objectMode,P4=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Xg=class extends h0.EventEmitter{[Xt]=!1;[hl]=!1;[On]=[];[Yt]=[];[gn];[Xr];[Si];[fu];[Yi]=!1;[qs]=!1;[Kg]=!1;[Wg]=!1;[pl]=null;[Jt]=0;[Dt]=!1;[dl];[Vg]=!1;[Io]=0;[nr]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");A4(n)?(this[gn]=!0,this[Xr]=null):P4(n)?(this[Xr]=n.encoding,this[gn]=!1):(this[gn]=!1,this[Xr]=null),this[Si]=!!n.async,this[fu]=this[Xr]?new _4.StringDecoder(this[Xr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Yt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[On]});let{signal:r}=n;r&&(this[dl]=r,r.aborted?this[l0]():r.addEventListener("abort",()=>this[l0]()))}get bufferLength(){return this[Jt]}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[gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Si]}set async(e){this[Si]=this[Si]||!!e}[l0](){this[Vg]=!0,this.emit("abort",this[dl]?.reason),this.destroy(this[dl]?.reason)}get aborted(){return this[Vg]}set aborted(e){}write(e,n,r){if(this[Vg])return!1;if(this[Yi])throw new Error("write after end");if(this[Dt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[Si]?fl:w4;if(!this[gn]&&!Buffer.isBuffer(e)){if(k4(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(E4(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[gn]?(this[Xt]&&this[Jt]!==0&&this[Gg](!0),this[Xt]?this.emit("data",e):this[o0](e),this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt]):e.length?(typeof e=="string"&&!(n===this[Xr]&&!this[fu]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Xr]&&(e=this[fu].write(e)),this[Xt]&&this[Jt]!==0&&this[Gg](!0),this[Xt]?this.emit("data",e):this[o0](e),this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt]):(this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt])}read(e){if(this[Dt])return null;if(this[nr]=!1,this[Jt]===0||e===0||e&&e>this[Jt])return this[Ji](),null;this[gn]&&(e=null),this[Yt].length>1&&!this[gn]&&(this[Yt]=[this[Xr]?this[Yt].join(""):Buffer.concat(this[Yt],this[Jt])]);let n=this[QC](e||null,this[Yt][0]);return this[Ji](),n}[QC](e,n){if(this[gn])this[Hg]();else{let r=n;e===r.length||e===null?this[Hg]():typeof r=="string"?(this[Yt][0]=r.slice(e),n=r.slice(0,e),this[Jt]-=e):(this[Yt][0]=r.subarray(e),n=r.subarray(0,e),this[Jt]-=e)}return this.emit("data",n),!this[Yt].length&&!this[Yi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[Yi]=!0,this.writable=!1,(this[Xt]||!this[hl])&&this[Ji](),this}[gu](){this[Dt]||(!this[Io]&&!this[On].length&&(this[nr]=!0),this[hl]=!1,this[Xt]=!0,this.emit("resume"),this[Yt].length?this[Gg]():this[Yi]?this[Ji]():this.emit("drain"))}resume(){return this[gu]()}pause(){this[Xt]=!1,this[hl]=!0,this[nr]=!1}get destroyed(){return this[Dt]}get flowing(){return this[Xt]}get paused(){return this[hl]}[o0](e){this[gn]?this[Jt]+=1:this[Jt]+=e.length,this[Yt].push(e)}[Hg](){return this[gn]?this[Jt]-=1:this[Jt]-=this[Yt][0].length,this[Yt].shift()}[Gg](e=!1){do;while(this[ZC](this[Hg]())&&this[Yt].length);!e&&!this[Yt].length&&!this[Yi]&&this.emit("drain")}[ZC](e){return this.emit("data",e),this[Xt]}pipe(e,n){if(this[Dt])return e;this[nr]=!1;let r=this[qs];return n=n||{},e===JC.stdout||e===JC.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[On].push(n.proxyErrors?new p0(this,e,n):new zg(this,e,n)),this[Si]?fl(()=>this[gu]()):this[gu]()),e}unpipe(e){let n=this[On].find(r=>r.dest===e);n&&(this[On].length===1?(this[Xt]&&this[Io]===0&&(this[Xt]=!1),this[On]=[]):this[On].splice(this[On].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[nr]=!1,this[Io]++,!this[On].length&&!this[Xt]&&this[gu]();else if(e==="readable"&&this[Jt]!==0)super.emit("readable");else if(x4(e)&&this[qs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[pl]){let i=n;this[Si]?fl(()=>i.call(this,this[pl])):i.call(this,this[pl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Io]=this.listeners("data").length,this[Io]===0&&!this[nr]&&!this[On].length&&(this[Xt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Io]=0,!this[nr]&&!this[On].length&&(this[Xt]=!1)),n}get emittedEnd(){return this[qs]}[Ji](){!this[Kg]&&!this[qs]&&!this[Dt]&&this[Yt].length===0&&this[Yi]&&(this[Kg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Wg]&&this.emit("close"),this[Kg]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Dt&&this[Dt])return!1;if(e==="data")return!this[gn]&&!r?!1:this[Si]?(fl(()=>this[u0](r)),!0):this[u0](r);if(e==="end")return this[eM]();if(e==="close"){if(this[Wg]=!0,!this[qs]&&!this[Dt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[pl]=r,super.emit(a0,r);let s=!this[dl]||this.listeners("error").length?super.emit("error",r):!1;return this[Ji](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ji](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[Ji](),i}[u0](e){for(let r of this[On])r.dest.write(e)===!1&&this.pause();let n=this[nr]?!1:super.emit("data",e);return this[Ji](),n}[eM](){return this[qs]?!1:(this[qs]=!0,this.readable=!1,this[Si]?(fl(()=>this[c0]()),!0):this[c0]())}[c0](){if(this[fu]){let n=this[fu].end();if(n){for(let r of this[On])r.dest.write(n);this[nr]||super.emit("data",n)}}for(let n of this[On])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[gn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[gn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[gn])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,n)=>{this.on(Dt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[nr]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Yi])return n();let s,o,a=p=>{this.off("data",u),this.off("end",c),this.off(Dt,l),n(),o(p)},u=p=>{this.off("error",a),this.off("end",c),this.off(Dt,l),this.pause(),s({value:p,done:!!this[Yi]})},c=()=>{this.off("error",a),this.off("data",u),this.off(Dt,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((p,h)=>{o=h,s=p,this.once(Dt,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[nr]=!1;let e=!1,n=()=>(this.pause(),this.off(a0,n),this.off(Dt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(a0,n),this.once(Dt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Dt])return e?this.emit("error",e):this.emit(Dt),this;this[Dt]=!0,this[nr]=!0,this[Yt].length=0,this[Jt]=0;let n=this;return typeof n.close=="function"&&!this[Wg]&&n.close(),e?this.emit("error",e):this.emit(Dt),this}static get isStream(){return Dn.isStream}};Dn.Minipass=Xg});var mM=f(qe=>{"use strict";var O4=qe&&qe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),D4=qe&&qe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R4=qe&&qe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&O4(e,t,n);return D4(e,t),e};Object.defineProperty(qe,"__esModule",{value:!0});qe.PathScurry=qe.Path=qe.PathScurryDarwin=qe.PathScurryPosix=qe.PathScurryWin32=qe.PathScurryBase=qe.PathPosix=qe.PathWin32=qe.PathBase=qe.ChildrenCache=qe.ResolveCache=void 0;var aM=sl(),em=require("node:path"),I4=require("node:url"),ml=require("fs"),C4=R4(require("node:fs")),M4=ml.realpathSync.native,Yg=require("node:fs/promises"),nM=d0(),yl={lstatSync:ml.lstatSync,readdir:ml.readdir,readdirSync:ml.readdirSync,readlinkSync:ml.readlinkSync,realpathSync:M4,promises:{lstat:Yg.lstat,readdir:Yg.readdir,readlink:Yg.readlink,realpath:Yg.realpath}},uM=t=>!t||t===yl||t===C4?yl:{...yl,...t,promises:{...yl.promises,...t.promises||{}}},cM=/^\\\\\?\\([a-z]:)\\?$/i,L4=t=>t.replace(/\//g,"\\").replace(cM,"$1\\"),N4=/[\\\/]/,Pr=0,lM=1,pM=2,Ti=4,hM=6,dM=8,Co=10,fM=12,Ar=15,gl=~Ar,f0=16,rM=32,bl=64,Yr=128,Jg=256,Zg=512,iM=bl|Yr|Zg,q4=1023,g0=t=>t.isFile()?dM:t.isDirectory()?Ti:t.isSymbolicLink()?Co:t.isCharacterDevice()?pM:t.isBlockDevice()?hM:t.isSocket()?fM:t.isFIFO()?lM:Pr,sM=new Map,_l=t=>{let e=sM.get(t);if(e)return e;let n=t.normalize("NFKD");return sM.set(t,n),n},oM=new Map,Qg=t=>{let e=oM.get(t);if(e)return e;let n=_l(t.toLowerCase());return oM.set(t,n),n},vl=class extends aM.LRUCache{constructor(){super({max:256})}};qe.ResolveCache=vl;var tm=class extends aM.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};qe.ChildrenCache=tm;var gM=Symbol("PathScurry setAsCwd"),sn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#y;get rdev(){return this.#y}#a;get blksize(){return this.#a}#p;get ino(){return this.#p}#u;get size(){return this.#u}#c;get blocks(){return this.#c}#n;get atimeMs(){return this.#n}#h;get mtimeMs(){return this.#h}#b;get ctimeMs(){return this.#b}#f;get birthtimeMs(){return this.#f}#g;get atime(){return this.#g}#A;get mtime(){return this.#A}#m;get ctime(){return this.#m}#P;get birthtime(){return this.#P}#T;#S;#_;#E;#d;#D;#r;#C;#w;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Pr,r,i,s,o,a){this.name=e,this.#T=s?Qg(e):_l(e),this.#r=n&q4,this.nocase=s,this.roots=i,this.root=r||this,this.#C=o,this.#_=a.fullpath,this.#d=a.relative,this.#D=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=uM(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#C}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#x(i):this.#x(i)}#x(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#C.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#C.set(this,n),this.#r&=~f0,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Qg(e):_l(e);for(let u of r)if(u.#T===i)return u;let s=this.parent?this.sep:"",o=this.#_?this.#_+s+e:void 0,a=this.newChild(e,Pr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Yr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#d!==void 0)return this.#d;let e=this.name,n=this.parent;if(!n)return this.#d=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,n=this.parent;if(!n)return this.#D=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,n=this.parent;if(!n)return this.#_=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#_=i}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#E=`//?/${i}`:this.#E=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#r&Ar)===Pr}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&Ar)===dM}isDirectory(){return(this.#r&Ar)===Ti}isCharacterDevice(){return(this.#r&Ar)===pM}isBlockDevice(){return(this.#r&Ar)===hM}isFIFO(){return(this.#r&Ar)===lM}isSocket(){return(this.#r&Ar)===fM}isSymbolicLink(){return(this.#r&Co)===Co}lstatCached(){return this.#r&rM?this:void 0}readlinkCached(){return this.#w}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#w)return!0;if(!this.parent)return!1;let e=this.#r&Ar;return!(e!==Pr&&e!==Co||this.#r&Jg||this.#r&Yr)}calledReaddir(){return!!(this.#r&f0)}isENOENT(){return!!(this.#r&Yr)}isNamed(e){return this.nocase?this.#T===Qg(e):this.#T===_l(e)}async readlink(){let e=this.#w;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#w=r}catch(n){this.#q(n.code);return}}readlinkSync(){let e=this.#w;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#w=r}catch(n){this.#q(n.code);return}}#B(e){this.#r|=f0;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&Yr||(this.#r=(this.#r|Yr)&gl,this.#N())}#N(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#$(){this.#r|=Zg,this.#k()}#k(){if(this.#r&bl)return;let e=this.#r;(e&Ar)===Ti&&(e&=gl),this.#r=e|bl,this.#N()}#O(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#M():this.children().provisional=0}#U(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#M()}#q(e=""){let n=this.#r;n|=Jg,e==="ENOENT"&&(n|=Yr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=gl),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#L(e,n){return this.#K(e,n)||this.#l(e,n)}#l(e,n){let r=g0(e),i=this.newChild(e.name,r,{parent:this}),s=i.#r&Ar;return s!==Ti&&s!==Co&&s!==Pr&&(i.#r|=bl),n.unshift(i),n.provisional++,i}#K(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?Qg(e.name):_l(e.name))===i.#T)return this.#j(e,i,r,n)}}#j(e,n,r,i){let s=n.name;return n.#r=n.#r&gl|g0(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#r&Yr))try{return this.#I(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#U(e.code)}}lstatSync(){if(!(this.#r&Yr))try{return this.#I(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#U(e.code)}}#I(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:p,ino:h,mode:m,mtime:b,mtimeMs:v,nlink:R,rdev:A,size:T,uid:w}=e;this.#g=n,this.#n=r,this.#P=i,this.#f=s,this.#a=o,this.#c=a,this.#m=u,this.#b=c,this.#t=l,this.#v=p,this.#p=h,this.#s=m,this.#A=b,this.#h=v,this.#i=R,this.#y=A,this.#u=T,this.#o=w;let _=g0(e);this.#r=this.#r&gl|_|rM,_!==Pr&&_!==Ti&&_!==Co&&(this.#r|=bl)}#F=[];#G=!1;#H(e){this.#G=!1;let n=this.#F.slice();this.#F.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#F.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#O(s.code),r.provisional=0;else{for(let a of o)this.#L(a,r);this.#B(r)}this.#H(r.slice(0,r.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#W)await this.#W;else{let r=()=>{};this.#W=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#L(i,e);this.#B(e)}catch(i){this.#O(i.code),e.provisional=0}this.#W=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#L(r,e);this.#B(e)}catch(r){this.#O(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&iM)return!1;let e=Ar&this.#r;return e===Pr||e===Ti||e===Co}shouldWalk(e,n){return(this.#r&Ti)===Ti&&!(this.#r&iM)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((Zg|Jg|Yr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#R)return this.#R;if(!((Zg|Jg|Yr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#$()}}[gM](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#d=r.join(this.sep),i.#D=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#d=void 0,i.#D=void 0,i=i.parent}};qe.PathBase=sn;var Sl=class t extends sn{sep="\\";splitSep=N4;constructor(e,n=Pr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=Pr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return em.win32.parse(e).root}getRoot(e){if(e=L4(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new xl(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(cM,"$1\\"),e===n}};qe.PathWin32=Sl;var Tl=class t extends sn{splitSep="/";sep="/";constructor(e,n=Pr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Pr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};qe.PathPosix=Tl;var wl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=yl}={}){this.#i=uM(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,I4.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new vl,this.#t=new vl,this.#s=new tm(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,p=n.sep,h=this.rootPath,m=!1;for(let b of u){let v=l--;c=c.child(b,{relative:new Array(v).fill("..").join(p),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(m?"":p)+b}),m=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(p,h)=>{u.add(p),p.readdirCB((m,b)=>{if(m)return h(m);let v=b.length;if(!v)return h();let R=()=>{--v===0&&h()};for(let A of b)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(u,o)?c(T,R):R()):A.shouldWalk(u,o)?c(A,R):R()},!0)},l=e;return new Promise((p,h)=>{c(l,m=>{if(m)return h(m);p(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let p of l){(!s||s(p))&&a.push(r?p:p.fullpath());let h=p;if(p.isSymbolicLink()){if(!(i&&(h=p.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(u,o)&&u.add(h)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let p=l;if(l.isSymbolicLink()){if(!(i&&(p=l.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(a,o)&&a.add(p)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new nM.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,p=()=>{let h=!1;for(;!h;){let m=c.shift();if(!m){l===0&&a.end();return}l++,u.add(m);let b=(R,A,T=!1)=>{if(R)return a.emit("error",R);if(i&&!T){let w=[];for(let _ of A)_.isSymbolicLink()&&w.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(w.length){Promise.all(w).then(()=>b(null,A,!0));return}}for(let w of A)w&&(!s||s(w))&&(a.write(r?w:w.fullpath())||(h=!0));l--;for(let w of A){let _=w.realpathCached()||w;_.shouldWalk(u,o)&&c.push(_)}h&&!a.flowing?a.once("drain",p):v||p()},v=!0;m.readdirCB(b,!0),v=!1}};return p(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new nM.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,p=()=>{let h=!1;for(;!h;){let m=c.shift();if(!m){l===0&&a.end();return}l++,u.add(m);let b=m.readdirSync();for(let v of b)(!s||s(v))&&(a.write(r?v:v.fullpath())||(h=!0));l--;for(let v of b){let R=v;if(v.isSymbolicLink()){if(!(i&&(R=v.realpathSync())))continue;R.isUnknown()&&R.lstatSync()}R.shouldWalk(u,o)&&c.push(R)}}h&&!a.flowing&&a.once("drain",p)};return p(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[gM](n)}};qe.PathScurryBase=wl;var xl=class extends wl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,em.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return em.win32.parse(e).root.toUpperCase()}newRoot(e){return new Sl(this.rootPath,Ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};qe.PathScurryWin32=xl;var El=class extends wl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,em.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Tl(this.rootPath,Ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};qe.PathScurryPosix=El;var nm=class extends El{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};qe.PathScurryDarwin=nm;qe.Path=process.platform==="win32"?Sl:Tl;qe.PathScurry=process.platform==="win32"?xl:process.platform==="darwin"?nm:El});var y0=f(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.Pattern=void 0;var j4=Ns(),F4=t=>t.length>=1,B4=t=>t.length>=1,m0=class t{#e;#t;#s;length;#i;#o;#v;#y;#a;#p;#u=!0;constructor(e,n,r,i){if(!F4(e))throw new TypeError("empty pattern list");if(!B4(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#i=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,p,h,m,...b]=this.#t;c[0]===""&&(c.shift(),b.shift());let v=[s,o,a,u,""].join("/"),R=[l,p,h,m,""].join("/");this.#e=[v,...c],this.#t=[R,...b],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===j4.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#i),this.#o.#p=this.#p,this.#o.#a=this.#a,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#p!==void 0?this.#p:this.#p=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};rm.Pattern=m0});var _0=f(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.Ignore=void 0;var yM=Ns(),$4=y0(),U4=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",b0=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=U4}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new yM.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new $4.Pattern(i,s,0,this.platform),a=new yM.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};im.Ignore=b0});var _M=f(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Processor=wi.SubWalks=wi.MatchRecord=wi.HasWalkedCache=void 0;var bM=Ns(),sm=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};wi.HasWalkedCache=sm;var om=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};wi.MatchRecord=om;var am=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};wi.SubWalks=am;var v0=class t{hasWalkedCache;matches=new om;subwalks=new am;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new sm}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let p=s.rest();if(p)s=p;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let p=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,p);continue}else if(u===bM.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let p=c?.pattern(),h=c?.rest();if(!c||(p===""||p===".")&&!h)this.matches.add(i,a,p===""||p===".");else if(p===".."){let m=i.parent||i;h?this.hasWalkedCache.hasWalked(m,h)||this.subwalks.add(m,h):this.matches.add(m,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===bM.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};wi.Processor=v0});var TM=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.GlobStream=js.GlobWalker=js.GlobUtil=void 0;var K4=d0(),vM=_0(),SM=_M(),W4=(t,e)=>typeof t=="string"?new vM.Ignore([t],e):Array.isArray(t)?new vM.Ignore(t,e):t,kl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=W4(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new SM.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new SM.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};js.GlobUtil=kl;var S0=class extends kl{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};js.GlobWalker=S0;var T0=class extends kl{results;constructor(e,n,r){super(e,n,r),this.results=new K4.Minipass({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}};js.GlobStream=T0});var x0=f(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.Glob=void 0;var G4=Ns(),H4=require("node:url"),um=mM(),V4=y0(),cm=TM(),z4=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",w0=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,H4.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||z4,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?um.PathScurryWin32:n.platform==="darwin"?um.PathScurryDarwin:n.platform?um.PathScurryPosix:um.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new G4.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new V4.Pattern(u,l,0,this.platform)})}async walk(){return[...await new cm.GlobWalker(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 cm.GlobWalker(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 cm.GlobStream(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 cm.GlobStream(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()}};lm.Glob=w0});var E0=f(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.hasMagic=void 0;var X4=Ns(),Y4=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new X4.Minimatch(n,e).hasMagic())return!0;return!1};pm.hasMagic=Y4});var kM=f(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.glob=Ee.sync=Ee.iterate=Ee.iterateSync=Ee.stream=Ee.streamSync=Ee.Ignore=Ee.hasMagic=Ee.Glob=Ee.unescape=Ee.escape=void 0;Ee.globStreamSync=Al;Ee.globStream=k0;Ee.globSync=A0;Ee.globIterateSync=Pl;Ee.globIterate=P0;var wM=Ns(),Mo=x0(),J4=E0(),EM=Ns();Object.defineProperty(Ee,"escape",{enumerable:!0,get:function(){return EM.escape}});Object.defineProperty(Ee,"unescape",{enumerable:!0,get:function(){return EM.unescape}});var Q4=x0();Object.defineProperty(Ee,"Glob",{enumerable:!0,get:function(){return Q4.Glob}});var Z4=E0();Object.defineProperty(Ee,"hasMagic",{enumerable:!0,get:function(){return Z4.hasMagic}});var ez=_0();Object.defineProperty(Ee,"Ignore",{enumerable:!0,get:function(){return ez.Ignore}});function Al(t,e={}){return new Mo.Glob(t,e).streamSync()}function k0(t,e={}){return new Mo.Glob(t,e).stream()}function A0(t,e={}){return new Mo.Glob(t,e).walkSync()}async function xM(t,e={}){return new Mo.Glob(t,e).walk()}function Pl(t,e={}){return new Mo.Glob(t,e).iterateSync()}function P0(t,e={}){return new Mo.Glob(t,e).iterate()}Ee.streamSync=Al;Ee.stream=Object.assign(k0,{sync:Al});Ee.iterateSync=Pl;Ee.iterate=Object.assign(P0,{sync:Pl});Ee.sync=Object.assign(A0,{stream:Al,iterate:Pl});Ee.glob=Object.assign(xM,{glob:xM,globSync:A0,sync:Ee.sync,globStream:k0,stream:Ee.stream,globStreamSync:Al,streamSync:Ee.streamSync,globIterate:P0,iterate:Ee.iterate,globIterateSync:Pl,iterateSync:Ee.iterateSync,Glob:Mo.Glob,hasMagic:J4.hasMagic,escape:wM.escape,unescape:wM.unescape});Ee.glob.glob=Ee.glob});var OM=f(mu=>{"use strict";var PM=mu&&mu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mu,"__esModule",{value:!0});mu.FileSystem=void 0;var tz=fb(),AM=(EC(),FM(xC)),nz=PM(require("events")),hm=cg(),rz=PM(require("fs")),iz=Ig(),sz=sl(),oz=kM(),O0=class extends nz.default{constructor(e){super(),this._connection=null,this._context=e,this._textDocumentManager=new tz.TextDocuments(AM.TextDocument),this._tempTextDocumentCache=new sz.LRUCache({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._connection?.workspace==null)return[];let e=await this._connection.workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>hm.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,oz.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>hm.URI.file(o))}async findExistingPath(e,...n){if(await this.getTextDocument(e)!=null)return e;if(n.length===0)return null;try{let i=await Promise.any(n.map(async s=>{if(await this.getTextDocument(s)!=null)return s;throw new Error("Alternative path could not resolve")}));return i??null}catch{return null}}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=hm.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await rz.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=AM.TextDocument.create(e,iz.LanguageId,0,s),this._connection?.sendNotification("textDocument/didOpen",{textDocument:i})}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(hm.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._connection=e,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};mu.FileSystem=O0});var DM=f(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.NodeContext=void 0;var D0=fb(),R0=Ig(),az=OM(),I0=class extends R0.CoreContext{constructor(){super(),this.documentManager=new R0.DocumentManager().setContext(this),this.documentMerger=new R0.DocumentMerger,this.connection=(0,D0.createConnection)(D0.ProposedFeatures.all),this.fs=new az.FileSystem(this)}createSemanticTokensBuilder(){return new D0.SemanticTokensBuilder}};dm.NodeContext=I0});Object.defineProperty(exports,"__esModule",{value:!0});var uz=DM(),Jr=Ig(),RM=new uz.NodeContext;RM.on("ready",t=>{(0,Jr.activateAutocomplete)(t),(0,Jr.activateColor)(t),(0,Jr.activateDefinition)(t),(0,Jr.activateDiagnostic)(t),(0,Jr.activateFormatter)(t),(0,Jr.activateHover)(t),(0,Jr.activateSignature)(t),(0,Jr.activateSubscriptions)(t),(0,Jr.activateSymbol)(t),(0,Jr.activateSemantic)(t),(0,Jr.activateFoldingRange)(t)});RM.listen();
|
160
|
+
>>> no match, partial?`,e,h,n,m),h===u))}let v;if(typeof l=="string"?(v=p===l,this.debug("string match",l,p,v)):(v=l.test(p),this.debug("pattern match",l,p,v)),!v)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,Z.braceExpand)(this.pattern,this.options)}parse(e){(0,Ug.assertValidPattern)(e);let n=this.options;if(e==="**")return Z.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(JV))?i=n.dot?ZV:QV:(r=e.match($V))?i=(n.nocase?n.dot?GV:WV:n.dot?KV:UV)(r[1]):(r=e.match(e4))?i=(n.nocase?n.dot?n4:t4:n.dot?r4:i4)(r):(r=e.match(HV))?i=n.dot?zV:VV:(r=e.match(XV))&&(i=YV);let s=VC.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?o4:n.dot?a4:u4,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let p of l.flags.split(""))i.add(p);return typeof l=="string"?f4(l):l===Z.GLOBSTAR?Z.GLOBSTAR:l._src});return c.forEach((l,p)=>{let h=c[p+1],m=c[p-1];l!==Z.GLOBSTAR||m===Z.GLOBSTAR||(m===void 0?h!==void 0&&h!==Z.GLOBSTAR?c[p+1]="(?:\\/|"+r+"\\/)?"+h:c[p]=r:h===void 0?c[p-1]=m+"(?:\\/|"+r+")?":h!==Z.GLOBSTAR&&(c[p-1]=m+"(?:\\/|\\/"+r+"\\/)"+h,c[p+1]=Z.GLOBSTAR))}),c.filter(l=>l!==Z.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Z.minimatch.defaults(e).Minimatch}};Z.Minimatch=Do;var g4=i0();Object.defineProperty(Z,"AST",{enumerable:!0,get:function(){return g4.AST}});var m4=s0();Object.defineProperty(Z,"escape",{enumerable:!0,get:function(){return m4.escape}});var y4=qg();Object.defineProperty(Z,"unescape",{enumerable:!0,get:function(){return y4.unescape}});Z.minimatch.AST=VC.AST;Z.minimatch.Minimatch=Do;Z.minimatch.escape=jV.escape;Z.minimatch.unescape=FV.unescape});var d0=f(Rn=>{"use strict";var b4=Rn&&Rn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Minipass=Rn.isWritable=Rn.isReadable=Rn.isStream=void 0;var JC=typeof process=="object"&&process?process:{stdout:null,stderr:null},h0=require("node:events"),tM=b4(require("node:stream")),_4=require("node:string_decoder"),v4=t=>!!t&&typeof t=="object"&&(t instanceof Xg||t instanceof tM.default||(0,Rn.isReadable)(t)||(0,Rn.isWritable)(t));Rn.isStream=v4;var S4=t=>!!t&&typeof t=="object"&&t instanceof h0.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==tM.default.Writable.prototype.pipe;Rn.isReadable=S4;var T4=t=>!!t&&typeof t=="object"&&t instanceof h0.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";Rn.isWritable=T4;var Yi=Symbol("EOF"),Ji=Symbol("maybeEmitEnd"),qs=Symbol("emittedEnd"),Kg=Symbol("emittingEnd"),pl=Symbol("emittedError"),Wg=Symbol("closed"),QC=Symbol("read"),Gg=Symbol("flush"),ZC=Symbol("flushChunk"),Xr=Symbol("encoding"),fu=Symbol("decoder"),Xt=Symbol("flowing"),hl=Symbol("paused"),gu=Symbol("resume"),Yt=Symbol("buffer"),On=Symbol("pipes"),Jt=Symbol("bufferLength"),o0=Symbol("bufferPush"),Hg=Symbol("bufferShift"),gn=Symbol("objectMode"),Rt=Symbol("destroyed"),a0=Symbol("error"),u0=Symbol("emitData"),eM=Symbol("emitEnd"),c0=Symbol("emitEnd2"),Si=Symbol("async"),l0=Symbol("abort"),Vg=Symbol("aborted"),dl=Symbol("signal"),Io=Symbol("dataListeners"),nr=Symbol("discarded"),fl=t=>Promise.resolve().then(t),w4=t=>t(),x4=t=>t==="end"||t==="finish"||t==="prefinish",E4=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,k4=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),zg=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[gu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},p0=class extends zg{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},A4=t=>!!t.objectMode,P4=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Xg=class extends h0.EventEmitter{[Xt]=!1;[hl]=!1;[On]=[];[Yt]=[];[gn];[Xr];[Si];[fu];[Yi]=!1;[qs]=!1;[Kg]=!1;[Wg]=!1;[pl]=null;[Jt]=0;[Rt]=!1;[dl];[Vg]=!1;[Io]=0;[nr]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");A4(n)?(this[gn]=!0,this[Xr]=null):P4(n)?(this[Xr]=n.encoding,this[gn]=!1):(this[gn]=!1,this[Xr]=null),this[Si]=!!n.async,this[fu]=this[Xr]?new _4.StringDecoder(this[Xr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Yt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[On]});let{signal:r}=n;r&&(this[dl]=r,r.aborted?this[l0]():r.addEventListener("abort",()=>this[l0]()))}get bufferLength(){return this[Jt]}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[gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Si]}set async(e){this[Si]=this[Si]||!!e}[l0](){this[Vg]=!0,this.emit("abort",this[dl]?.reason),this.destroy(this[dl]?.reason)}get aborted(){return this[Vg]}set aborted(e){}write(e,n,r){if(this[Vg])return!1;if(this[Yi])throw new Error("write after end");if(this[Rt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[Si]?fl:w4;if(!this[gn]&&!Buffer.isBuffer(e)){if(k4(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(E4(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[gn]?(this[Xt]&&this[Jt]!==0&&this[Gg](!0),this[Xt]?this.emit("data",e):this[o0](e),this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt]):e.length?(typeof e=="string"&&!(n===this[Xr]&&!this[fu]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Xr]&&(e=this[fu].write(e)),this[Xt]&&this[Jt]!==0&&this[Gg](!0),this[Xt]?this.emit("data",e):this[o0](e),this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt]):(this[Jt]!==0&&this.emit("readable"),r&&i(r),this[Xt])}read(e){if(this[Rt])return null;if(this[nr]=!1,this[Jt]===0||e===0||e&&e>this[Jt])return this[Ji](),null;this[gn]&&(e=null),this[Yt].length>1&&!this[gn]&&(this[Yt]=[this[Xr]?this[Yt].join(""):Buffer.concat(this[Yt],this[Jt])]);let n=this[QC](e||null,this[Yt][0]);return this[Ji](),n}[QC](e,n){if(this[gn])this[Hg]();else{let r=n;e===r.length||e===null?this[Hg]():typeof r=="string"?(this[Yt][0]=r.slice(e),n=r.slice(0,e),this[Jt]-=e):(this[Yt][0]=r.subarray(e),n=r.subarray(0,e),this[Jt]-=e)}return this.emit("data",n),!this[Yt].length&&!this[Yi]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[Yi]=!0,this.writable=!1,(this[Xt]||!this[hl])&&this[Ji](),this}[gu](){this[Rt]||(!this[Io]&&!this[On].length&&(this[nr]=!0),this[hl]=!1,this[Xt]=!0,this.emit("resume"),this[Yt].length?this[Gg]():this[Yi]?this[Ji]():this.emit("drain"))}resume(){return this[gu]()}pause(){this[Xt]=!1,this[hl]=!0,this[nr]=!1}get destroyed(){return this[Rt]}get flowing(){return this[Xt]}get paused(){return this[hl]}[o0](e){this[gn]?this[Jt]+=1:this[Jt]+=e.length,this[Yt].push(e)}[Hg](){return this[gn]?this[Jt]-=1:this[Jt]-=this[Yt][0].length,this[Yt].shift()}[Gg](e=!1){do;while(this[ZC](this[Hg]())&&this[Yt].length);!e&&!this[Yt].length&&!this[Yi]&&this.emit("drain")}[ZC](e){return this.emit("data",e),this[Xt]}pipe(e,n){if(this[Rt])return e;this[nr]=!1;let r=this[qs];return n=n||{},e===JC.stdout||e===JC.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[On].push(n.proxyErrors?new p0(this,e,n):new zg(this,e,n)),this[Si]?fl(()=>this[gu]()):this[gu]()),e}unpipe(e){let n=this[On].find(r=>r.dest===e);n&&(this[On].length===1?(this[Xt]&&this[Io]===0&&(this[Xt]=!1),this[On]=[]):this[On].splice(this[On].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[nr]=!1,this[Io]++,!this[On].length&&!this[Xt]&&this[gu]();else if(e==="readable"&&this[Jt]!==0)super.emit("readable");else if(x4(e)&&this[qs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[pl]){let i=n;this[Si]?fl(()=>i.call(this,this[pl])):i.call(this,this[pl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Io]=this.listeners("data").length,this[Io]===0&&!this[nr]&&!this[On].length&&(this[Xt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Io]=0,!this[nr]&&!this[On].length&&(this[Xt]=!1)),n}get emittedEnd(){return this[qs]}[Ji](){!this[Kg]&&!this[qs]&&!this[Rt]&&this[Yt].length===0&&this[Yi]&&(this[Kg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Wg]&&this.emit("close"),this[Kg]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Rt&&this[Rt])return!1;if(e==="data")return!this[gn]&&!r?!1:this[Si]?(fl(()=>this[u0](r)),!0):this[u0](r);if(e==="end")return this[eM]();if(e==="close"){if(this[Wg]=!0,!this[qs]&&!this[Rt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[pl]=r,super.emit(a0,r);let s=!this[dl]||this.listeners("error").length?super.emit("error",r):!1;return this[Ji](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ji](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[Ji](),i}[u0](e){for(let r of this[On])r.dest.write(e)===!1&&this.pause();let n=this[nr]?!1:super.emit("data",e);return this[Ji](),n}[eM](){return this[qs]?!1:(this[qs]=!0,this.readable=!1,this[Si]?(fl(()=>this[c0]()),!0):this[c0]())}[c0](){if(this[fu]){let n=this[fu].end();if(n){for(let r of this[On])r.dest.write(n);this[nr]||super.emit("data",n)}}for(let n of this[On])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[gn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[gn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[gn])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,n)=>{this.on(Rt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[nr]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Yi])return n();let s,o,a=p=>{this.off("data",u),this.off("end",c),this.off(Rt,l),n(),o(p)},u=p=>{this.off("error",a),this.off("end",c),this.off(Rt,l),this.pause(),s({value:p,done:!!this[Yi]})},c=()=>{this.off("error",a),this.off("data",u),this.off(Rt,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((p,h)=>{o=h,s=p,this.once(Rt,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[nr]=!1;let e=!1,n=()=>(this.pause(),this.off(a0,n),this.off(Rt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(a0,n),this.once(Rt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Rt])return e?this.emit("error",e):this.emit(Rt),this;this[Rt]=!0,this[nr]=!0,this[Yt].length=0,this[Jt]=0;let n=this;return typeof n.close=="function"&&!this[Wg]&&n.close(),e?this.emit("error",e):this.emit(Rt),this}static get isStream(){return Rn.isStream}};Rn.Minipass=Xg});var mM=f(qe=>{"use strict";var O4=qe&&qe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),R4=qe&&qe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),D4=qe&&qe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&O4(e,t,n);return R4(e,t),e};Object.defineProperty(qe,"__esModule",{value:!0});qe.PathScurry=qe.Path=qe.PathScurryDarwin=qe.PathScurryPosix=qe.PathScurryWin32=qe.PathScurryBase=qe.PathPosix=qe.PathWin32=qe.PathBase=qe.ChildrenCache=qe.ResolveCache=void 0;var aM=sl(),em=require("node:path"),I4=require("node:url"),ml=require("fs"),C4=D4(require("node:fs")),M4=ml.realpathSync.native,Yg=require("node:fs/promises"),nM=d0(),yl={lstatSync:ml.lstatSync,readdir:ml.readdir,readdirSync:ml.readdirSync,readlinkSync:ml.readlinkSync,realpathSync:M4,promises:{lstat:Yg.lstat,readdir:Yg.readdir,readlink:Yg.readlink,realpath:Yg.realpath}},uM=t=>!t||t===yl||t===C4?yl:{...yl,...t,promises:{...yl.promises,...t.promises||{}}},cM=/^\\\\\?\\([a-z]:)\\?$/i,L4=t=>t.replace(/\//g,"\\").replace(cM,"$1\\"),N4=/[\\\/]/,Pr=0,lM=1,pM=2,Ti=4,hM=6,dM=8,Co=10,fM=12,Ar=15,gl=~Ar,f0=16,rM=32,bl=64,Yr=128,Jg=256,Zg=512,iM=bl|Yr|Zg,q4=1023,g0=t=>t.isFile()?dM:t.isDirectory()?Ti:t.isSymbolicLink()?Co:t.isCharacterDevice()?pM:t.isBlockDevice()?hM:t.isSocket()?fM:t.isFIFO()?lM:Pr,sM=new Map,_l=t=>{let e=sM.get(t);if(e)return e;let n=t.normalize("NFKD");return sM.set(t,n),n},oM=new Map,Qg=t=>{let e=oM.get(t);if(e)return e;let n=_l(t.toLowerCase());return oM.set(t,n),n},vl=class extends aM.LRUCache{constructor(){super({max:256})}};qe.ResolveCache=vl;var tm=class extends aM.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};qe.ChildrenCache=tm;var gM=Symbol("PathScurry setAsCwd"),sn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#y;get rdev(){return this.#y}#a;get blksize(){return this.#a}#p;get ino(){return this.#p}#u;get size(){return this.#u}#c;get blocks(){return this.#c}#n;get atimeMs(){return this.#n}#h;get mtimeMs(){return this.#h}#b;get ctimeMs(){return this.#b}#f;get birthtimeMs(){return this.#f}#g;get atime(){return this.#g}#A;get mtime(){return this.#A}#m;get ctime(){return this.#m}#P;get birthtime(){return this.#P}#T;#S;#_;#E;#d;#R;#r;#C;#w;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Pr,r,i,s,o,a){this.name=e,this.#T=s?Qg(e):_l(e),this.#r=n&q4,this.nocase=s,this.roots=i,this.root=r||this,this.#C=o,this.#_=a.fullpath,this.#d=a.relative,this.#R=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=uM(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#C}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#x(i):this.#x(i)}#x(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#C.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#C.set(this,n),this.#r&=~f0,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?Qg(e):_l(e);for(let u of r)if(u.#T===i)return u;let s=this.parent?this.sep:"",o=this.#_?this.#_+s+e:void 0,a=this.newChild(e,Pr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=Yr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#d!==void 0)return this.#d;let e=this.name,n=this.parent;if(!n)return this.#d=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,n=this.parent;if(!n)return this.#R=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,n=this.parent;if(!n)return this.#_=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#_=i}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#E=`//?/${i}`:this.#E=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#r&Ar)===Pr}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&Ar)===dM}isDirectory(){return(this.#r&Ar)===Ti}isCharacterDevice(){return(this.#r&Ar)===pM}isBlockDevice(){return(this.#r&Ar)===hM}isFIFO(){return(this.#r&Ar)===lM}isSocket(){return(this.#r&Ar)===fM}isSymbolicLink(){return(this.#r&Co)===Co}lstatCached(){return this.#r&rM?this:void 0}readlinkCached(){return this.#w}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#w)return!0;if(!this.parent)return!1;let e=this.#r&Ar;return!(e!==Pr&&e!==Co||this.#r&Jg||this.#r&Yr)}calledReaddir(){return!!(this.#r&f0)}isENOENT(){return!!(this.#r&Yr)}isNamed(e){return this.nocase?this.#T===Qg(e):this.#T===_l(e)}async readlink(){let e=this.#w;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#w=r}catch(n){this.#q(n.code);return}}readlinkSync(){let e=this.#w;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#w=r}catch(n){this.#q(n.code);return}}#B(e){this.#r|=f0;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&Yr||(this.#r=(this.#r|Yr)&gl,this.#N())}#N(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#$(){this.#r|=Zg,this.#k()}#k(){if(this.#r&bl)return;let e=this.#r;(e&Ar)===Ti&&(e&=gl),this.#r=e|bl,this.#N()}#O(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#M():this.children().provisional=0}#U(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#M()}#q(e=""){let n=this.#r;n|=Jg,e==="ENOENT"&&(n|=Yr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=gl),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#L(e,n){return this.#K(e,n)||this.#l(e,n)}#l(e,n){let r=g0(e),i=this.newChild(e.name,r,{parent:this}),s=i.#r&Ar;return s!==Ti&&s!==Co&&s!==Pr&&(i.#r|=bl),n.unshift(i),n.provisional++,i}#K(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?Qg(e.name):_l(e.name))===i.#T)return this.#j(e,i,r,n)}}#j(e,n,r,i){let s=n.name;return n.#r=n.#r&gl|g0(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#r&Yr))try{return this.#I(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#U(e.code)}}lstatSync(){if(!(this.#r&Yr))try{return this.#I(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#U(e.code)}}#I(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:p,ino:h,mode:m,mtime:b,mtimeMs:v,nlink:D,rdev:A,size:T,uid:w}=e;this.#g=n,this.#n=r,this.#P=i,this.#f=s,this.#a=o,this.#c=a,this.#m=u,this.#b=c,this.#t=l,this.#v=p,this.#p=h,this.#s=m,this.#A=b,this.#h=v,this.#i=D,this.#y=A,this.#u=T,this.#o=w;let _=g0(e);this.#r=this.#r&gl|_|rM,_!==Pr&&_!==Ti&&_!==Co&&(this.#r|=bl)}#F=[];#G=!1;#H(e){this.#G=!1;let n=this.#F.slice();this.#F.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#F.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#O(s.code),r.provisional=0;else{for(let a of o)this.#L(a,r);this.#B(r)}this.#H(r.slice(0,r.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#W)await this.#W;else{let r=()=>{};this.#W=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#L(i,e);this.#B(e)}catch(i){this.#O(i.code),e.provisional=0}this.#W=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#L(r,e);this.#B(e)}catch(r){this.#O(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&iM)return!1;let e=Ar&this.#r;return e===Pr||e===Ti||e===Co}shouldWalk(e,n){return(this.#r&Ti)===Ti&&!(this.#r&iM)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#D)return this.#D;if(!((Zg|Jg|Yr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#D)return this.#D;if(!((Zg|Jg|Yr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#$()}}[gM](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#d=r.join(this.sep),i.#R=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#d=void 0,i.#R=void 0,i=i.parent}};qe.PathBase=sn;var Sl=class t extends sn{sep="\\";splitSep=N4;constructor(e,n=Pr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=Pr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return em.win32.parse(e).root}getRoot(e){if(e=L4(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new xl(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(cM,"$1\\"),e===n}};qe.PathWin32=Sl;var Tl=class t extends sn{splitSep="/";sep="/";constructor(e,n=Pr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Pr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};qe.PathPosix=Tl;var wl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=yl}={}){this.#i=uM(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,I4.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new vl,this.#t=new vl,this.#s=new tm(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,p=n.sep,h=this.rootPath,m=!1;for(let b of u){let v=l--;c=c.child(b,{relative:new Array(v).fill("..").join(p),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(m?"":p)+b}),m=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(p,h)=>{u.add(p),p.readdirCB((m,b)=>{if(m)return h(m);let v=b.length;if(!v)return h();let D=()=>{--v===0&&h()};for(let A of b)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(u,o)?c(T,D):D()):A.shouldWalk(u,o)?c(A,D):D()},!0)},l=e;return new Promise((p,h)=>{c(l,m=>{if(m)return h(m);p(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let p of l){(!s||s(p))&&a.push(r?p:p.fullpath());let h=p;if(p.isSymbolicLink()){if(!(i&&(h=p.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(u,o)&&u.add(h)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let p=l;if(l.isSymbolicLink()){if(!(i&&(p=l.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(a,o)&&a.add(p)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new nM.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,p=()=>{let h=!1;for(;!h;){let m=c.shift();if(!m){l===0&&a.end();return}l++,u.add(m);let b=(D,A,T=!1)=>{if(D)return a.emit("error",D);if(i&&!T){let w=[];for(let _ of A)_.isSymbolicLink()&&w.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(w.length){Promise.all(w).then(()=>b(null,A,!0));return}}for(let w of A)w&&(!s||s(w))&&(a.write(r?w:w.fullpath())||(h=!0));l--;for(let w of A){let _=w.realpathCached()||w;_.shouldWalk(u,o)&&c.push(_)}h&&!a.flowing?a.once("drain",p):v||p()},v=!0;m.readdirCB(b,!0),v=!1}};return p(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof sn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new nM.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,p=()=>{let h=!1;for(;!h;){let m=c.shift();if(!m){l===0&&a.end();return}l++,u.add(m);let b=m.readdirSync();for(let v of b)(!s||s(v))&&(a.write(r?v:v.fullpath())||(h=!0));l--;for(let v of b){let D=v;if(v.isSymbolicLink()){if(!(i&&(D=v.realpathSync())))continue;D.isUnknown()&&D.lstatSync()}D.shouldWalk(u,o)&&c.push(D)}}h&&!a.flowing&&a.once("drain",p)};return p(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[gM](n)}};qe.PathScurryBase=wl;var xl=class extends wl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,em.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return em.win32.parse(e).root.toUpperCase()}newRoot(e){return new Sl(this.rootPath,Ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};qe.PathScurryWin32=xl;var El=class extends wl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,em.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Tl(this.rootPath,Ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};qe.PathScurryPosix=El;var nm=class extends El{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};qe.PathScurryDarwin=nm;qe.Path=process.platform==="win32"?Sl:Tl;qe.PathScurry=process.platform==="win32"?xl:process.platform==="darwin"?nm:El});var y0=f(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.Pattern=void 0;var j4=Ns(),F4=t=>t.length>=1,B4=t=>t.length>=1,m0=class t{#e;#t;#s;length;#i;#o;#v;#y;#a;#p;#u=!0;constructor(e,n,r,i){if(!F4(e))throw new TypeError("empty pattern list");if(!B4(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#i=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,p,h,m,...b]=this.#t;c[0]===""&&(c.shift(),b.shift());let v=[s,o,a,u,""].join("/"),D=[l,p,h,m,""].join("/");this.#e=[v,...c],this.#t=[D,...b],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===j4.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#i),this.#o.#p=this.#p,this.#o.#a=this.#a,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#p!==void 0?this.#p:this.#p=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};rm.Pattern=m0});var _0=f(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.Ignore=void 0;var yM=Ns(),$4=y0(),U4=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",b0=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=U4}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new yM.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new $4.Pattern(i,s,0,this.platform),a=new yM.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};im.Ignore=b0});var _M=f(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Processor=wi.SubWalks=wi.MatchRecord=wi.HasWalkedCache=void 0;var bM=Ns(),sm=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};wi.HasWalkedCache=sm;var om=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};wi.MatchRecord=om;var am=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};wi.SubWalks=am;var v0=class t{hasWalkedCache;matches=new om;subwalks=new am;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new sm}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let p=s.rest();if(p)s=p;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let p=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,p);continue}else if(u===bM.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let p=c?.pattern(),h=c?.rest();if(!c||(p===""||p===".")&&!h)this.matches.add(i,a,p===""||p===".");else if(p===".."){let m=i.parent||i;h?this.hasWalkedCache.hasWalked(m,h)||this.subwalks.add(m,h):this.matches.add(m,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===bM.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};wi.Processor=v0});var TM=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.GlobStream=js.GlobWalker=js.GlobUtil=void 0;var K4=d0(),vM=_0(),SM=_M(),W4=(t,e)=>typeof t=="string"?new vM.Ignore([t],e):Array.isArray(t)?new vM.Ignore(t,e):t,kl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=W4(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new SM.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new SM.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#i(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};js.GlobUtil=kl;var S0=class extends kl{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};js.GlobWalker=S0;var T0=class extends kl{results;constructor(e,n,r){super(e,n,r),this.results=new K4.Minipass({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}};js.GlobStream=T0});var x0=f(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.Glob=void 0;var G4=Ns(),H4=require("node:url"),um=mM(),V4=y0(),cm=TM(),z4=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",w0=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,H4.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||z4,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=n.platform==="win32"?um.PathScurryWin32:n.platform==="darwin"?um.PathScurryDarwin:n.platform?um.PathScurryPosix:um.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new G4.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new V4.Pattern(u,l,0,this.platform)})}async walk(){return[...await new cm.GlobWalker(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 cm.GlobWalker(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 cm.GlobStream(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 cm.GlobStream(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()}};lm.Glob=w0});var E0=f(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.hasMagic=void 0;var X4=Ns(),Y4=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new X4.Minimatch(n,e).hasMagic())return!0;return!1};pm.hasMagic=Y4});var kM=f(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.glob=Ee.sync=Ee.iterate=Ee.iterateSync=Ee.stream=Ee.streamSync=Ee.Ignore=Ee.hasMagic=Ee.Glob=Ee.unescape=Ee.escape=void 0;Ee.globStreamSync=Al;Ee.globStream=k0;Ee.globSync=A0;Ee.globIterateSync=Pl;Ee.globIterate=P0;var wM=Ns(),Mo=x0(),J4=E0(),EM=Ns();Object.defineProperty(Ee,"escape",{enumerable:!0,get:function(){return EM.escape}});Object.defineProperty(Ee,"unescape",{enumerable:!0,get:function(){return EM.unescape}});var Q4=x0();Object.defineProperty(Ee,"Glob",{enumerable:!0,get:function(){return Q4.Glob}});var Z4=E0();Object.defineProperty(Ee,"hasMagic",{enumerable:!0,get:function(){return Z4.hasMagic}});var ez=_0();Object.defineProperty(Ee,"Ignore",{enumerable:!0,get:function(){return ez.Ignore}});function Al(t,e={}){return new Mo.Glob(t,e).streamSync()}function k0(t,e={}){return new Mo.Glob(t,e).stream()}function A0(t,e={}){return new Mo.Glob(t,e).walkSync()}async function xM(t,e={}){return new Mo.Glob(t,e).walk()}function Pl(t,e={}){return new Mo.Glob(t,e).iterateSync()}function P0(t,e={}){return new Mo.Glob(t,e).iterate()}Ee.streamSync=Al;Ee.stream=Object.assign(k0,{sync:Al});Ee.iterateSync=Pl;Ee.iterate=Object.assign(P0,{sync:Pl});Ee.sync=Object.assign(A0,{stream:Al,iterate:Pl});Ee.glob=Object.assign(xM,{glob:xM,globSync:A0,sync:Ee.sync,globStream:k0,stream:Ee.stream,globStreamSync:Al,streamSync:Ee.streamSync,globIterate:P0,iterate:Ee.iterate,globIterateSync:Pl,iterateSync:Ee.iterateSync,Glob:Mo.Glob,hasMagic:J4.hasMagic,escape:wM.escape,unescape:wM.unescape});Ee.glob.glob=Ee.glob});var OM=f(mu=>{"use strict";var PM=mu&&mu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mu,"__esModule",{value:!0});mu.FileSystem=void 0;var tz=fb(),AM=(EC(),FM(xC)),nz=PM(require("events")),hm=cg(),rz=PM(require("fs")),iz=Ig(),sz=sl(),oz=kM(),O0=class extends nz.default{constructor(e){super(),this._connection=null,this._context=e,this._textDocumentManager=new tz.TextDocuments(AM.TextDocument),this._tempTextDocumentCache=new sz.LRUCache({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._connection?.workspace==null)return[];let e=await this._connection.workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>hm.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,oz.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>hm.URI.file(o))}async findExistingPath(e,...n){if(await this.getTextDocument(e)!=null)return e;if(n.length===0)return null;try{let i=await Promise.any(n.map(async s=>{if(await this.getTextDocument(s)!=null)return s;throw new Error("Alternative path could not resolve")}));return i??null}catch{return null}}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=hm.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await rz.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=AM.TextDocument.create(e,iz.LanguageId,0,s),this._connection?.sendNotification("textDocument/didOpen",{textDocument:i})}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(hm.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._connection=e,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};mu.FileSystem=O0});var RM=f(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.NodeContext=void 0;var R0=fb(),D0=Ig(),az=OM(),I0=class extends D0.CoreContext{constructor(){super(),this.documentManager=new D0.DocumentManager().setContext(this),this.documentMerger=new D0.DocumentMerger,this.connection=(0,R0.createConnection)(R0.ProposedFeatures.all),this.fs=new az.FileSystem(this)}createSemanticTokensBuilder(){return new R0.SemanticTokensBuilder}};dm.NodeContext=I0});Object.defineProperty(exports,"__esModule",{value:!0});var uz=RM(),Jr=Ig(),DM=new uz.NodeContext;DM.on("ready",t=>{(0,Jr.activateAutocomplete)(t),(0,Jr.activateColor)(t),(0,Jr.activateDefinition)(t),(0,Jr.activateDiagnostic)(t),(0,Jr.activateFormatter)(t),(0,Jr.activateHover)(t),(0,Jr.activateSignature)(t),(0,Jr.activateSubscriptions)(t),(0,Jr.activateSymbol)(t),(0,Jr.activateSemantic)(t),(0,Jr.activateFoldingRange)(t)});DM.listen();
|