miniscript-languageserver 1.7.4 → 1.7.6
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 +57 -57
- package/package.json +3 -3
package/index.js
CHANGED
@@ -1,59 +1,59 @@
|
|
1
|
-
"use strict";var vp=Object.defineProperty;var lP=Object.getOwnPropertyDescriptor;var cP=Object.getOwnPropertyNames;var hP=Object.prototype.hasOwnProperty;var fP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dP=(t,e)=>{for(var n in e)vp(t,n,{get:e[n],enumerable:!0})},pP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cP(e))!hP.call(t,i)&&i!==n&&vp(t,i,{get:()=>e[i],enumerable:!(r=lP(e,i))||r.enumerable});return t};var gP=t=>pP(vp({},"__esModule",{value:!0}),t);var Ll=m(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.thenable=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function mP(t){return t===!0||t===!1}At.boolean=mP;function aS(t){return typeof t=="string"||t instanceof String}At.string=aS;function yP(t){return typeof t=="number"||t instanceof Number}At.number=yP;function bP(t){return t instanceof Error}At.error=bP;function uS(t){return typeof t=="function"}At.func=uS;function lS(t){return Array.isArray(t)}At.array=lS;function vP(t){return lS(t)&&t.every(e=>aS(e))}At.stringArray=vP;function _P(t,e){return Array.isArray(t)&&t.every(e)}At.typedArray=_P;function TP(t){return t&&uS(t.then)}At.thenable=TP});var no=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.stringArray=en.array=en.func=en.error=en.number=en.string=en.boolean=void 0;function SP(t){return t===!0||t===!1}en.boolean=SP;function cS(t){return typeof t=="string"||t instanceof String}en.string=cS;function kP(t){return typeof t=="number"||t instanceof Number}en.number=kP;function wP(t){return t instanceof Error}en.error=wP;function xP(t){return typeof t=="function"}en.func=xP;function hS(t){return Array.isArray(t)}en.array=hS;function EP(t){return hS(t)&&t.every(e=>cS(e))}en.stringArray=EP});var Hp=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.Message=oe.NotificationType9=oe.NotificationType8=oe.NotificationType7=oe.NotificationType6=oe.NotificationType5=oe.NotificationType4=oe.NotificationType3=oe.NotificationType2=oe.NotificationType1=oe.NotificationType0=oe.NotificationType=oe.RequestType9=oe.RequestType8=oe.RequestType7=oe.RequestType6=oe.RequestType5=oe.RequestType4=oe.RequestType3=oe.RequestType2=oe.RequestType1=oe.RequestType=oe.RequestType0=oe.AbstractMessageSignature=oe.ParameterStructures=oe.ResponseError=oe.ErrorCodes=void 0;var cs=no(),_p;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(_p||(oe.ErrorCodes=_p={}));var Tp=class t extends Error{constructor(e,n,r){super(n),this.code=cs.number(e)?e:_p.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};oe.ResponseError=Tp;var Sn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};oe.ParameterStructures=Sn;Sn.auto=new Sn("auto");Sn.byPosition=new Sn("byPosition");Sn.byName=new Sn("byName");var Ze=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Sn.auto}};oe.AbstractMessageSignature=Ze;var Sp=class extends Ze{constructor(e){super(e,0)}};oe.RequestType0=Sp;var kp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType=kp;var wp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType1=wp;var xp=class extends Ze{constructor(e){super(e,2)}};oe.RequestType2=xp;var Ep=class extends Ze{constructor(e){super(e,3)}};oe.RequestType3=Ep;var Ap=class extends Ze{constructor(e){super(e,4)}};oe.RequestType4=Ap;var Op=class extends Ze{constructor(e){super(e,5)}};oe.RequestType5=Op;var Cp=class extends Ze{constructor(e){super(e,6)}};oe.RequestType6=Cp;var Rp=class extends Ze{constructor(e){super(e,7)}};oe.RequestType7=Rp;var Pp=class extends Ze{constructor(e){super(e,8)}};oe.RequestType8=Pp;var Dp=class extends Ze{constructor(e){super(e,9)}};oe.RequestType9=Dp;var Ip=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType=Ip;var Mp=class extends Ze{constructor(e){super(e,0)}};oe.NotificationType0=Mp;var Lp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType1=Lp;var Np=class extends Ze{constructor(e){super(e,2)}};oe.NotificationType2=Np;var qp=class extends Ze{constructor(e){super(e,3)}};oe.NotificationType3=qp;var jp=class extends Ze{constructor(e){super(e,4)}};oe.NotificationType4=jp;var Fp=class extends Ze{constructor(e){super(e,5)}};oe.NotificationType5=Fp;var $p=class extends Ze{constructor(e){super(e,6)}};oe.NotificationType6=$p;var Bp=class extends Ze{constructor(e){super(e,7)}};oe.NotificationType7=Bp;var Up=class extends Ze{constructor(e){super(e,8)}};oe.NotificationType8=Up;var Wp=class extends Ze{constructor(e){super(e,9)}};oe.NotificationType9=Wp;var fS;(function(t){function e(i){let s=i;return s&&cs.string(s.method)&&(cs.string(s.id)||cs.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&cs.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(cs.string(s.id)||cs.number(s.id)||s.id===null)}t.isResponse=r})(fS||(oe.Message=fS={}))});var Kp=m(xi=>{"use strict";var dS;Object.defineProperty(xi,"__esModule",{value:!0});xi.LRUCache=xi.LinkedMap=xi.Touch=void 0;var tn;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(tn||(xi.Touch=tn={}));var Nl=class{constructor(){this[dS]="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=tn.None){let r=this._map.get(e);if(r)return n!==tn.None&&this.touch(r,n),r.value}set(e,n,r=tn.None){let i=this._map.get(e);if(i)i.value=n,r!==tn.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case tn.None:this.addItemLast(i);break;case tn.First:this.addItemFirst(i);break;case tn.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}[(dS=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!==tn.First&&n!==tn.Last)){if(n===tn.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===tn.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)}};xi.LinkedMap=Nl;var Gp=class extends Nl{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=tn.AsNew){return super.get(e,n)}peek(e){return super.get(e,tn.None)}set(e,n){return super.set(e,n,tn.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};xi.LRUCache=Gp});var gS=m(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.Disposable=void 0;var pS;(function(t){function e(n){return{dispose:n}}t.create=e})(pS||(ql.Disposable=pS={}))});var Ei=m(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var zp;function Vp(){if(zp===void 0)throw new Error("No runtime abstraction layer installed");return zp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");zp=n}t.install=e})(Vp||(Vp={}));Xp.default=Vp});var io=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.Emitter=ro.Event=void 0;var AP=Ei(),mS;(function(t){let e={dispose(){}};t.None=function(){return e}})(mS||(ro.Event=mS={}));var Yp=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,AP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},jl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Yp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ro.Emitter=jl;jl._noop=function(){}});var Bl=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var OP=Ei(),CP=no(),Jp=io(),Fl;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Jp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Jp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||CP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Fl||(so.CancellationToken=Fl={}));var RP=Object.freeze(function(t,e){let n=(0,OP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),$l=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?RP:(this._emitter||(this._emitter=new Jp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Qp=class{get token(){return this._token||(this._token=new $l),this._token}cancel(){this._token?this._token.cancel():this._token=Fl.Cancelled}dispose(){this._token?this._token instanceof $l&&this._token.dispose():this._token=Fl.None}};so.CancellationTokenSource=Qp});var yS=m(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.SharedArrayReceiverStrategy=oo.SharedArraySenderStrategy=void 0;var PP=Bl(),Ra;(function(t){t.Continue=0,t.Cancelled=1})(Ra||(Ra={}));var Zp=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]=Ra.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,Ra.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};oo.SharedArraySenderStrategy=Zp;var eg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ra.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},tg=class{constructor(e){this.token=new eg(e)}cancel(){}dispose(){}},ng=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new PP.CancellationTokenSource:new tg(n)}};oo.SharedArrayReceiverStrategy=ng});var ig=m(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.Semaphore=void 0;var DP=Ei(),rg=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,DP.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()}}};Ul.Semaphore=rg});var vS=m(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ReadableStreamMessageReader=Ai.AbstractMessageReader=Ai.MessageReader=void 0;var og=Ei(),ao=no(),sg=io(),IP=ig(),bS;(function(t){function e(n){let r=n;return r&&ao.func(r.listen)&&ao.func(r.dispose)&&ao.func(r.onError)&&ao.func(r.onClose)&&ao.func(r.onPartialMessage)}t.is=e})(bS||(Ai.MessageReader=bS={}));var Wl=class{constructor(){this.errorEmitter=new sg.Emitter,this.closeEmitter=new sg.Emitter,this.partialMessageEmitter=new sg.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ao.string(e.message)?e.message:"unknown"}`)}};Ai.AbstractMessageReader=Wl;var ag;(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 l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)u.set(l.name,l)}return a===void 0&&(a=(0,og.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(ag||(ag={}));var ug=class extends Wl{constructor(e,n){super(),this.readable=e,this.options=ag.fromOptions(n),this.buffer=(0,og.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new IP.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
|
-
${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,og.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))}};Ai.ReadableStreamMessageReader=ug});var
|
3
|
-
`,
|
1
|
+
"use strict";var vp=Object.defineProperty;var lP=Object.getOwnPropertyDescriptor;var cP=Object.getOwnPropertyNames;var hP=Object.prototype.hasOwnProperty;var fP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dP=(t,e)=>{for(var n in e)vp(t,n,{get:e[n],enumerable:!0})},pP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cP(e))!hP.call(t,i)&&i!==n&&vp(t,i,{get:()=>e[i],enumerable:!(r=lP(e,i))||r.enumerable});return t};var gP=t=>pP(vp({},"__esModule",{value:!0}),t);var Ll=m(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.thenable=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function mP(t){return t===!0||t===!1}Ot.boolean=mP;function oS(t){return typeof t=="string"||t instanceof String}Ot.string=oS;function yP(t){return typeof t=="number"||t instanceof Number}Ot.number=yP;function bP(t){return t instanceof Error}Ot.error=bP;function aS(t){return typeof t=="function"}Ot.func=aS;function uS(t){return Array.isArray(t)}Ot.array=uS;function vP(t){return uS(t)&&t.every(e=>oS(e))}Ot.stringArray=vP;function _P(t,e){return Array.isArray(t)&&t.every(e)}Ot.typedArray=_P;function TP(t){return t&&aS(t.then)}Ot.thenable=TP});var no=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.stringArray=en.array=en.func=en.error=en.number=en.string=en.boolean=void 0;function SP(t){return t===!0||t===!1}en.boolean=SP;function lS(t){return typeof t=="string"||t instanceof String}en.string=lS;function kP(t){return typeof t=="number"||t instanceof Number}en.number=kP;function wP(t){return t instanceof Error}en.error=wP;function xP(t){return typeof t=="function"}en.func=xP;function cS(t){return Array.isArray(t)}en.array=cS;function EP(t){return cS(t)&&t.every(e=>lS(e))}en.stringArray=EP});var Hp=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.Message=oe.NotificationType9=oe.NotificationType8=oe.NotificationType7=oe.NotificationType6=oe.NotificationType5=oe.NotificationType4=oe.NotificationType3=oe.NotificationType2=oe.NotificationType1=oe.NotificationType0=oe.NotificationType=oe.RequestType9=oe.RequestType8=oe.RequestType7=oe.RequestType6=oe.RequestType5=oe.RequestType4=oe.RequestType3=oe.RequestType2=oe.RequestType1=oe.RequestType=oe.RequestType0=oe.AbstractMessageSignature=oe.ParameterStructures=oe.ResponseError=oe.ErrorCodes=void 0;var cs=no(),_p;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(_p||(oe.ErrorCodes=_p={}));var Tp=class t extends Error{constructor(e,n,r){super(n),this.code=cs.number(e)?e:_p.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};oe.ResponseError=Tp;var Sn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};oe.ParameterStructures=Sn;Sn.auto=new Sn("auto");Sn.byPosition=new Sn("byPosition");Sn.byName=new Sn("byName");var Ze=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Sn.auto}};oe.AbstractMessageSignature=Ze;var Sp=class extends Ze{constructor(e){super(e,0)}};oe.RequestType0=Sp;var kp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType=kp;var wp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.RequestType1=wp;var xp=class extends Ze{constructor(e){super(e,2)}};oe.RequestType2=xp;var Ep=class extends Ze{constructor(e){super(e,3)}};oe.RequestType3=Ep;var Ap=class extends Ze{constructor(e){super(e,4)}};oe.RequestType4=Ap;var Op=class extends Ze{constructor(e){super(e,5)}};oe.RequestType5=Op;var Cp=class extends Ze{constructor(e){super(e,6)}};oe.RequestType6=Cp;var Rp=class extends Ze{constructor(e){super(e,7)}};oe.RequestType7=Rp;var Pp=class extends Ze{constructor(e){super(e,8)}};oe.RequestType8=Pp;var Dp=class extends Ze{constructor(e){super(e,9)}};oe.RequestType9=Dp;var Ip=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType=Ip;var Mp=class extends Ze{constructor(e){super(e,0)}};oe.NotificationType0=Mp;var Lp=class extends Ze{constructor(e,n=Sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};oe.NotificationType1=Lp;var Np=class extends Ze{constructor(e){super(e,2)}};oe.NotificationType2=Np;var qp=class extends Ze{constructor(e){super(e,3)}};oe.NotificationType3=qp;var jp=class extends Ze{constructor(e){super(e,4)}};oe.NotificationType4=jp;var Fp=class extends Ze{constructor(e){super(e,5)}};oe.NotificationType5=Fp;var $p=class extends Ze{constructor(e){super(e,6)}};oe.NotificationType6=$p;var Bp=class extends Ze{constructor(e){super(e,7)}};oe.NotificationType7=Bp;var Up=class extends Ze{constructor(e){super(e,8)}};oe.NotificationType8=Up;var Wp=class extends Ze{constructor(e){super(e,9)}};oe.NotificationType9=Wp;var hS;(function(t){function e(i){let s=i;return s&&cs.string(s.method)&&(cs.string(s.id)||cs.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&cs.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(cs.string(s.id)||cs.number(s.id)||s.id===null)}t.isResponse=r})(hS||(oe.Message=hS={}))});var zp=m(xi=>{"use strict";var fS;Object.defineProperty(xi,"__esModule",{value:!0});xi.LRUCache=xi.LinkedMap=xi.Touch=void 0;var tn;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(tn||(xi.Touch=tn={}));var Nl=class{constructor(){this[fS]="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=tn.None){let r=this._map.get(e);if(r)return n!==tn.None&&this.touch(r,n),r.value}set(e,n,r=tn.None){let i=this._map.get(e);if(i)i.value=n,r!==tn.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case tn.None:this.addItemLast(i);break;case tn.First:this.addItemFirst(i);break;case tn.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}[(fS=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!==tn.First&&n!==tn.Last)){if(n===tn.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===tn.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)}};xi.LinkedMap=Nl;var Gp=class extends Nl{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=tn.AsNew){return super.get(e,n)}peek(e){return super.get(e,tn.None)}set(e,n){return super.set(e,n,tn.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};xi.LRUCache=Gp});var pS=m(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.Disposable=void 0;var dS;(function(t){function e(n){return{dispose:n}}t.create=e})(dS||(ql.Disposable=dS={}))});var Ei=m(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Kp;function Vp(){if(Kp===void 0)throw new Error("No runtime abstraction layer installed");return Kp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Kp=n}t.install=e})(Vp||(Vp={}));Xp.default=Vp});var io=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.Emitter=ro.Event=void 0;var AP=Ei(),gS;(function(t){let e={dispose(){}};t.None=function(){return e}})(gS||(ro.Event=gS={}));var Yp=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,AP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},jl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Yp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ro.Emitter=jl;jl._noop=function(){}});var Bl=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CancellationTokenSource=so.CancellationToken=void 0;var OP=Ei(),CP=no(),Jp=io(),Fl;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Jp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Jp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||CP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Fl||(so.CancellationToken=Fl={}));var RP=Object.freeze(function(t,e){let n=(0,OP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),$l=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?RP:(this._emitter||(this._emitter=new Jp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Qp=class{get token(){return this._token||(this._token=new $l),this._token}cancel(){this._token?this._token.cancel():this._token=Fl.Cancelled}dispose(){this._token?this._token instanceof $l&&this._token.dispose():this._token=Fl.None}};so.CancellationTokenSource=Qp});var mS=m(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.SharedArrayReceiverStrategy=oo.SharedArraySenderStrategy=void 0;var PP=Bl(),Ra;(function(t){t.Continue=0,t.Cancelled=1})(Ra||(Ra={}));var Zp=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]=Ra.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,Ra.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};oo.SharedArraySenderStrategy=Zp;var eg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ra.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},tg=class{constructor(e){this.token=new eg(e)}cancel(){}dispose(){}},ng=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new PP.CancellationTokenSource:new tg(n)}};oo.SharedArrayReceiverStrategy=ng});var ig=m(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.Semaphore=void 0;var DP=Ei(),rg=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,DP.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()}}};Ul.Semaphore=rg});var bS=m(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ReadableStreamMessageReader=Ai.AbstractMessageReader=Ai.MessageReader=void 0;var og=Ei(),ao=no(),sg=io(),IP=ig(),yS;(function(t){function e(n){let r=n;return r&&ao.func(r.listen)&&ao.func(r.dispose)&&ao.func(r.onError)&&ao.func(r.onClose)&&ao.func(r.onPartialMessage)}t.is=e})(yS||(Ai.MessageReader=yS={}));var Wl=class{constructor(){this.errorEmitter=new sg.Emitter,this.closeEmitter=new sg.Emitter,this.partialMessageEmitter=new sg.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ao.string(e.message)?e.message:"unknown"}`)}};Ai.AbstractMessageReader=Wl;var ag;(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 l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)u.set(l.name,l)}return a===void 0&&(a=(0,og.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(ag||(ag={}));var ug=class extends Wl{constructor(e,n){super(),this.readable=e,this.options=ag.fromOptions(n),this.buffer=(0,og.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new IP.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
|
+
${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,og.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))}};Ai.ReadableStreamMessageReader=ug});var kS=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.WriteableStreamMessageWriter=Oi.AbstractMessageWriter=Oi.MessageWriter=void 0;var vS=Ei(),Pa=no(),MP=ig(),_S=io(),LP="Content-Length: ",TS=`\r
|
3
|
+
`,SS;(function(t){function e(n){let r=n;return r&&Pa.func(r.dispose)&&Pa.func(r.onClose)&&Pa.func(r.onError)&&Pa.func(r.write)}t.is=e})(SS||(Oi.MessageWriter=SS={}));var Hl=class{constructor(){this.errorEmitter=new _S.Emitter,this.closeEmitter=new _S.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: ${Pa.string(e.message)?e.message:"unknown"}`)}};Oi.AbstractMessageWriter=Hl;var lg;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,vS.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,vS.default)().applicationJson.encoder}}t.fromOptions=e})(lg||(lg={}));var cg=class extends Hl{constructor(e,n){super(),this.writable=e,this.options=lg.fromOptions(n),this.errorCount=0,this.writeSemaphore=new MP.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(LP,r.byteLength.toString(),TS),i.push(TS),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()}};Oi.WriteableStreamMessageWriter=cg});var wS=m(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.AbstractMessageBuffer=void 0;var NP=13,qP=10,jP=`\r
|
4
4
|
`,hg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(i=0;i<l.length;){switch(l[i]){case NP:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case qP:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=l.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,u=this.toString(o,"ascii").split(jP);if(u.length<2)return a;for(let l=0;l<u.length-2;l++){let c=u[l],h=c.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
|
5
|
-
${c}`);let f=c.substr(0,h),g=c.substr(h+1).trim();a.set(e?f.toLowerCase():f,g)}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}};Gl.AbstractMessageBuffer=hg});var
|
5
|
+
${c}`);let f=c.substr(0,h),g=c.substr(h+1).trim();a.set(e?f.toLowerCase():f,g)}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}};Gl.AbstractMessageBuffer=hg});var CS=m(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.ConnectionOptions=_e.MessageStrategy=_e.CancellationStrategy=_e.CancellationSenderStrategy=_e.CancellationReceiverStrategy=_e.RequestCancellationReceiverStrategy=_e.IdCancellationReceiverStrategy=_e.ConnectionStrategy=_e.ConnectionError=_e.ConnectionErrors=_e.LogTraceNotification=_e.SetTraceNotification=_e.TraceFormat=_e.TraceValues=_e.Trace=_e.NullLogger=_e.ProgressType=_e.ProgressToken=void 0;var xS=Ei(),ct=no(),de=Hp(),ES=zp(),Da=io(),fg=Bl(),La;(function(t){t.type=new de.NotificationType("$/cancelRequest")})(La||(La={}));var dg;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(dg||(_e.ProgressToken=dg={}));var Ia;(function(t){t.type=new de.NotificationType("$/progress")})(Ia||(Ia={}));var pg=class{constructor(){}};_e.ProgressType=pg;var gg;(function(t){function e(n){return ct.func(n)}t.is=e})(gg||(gg={}));_e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var qe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(qe||(_e.Trace=qe={}));var AS;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(AS||(_e.TraceValues=AS={}));(function(t){function e(r){if(!ct.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})(qe||(_e.Trace=qe={}));var In;(function(t){t.Text="text",t.JSON="json"})(In||(_e.TraceFormat=In={}));(function(t){function e(n){return ct.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(In||(_e.TraceFormat=In={}));var mg;(function(t){t.type=new de.NotificationType("$/setTrace")})(mg||(_e.SetTraceNotification=mg={}));var zl;(function(t){t.type=new de.NotificationType("$/logTrace")})(zl||(_e.LogTraceNotification=zl={}));var Ma;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ma||(_e.ConnectionErrors=Ma={}));var uo=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};_e.ConnectionError=uo;var yg;(function(t){function e(n){let r=n;return r&&ct.func(r.cancelUndispatched)}t.is=e})(yg||(_e.ConnectionStrategy=yg={}));var Kl;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&ct.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ct.func(r.dispose))}t.is=e})(Kl||(_e.IdCancellationReceiverStrategy=Kl={}));var bg;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&ct.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ct.func(r.dispose))}t.is=e})(bg||(_e.RequestCancellationReceiverStrategy=bg={}));var Vl;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new fg.CancellationTokenSource}});function e(n){return Kl.is(n)||bg.is(n)}t.is=e})(Vl||(_e.CancellationReceiverStrategy=Vl={}));var Xl;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(La.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&ct.func(r.sendCancellation)&&ct.func(r.cleanup)}t.is=e})(Xl||(_e.CancellationSenderStrategy=Xl={}));var Yl;(function(t){t.Message=Object.freeze({receiver:Vl.Message,sender:Xl.Message});function e(n){let r=n;return r&&Vl.is(r.receiver)&&Xl.is(r.sender)}t.is=e})(Yl||(_e.CancellationStrategy=Yl={}));var Jl;(function(t){function e(n){let r=n;return r&&ct.func(r.handleMessage)}t.is=e})(Jl||(_e.MessageStrategy=Jl={}));var OS;(function(t){function e(n){let r=n;return r&&(Yl.is(r.cancellationStrategy)||yg.is(r.connectionStrategy)||Jl.is(r.messageStrategy))}t.is=e})(OS||(_e.ConnectionOptions=OS={}));var yr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(yr||(yr={}));function FP(t,e,n,r){let i=n!==void 0?n:_e.NullLogger,s=0,o=0,a=0,u="2.0",l,c=new Map,h,f=new Map,g=new Map,v,b=new ES.LinkedMap,O=new Map,A=new Set,k=new Map,S=qe.Off,_=In.Text,N,R=yr.New,G=new Da.Emitter,ie=new Da.Emitter,ue=new Da.Emitter,z=new Da.Emitter,C=new Da.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:Yl.Message;function L(w){if(w===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+w.toString()}function F(w){return w===null?"res-unknown-"+(++a).toString():"res-"+w.toString()}function me(){return"not-"+(++o).toString()}function pe(w,$){de.Message.isRequest($)?w.set(L($.id),$):de.Message.isResponse($)?w.set(F($.id),$):w.set(me(),$)}function jt(w){}function Tt(){return R===yr.Listening}function We(){return R===yr.Closed}function Tn(){return R===yr.Disposed}function Js(){(R===yr.New||R===yr.Listening)&&(R=yr.Closed,ie.fire(void 0))}function us(w){G.fire([w,void 0,void 0])}function Tl(w){G.fire(w)}t.onClose(Js),t.onError(us),e.onClose(Js),e.onError(Tl);function xa(){v||b.size===0||(v=(0,xS.default)().timer.setImmediate(()=>{v=void 0,Sl()}))}function Ea(w){de.Message.isRequest(w)?wl(w):de.Message.isNotification(w)?El(w):de.Message.isResponse(w)?xl(w):Qs(w)}function Sl(){if(b.size===0)return;let w=b.shift();try{let $=r?.messageStrategy;Jl.is($)?$.handleMessage(w,Ea):Ea(w)}finally{xa()}}let kl=w=>{try{if(de.Message.isNotification(w)&&w.method===La.type.method){let $=w.params.id,V=L($),te=b.get(V);if(de.Message.isRequest(te)){let Fe=r?.connectionStrategy,Qe=Fe&&Fe.cancelUndispatched?Fe.cancelUndispatched(te,jt):void 0;if(Qe&&(Qe.error!==void 0||Qe.result!==void 0)){b.delete(V),k.delete($),Qe.id=te.id,ls(Qe,w.method,Date.now()),e.write(Qe).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ke=k.get($);if(Ke!==void 0){Ke.cancel(),Zs(w);return}else A.add($)}pe(b,w)}finally{xa()}};function wl(w){if(Tn())return;function $(xe,Ve,Me){let dt={jsonrpc:u,id:w.id};xe instanceof de.ResponseError?dt.error=xe.toJson():dt.result=xe===void 0?null:xe,ls(dt,Ve,Me),e.write(dt).catch(()=>i.error("Sending response failed."))}function V(xe,Ve,Me){let dt={jsonrpc:u,id:w.id,error:xe.toJson()};ls(dt,Ve,Me),e.write(dt).catch(()=>i.error("Sending response failed."))}function te(xe,Ve,Me){xe===void 0&&(xe=null);let dt={jsonrpc:u,id:w.id,result:xe};ls(dt,Ve,Me),e.write(dt).catch(()=>i.error("Sending response failed."))}Cl(w);let Ke=c.get(w.method),Fe,Qe;Ke&&(Fe=Ke.type,Qe=Ke.handler);let it=Date.now();if(Qe||l){let xe=w.id??String(Date.now()),Ve=Kl.is(M.receiver)?M.receiver.createCancellationTokenSource(xe):M.receiver.createCancellationTokenSource(w);w.id!==null&&A.has(w.id)&&Ve.cancel(),w.id!==null&&k.set(xe,Ve);try{let Me;if(Qe)if(w.params===void 0){if(Fe!==void 0&&Fe.numberOfParams!==0){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines ${Fe.numberOfParams} params but received none.`),w.method,it);return}Me=Qe(Ve.token)}else if(Array.isArray(w.params)){if(Fe!==void 0&&Fe.parameterStructures===de.ParameterStructures.byName){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by name but received parameters by position`),w.method,it);return}Me=Qe(...w.params,Ve.token)}else{if(Fe!==void 0&&Fe.parameterStructures===de.ParameterStructures.byPosition){V(new de.ResponseError(de.ErrorCodes.InvalidParams,`Request ${w.method} defines parameters by position but received parameters by name`),w.method,it);return}Me=Qe(w.params,Ve.token)}else l&&(Me=l(w.method,w.params,Ve.token));let dt=Me;Me?dt.then?dt.then(Ft=>{k.delete(xe),$(Ft,w.method,it)},Ft=>{k.delete(xe),Ft instanceof de.ResponseError?V(Ft,w.method,it):Ft&&ct.string(Ft.message)?V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${Ft.message}`),w.method,it):V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,it)}):(k.delete(xe),$(Me,w.method,it)):(k.delete(xe),te(Me,w.method,it))}catch(Me){k.delete(xe),Me instanceof de.ResponseError?$(Me,w.method,it):Me&&ct.string(Me.message)?V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed with message: ${Me.message}`),w.method,it):V(new de.ResponseError(de.ErrorCodes.InternalError,`Request ${w.method} failed unexpectedly without providing any details.`),w.method,it)}}else V(new de.ResponseError(de.ErrorCodes.MethodNotFound,`Unhandled method ${w.method}`),w.method,it)}function xl(w){if(!Tn())if(w.id===null)w.error?i.error(`Received response message without id: Error is:
|
6
6
|
${JSON.stringify(w.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let $=w.id,V=O.get($);if(Rl(w,V),V!==void 0){O.delete($);try{if(w.error){let te=w.error;V.reject(new de.ResponseError(te.code,te.message,te.data))}else if(w.result!==void 0)V.resolve(w.result);else throw new Error("Should never happen.")}catch(te){te.message?i.error(`Response handler '${V.method}' failed with message: ${te.message}`):i.error(`Response handler '${V.method}' failed unexpectedly.`)}}}}function El(w){if(Tn())return;let $,V;if(w.method===La.type.method){let te=w.params.id;A.delete(te),Zs(w);return}else{let te=f.get(w.method);te&&(V=te.handler,$=te.type)}if(V||h)try{if(Zs(w),V)if(w.params===void 0)$!==void 0&&$.numberOfParams!==0&&$.parameterStructures!==de.ParameterStructures.byName&&i.error(`Notification ${w.method} defines ${$.numberOfParams} params but received none.`),V();else if(Array.isArray(w.params)){let te=w.params;w.method===Ia.type.method&&te.length===2&&dg.is(te[0])?V({token:te[0],value:te[1]}):($!==void 0&&($.parameterStructures===de.ParameterStructures.byName&&i.error(`Notification ${w.method} defines parameters by name but received parameters by position`),$.numberOfParams!==w.params.length&&i.error(`Notification ${w.method} defines ${$.numberOfParams} params but received ${te.length} arguments`)),V(...te))}else $!==void 0&&$.parameterStructures===de.ParameterStructures.byPosition&&i.error(`Notification ${w.method} defines parameters by position but received parameters by name`),V(w.params);else h&&h(w.method,w.params)}catch(te){te.message?i.error(`Notification handler '${w.method}' failed with message: ${te.message}`):i.error(`Notification handler '${w.method}' failed unexpectedly.`)}else ue.fire(w)}function Qs(w){if(!w){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
7
|
-
${JSON.stringify(w,null,4)}`);let $=w;if(ct.string($.id)||ct.number($.id)){let V=$.id,te=O.get(V);te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function
|
7
|
+
${JSON.stringify(w,null,4)}`);let $=w;if(ct.string($.id)||ct.number($.id)){let V=$.id,te=O.get(V);te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function pr(w){if(w!=null)switch(S){case qe.Verbose:return JSON.stringify(w,null,4);case qe.Compact:return JSON.stringify(w);default:return}}function Al(w){if(!(S===qe.Off||!N))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&w.params&&($=`Params: ${pr(w.params)}
|
8
8
|
|
9
|
-
`),N.log(`Sending request '${w.method} - (${w.id})'.`,$)}else ri("send-request",w)}function Ol(w){if(!(S===qe.Off||!N))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&(w.params?$=`Params: ${
|
9
|
+
`),N.log(`Sending request '${w.method} - (${w.id})'.`,$)}else ri("send-request",w)}function Ol(w){if(!(S===qe.Off||!N))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&(w.params?$=`Params: ${pr(w.params)}
|
10
10
|
|
11
11
|
`:$=`No parameters provided.
|
12
12
|
|
13
|
-
`),N.log(`Sending notification '${w.method}'.`,$)}else ri("send-notification",w)}function ls(w,$,V){if(!(S===qe.Off||!N))if(_===In.Text){let te;(S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?te=`Error data: ${
|
13
|
+
`),N.log(`Sending notification '${w.method}'.`,$)}else ri("send-notification",w)}function ls(w,$,V){if(!(S===qe.Off||!N))if(_===In.Text){let te;(S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?te=`Error data: ${pr(w.error.data)}
|
14
14
|
|
15
|
-
`:w.result?te=`Result: ${
|
15
|
+
`:w.result?te=`Result: ${pr(w.result)}
|
16
16
|
|
17
17
|
`:w.error===void 0&&(te=`No result returned.
|
18
18
|
|
19
|
-
`)),N.log(`Sending response '${$} - (${w.id})'. Processing request took ${Date.now()-V}ms`,te)}else ri("send-response",w)}function Cl(w){if(!(S===qe.Off||!N))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&w.params&&($=`Params: ${
|
19
|
+
`)),N.log(`Sending response '${$} - (${w.id})'. Processing request took ${Date.now()-V}ms`,te)}else ri("send-response",w)}function Cl(w){if(!(S===qe.Off||!N))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&w.params&&($=`Params: ${pr(w.params)}
|
20
20
|
|
21
|
-
`),N.log(`Received request '${w.method} - (${w.id})'.`,$)}else ri("receive-request",w)}function Zs(w){if(!(S===qe.Off||!N||w.method===
|
21
|
+
`),N.log(`Received request '${w.method} - (${w.id})'.`,$)}else ri("receive-request",w)}function Zs(w){if(!(S===qe.Off||!N||w.method===zl.type.method))if(_===In.Text){let $;(S===qe.Verbose||S===qe.Compact)&&(w.params?$=`Params: ${pr(w.params)}
|
22
22
|
|
23
23
|
`:$=`No parameters provided.
|
24
24
|
|
25
|
-
`),N.log(`Received notification '${w.method}'.`,$)}else ri("receive-notification",w)}function Rl(w,$){if(!(S===qe.Off||!N))if(_===In.Text){let V;if((S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?V=`Error data: ${
|
25
|
+
`),N.log(`Received notification '${w.method}'.`,$)}else ri("receive-notification",w)}function Rl(w,$){if(!(S===qe.Off||!N))if(_===In.Text){let V;if((S===qe.Verbose||S===qe.Compact)&&(w.error&&w.error.data?V=`Error data: ${pr(w.error.data)}
|
26
26
|
|
27
|
-
`:w.result?V=`Result: ${
|
27
|
+
`:w.result?V=`Result: ${pr(w.result)}
|
28
28
|
|
29
29
|
`:w.error===void 0&&(V=`No result returned.
|
30
30
|
|
31
|
-
`)),$){let te=w.error?` Request failed: ${w.error.message} (${w.error.code}).`:"";N.log(`Received response '${$.method} - (${w.id})' in ${Date.now()-$.timerStart}ms.${te}`,V)}else N.log(`Received response ${w.id} without active response promise.`,V)}else ri("receive-response",w)}function ri(w,$){if(!N||S===qe.Off)return;let V={isLSPMessage:!0,type:w,message:$,timestamp:Date.now()};N.log(V)}function wi(){if(Ue())throw new uo(Ma.Closed,"Connection is closed.");if(Tn())throw new uo(Ma.Disposed,"Connection is disposed.")}function Pl(){if(Tt())throw new uo(Ma.AlreadyListening,"Connection is already listening")}function Dl(){if(!Tt())throw new Error("Call listen() first.")}function Dr(w){return w===void 0?null:w}function Aa(w){if(w!==null)return w}function Oa(w){return w!=null&&!Array.isArray(w)&&typeof w=="object"}function eo(w,$){switch(w){case de.ParameterStructures.auto:return Oa($)?Aa($):[Dr($)];case de.ParameterStructures.byName:if(!Oa($))throw new Error("Received parameters by name but param is not an object literal.");return Aa($);case de.ParameterStructures.byPosition:return[Dr($)];default:throw new Error(`Unknown parameter structure ${w.toString()}`)}}function Ca(w,$){let V,te=w.numberOfParams;switch(te){case 0:V=void 0;break;case 1:V=eo(w.parameterStructures,$[0]);break;default:V=[];for(let ze=0;ze<$.length&&ze<te;ze++)V.push(Dr($[ze]));if($.length<te)for(let ze=$.length;ze<te;ze++)V.push(null);break}return V}let ii={sendNotification:(w,...$)=>{wi();let V,te;if(ct.string(w)){V=w;let Fe=$[0],Qe=0,it=de.ParameterStructures.auto;de.ParameterStructures.is(Fe)&&(Qe=1,it=Fe);let xe=$.length,Ve=xe-Qe;switch(Ve){case 0:te=void 0;break;case 1:te=eo(it,$[Qe]);break;default:if(it===de.ParameterStructures.byName)throw new Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);te=$.slice(Qe,xe).map(Me=>Dr(Me));break}}else{let Fe=$;V=w.method,te=Ca(w,Fe)}let ze={jsonrpc:u,method:V,params:te};return Ol(ze),e.write(ze).catch(Fe=>{throw i.error("Sending notification failed."),Fe})},onNotification:(w,$)=>{wi();let V;return ct.func(w)?h=w:$&&(ct.string(w)?(V=w,f.set(w,{type:void 0,handler:$})):(V=w.method,f.set(w.method,{type:w,handler:$}))),{dispose:()=>{V!==void 0?f.delete(V):h=void 0}}},onProgress:(w,$,V)=>{if(g.has($))throw new Error(`Progress handler for token ${$} already registered`);return g.set($,V),{dispose:()=>{g.delete($)}}},sendProgress:(w,$,V)=>ii.sendNotification(Ia.type,{token:$,value:V}),onUnhandledProgress:K.event,sendRequest:(w,...$)=>{wi(),Dl();let V,te,ze;if(ct.string(w)){V=w;let xe=$[0],Ve=$[$.length-1],Me=0,dt=de.ParameterStructures.auto;de.ParameterStructures.is(xe)&&(Me=1,dt=xe);let jt=$.length;fg.CancellationToken.is(Ve)&&(jt=jt-1,ze=Ve);let Dn=jt-Me;switch(Dn){case 0:te=void 0;break;case 1:te=eo(dt,$[Me]);break;default:if(dt===de.ParameterStructures.byName)throw new Error(`Received ${Dn} parameters for 'by Name' request parameter structure.`);te=$.slice(Me,jt).map(Il=>Dr(Il));break}}else{let xe=$;V=w.method,te=Ca(w,xe);let Ve=w.numberOfParams;ze=fg.CancellationToken.is(xe[Ve])?xe[Ve]:void 0}let Fe=s++,Qe;ze&&(Qe=ze.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(ii,Fe);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Fe}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${Fe} failed`)})}));let it={jsonrpc:u,id:Fe,method:V,params:te};return Al(it),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(it),new Promise(async(xe,Ve)=>{let Me=Dn=>{xe(Dn),M.sender.cleanup(Fe),Qe?.dispose()},dt=Dn=>{Ve(Dn),M.sender.cleanup(Fe),Qe?.dispose()},jt={method:V,timerStart:Date.now(),resolve:Me,reject:dt};try{await e.write(it),O.set(Fe,jt)}catch(Dn){throw i.error("Sending request failed."),jt.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Dn.message?Dn.message:"Unknown reason")),Dn}})},onRequest:(w,$)=>{wi();let V=null;return gg.is(w)?(V=void 0,l=w):ct.string(w)?(V=null,$!==void 0&&(V=w,c.set(w,{handler:$,type:void 0}))):$!==void 0&&(V=w.method,c.set(w.method,{type:w,handler:$})),{dispose:()=>{V!==null&&(V!==void 0?c.delete(V):l=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(w,$,V)=>{let te=!1,ze=In.Text;V!==void 0&&(ct.boolean(V)?te=V:(te=V.sendNotification||!1,ze=V.traceFormat||In.Text)),S=w,_=ze,S===qe.Off?N=void 0:N=$,te&&!Ue()&&!Tn()&&await ii.sendNotification(mg.type,{value:qe.toString(w)})},onError:G.event,onClose:ie.event,onUnhandledNotification:ue.event,onDispose:C.event,end:()=>{e.end()},dispose:()=>{if(Tn())return;R=mr.Disposed,C.fire(void 0);let w=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let $ of O.values())$.reject(w);O=new Map,k=new Map,A=new Set,b=new AS.LinkedMap,ct.func(e.dispose)&&e.dispose(),ct.func(t.dispose)&&t.dispose()},listen:()=>{wi(),Pl(),R=mr.Listening,t.listen(kl)},inspect:()=>{(0,ES.default)().console.log("inspect")}};return ii.onNotification(Kl.type,w=>{if(S===qe.Off||!N)return;let $=S===qe.Verbose||S===qe.Compact;N.log(w.message,$?w.verbose:void 0)}),ii.onNotification(Ia.type,w=>{let $=g.get(w.token);$?$(w.value):K.fire(w)}),ii}_e.createMessageConnection=FP});var Ql=m(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.ProgressType=j.ProgressToken=j.createMessageConnection=j.NullLogger=j.ConnectionOptions=j.ConnectionStrategy=j.AbstractMessageBuffer=j.WriteableStreamMessageWriter=j.AbstractMessageWriter=j.MessageWriter=j.ReadableStreamMessageReader=j.AbstractMessageReader=j.MessageReader=j.SharedArrayReceiverStrategy=j.SharedArraySenderStrategy=j.CancellationToken=j.CancellationTokenSource=j.Emitter=j.Event=j.Disposable=j.LRUCache=j.Touch=j.LinkedMap=j.ParameterStructures=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.ErrorCodes=j.ResponseError=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType0=j.RequestType=j.Message=j.RAL=void 0;j.MessageStrategy=j.CancellationStrategy=j.CancellationSenderStrategy=j.CancellationReceiverStrategy=j.ConnectionError=j.ConnectionErrors=j.LogTraceNotification=j.SetTraceNotification=j.TraceFormat=j.TraceValues=j.Trace=void 0;var Ye=Hp();Object.defineProperty(j,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(j,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(j,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(j,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(j,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(j,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(j,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(j,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(j,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(j,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(j,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(j,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(j,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(j,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(j,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(j,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(j,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(j,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(j,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(j,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(j,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(j,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(j,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(j,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(j,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(j,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var vg=Kp();Object.defineProperty(j,"LinkedMap",{enumerable:!0,get:function(){return vg.LinkedMap}});Object.defineProperty(j,"LRUCache",{enumerable:!0,get:function(){return vg.LRUCache}});Object.defineProperty(j,"Touch",{enumerable:!0,get:function(){return vg.Touch}});var $P=gS();Object.defineProperty(j,"Disposable",{enumerable:!0,get:function(){return $P.Disposable}});var PS=io();Object.defineProperty(j,"Event",{enumerable:!0,get:function(){return PS.Event}});Object.defineProperty(j,"Emitter",{enumerable:!0,get:function(){return PS.Emitter}});var DS=Bl();Object.defineProperty(j,"CancellationTokenSource",{enumerable:!0,get:function(){return DS.CancellationTokenSource}});Object.defineProperty(j,"CancellationToken",{enumerable:!0,get:function(){return DS.CancellationToken}});var IS=yS();Object.defineProperty(j,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return IS.SharedArraySenderStrategy}});Object.defineProperty(j,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return IS.SharedArrayReceiverStrategy}});var _g=vS();Object.defineProperty(j,"MessageReader",{enumerable:!0,get:function(){return _g.MessageReader}});Object.defineProperty(j,"AbstractMessageReader",{enumerable:!0,get:function(){return _g.AbstractMessageReader}});Object.defineProperty(j,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _g.ReadableStreamMessageReader}});var Tg=wS();Object.defineProperty(j,"MessageWriter",{enumerable:!0,get:function(){return Tg.MessageWriter}});Object.defineProperty(j,"AbstractMessageWriter",{enumerable:!0,get:function(){return Tg.AbstractMessageWriter}});Object.defineProperty(j,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Tg.WriteableStreamMessageWriter}});var BP=xS();Object.defineProperty(j,"AbstractMessageBuffer",{enumerable:!0,get:function(){return BP.AbstractMessageBuffer}});var Vt=RS();Object.defineProperty(j,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(j,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(j,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(j,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(j,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(j,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(j,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(j,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(j,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(j,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(j,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(j,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(j,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(j,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(j,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(j,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(j,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var UP=Ei();j.RAL=UP.default});var NS=m(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var MS=require("util"),oi=Ql(),Zl=class t extends oi.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 MS.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)}};Zl.emptyBuffer=Buffer.allocUnsafe(0);var Sg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),oi.Disposable.create(()=>this.stream.off("data",e))}},kg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.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()}},LS=Object.freeze({messageBuffer:Object.freeze({create:t=>new Zl(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 MS.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Sg(t),asWritableStream:t=>new kg(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 wg(){return LS}(function(t){function e(){oi.RAL.install(LS)}t.install=e})(wg||(wg={}));xg.default=wg});var ds=m(Ce=>{"use strict";var WP=Ce&&Ce.__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]}),HP=Ce&&Ce.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WP(e,t,n)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.createMessageConnection=Ce.createServerSocketTransport=Ce.createClientSocketTransport=Ce.createServerPipeTransport=Ce.createClientPipeTransport=Ce.generateRandomPipeName=Ce.StreamMessageWriter=Ce.StreamMessageReader=Ce.SocketMessageWriter=Ce.SocketMessageReader=Ce.PortMessageWriter=Ce.PortMessageReader=Ce.IPCMessageWriter=Ce.IPCMessageReader=void 0;var lo=NS();lo.default.install();var qS=require("path"),GP=require("os"),KP=require("crypto"),nc=require("net"),Mn=Ql();HP(Ql(),Ce);var Eg=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};Ce.IPCMessageReader=Eg;var Ag=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ce.IPCMessageWriter=Ag;var Og=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};Ce.PortMessageReader=Og;var Cg=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ce.PortMessageWriter=Cg;var hs=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,lo.default)().stream.asReadableStream(e),n)}};Ce.SocketMessageReader=hs;var fs=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ce.SocketMessageWriter=fs;var ec=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,lo.default)().stream.asReadableStream(e),n)}};Ce.StreamMessageReader=ec;var tc=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n)}};Ce.StreamMessageWriter=tc;var jS=process.env.XDG_RUNTIME_DIR,zP=new Map([["linux",107],["darwin",103]]);function VP(){let t=(0,KP.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;jS?e=qS.join(jS,`vscode-ipc-${t}.sock`):e=qS.join(GP.tmpdir(),`vscode-${t}.sock`);let n=zP.get(process.platform);return n!==void 0&&e.length>n&&(0,lo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ce.generateRandomPipeName=VP;function XP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,nc.createServer)(a=>{o.close(),n([new hs(a,e),new fs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ce.createClientPipeTransport=XP;function YP(t,e="utf-8"){let n=(0,nc.createConnection)(t);return[new hs(n,e),new fs(n,e)]}Ce.createServerPipeTransport=YP;function JP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,nc.createServer)(a=>{o.close(),n([new hs(a,e),new fs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ce.createClientSocketTransport=JP;function QP(t,e="utf-8"){let n=(0,nc.createConnection)(t,"127.0.0.1");return[new hs(n,e),new fs(n,e)]}Ce.createServerSocketTransport=QP;function ZP(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function eD(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function tD(t,e,n,r){n||(n=Mn.NullLogger);let i=ZP(t)?new ec(t):t,s=eD(e)?new tc(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(i,s,n,r)}Ce.createMessageConnection=tD});var Rg=m((pH,FS)=>{"use strict";FS.exports=ds()});var ic=m(($S,rc)=>{(function(t){if(typeof rc=="object"&&typeof rc.exports=="object"){var e=t(require,$S);e!==void 0&&(rc.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(p){function x(E){return typeof E=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(E){return typeof E=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(y,d){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),d===Number.MAX_VALUE&&(d=s.MAX_VALUE),{line:y,character:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.line)&&I.uinteger(d.character)}p.is=E})(o||(e.Position=o={}));var a;(function(p){function x(y,d,D,U){if(I.uinteger(y)&&I.uinteger(d)&&I.uinteger(D)&&I.uinteger(U))return{start:o.create(y,d),end:o.create(D,U)};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(D,", ").concat(U,"]"))}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.start)&&o.is(d.end)}p.is=E})(a||(e.Range=a={}));var u;(function(p){function x(y,d){return{uri:y,range:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(I.string(d.uri)||I.undefined(d.uri))}p.is=E})(u||(e.Location=u={}));var l;(function(p){function x(y,d,D,U){return{targetUri:y,targetRange:d,targetSelectionRange:D,originSelectionRange:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.targetRange)&&I.string(d.targetUri)&&a.is(d.targetSelectionRange)&&(a.is(d.originSelectionRange)||I.undefined(d.originSelectionRange))}p.is=E})(l||(e.LocationLink=l={}));var c;(function(p){function x(y,d,D,U){return{red:y,green:d,blue:D,alpha:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.numberRange(d.red,0,1)&&I.numberRange(d.green,0,1)&&I.numberRange(d.blue,0,1)&&I.numberRange(d.alpha,0,1)}p.is=E})(c||(e.Color=c={}));var h;(function(p){function x(y,d){return{range:y,color:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&c.is(d.color)}p.is=E})(h||(e.ColorInformation=h={}));var f;(function(p){function x(y,d,D){return{label:y,textEdit:d,additionalTextEdits:D}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.undefined(d.textEdit)||N.is(d))&&(I.undefined(d.additionalTextEdits)||I.typedArray(d.additionalTextEdits,N.is))}p.is=E})(f||(e.ColorPresentation=f={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var v;(function(p){function x(y,d,D,U,ve,pt){var Xe={startLine:y,endLine:d};return I.defined(D)&&(Xe.startCharacter=D),I.defined(U)&&(Xe.endCharacter=U),I.defined(ve)&&(Xe.kind=ve),I.defined(pt)&&(Xe.collapsedText=pt),Xe}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.startLine)&&I.uinteger(d.startLine)&&(I.undefined(d.startCharacter)||I.uinteger(d.startCharacter))&&(I.undefined(d.endCharacter)||I.uinteger(d.endCharacter))&&(I.undefined(d.kind)||I.string(d.kind))}p.is=E})(v||(e.FoldingRange=v={}));var b;(function(p){function x(y,d){return{location:y,message:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&u.is(d.location)&&I.string(d.message)}p.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var O;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(O||(e.DiagnosticSeverity=O={}));var A;(function(p){p.Unnecessary=1,p.Deprecated=2})(A||(e.DiagnosticTag=A={}));var k;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&I.string(y.href)}p.is=x})(k||(e.CodeDescription=k={}));var S;(function(p){function x(y,d,D,U,ve,pt){var Xe={range:y,message:d};return I.defined(D)&&(Xe.severity=D),I.defined(U)&&(Xe.code=U),I.defined(ve)&&(Xe.source=ve),I.defined(pt)&&(Xe.relatedInformation=pt),Xe}p.create=x;function E(y){var d,D=y;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((d=D.codeDescription)===null||d===void 0?void 0:d.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,b.is))}p.is=E})(S||(e.Diagnostic=S={}));var _;(function(p){function x(y,d){for(var D=[],U=2;U<arguments.length;U++)D[U-2]=arguments[U];var ve={title:y,command:d};return I.defined(D)&&D.length>0&&(ve.arguments=D),ve}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.title)&&I.string(d.command)}p.is=E})(_||(e.Command=_={}));var N;(function(p){function x(D,U){return{range:D,newText:U}}p.replace=x;function E(D,U){return{range:{start:D,end:D},newText:U}}p.insert=E;function y(D){return{range:D,newText:""}}p.del=y;function d(D){var U=D;return I.objectLiteral(U)&&I.string(U.newText)&&a.is(U.range)}p.is=d})(N||(e.TextEdit=N={}));var R;(function(p){function x(y,d,D){var U={label:y};return d!==void 0&&(U.needsConfirmation=d),D!==void 0&&(U.description=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.boolean(d.needsConfirmation)||d.needsConfirmation===void 0)&&(I.string(d.description)||d.description===void 0)}p.is=E})(R||(e.ChangeAnnotation=R={}));var G;(function(p){function x(E){var y=E;return I.string(y)}p.is=x})(G||(e.ChangeAnnotationIdentifier=G={}));var ie;(function(p){function x(D,U,ve){return{range:D,newText:U,annotationId:ve}}p.replace=x;function E(D,U,ve){return{range:{start:D,end:D},newText:U,annotationId:ve}}p.insert=E;function y(D,U){return{range:D,newText:"",annotationId:U}}p.del=y;function d(D){var U=D;return N.is(U)&&(R.is(U.annotationId)||G.is(U.annotationId))}p.is=d})(ie||(e.AnnotatedTextEdit=ie={}));var ue;(function(p){function x(y,d){return{textDocument:y,edits:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&Ue.is(d.textDocument)&&Array.isArray(d.edits)}p.is=E})(ue||(e.TextDocumentEdit=ue={}));var K;(function(p){function x(y,d,D){var U={kind:"create",uri:y};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="create"&&I.string(d.uri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(K||(e.CreateFile=K={}));var C;(function(p){function x(y,d,D,U){var ve={kind:"rename",oldUri:y,newUri:d};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ve.options=D),U!==void 0&&(ve.annotationId=U),ve}p.create=x;function E(y){var d=y;return d&&d.kind==="rename"&&I.string(d.oldUri)&&I.string(d.newUri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(C||(e.RenameFile=C={}));var M;(function(p){function x(y,d,D){var U={kind:"delete",uri:y};return d!==void 0&&(d.recursive!==void 0||d.ignoreIfNotExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="delete"&&I.string(d.uri)&&(d.options===void 0||(d.options.recursive===void 0||I.boolean(d.options.recursive))&&(d.options.ignoreIfNotExists===void 0||I.boolean(d.options.ignoreIfNotExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(M||(e.DeleteFile=M={}));var L;(function(p){function x(E){var y=E;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(d){return I.string(d.kind)?K.is(d)||C.is(d)||M.is(d):ue.is(d)}))}p.is=x})(L||(e.WorkspaceEdit=L={}));var F=function(){function p(x,E){this.edits=x,this.changeAnnotations=E}return p.prototype.insert=function(x,E,y){var d,D;if(y===void 0?d=N.insert(x,E):G.is(y)?(D=y,d=ie.insert(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=ie.insert(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.replace=function(x,E,y){var d,D;if(y===void 0?d=N.replace(x,E):G.is(y)?(D=y,d=ie.replace(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=ie.replace(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.delete=function(x,E){var y,d;if(E===void 0?y=N.del(x):G.is(E)?(d=E,y=ie.del(x,E)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(E),y=ie.del(x,d)),this.edits.push(y),d!==void 0)return d},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),me=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,E){var y;if(G.is(x)?y=x:(y=this.nextId(),E=x),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=E,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),pe=function(){function p(x){var E=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new me(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(y){if(ue.is(y)){var d=new F(y.edits,E._changeAnnotations);E._textEditChanges[y.textDocument.uri]=d}})):x.changes&&Object.keys(x.changes).forEach(function(y){var d=new F(x.changes[y]);E._textEditChanges[y]=d})):this._workspaceEdit={}}return Object.defineProperty(p.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),p.prototype.getTextEditChange=function(x){if(Ue.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:x.uri,version:x.version},y=this._textEditChanges[E.uri];if(!y){var d=[],D={textDocument:E,edits:d};this._workspaceEdit.documentChanges.push(D),y=new F(d,this._changeAnnotations),this._textEditChanges[E.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[x];if(!y){var d=[];this._workspaceEdit.changes[x]=d,y=new F(d),this._textEditChanges[x]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new me,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=K.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=K.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p.prototype.renameFile=function(x,E,y,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(y)||G.is(y)?D=y:d=y;var U,ve;if(D===void 0?U=C.create(x,E,d):(ve=G.is(D)?D:this._changeAnnotations.manage(D),U=C.create(x,E,d,ve)),this._workspaceEdit.documentChanges.push(U),ve!==void 0)return ve},p.prototype.deleteFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=M.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=M.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p}();e.WorkspaceChange=pe;var qt;(function(p){function x(y){return{uri:y}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)}p.is=E})(qt||(e.TextDocumentIdentifier=qt={}));var Tt;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.integer(d.version)}p.is=E})(Tt||(e.VersionedTextDocumentIdentifier=Tt={}));var Ue;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&(d.version===null||I.integer(d.version))}p.is=E})(Ue||(e.OptionalVersionedTextDocumentIdentifier=Ue={}));var Tn;(function(p){function x(y,d,D,U){return{uri:y,languageId:d,version:D,text:U}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.string(d.languageId)&&I.integer(d.version)&&I.string(d.text)}p.is=E})(Tn||(e.TextDocumentItem=Tn={}));var Js;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(E){var y=E;return y===p.PlainText||y===p.Markdown}p.is=x})(Js||(e.MarkupKind=Js={}));var us;(function(p){function x(E){var y=E;return I.objectLiteral(E)&&Js.is(y.kind)&&I.string(y.value)}p.is=x})(us||(e.MarkupContent=us={}));var Tl;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(Tl||(e.CompletionItemKind=Tl={}));var xa;(function(p){p.PlainText=1,p.Snippet=2})(xa||(e.InsertTextFormat=xa={}));var Ea;(function(p){p.Deprecated=1})(Ea||(e.CompletionItemTag=Ea={}));var Sl;(function(p){function x(y,d,D){return{newText:y,insert:d,replace:D}}p.create=x;function E(y){var d=y;return d&&I.string(d.newText)&&a.is(d.insert)&&a.is(d.replace)}p.is=E})(Sl||(e.InsertReplaceEdit=Sl={}));var kl;(function(p){p.asIs=1,p.adjustIndentation=2})(kl||(e.InsertTextMode=kl={}));var wl;(function(p){function x(E){var y=E;return y&&(I.string(y.detail)||y.detail===void 0)&&(I.string(y.description)||y.description===void 0)}p.is=x})(wl||(e.CompletionItemLabelDetails=wl={}));var xl;(function(p){function x(E){return{label:E}}p.create=x})(xl||(e.CompletionItem=xl={}));var El;(function(p){function x(E,y){return{items:E||[],isIncomplete:!!y}}p.create=x})(El||(e.CompletionList=El={}));var Qs;(function(p){function x(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function E(y){var d=y;return I.string(d)||I.objectLiteral(d)&&I.string(d.language)&&I.string(d.value)}p.is=E})(Qs||(e.MarkedString=Qs={}));var dr;(function(p){function x(E){var y=E;return!!y&&I.objectLiteral(y)&&(us.is(y.contents)||Qs.is(y.contents)||I.typedArray(y.contents,Qs.is))&&(E.range===void 0||a.is(E.range))}p.is=x})(dr||(e.Hover=dr={}));var Al;(function(p){function x(E,y){return y?{label:E,documentation:y}:{label:E}}p.create=x})(Al||(e.ParameterInformation=Al={}));var Ol;(function(p){function x(E,y){for(var d=[],D=2;D<arguments.length;D++)d[D-2]=arguments[D];var U={label:E};return I.defined(y)&&(U.documentation=y),I.defined(d)?U.parameters=d:U.parameters=[],U}p.create=x})(Ol||(e.SignatureInformation=Ol={}));var ls;(function(p){p.Text=1,p.Read=2,p.Write=3})(ls||(e.DocumentHighlightKind=ls={}));var Cl;(function(p){function x(E,y){var d={range:E};return I.number(y)&&(d.kind=y),d}p.create=x})(Cl||(e.DocumentHighlight=Cl={}));var Zs;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(Zs||(e.SymbolKind=Zs={}));var Rl;(function(p){p.Deprecated=1})(Rl||(e.SymbolTag=Rl={}));var ri;(function(p){function x(E,y,d,D,U){var ve={name:E,kind:y,location:{uri:D,range:d}};return U&&(ve.containerName=U),ve}p.create=x})(ri||(e.SymbolInformation=ri={}));var wi;(function(p){function x(E,y,d,D){return D!==void 0?{name:E,kind:y,location:{uri:d,range:D}}:{name:E,kind:y,location:{uri:d}}}p.create=x})(wi||(e.WorkspaceSymbol=wi={}));var Pl;(function(p){function x(y,d,D,U,ve,pt){var Xe={name:y,detail:d,kind:D,range:U,selectionRange:ve};return pt!==void 0&&(Xe.children=pt),Xe}p.create=x;function E(y){var d=y;return d&&I.string(d.name)&&I.number(d.kind)&&a.is(d.range)&&a.is(d.selectionRange)&&(d.detail===void 0||I.string(d.detail))&&(d.deprecated===void 0||I.boolean(d.deprecated))&&(d.children===void 0||Array.isArray(d.children))&&(d.tags===void 0||Array.isArray(d.tags))}p.is=E})(Pl||(e.DocumentSymbol=Pl={}));var Dl;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Dl||(e.CodeActionKind=Dl={}));var Dr;(function(p){p.Invoked=1,p.Automatic=2})(Dr||(e.CodeActionTriggerKind=Dr={}));var Aa;(function(p){function x(y,d,D){var U={diagnostics:y};return d!=null&&(U.only=d),D!=null&&(U.triggerKind=D),U}p.create=x;function E(y){var d=y;return I.defined(d)&&I.typedArray(d.diagnostics,S.is)&&(d.only===void 0||I.typedArray(d.only,I.string))&&(d.triggerKind===void 0||d.triggerKind===Dr.Invoked||d.triggerKind===Dr.Automatic)}p.is=E})(Aa||(e.CodeActionContext=Aa={}));var Oa;(function(p){function x(y,d,D){var U={title:y},ve=!0;return typeof d=="string"?(ve=!1,U.kind=d):_.is(d)?U.command=d:U.edit=d,ve&&D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return d&&I.string(d.title)&&(d.diagnostics===void 0||I.typedArray(d.diagnostics,S.is))&&(d.kind===void 0||I.string(d.kind))&&(d.edit!==void 0||d.command!==void 0)&&(d.command===void 0||_.is(d.command))&&(d.isPreferred===void 0||I.boolean(d.isPreferred))&&(d.edit===void 0||L.is(d.edit))}p.is=E})(Oa||(e.CodeAction=Oa={}));var eo;(function(p){function x(y,d){var D={range:y};return I.defined(d)&&(D.data=d),D}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.command)||_.is(d.command))}p.is=E})(eo||(e.CodeLens=eo={}));var Ca;(function(p){function x(y,d){return{tabSize:y,insertSpaces:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.uinteger(d.tabSize)&&I.boolean(d.insertSpaces)}p.is=E})(Ca||(e.FormattingOptions=Ca={}));var ii;(function(p){function x(y,d,D){return{range:y,target:d,data:D}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.target)||I.string(d.target))}p.is=E})(ii||(e.DocumentLink=ii={}));var w;(function(p){function x(y,d){return{range:y,parent:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(d.parent===void 0||p.is(d.parent))}p.is=E})(w||(e.SelectionRange=w={}));var $;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})($||(e.SemanticTokenTypes=$={}));var V;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var te;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=x})(te||(e.SemanticTokens=te={}));var ze;(function(p){function x(y,d){return{range:y,text:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.string(d.text)}p.is=E})(ze||(e.InlineValueText=ze={}));var Fe;(function(p){function x(y,d,D){return{range:y,variableName:d,caseSensitiveLookup:D}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.boolean(d.caseSensitiveLookup)&&(I.string(d.variableName)||d.variableName===void 0)}p.is=E})(Fe||(e.InlineValueVariableLookup=Fe={}));var Qe;(function(p){function x(y,d){return{range:y,expression:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&(I.string(d.expression)||d.expression===void 0)}p.is=E})(Qe||(e.InlineValueEvaluatableExpression=Qe={}));var it;(function(p){function x(y,d){return{frameId:y,stoppedLocation:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(y.stoppedLocation)}p.is=E})(it||(e.InlineValueContext=it={}));var xe;(function(p){p.Type=1,p.Parameter=2;function x(E){return E===1||E===2}p.is=x})(xe||(e.InlayHintKind=xe={}));var Ve;(function(p){function x(y){return{value:y}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&(d.tooltip===void 0||I.string(d.tooltip)||us.is(d.tooltip))&&(d.location===void 0||u.is(d.location))&&(d.command===void 0||_.is(d.command))}p.is=E})(Ve||(e.InlayHintLabelPart=Ve={}));var Me;(function(p){function x(y,d,D){var U={position:y,label:d};return D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.position)&&(I.string(d.label)||I.typedArray(d.label,Ve.is))&&(d.kind===void 0||xe.is(d.kind))&&d.textEdits===void 0||I.typedArray(d.textEdits,N.is)&&(d.tooltip===void 0||I.string(d.tooltip)||us.is(d.tooltip))&&(d.paddingLeft===void 0||I.boolean(d.paddingLeft))&&(d.paddingRight===void 0||I.boolean(d.paddingRight))}p.is=E})(Me||(e.InlayHint=Me={}));var dt;(function(p){function x(E){return{kind:"snippet",value:E}}p.createSnippet=x})(dt||(e.StringValue=dt={}));var jt;(function(p){function x(E,y,d,D){return{insertText:E,filterText:y,range:d,command:D}}p.create=x})(jt||(e.InlineCompletionItem=jt={}));var Dn;(function(p){function x(E){return{items:E}}p.create=x})(Dn||(e.InlineCompletionList=Dn={}));var Il;(function(p){p.Invoked=0,p.Automatic=1})(Il||(e.InlineCompletionTriggerKind=Il={}));var nS;(function(p){function x(E,y){return{range:E,text:y}}p.create=x})(nS||(e.SelectedCompletionInfo=nS={}));var rS;(function(p){function x(E,y){return{triggerKind:E,selectedCompletionInfo:y}}p.create=x})(rS||(e.InlineCompletionContext=rS={}));var iS;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&r.is(y.uri)&&I.string(y.name)}p.is=x})(iS||(e.WorkspaceFolder=iS={})),e.EOL=[`
|
31
|
+
`)),$){let te=w.error?` Request failed: ${w.error.message} (${w.error.code}).`:"";N.log(`Received response '${$.method} - (${w.id})' in ${Date.now()-$.timerStart}ms.${te}`,V)}else N.log(`Received response ${w.id} without active response promise.`,V)}else ri("receive-response",w)}function ri(w,$){if(!N||S===qe.Off)return;let V={isLSPMessage:!0,type:w,message:$,timestamp:Date.now()};N.log(V)}function wi(){if(We())throw new uo(Ma.Closed,"Connection is closed.");if(Tn())throw new uo(Ma.Disposed,"Connection is disposed.")}function Pl(){if(Tt())throw new uo(Ma.AlreadyListening,"Connection is already listening")}function Dl(){if(!Tt())throw new Error("Call listen() first.")}function Dr(w){return w===void 0?null:w}function Aa(w){if(w!==null)return w}function Oa(w){return w!=null&&!Array.isArray(w)&&typeof w=="object"}function eo(w,$){switch(w){case de.ParameterStructures.auto:return Oa($)?Aa($):[Dr($)];case de.ParameterStructures.byName:if(!Oa($))throw new Error("Received parameters by name but param is not an object literal.");return Aa($);case de.ParameterStructures.byPosition:return[Dr($)];default:throw new Error(`Unknown parameter structure ${w.toString()}`)}}function Ca(w,$){let V,te=w.numberOfParams;switch(te){case 0:V=void 0;break;case 1:V=eo(w.parameterStructures,$[0]);break;default:V=[];for(let Ke=0;Ke<$.length&&Ke<te;Ke++)V.push(Dr($[Ke]));if($.length<te)for(let Ke=$.length;Ke<te;Ke++)V.push(null);break}return V}let ii={sendNotification:(w,...$)=>{wi();let V,te;if(ct.string(w)){V=w;let Fe=$[0],Qe=0,it=de.ParameterStructures.auto;de.ParameterStructures.is(Fe)&&(Qe=1,it=Fe);let xe=$.length,Ve=xe-Qe;switch(Ve){case 0:te=void 0;break;case 1:te=eo(it,$[Qe]);break;default:if(it===de.ParameterStructures.byName)throw new Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);te=$.slice(Qe,xe).map(Me=>Dr(Me));break}}else{let Fe=$;V=w.method,te=Ca(w,Fe)}let Ke={jsonrpc:u,method:V,params:te};return Ol(Ke),e.write(Ke).catch(Fe=>{throw i.error("Sending notification failed."),Fe})},onNotification:(w,$)=>{wi();let V;return ct.func(w)?h=w:$&&(ct.string(w)?(V=w,f.set(w,{type:void 0,handler:$})):(V=w.method,f.set(w.method,{type:w,handler:$}))),{dispose:()=>{V!==void 0?f.delete(V):h=void 0}}},onProgress:(w,$,V)=>{if(g.has($))throw new Error(`Progress handler for token ${$} already registered`);return g.set($,V),{dispose:()=>{g.delete($)}}},sendProgress:(w,$,V)=>ii.sendNotification(Ia.type,{token:$,value:V}),onUnhandledProgress:z.event,sendRequest:(w,...$)=>{wi(),Dl();let V,te,Ke;if(ct.string(w)){V=w;let xe=$[0],Ve=$[$.length-1],Me=0,dt=de.ParameterStructures.auto;de.ParameterStructures.is(xe)&&(Me=1,dt=xe);let Ft=$.length;fg.CancellationToken.is(Ve)&&(Ft=Ft-1,Ke=Ve);let Dn=Ft-Me;switch(Dn){case 0:te=void 0;break;case 1:te=eo(dt,$[Me]);break;default:if(dt===de.ParameterStructures.byName)throw new Error(`Received ${Dn} parameters for 'by Name' request parameter structure.`);te=$.slice(Me,Ft).map(Il=>Dr(Il));break}}else{let xe=$;V=w.method,te=Ca(w,xe);let Ve=w.numberOfParams;Ke=fg.CancellationToken.is(xe[Ve])?xe[Ve]:void 0}let Fe=s++,Qe;Ke&&(Qe=Ke.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(ii,Fe);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Fe}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${Fe} failed`)})}));let it={jsonrpc:u,id:Fe,method:V,params:te};return Al(it),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(it),new Promise(async(xe,Ve)=>{let Me=Dn=>{xe(Dn),M.sender.cleanup(Fe),Qe?.dispose()},dt=Dn=>{Ve(Dn),M.sender.cleanup(Fe),Qe?.dispose()},Ft={method:V,timerStart:Date.now(),resolve:Me,reject:dt};try{await e.write(it),O.set(Fe,Ft)}catch(Dn){throw i.error("Sending request failed."),Ft.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Dn.message?Dn.message:"Unknown reason")),Dn}})},onRequest:(w,$)=>{wi();let V=null;return gg.is(w)?(V=void 0,l=w):ct.string(w)?(V=null,$!==void 0&&(V=w,c.set(w,{handler:$,type:void 0}))):$!==void 0&&(V=w.method,c.set(w.method,{type:w,handler:$})),{dispose:()=>{V!==null&&(V!==void 0?c.delete(V):l=void 0)}}},hasPendingResponse:()=>O.size>0,trace:async(w,$,V)=>{let te=!1,Ke=In.Text;V!==void 0&&(ct.boolean(V)?te=V:(te=V.sendNotification||!1,Ke=V.traceFormat||In.Text)),S=w,_=Ke,S===qe.Off?N=void 0:N=$,te&&!We()&&!Tn()&&await ii.sendNotification(mg.type,{value:qe.toString(w)})},onError:G.event,onClose:ie.event,onUnhandledNotification:ue.event,onDispose:C.event,end:()=>{e.end()},dispose:()=>{if(Tn())return;R=yr.Disposed,C.fire(void 0);let w=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let $ of O.values())$.reject(w);O=new Map,k=new Map,A=new Set,b=new ES.LinkedMap,ct.func(e.dispose)&&e.dispose(),ct.func(t.dispose)&&t.dispose()},listen:()=>{wi(),Pl(),R=yr.Listening,t.listen(kl)},inspect:()=>{(0,xS.default)().console.log("inspect")}};return ii.onNotification(zl.type,w=>{if(S===qe.Off||!N)return;let $=S===qe.Verbose||S===qe.Compact;N.log(w.message,$?w.verbose:void 0)}),ii.onNotification(Ia.type,w=>{let $=g.get(w.token);$?$(w.value):z.fire(w)}),ii}_e.createMessageConnection=FP});var Ql=m(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.ProgressType=j.ProgressToken=j.createMessageConnection=j.NullLogger=j.ConnectionOptions=j.ConnectionStrategy=j.AbstractMessageBuffer=j.WriteableStreamMessageWriter=j.AbstractMessageWriter=j.MessageWriter=j.ReadableStreamMessageReader=j.AbstractMessageReader=j.MessageReader=j.SharedArrayReceiverStrategy=j.SharedArraySenderStrategy=j.CancellationToken=j.CancellationTokenSource=j.Emitter=j.Event=j.Disposable=j.LRUCache=j.Touch=j.LinkedMap=j.ParameterStructures=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.ErrorCodes=j.ResponseError=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType0=j.RequestType=j.Message=j.RAL=void 0;j.MessageStrategy=j.CancellationStrategy=j.CancellationSenderStrategy=j.CancellationReceiverStrategy=j.ConnectionError=j.ConnectionErrors=j.LogTraceNotification=j.SetTraceNotification=j.TraceFormat=j.TraceValues=j.Trace=void 0;var Je=Hp();Object.defineProperty(j,"Message",{enumerable:!0,get:function(){return Je.Message}});Object.defineProperty(j,"RequestType",{enumerable:!0,get:function(){return Je.RequestType}});Object.defineProperty(j,"RequestType0",{enumerable:!0,get:function(){return Je.RequestType0}});Object.defineProperty(j,"RequestType1",{enumerable:!0,get:function(){return Je.RequestType1}});Object.defineProperty(j,"RequestType2",{enumerable:!0,get:function(){return Je.RequestType2}});Object.defineProperty(j,"RequestType3",{enumerable:!0,get:function(){return Je.RequestType3}});Object.defineProperty(j,"RequestType4",{enumerable:!0,get:function(){return Je.RequestType4}});Object.defineProperty(j,"RequestType5",{enumerable:!0,get:function(){return Je.RequestType5}});Object.defineProperty(j,"RequestType6",{enumerable:!0,get:function(){return Je.RequestType6}});Object.defineProperty(j,"RequestType7",{enumerable:!0,get:function(){return Je.RequestType7}});Object.defineProperty(j,"RequestType8",{enumerable:!0,get:function(){return Je.RequestType8}});Object.defineProperty(j,"RequestType9",{enumerable:!0,get:function(){return Je.RequestType9}});Object.defineProperty(j,"ResponseError",{enumerable:!0,get:function(){return Je.ResponseError}});Object.defineProperty(j,"ErrorCodes",{enumerable:!0,get:function(){return Je.ErrorCodes}});Object.defineProperty(j,"NotificationType",{enumerable:!0,get:function(){return Je.NotificationType}});Object.defineProperty(j,"NotificationType0",{enumerable:!0,get:function(){return Je.NotificationType0}});Object.defineProperty(j,"NotificationType1",{enumerable:!0,get:function(){return Je.NotificationType1}});Object.defineProperty(j,"NotificationType2",{enumerable:!0,get:function(){return Je.NotificationType2}});Object.defineProperty(j,"NotificationType3",{enumerable:!0,get:function(){return Je.NotificationType3}});Object.defineProperty(j,"NotificationType4",{enumerable:!0,get:function(){return Je.NotificationType4}});Object.defineProperty(j,"NotificationType5",{enumerable:!0,get:function(){return Je.NotificationType5}});Object.defineProperty(j,"NotificationType6",{enumerable:!0,get:function(){return Je.NotificationType6}});Object.defineProperty(j,"NotificationType7",{enumerable:!0,get:function(){return Je.NotificationType7}});Object.defineProperty(j,"NotificationType8",{enumerable:!0,get:function(){return Je.NotificationType8}});Object.defineProperty(j,"NotificationType9",{enumerable:!0,get:function(){return Je.NotificationType9}});Object.defineProperty(j,"ParameterStructures",{enumerable:!0,get:function(){return Je.ParameterStructures}});var vg=zp();Object.defineProperty(j,"LinkedMap",{enumerable:!0,get:function(){return vg.LinkedMap}});Object.defineProperty(j,"LRUCache",{enumerable:!0,get:function(){return vg.LRUCache}});Object.defineProperty(j,"Touch",{enumerable:!0,get:function(){return vg.Touch}});var $P=pS();Object.defineProperty(j,"Disposable",{enumerable:!0,get:function(){return $P.Disposable}});var RS=io();Object.defineProperty(j,"Event",{enumerable:!0,get:function(){return RS.Event}});Object.defineProperty(j,"Emitter",{enumerable:!0,get:function(){return RS.Emitter}});var PS=Bl();Object.defineProperty(j,"CancellationTokenSource",{enumerable:!0,get:function(){return PS.CancellationTokenSource}});Object.defineProperty(j,"CancellationToken",{enumerable:!0,get:function(){return PS.CancellationToken}});var DS=mS();Object.defineProperty(j,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return DS.SharedArraySenderStrategy}});Object.defineProperty(j,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return DS.SharedArrayReceiverStrategy}});var _g=bS();Object.defineProperty(j,"MessageReader",{enumerable:!0,get:function(){return _g.MessageReader}});Object.defineProperty(j,"AbstractMessageReader",{enumerable:!0,get:function(){return _g.AbstractMessageReader}});Object.defineProperty(j,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _g.ReadableStreamMessageReader}});var Tg=kS();Object.defineProperty(j,"MessageWriter",{enumerable:!0,get:function(){return Tg.MessageWriter}});Object.defineProperty(j,"AbstractMessageWriter",{enumerable:!0,get:function(){return Tg.AbstractMessageWriter}});Object.defineProperty(j,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Tg.WriteableStreamMessageWriter}});var BP=wS();Object.defineProperty(j,"AbstractMessageBuffer",{enumerable:!0,get:function(){return BP.AbstractMessageBuffer}});var Vt=CS();Object.defineProperty(j,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(j,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(j,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(j,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(j,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(j,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(j,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(j,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(j,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(j,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(j,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(j,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(j,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(j,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(j,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(j,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(j,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var UP=Ei();j.RAL=UP.default});var LS=m(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var IS=require("util"),oi=Ql(),Zl=class t extends oi.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 IS.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)}};Zl.emptyBuffer=Buffer.allocUnsafe(0);var Sg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),oi.Disposable.create(()=>this.stream.off("data",e))}},kg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.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()}},MS=Object.freeze({messageBuffer:Object.freeze({create:t=>new Zl(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 IS.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Sg(t),asWritableStream:t=>new kg(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 wg(){return MS}(function(t){function e(){oi.RAL.install(MS)}t.install=e})(wg||(wg={}));xg.default=wg});var ds=m(Ce=>{"use strict";var WP=Ce&&Ce.__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]}),HP=Ce&&Ce.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WP(e,t,n)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.createMessageConnection=Ce.createServerSocketTransport=Ce.createClientSocketTransport=Ce.createServerPipeTransport=Ce.createClientPipeTransport=Ce.generateRandomPipeName=Ce.StreamMessageWriter=Ce.StreamMessageReader=Ce.SocketMessageWriter=Ce.SocketMessageReader=Ce.PortMessageWriter=Ce.PortMessageReader=Ce.IPCMessageWriter=Ce.IPCMessageReader=void 0;var lo=LS();lo.default.install();var NS=require("path"),GP=require("os"),zP=require("crypto"),nc=require("net"),Mn=Ql();HP(Ql(),Ce);var Eg=class extends Mn.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mn.Disposable.create(()=>this.process.off("message",e))}};Ce.IPCMessageReader=Eg;var Ag=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ce.IPCMessageWriter=Ag;var Og=class extends Mn.AbstractMessageReader{constructor(e){super(),this.onData=new Mn.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};Ce.PortMessageReader=Og;var Cg=class extends Mn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};Ce.PortMessageWriter=Cg;var hs=class extends Mn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,lo.default)().stream.asReadableStream(e),n)}};Ce.SocketMessageReader=hs;var fs=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ce.SocketMessageWriter=fs;var ec=class extends Mn.ReadableStreamMessageReader{constructor(e,n){super((0,lo.default)().stream.asReadableStream(e),n)}};Ce.StreamMessageReader=ec;var tc=class extends Mn.WriteableStreamMessageWriter{constructor(e,n){super((0,lo.default)().stream.asWritableStream(e),n)}};Ce.StreamMessageWriter=tc;var qS=process.env.XDG_RUNTIME_DIR,KP=new Map([["linux",107],["darwin",103]]);function VP(){let t=(0,zP.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;qS?e=NS.join(qS,`vscode-ipc-${t}.sock`):e=NS.join(GP.tmpdir(),`vscode-${t}.sock`);let n=KP.get(process.platform);return n!==void 0&&e.length>n&&(0,lo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Ce.generateRandomPipeName=VP;function XP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,nc.createServer)(a=>{o.close(),n([new hs(a,e),new fs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ce.createClientPipeTransport=XP;function YP(t,e="utf-8"){let n=(0,nc.createConnection)(t);return[new hs(n,e),new fs(n,e)]}Ce.createServerPipeTransport=YP;function JP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,nc.createServer)(a=>{o.close(),n([new hs(a,e),new fs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Ce.createClientSocketTransport=JP;function QP(t,e="utf-8"){let n=(0,nc.createConnection)(t,"127.0.0.1");return[new hs(n,e),new fs(n,e)]}Ce.createServerSocketTransport=QP;function ZP(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function eD(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function tD(t,e,n,r){n||(n=Mn.NullLogger);let i=ZP(t)?new ec(t):t,s=eD(e)?new tc(e):e;return Mn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Mn.createMessageConnection)(i,s,n,r)}Ce.createMessageConnection=tD});var Rg=m((gH,jS)=>{"use strict";jS.exports=ds()});var ic=m((FS,rc)=>{(function(t){if(typeof rc=="object"&&typeof rc.exports=="object"){var e=t(require,FS);e!==void 0&&(rc.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(p){function x(E){return typeof E=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(E){return typeof E=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(E){return typeof E=="number"&&p.MIN_VALUE<=E&&E<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(y,d){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),d===Number.MAX_VALUE&&(d=s.MAX_VALUE),{line:y,character:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.line)&&I.uinteger(d.character)}p.is=E})(o||(e.Position=o={}));var a;(function(p){function x(y,d,D,U){if(I.uinteger(y)&&I.uinteger(d)&&I.uinteger(D)&&I.uinteger(U))return{start:o.create(y,d),end:o.create(D,U)};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(D,", ").concat(U,"]"))}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.start)&&o.is(d.end)}p.is=E})(a||(e.Range=a={}));var u;(function(p){function x(y,d){return{uri:y,range:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(I.string(d.uri)||I.undefined(d.uri))}p.is=E})(u||(e.Location=u={}));var l;(function(p){function x(y,d,D,U){return{targetUri:y,targetRange:d,targetSelectionRange:D,originSelectionRange:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.targetRange)&&I.string(d.targetUri)&&a.is(d.targetSelectionRange)&&(a.is(d.originSelectionRange)||I.undefined(d.originSelectionRange))}p.is=E})(l||(e.LocationLink=l={}));var c;(function(p){function x(y,d,D,U){return{red:y,green:d,blue:D,alpha:U}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.numberRange(d.red,0,1)&&I.numberRange(d.green,0,1)&&I.numberRange(d.blue,0,1)&&I.numberRange(d.alpha,0,1)}p.is=E})(c||(e.Color=c={}));var h;(function(p){function x(y,d){return{range:y,color:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&c.is(d.color)}p.is=E})(h||(e.ColorInformation=h={}));var f;(function(p){function x(y,d,D){return{label:y,textEdit:d,additionalTextEdits:D}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.undefined(d.textEdit)||N.is(d))&&(I.undefined(d.additionalTextEdits)||I.typedArray(d.additionalTextEdits,N.is))}p.is=E})(f||(e.ColorPresentation=f={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var v;(function(p){function x(y,d,D,U,ve,pt){var Ye={startLine:y,endLine:d};return I.defined(D)&&(Ye.startCharacter=D),I.defined(U)&&(Ye.endCharacter=U),I.defined(ve)&&(Ye.kind=ve),I.defined(pt)&&(Ye.collapsedText=pt),Ye}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.uinteger(d.startLine)&&I.uinteger(d.startLine)&&(I.undefined(d.startCharacter)||I.uinteger(d.startCharacter))&&(I.undefined(d.endCharacter)||I.uinteger(d.endCharacter))&&(I.undefined(d.kind)||I.string(d.kind))}p.is=E})(v||(e.FoldingRange=v={}));var b;(function(p){function x(y,d){return{location:y,message:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&u.is(d.location)&&I.string(d.message)}p.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var O;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(O||(e.DiagnosticSeverity=O={}));var A;(function(p){p.Unnecessary=1,p.Deprecated=2})(A||(e.DiagnosticTag=A={}));var k;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&I.string(y.href)}p.is=x})(k||(e.CodeDescription=k={}));var S;(function(p){function x(y,d,D,U,ve,pt){var Ye={range:y,message:d};return I.defined(D)&&(Ye.severity=D),I.defined(U)&&(Ye.code=U),I.defined(ve)&&(Ye.source=ve),I.defined(pt)&&(Ye.relatedInformation=pt),Ye}p.create=x;function E(y){var d,D=y;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((d=D.codeDescription)===null||d===void 0?void 0:d.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,b.is))}p.is=E})(S||(e.Diagnostic=S={}));var _;(function(p){function x(y,d){for(var D=[],U=2;U<arguments.length;U++)D[U-2]=arguments[U];var ve={title:y,command:d};return I.defined(D)&&D.length>0&&(ve.arguments=D),ve}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.title)&&I.string(d.command)}p.is=E})(_||(e.Command=_={}));var N;(function(p){function x(D,U){return{range:D,newText:U}}p.replace=x;function E(D,U){return{range:{start:D,end:D},newText:U}}p.insert=E;function y(D){return{range:D,newText:""}}p.del=y;function d(D){var U=D;return I.objectLiteral(U)&&I.string(U.newText)&&a.is(U.range)}p.is=d})(N||(e.TextEdit=N={}));var R;(function(p){function x(y,d,D){var U={label:y};return d!==void 0&&(U.needsConfirmation=d),D!==void 0&&(U.description=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&I.string(d.label)&&(I.boolean(d.needsConfirmation)||d.needsConfirmation===void 0)&&(I.string(d.description)||d.description===void 0)}p.is=E})(R||(e.ChangeAnnotation=R={}));var G;(function(p){function x(E){var y=E;return I.string(y)}p.is=x})(G||(e.ChangeAnnotationIdentifier=G={}));var ie;(function(p){function x(D,U,ve){return{range:D,newText:U,annotationId:ve}}p.replace=x;function E(D,U,ve){return{range:{start:D,end:D},newText:U,annotationId:ve}}p.insert=E;function y(D,U){return{range:D,newText:"",annotationId:U}}p.del=y;function d(D){var U=D;return N.is(U)&&(R.is(U.annotationId)||G.is(U.annotationId))}p.is=d})(ie||(e.AnnotatedTextEdit=ie={}));var ue;(function(p){function x(y,d){return{textDocument:y,edits:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&We.is(d.textDocument)&&Array.isArray(d.edits)}p.is=E})(ue||(e.TextDocumentEdit=ue={}));var z;(function(p){function x(y,d,D){var U={kind:"create",uri:y};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="create"&&I.string(d.uri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(z||(e.CreateFile=z={}));var C;(function(p){function x(y,d,D,U){var ve={kind:"rename",oldUri:y,newUri:d};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ve.options=D),U!==void 0&&(ve.annotationId=U),ve}p.create=x;function E(y){var d=y;return d&&d.kind==="rename"&&I.string(d.oldUri)&&I.string(d.newUri)&&(d.options===void 0||(d.options.overwrite===void 0||I.boolean(d.options.overwrite))&&(d.options.ignoreIfExists===void 0||I.boolean(d.options.ignoreIfExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(C||(e.RenameFile=C={}));var M;(function(p){function x(y,d,D){var U={kind:"delete",uri:y};return d!==void 0&&(d.recursive!==void 0||d.ignoreIfNotExists!==void 0)&&(U.options=d),D!==void 0&&(U.annotationId=D),U}p.create=x;function E(y){var d=y;return d&&d.kind==="delete"&&I.string(d.uri)&&(d.options===void 0||(d.options.recursive===void 0||I.boolean(d.options.recursive))&&(d.options.ignoreIfNotExists===void 0||I.boolean(d.options.ignoreIfNotExists)))&&(d.annotationId===void 0||G.is(d.annotationId))}p.is=E})(M||(e.DeleteFile=M={}));var L;(function(p){function x(E){var y=E;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(d){return I.string(d.kind)?z.is(d)||C.is(d)||M.is(d):ue.is(d)}))}p.is=x})(L||(e.WorkspaceEdit=L={}));var F=function(){function p(x,E){this.edits=x,this.changeAnnotations=E}return p.prototype.insert=function(x,E,y){var d,D;if(y===void 0?d=N.insert(x,E):G.is(y)?(D=y,d=ie.insert(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=ie.insert(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.replace=function(x,E,y){var d,D;if(y===void 0?d=N.replace(x,E):G.is(y)?(D=y,d=ie.replace(x,E,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),d=ie.replace(x,E,D)),this.edits.push(d),D!==void 0)return D},p.prototype.delete=function(x,E){var y,d;if(E===void 0?y=N.del(x):G.is(E)?(d=E,y=ie.del(x,E)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(E),y=ie.del(x,d)),this.edits.push(y),d!==void 0)return d},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),me=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,E){var y;if(G.is(x)?y=x:(y=this.nextId(),E=x),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=E,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),pe=function(){function p(x){var E=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new me(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(y){if(ue.is(y)){var d=new F(y.edits,E._changeAnnotations);E._textEditChanges[y.textDocument.uri]=d}})):x.changes&&Object.keys(x.changes).forEach(function(y){var d=new F(x.changes[y]);E._textEditChanges[y]=d})):this._workspaceEdit={}}return Object.defineProperty(p.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),p.prototype.getTextEditChange=function(x){if(We.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:x.uri,version:x.version},y=this._textEditChanges[E.uri];if(!y){var d=[],D={textDocument:E,edits:d};this._workspaceEdit.documentChanges.push(D),y=new F(d,this._changeAnnotations),this._textEditChanges[E.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[x];if(!y){var d=[];this._workspaceEdit.changes[x]=d,y=new F(d),this._textEditChanges[x]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new me,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=z.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=z.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p.prototype.renameFile=function(x,E,y,d){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(y)||G.is(y)?D=y:d=y;var U,ve;if(D===void 0?U=C.create(x,E,d):(ve=G.is(D)?D:this._changeAnnotations.manage(D),U=C.create(x,E,d,ve)),this._workspaceEdit.documentChanges.push(U),ve!==void 0)return ve},p.prototype.deleteFile=function(x,E,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;R.is(E)||G.is(E)?d=E:y=E;var D,U;if(d===void 0?D=M.create(x,y):(U=G.is(d)?d:this._changeAnnotations.manage(d),D=M.create(x,y,U)),this._workspaceEdit.documentChanges.push(D),U!==void 0)return U},p}();e.WorkspaceChange=pe;var jt;(function(p){function x(y){return{uri:y}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)}p.is=E})(jt||(e.TextDocumentIdentifier=jt={}));var Tt;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.integer(d.version)}p.is=E})(Tt||(e.VersionedTextDocumentIdentifier=Tt={}));var We;(function(p){function x(y,d){return{uri:y,version:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&(d.version===null||I.integer(d.version))}p.is=E})(We||(e.OptionalVersionedTextDocumentIdentifier=We={}));var Tn;(function(p){function x(y,d,D,U){return{uri:y,languageId:d,version:D,text:U}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.string(d.uri)&&I.string(d.languageId)&&I.integer(d.version)&&I.string(d.text)}p.is=E})(Tn||(e.TextDocumentItem=Tn={}));var Js;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(E){var y=E;return y===p.PlainText||y===p.Markdown}p.is=x})(Js||(e.MarkupKind=Js={}));var us;(function(p){function x(E){var y=E;return I.objectLiteral(E)&&Js.is(y.kind)&&I.string(y.value)}p.is=x})(us||(e.MarkupContent=us={}));var Tl;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(Tl||(e.CompletionItemKind=Tl={}));var xa;(function(p){p.PlainText=1,p.Snippet=2})(xa||(e.InsertTextFormat=xa={}));var Ea;(function(p){p.Deprecated=1})(Ea||(e.CompletionItemTag=Ea={}));var Sl;(function(p){function x(y,d,D){return{newText:y,insert:d,replace:D}}p.create=x;function E(y){var d=y;return d&&I.string(d.newText)&&a.is(d.insert)&&a.is(d.replace)}p.is=E})(Sl||(e.InsertReplaceEdit=Sl={}));var kl;(function(p){p.asIs=1,p.adjustIndentation=2})(kl||(e.InsertTextMode=kl={}));var wl;(function(p){function x(E){var y=E;return y&&(I.string(y.detail)||y.detail===void 0)&&(I.string(y.description)||y.description===void 0)}p.is=x})(wl||(e.CompletionItemLabelDetails=wl={}));var xl;(function(p){function x(E){return{label:E}}p.create=x})(xl||(e.CompletionItem=xl={}));var El;(function(p){function x(E,y){return{items:E||[],isIncomplete:!!y}}p.create=x})(El||(e.CompletionList=El={}));var Qs;(function(p){function x(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function E(y){var d=y;return I.string(d)||I.objectLiteral(d)&&I.string(d.language)&&I.string(d.value)}p.is=E})(Qs||(e.MarkedString=Qs={}));var pr;(function(p){function x(E){var y=E;return!!y&&I.objectLiteral(y)&&(us.is(y.contents)||Qs.is(y.contents)||I.typedArray(y.contents,Qs.is))&&(E.range===void 0||a.is(E.range))}p.is=x})(pr||(e.Hover=pr={}));var Al;(function(p){function x(E,y){return y?{label:E,documentation:y}:{label:E}}p.create=x})(Al||(e.ParameterInformation=Al={}));var Ol;(function(p){function x(E,y){for(var d=[],D=2;D<arguments.length;D++)d[D-2]=arguments[D];var U={label:E};return I.defined(y)&&(U.documentation=y),I.defined(d)?U.parameters=d:U.parameters=[],U}p.create=x})(Ol||(e.SignatureInformation=Ol={}));var ls;(function(p){p.Text=1,p.Read=2,p.Write=3})(ls||(e.DocumentHighlightKind=ls={}));var Cl;(function(p){function x(E,y){var d={range:E};return I.number(y)&&(d.kind=y),d}p.create=x})(Cl||(e.DocumentHighlight=Cl={}));var Zs;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(Zs||(e.SymbolKind=Zs={}));var Rl;(function(p){p.Deprecated=1})(Rl||(e.SymbolTag=Rl={}));var ri;(function(p){function x(E,y,d,D,U){var ve={name:E,kind:y,location:{uri:D,range:d}};return U&&(ve.containerName=U),ve}p.create=x})(ri||(e.SymbolInformation=ri={}));var wi;(function(p){function x(E,y,d,D){return D!==void 0?{name:E,kind:y,location:{uri:d,range:D}}:{name:E,kind:y,location:{uri:d}}}p.create=x})(wi||(e.WorkspaceSymbol=wi={}));var Pl;(function(p){function x(y,d,D,U,ve,pt){var Ye={name:y,detail:d,kind:D,range:U,selectionRange:ve};return pt!==void 0&&(Ye.children=pt),Ye}p.create=x;function E(y){var d=y;return d&&I.string(d.name)&&I.number(d.kind)&&a.is(d.range)&&a.is(d.selectionRange)&&(d.detail===void 0||I.string(d.detail))&&(d.deprecated===void 0||I.boolean(d.deprecated))&&(d.children===void 0||Array.isArray(d.children))&&(d.tags===void 0||Array.isArray(d.tags))}p.is=E})(Pl||(e.DocumentSymbol=Pl={}));var Dl;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Dl||(e.CodeActionKind=Dl={}));var Dr;(function(p){p.Invoked=1,p.Automatic=2})(Dr||(e.CodeActionTriggerKind=Dr={}));var Aa;(function(p){function x(y,d,D){var U={diagnostics:y};return d!=null&&(U.only=d),D!=null&&(U.triggerKind=D),U}p.create=x;function E(y){var d=y;return I.defined(d)&&I.typedArray(d.diagnostics,S.is)&&(d.only===void 0||I.typedArray(d.only,I.string))&&(d.triggerKind===void 0||d.triggerKind===Dr.Invoked||d.triggerKind===Dr.Automatic)}p.is=E})(Aa||(e.CodeActionContext=Aa={}));var Oa;(function(p){function x(y,d,D){var U={title:y},ve=!0;return typeof d=="string"?(ve=!1,U.kind=d):_.is(d)?U.command=d:U.edit=d,ve&&D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return d&&I.string(d.title)&&(d.diagnostics===void 0||I.typedArray(d.diagnostics,S.is))&&(d.kind===void 0||I.string(d.kind))&&(d.edit!==void 0||d.command!==void 0)&&(d.command===void 0||_.is(d.command))&&(d.isPreferred===void 0||I.boolean(d.isPreferred))&&(d.edit===void 0||L.is(d.edit))}p.is=E})(Oa||(e.CodeAction=Oa={}));var eo;(function(p){function x(y,d){var D={range:y};return I.defined(d)&&(D.data=d),D}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.command)||_.is(d.command))}p.is=E})(eo||(e.CodeLens=eo={}));var Ca;(function(p){function x(y,d){return{tabSize:y,insertSpaces:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&I.uinteger(d.tabSize)&&I.boolean(d.insertSpaces)}p.is=E})(Ca||(e.FormattingOptions=Ca={}));var ii;(function(p){function x(y,d,D){return{range:y,target:d,data:D}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(d.range)&&(I.undefined(d.target)||I.string(d.target))}p.is=E})(ii||(e.DocumentLink=ii={}));var w;(function(p){function x(y,d){return{range:y,parent:d}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&a.is(d.range)&&(d.parent===void 0||p.is(d.parent))}p.is=E})(w||(e.SelectionRange=w={}));var $;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})($||(e.SemanticTokenTypes=$={}));var V;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var te;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=x})(te||(e.SemanticTokens=te={}));var Ke;(function(p){function x(y,d){return{range:y,text:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.string(d.text)}p.is=E})(Ke||(e.InlineValueText=Ke={}));var Fe;(function(p){function x(y,d,D){return{range:y,variableName:d,caseSensitiveLookup:D}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&I.boolean(d.caseSensitiveLookup)&&(I.string(d.variableName)||d.variableName===void 0)}p.is=E})(Fe||(e.InlineValueVariableLookup=Fe={}));var Qe;(function(p){function x(y,d){return{range:y,expression:d}}p.create=x;function E(y){var d=y;return d!=null&&a.is(d.range)&&(I.string(d.expression)||d.expression===void 0)}p.is=E})(Qe||(e.InlineValueEvaluatableExpression=Qe={}));var it;(function(p){function x(y,d){return{frameId:y,stoppedLocation:d}}p.create=x;function E(y){var d=y;return I.defined(d)&&a.is(y.stoppedLocation)}p.is=E})(it||(e.InlineValueContext=it={}));var xe;(function(p){p.Type=1,p.Parameter=2;function x(E){return E===1||E===2}p.is=x})(xe||(e.InlayHintKind=xe={}));var Ve;(function(p){function x(y){return{value:y}}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&(d.tooltip===void 0||I.string(d.tooltip)||us.is(d.tooltip))&&(d.location===void 0||u.is(d.location))&&(d.command===void 0||_.is(d.command))}p.is=E})(Ve||(e.InlayHintLabelPart=Ve={}));var Me;(function(p){function x(y,d,D){var U={position:y,label:d};return D!==void 0&&(U.kind=D),U}p.create=x;function E(y){var d=y;return I.objectLiteral(d)&&o.is(d.position)&&(I.string(d.label)||I.typedArray(d.label,Ve.is))&&(d.kind===void 0||xe.is(d.kind))&&d.textEdits===void 0||I.typedArray(d.textEdits,N.is)&&(d.tooltip===void 0||I.string(d.tooltip)||us.is(d.tooltip))&&(d.paddingLeft===void 0||I.boolean(d.paddingLeft))&&(d.paddingRight===void 0||I.boolean(d.paddingRight))}p.is=E})(Me||(e.InlayHint=Me={}));var dt;(function(p){function x(E){return{kind:"snippet",value:E}}p.createSnippet=x})(dt||(e.StringValue=dt={}));var Ft;(function(p){function x(E,y,d,D){return{insertText:E,filterText:y,range:d,command:D}}p.create=x})(Ft||(e.InlineCompletionItem=Ft={}));var Dn;(function(p){function x(E){return{items:E}}p.create=x})(Dn||(e.InlineCompletionList=Dn={}));var Il;(function(p){p.Invoked=0,p.Automatic=1})(Il||(e.InlineCompletionTriggerKind=Il={}));var tS;(function(p){function x(E,y){return{range:E,text:y}}p.create=x})(tS||(e.SelectedCompletionInfo=tS={}));var nS;(function(p){function x(E,y){return{triggerKind:E,selectedCompletionInfo:y}}p.create=x})(nS||(e.InlineCompletionContext=nS={}));var rS;(function(p){function x(E){var y=E;return I.objectLiteral(y)&&r.is(y.uri)&&I.string(y.name)}p.is=x})(rS||(e.WorkspaceFolder=rS={})),e.EOL=[`
|
32
32
|
`,`\r
|
33
|
-
`,"\r"];var
|
33
|
+
`,"\r"];var iS;(function(p){function x(D,U,ve,pt){return new uP(D,U,ve,pt)}p.create=x;function E(D){var U=D;return!!(I.defined(U)&&I.string(U.uri)&&(I.undefined(U.languageId)||I.string(U.languageId))&&I.uinteger(U.lineCount)&&I.func(U.getText)&&I.func(U.positionAt)&&I.func(U.offsetAt))}p.is=E;function y(D,U){for(var ve=D.getText(),pt=d(U,function(to,Ml){var sS=to.range.start.line-Ml.range.start.line;return sS===0?to.range.start.character-Ml.range.start.character:sS}),Ye=ve.length,gr=pt.length-1;gr>=0;gr--){var mr=pt[gr],si=D.offsetAt(mr.range.start),Oe=D.offsetAt(mr.range.end);if(Oe<=Ye)ve=ve.substring(0,si)+mr.newText+ve.substring(Oe,ve.length);else throw new Error("Overlapping edit");Ye=si}return ve}p.applyEdits=y;function d(D,U){if(D.length<=1)return D;var ve=D.length/2|0,pt=D.slice(0,ve),Ye=D.slice(ve);d(pt,U),d(Ye,U);for(var gr=0,mr=0,si=0;gr<pt.length&&mr<Ye.length;){var Oe=U(pt[gr],Ye[mr]);Oe<=0?D[si++]=pt[gr++]:D[si++]=Ye[mr++]}for(;gr<pt.length;)D[si++]=pt[gr++];for(;mr<Ye.length;)D[si++]=Ye[mr++];return D}})(iS||(e.TextDocument=iS={}));var uP=function(){function p(x,E,y,d){this._uri=x,this._languageId=E,this._version=y,this._content=d,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(x){if(x){var E=this.offsetAt(x.start),y=this.offsetAt(x.end);return this._content.substring(E,y)}return this._content},p.prototype.update=function(x,E){this._content=x.text,this._version=E,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var x=[],E=this._content,y=!0,d=0;d<E.length;d++){y&&(x.push(d),y=!1);var D=E.charAt(d);y=D==="\r"||D===`
|
34
34
|
`,D==="\r"&&d+1<E.length&&E.charAt(d+1)===`
|
35
|
-
`&&d++}y&&E.length>0&&x.push(E.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var E=this.getLineOffsets(),y=0,d=E.length;if(d===0)return o.create(0,x);for(;y<d;){var D=Math.floor((y+d)/2);E[D]>x?d=D:y=D+1}var U=y-1;return o.create(U,x-E[U])},p.prototype.offsetAt=function(x){var E=this.getLineOffsets();if(x.line>=E.length)return this._content.length;if(x.line<0)return 0;var y=E[x.line],d=x.line+1<E.length?E[x.line+1]:this._content.length;return Math.max(Math.min(y+x.character,d),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function E(Oe){return typeof Oe<"u"}p.defined=E;function y(Oe){return typeof Oe>"u"}p.undefined=y;function d(Oe){return Oe===!0||Oe===!1}p.boolean=d;function D(Oe){return x.call(Oe)==="[object String]"}p.string=D;function U(Oe){return x.call(Oe)==="[object Number]"}p.number=U;function ve(Oe,to,Ml){return x.call(Oe)==="[object Number]"&&to<=Oe&&Oe<=Ml}p.numberRange=ve;function pt(Oe){return x.call(Oe)==="[object Number]"&&-2147483648<=Oe&&Oe<=2147483647}p.integer=pt;function Xe(Oe){return x.call(Oe)==="[object Number]"&&0<=Oe&&Oe<=2147483647}p.uinteger=Xe;function pr(Oe){return x.call(Oe)==="[object Function]"}p.func=pr;function gr(Oe){return Oe!==null&&typeof Oe=="object"}p.objectLiteral=gr;function si(Oe,to){return Array.isArray(Oe)&&Oe.every(to)}p.typedArray=si})(I||(I={}))})});var st=m(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ProtocolNotificationType=kn.ProtocolNotificationType0=kn.ProtocolRequestType=kn.ProtocolRequestType0=kn.RegistrationType=kn.MessageDirection=void 0;var co=ds(),BS;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(BS||(kn.MessageDirection=BS={}));var Pg=class{constructor(e){this.method=e}};kn.RegistrationType=Pg;var Dg=class extends co.RequestType0{constructor(e){super(e)}};kn.ProtocolRequestType0=Dg;var Ig=class extends co.RequestType{constructor(e){super(e,co.ParameterStructures.byName)}};kn.ProtocolRequestType=Ig;var Mg=class extends co.NotificationType0{constructor(e){super(e)}};kn.ProtocolNotificationType0=Mg;var Lg=class extends co.NotificationType{constructor(e){super(e,co.ParameterStructures.byName)}};kn.ProtocolNotificationType=Lg});var sc=m(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.objectLiteral=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function nD(t){return t===!0||t===!1}Ot.boolean=nD;function US(t){return typeof t=="string"||t instanceof String}Ot.string=US;function rD(t){return typeof t=="number"||t instanceof Number}Ot.number=rD;function iD(t){return t instanceof Error}Ot.error=iD;function sD(t){return typeof t=="function"}Ot.func=sD;function WS(t){return Array.isArray(t)}Ot.array=WS;function oD(t){return WS(t)&&t.every(e=>US(e))}Ot.stringArray=oD;function aD(t,e){return Array.isArray(t)&&t.every(e)}Ot.typedArray=aD;function uD(t){return t!==null&&typeof t=="object"}Ot.objectLiteral=uD});var KS=m(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.ImplementationRequest=void 0;var HS=st(),GS;(function(t){t.method="textDocument/implementation",t.messageDirection=HS.MessageDirection.clientToServer,t.type=new HS.ProtocolRequestType(t.method)})(GS||(oc.ImplementationRequest=GS={}))});var XS=m(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.TypeDefinitionRequest=void 0;var zS=st(),VS;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=zS.MessageDirection.clientToServer,t.type=new zS.ProtocolRequestType(t.method)})(VS||(ac.TypeDefinitionRequest=VS={}))});var QS=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.DidChangeWorkspaceFoldersNotification=ho.WorkspaceFoldersRequest=void 0;var uc=st(),YS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=uc.MessageDirection.serverToClient,t.type=new uc.ProtocolRequestType0(t.method)})(YS||(ho.WorkspaceFoldersRequest=YS={}));var JS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=uc.MessageDirection.clientToServer,t.type=new uc.ProtocolNotificationType(t.method)})(JS||(ho.DidChangeWorkspaceFoldersNotification=JS={}))});var tk=m(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.ConfigurationRequest=void 0;var ZS=st(),ek;(function(t){t.method="workspace/configuration",t.messageDirection=ZS.MessageDirection.serverToClient,t.type=new ZS.ProtocolRequestType(t.method)})(ek||(lc.ConfigurationRequest=ek={}))});var ik=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ColorPresentationRequest=fo.DocumentColorRequest=void 0;var cc=st(),nk;(function(t){t.method="textDocument/documentColor",t.messageDirection=cc.MessageDirection.clientToServer,t.type=new cc.ProtocolRequestType(t.method)})(nk||(fo.DocumentColorRequest=nk={}));var rk;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=cc.MessageDirection.clientToServer,t.type=new cc.ProtocolRequestType(t.method)})(rk||(fo.ColorPresentationRequest=rk={}))});var ak=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.FoldingRangeRefreshRequest=po.FoldingRangeRequest=void 0;var hc=st(),sk;(function(t){t.method="textDocument/foldingRange",t.messageDirection=hc.MessageDirection.clientToServer,t.type=new hc.ProtocolRequestType(t.method)})(sk||(po.FoldingRangeRequest=sk={}));var ok;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=hc.MessageDirection.serverToClient,t.type=new hc.ProtocolRequestType0(t.method)})(ok||(po.FoldingRangeRefreshRequest=ok={}))});var ck=m(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.DeclarationRequest=void 0;var uk=st(),lk;(function(t){t.method="textDocument/declaration",t.messageDirection=uk.MessageDirection.clientToServer,t.type=new uk.ProtocolRequestType(t.method)})(lk||(fc.DeclarationRequest=lk={}))});var dk=m(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.SelectionRangeRequest=void 0;var hk=st(),fk;(function(t){t.method="textDocument/selectionRange",t.messageDirection=hk.MessageDirection.clientToServer,t.type=new hk.ProtocolRequestType(t.method)})(fk||(dc.SelectionRangeRequest=fk={}))});var yk=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WorkDoneProgressCancelNotification=Ci.WorkDoneProgressCreateRequest=Ci.WorkDoneProgress=void 0;var lD=ds(),pc=st(),pk;(function(t){t.type=new lD.ProgressType;function e(n){return n===t.type}t.is=e})(pk||(Ci.WorkDoneProgress=pk={}));var gk;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=pc.MessageDirection.serverToClient,t.type=new pc.ProtocolRequestType(t.method)})(gk||(Ci.WorkDoneProgressCreateRequest=gk={}));var mk;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=pc.MessageDirection.clientToServer,t.type=new pc.ProtocolNotificationType(t.method)})(mk||(Ci.WorkDoneProgressCancelNotification=mk={}))});var Tk=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.CallHierarchyOutgoingCallsRequest=Ri.CallHierarchyIncomingCallsRequest=Ri.CallHierarchyPrepareRequest=void 0;var go=st(),bk;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(bk||(Ri.CallHierarchyPrepareRequest=bk={}));var vk;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(vk||(Ri.CallHierarchyIncomingCallsRequest=vk={}));var _k;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(_k||(Ri.CallHierarchyOutgoingCallsRequest=_k={}))});var Ak=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.SemanticTokensRefreshRequest=wn.SemanticTokensRangeRequest=wn.SemanticTokensDeltaRequest=wn.SemanticTokensRequest=wn.SemanticTokensRegistrationType=wn.TokenFormat=void 0;var ai=st(),Sk;(function(t){t.Relative="relative"})(Sk||(wn.TokenFormat=Sk={}));var Na;(function(t){t.method="textDocument/semanticTokens",t.type=new ai.RegistrationType(t.method)})(Na||(wn.SemanticTokensRegistrationType=Na={}));var kk;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(kk||(wn.SemanticTokensRequest=kk={}));var wk;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(wk||(wn.SemanticTokensDeltaRequest=wk={}));var xk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(xk||(wn.SemanticTokensRangeRequest=xk={}));var Ek;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(Ek||(wn.SemanticTokensRefreshRequest=Ek={}))});var Rk=m(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.ShowDocumentRequest=void 0;var Ok=st(),Ck;(function(t){t.method="window/showDocument",t.messageDirection=Ok.MessageDirection.serverToClient,t.type=new Ok.ProtocolRequestType(t.method)})(Ck||(gc.ShowDocumentRequest=Ck={}))});var Ik=m(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.LinkedEditingRangeRequest=void 0;var Pk=st(),Dk;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Pk.MessageDirection.clientToServer,t.type=new Pk.ProtocolRequestType(t.method)})(Dk||(mc.LinkedEditingRangeRequest=Dk={}))});var Bk=m(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.WillDeleteFilesRequest=nn.DidDeleteFilesNotification=nn.DidRenameFilesNotification=nn.WillRenameFilesRequest=nn.DidCreateFilesNotification=nn.WillCreateFilesRequest=nn.FileOperationPatternKind=void 0;var Wn=st(),Mk;(function(t){t.file="file",t.folder="folder"})(Mk||(nn.FileOperationPatternKind=Mk={}));var Lk;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(Lk||(nn.WillCreateFilesRequest=Lk={}));var Nk;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(Nk||(nn.DidCreateFilesNotification=Nk={}));var qk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(qk||(nn.WillRenameFilesRequest=qk={}));var jk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(jk||(nn.DidRenameFilesNotification=jk={}));var Fk;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(Fk||(nn.DidDeleteFilesNotification=Fk={}));var $k;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})($k||(nn.WillDeleteFilesRequest=$k={}))});var Kk=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.MonikerRequest=Pi.MonikerKind=Pi.UniquenessLevel=void 0;var Uk=st(),Wk;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Wk||(Pi.UniquenessLevel=Wk={}));var Hk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Hk||(Pi.MonikerKind=Hk={}));var Gk;(function(t){t.method="textDocument/moniker",t.messageDirection=Uk.MessageDirection.clientToServer,t.type=new Uk.ProtocolRequestType(t.method)})(Gk||(Pi.MonikerRequest=Gk={}))});var Yk=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.TypeHierarchySubtypesRequest=Di.TypeHierarchySupertypesRequest=Di.TypeHierarchyPrepareRequest=void 0;var mo=st(),zk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(zk||(Di.TypeHierarchyPrepareRequest=zk={}));var Vk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(Vk||(Di.TypeHierarchySupertypesRequest=Vk={}));var Xk;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(Xk||(Di.TypeHierarchySubtypesRequest=Xk={}))});var Zk=m(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InlineValueRefreshRequest=yo.InlineValueRequest=void 0;var yc=st(),Jk;(function(t){t.method="textDocument/inlineValue",t.messageDirection=yc.MessageDirection.clientToServer,t.type=new yc.ProtocolRequestType(t.method)})(Jk||(yo.InlineValueRequest=Jk={}));var Qk;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=yc.MessageDirection.serverToClient,t.type=new yc.ProtocolRequestType0(t.method)})(Qk||(yo.InlineValueRefreshRequest=Qk={}))});var rw=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.InlayHintRefreshRequest=Ii.InlayHintResolveRequest=Ii.InlayHintRequest=void 0;var bo=st(),ew;(function(t){t.method="textDocument/inlayHint",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(ew||(Ii.InlayHintRequest=ew={}));var tw;(function(t){t.method="inlayHint/resolve",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(tw||(Ii.InlayHintResolveRequest=tw={}));var nw;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(nw||(Ii.InlayHintRefreshRequest=nw={}))});var cw=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.DiagnosticRefreshRequest=Hn.WorkspaceDiagnosticRequest=Hn.DocumentDiagnosticRequest=Hn.DocumentDiagnosticReportKind=Hn.DiagnosticServerCancellationData=void 0;var lw=ds(),cD=sc(),vo=st(),iw;(function(t){function e(n){let r=n;return r&&cD.boolean(r.retriggerRequest)}t.is=e})(iw||(Hn.DiagnosticServerCancellationData=iw={}));var sw;(function(t){t.Full="full",t.Unchanged="unchanged"})(sw||(Hn.DocumentDiagnosticReportKind=sw={}));var ow;(function(t){t.method="textDocument/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new lw.ProgressType})(ow||(Hn.DocumentDiagnosticRequest=ow={}));var aw;(function(t){t.method="workspace/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new lw.ProgressType})(aw||(Hn.WorkspaceDiagnosticRequest=aw={}));var uw;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=vo.MessageDirection.serverToClient,t.type=new vo.ProtocolRequestType0(t.method)})(uw||(Hn.DiagnosticRefreshRequest=uw={}))});var yw=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.DidCloseNotebookDocumentNotification=gt.DidSaveNotebookDocumentNotification=gt.DidChangeNotebookDocumentNotification=gt.NotebookCellArrayChange=gt.DidOpenNotebookDocumentNotification=gt.NotebookDocumentSyncRegistrationType=gt.NotebookDocument=gt.NotebookCell=gt.ExecutionSummary=gt.NotebookCellKind=void 0;var qa=ic(),yr=sc(),Ir=st(),Ng;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ng||(gt.NotebookCellKind=Ng={}));var qg;(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 yr.objectLiteral(s)&&qa.uinteger.is(s.executionOrder)&&(s.success===void 0||yr.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})(qg||(gt.ExecutionSummary=qg={}));var bc;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return yr.objectLiteral(o)&&Ng.is(o.kind)&&qa.DocumentUri.is(o.document)&&(o.metadata===void 0||yr.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)&&!qg.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 l=0;l<s.length;l++)if(!i(s[l],o[l]))return!1}if(yr.objectLiteral(s)&&yr.objectLiteral(o)){let l=Object.keys(s),c=Object.keys(o);if(l.length!==c.length||(l.sort(),c.sort(),!i(l,c)))return!1;for(let h=0;h<l.length;h++){let f=l[h];if(!i(s[f],o[f]))return!1}}return!0}})(bc||(gt.NotebookCell=bc={}));var hw;(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 yr.objectLiteral(i)&&yr.string(i.uri)&&qa.integer.is(i.version)&&yr.typedArray(i.cells,bc.is)}t.is=n})(hw||(gt.NotebookDocument=hw={}));var _o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.RegistrationType(t.method)})(_o||(gt.NotebookDocumentSyncRegistrationType=_o={}));var fw;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(fw||(gt.DidOpenNotebookDocumentNotification=fw={}));var dw;(function(t){function e(r){let i=r;return yr.objectLiteral(i)&&qa.uinteger.is(i.start)&&qa.uinteger.is(i.deleteCount)&&(i.cells===void 0||yr.typedArray(i.cells,bc.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})(dw||(gt.NotebookCellArrayChange=dw={}));var pw;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(pw||(gt.DidChangeNotebookDocumentNotification=pw={}));var gw;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(gw||(gt.DidSaveNotebookDocumentNotification=gw={}));var mw;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(mw||(gt.DidCloseNotebookDocumentNotification=mw={}))});var _w=m(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.InlineCompletionRequest=void 0;var bw=st(),vw;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=bw.MessageDirection.clientToServer,t.type=new bw.ProtocolRequestType(t.method)})(vw||(vc.InlineCompletionRequest=vw={}))});var I0=m(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.WorkspaceSymbolRequest=T.CodeActionResolveRequest=T.CodeActionRequest=T.DocumentSymbolRequest=T.DocumentHighlightRequest=T.ReferencesRequest=T.DefinitionRequest=T.SignatureHelpRequest=T.SignatureHelpTriggerKind=T.HoverRequest=T.CompletionResolveRequest=T.CompletionRequest=T.CompletionTriggerKind=T.PublishDiagnosticsNotification=T.WatchKind=T.RelativePattern=T.FileChangeType=T.DidChangeWatchedFilesNotification=T.WillSaveTextDocumentWaitUntilRequest=T.WillSaveTextDocumentNotification=T.TextDocumentSaveReason=T.DidSaveTextDocumentNotification=T.DidCloseTextDocumentNotification=T.DidChangeTextDocumentNotification=T.TextDocumentContentChangeEvent=T.DidOpenTextDocumentNotification=T.TextDocumentSyncKind=T.TelemetryEventNotification=T.LogMessageNotification=T.ShowMessageRequest=T.ShowMessageNotification=T.MessageType=T.DidChangeConfigurationNotification=T.ExitNotification=T.ShutdownRequest=T.InitializedNotification=T.InitializeErrorCodes=T.InitializeRequest=T.WorkDoneProgressOptions=T.TextDocumentRegistrationOptions=T.StaticRegistrationOptions=T.PositionEncodingKind=T.FailureHandlingKind=T.ResourceOperationKind=T.UnregistrationRequest=T.RegistrationRequest=T.DocumentSelector=T.NotebookCellTextDocumentFilter=T.NotebookDocumentFilter=T.TextDocumentFilter=void 0;T.MonikerRequest=T.MonikerKind=T.UniquenessLevel=T.WillDeleteFilesRequest=T.DidDeleteFilesNotification=T.WillRenameFilesRequest=T.DidRenameFilesNotification=T.WillCreateFilesRequest=T.DidCreateFilesNotification=T.FileOperationPatternKind=T.LinkedEditingRangeRequest=T.ShowDocumentRequest=T.SemanticTokensRegistrationType=T.SemanticTokensRefreshRequest=T.SemanticTokensRangeRequest=T.SemanticTokensDeltaRequest=T.SemanticTokensRequest=T.TokenFormat=T.CallHierarchyPrepareRequest=T.CallHierarchyOutgoingCallsRequest=T.CallHierarchyIncomingCallsRequest=T.WorkDoneProgressCancelNotification=T.WorkDoneProgressCreateRequest=T.WorkDoneProgress=T.SelectionRangeRequest=T.DeclarationRequest=T.FoldingRangeRefreshRequest=T.FoldingRangeRequest=T.ColorPresentationRequest=T.DocumentColorRequest=T.ConfigurationRequest=T.DidChangeWorkspaceFoldersNotification=T.WorkspaceFoldersRequest=T.TypeDefinitionRequest=T.ImplementationRequest=T.ApplyWorkspaceEditRequest=T.ExecuteCommandRequest=T.PrepareRenameRequest=T.RenameRequest=T.PrepareSupportDefaultBehavior=T.DocumentOnTypeFormattingRequest=T.DocumentRangesFormattingRequest=T.DocumentRangeFormattingRequest=T.DocumentFormattingRequest=T.DocumentLinkResolveRequest=T.DocumentLinkRequest=T.CodeLensRefreshRequest=T.CodeLensResolveRequest=T.CodeLensRequest=T.WorkspaceSymbolResolveRequest=void 0;T.InlineCompletionRequest=T.DidCloseNotebookDocumentNotification=T.DidSaveNotebookDocumentNotification=T.DidChangeNotebookDocumentNotification=T.NotebookCellArrayChange=T.DidOpenNotebookDocumentNotification=T.NotebookDocumentSyncRegistrationType=T.NotebookDocument=T.NotebookCell=T.ExecutionSummary=T.NotebookCellKind=T.DiagnosticRefreshRequest=T.WorkspaceDiagnosticRequest=T.DocumentDiagnosticRequest=T.DocumentDiagnosticReportKind=T.DiagnosticServerCancellationData=T.InlayHintRefreshRequest=T.InlayHintResolveRequest=T.InlayHintRequest=T.InlineValueRefreshRequest=T.InlineValueRequest=T.TypeHierarchySupertypesRequest=T.TypeHierarchySubtypesRequest=T.TypeHierarchyPrepareRequest=void 0;var z=st(),Tw=ic(),Ft=sc(),hD=KS();Object.defineProperty(T,"ImplementationRequest",{enumerable:!0,get:function(){return hD.ImplementationRequest}});var fD=XS();Object.defineProperty(T,"TypeDefinitionRequest",{enumerable:!0,get:function(){return fD.TypeDefinitionRequest}});var C0=QS();Object.defineProperty(T,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return C0.WorkspaceFoldersRequest}});Object.defineProperty(T,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return C0.DidChangeWorkspaceFoldersNotification}});var dD=tk();Object.defineProperty(T,"ConfigurationRequest",{enumerable:!0,get:function(){return dD.ConfigurationRequest}});var R0=ik();Object.defineProperty(T,"DocumentColorRequest",{enumerable:!0,get:function(){return R0.DocumentColorRequest}});Object.defineProperty(T,"ColorPresentationRequest",{enumerable:!0,get:function(){return R0.ColorPresentationRequest}});var P0=ak();Object.defineProperty(T,"FoldingRangeRequest",{enumerable:!0,get:function(){return P0.FoldingRangeRequest}});Object.defineProperty(T,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return P0.FoldingRangeRefreshRequest}});var pD=ck();Object.defineProperty(T,"DeclarationRequest",{enumerable:!0,get:function(){return pD.DeclarationRequest}});var gD=dk();Object.defineProperty(T,"SelectionRangeRequest",{enumerable:!0,get:function(){return gD.SelectionRangeRequest}});var Ug=yk();Object.defineProperty(T,"WorkDoneProgress",{enumerable:!0,get:function(){return Ug.WorkDoneProgress}});Object.defineProperty(T,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCreateRequest}});Object.defineProperty(T,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCancelNotification}});var Wg=Tk();Object.defineProperty(T,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(T,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(T,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyPrepareRequest}});var To=Ak();Object.defineProperty(T,"TokenFormat",{enumerable:!0,get:function(){return To.TokenFormat}});Object.defineProperty(T,"SemanticTokensRequest",{enumerable:!0,get:function(){return To.SemanticTokensRequest}});Object.defineProperty(T,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return To.SemanticTokensDeltaRequest}});Object.defineProperty(T,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return To.SemanticTokensRangeRequest}});Object.defineProperty(T,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return To.SemanticTokensRefreshRequest}});Object.defineProperty(T,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return To.SemanticTokensRegistrationType}});var mD=Rk();Object.defineProperty(T,"ShowDocumentRequest",{enumerable:!0,get:function(){return mD.ShowDocumentRequest}});var yD=Ik();Object.defineProperty(T,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return yD.LinkedEditingRangeRequest}});var ps=Bk();Object.defineProperty(T,"FileOperationPatternKind",{enumerable:!0,get:function(){return ps.FileOperationPatternKind}});Object.defineProperty(T,"DidCreateFilesNotification",{enumerable:!0,get:function(){return ps.DidCreateFilesNotification}});Object.defineProperty(T,"WillCreateFilesRequest",{enumerable:!0,get:function(){return ps.WillCreateFilesRequest}});Object.defineProperty(T,"DidRenameFilesNotification",{enumerable:!0,get:function(){return ps.DidRenameFilesNotification}});Object.defineProperty(T,"WillRenameFilesRequest",{enumerable:!0,get:function(){return ps.WillRenameFilesRequest}});Object.defineProperty(T,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return ps.DidDeleteFilesNotification}});Object.defineProperty(T,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return ps.WillDeleteFilesRequest}});var Hg=Kk();Object.defineProperty(T,"UniquenessLevel",{enumerable:!0,get:function(){return Hg.UniquenessLevel}});Object.defineProperty(T,"MonikerKind",{enumerable:!0,get:function(){return Hg.MonikerKind}});Object.defineProperty(T,"MonikerRequest",{enumerable:!0,get:function(){return Hg.MonikerRequest}});var Gg=Yk();Object.defineProperty(T,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchyPrepareRequest}});Object.defineProperty(T,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySubtypesRequest}});Object.defineProperty(T,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySupertypesRequest}});var D0=Zk();Object.defineProperty(T,"InlineValueRequest",{enumerable:!0,get:function(){return D0.InlineValueRequest}});Object.defineProperty(T,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return D0.InlineValueRefreshRequest}});var Kg=rw();Object.defineProperty(T,"InlayHintRequest",{enumerable:!0,get:function(){return Kg.InlayHintRequest}});Object.defineProperty(T,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Kg.InlayHintResolveRequest}});Object.defineProperty(T,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Kg.InlayHintRefreshRequest}});var ja=cw();Object.defineProperty(T,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ja.DiagnosticServerCancellationData}});Object.defineProperty(T,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ja.DocumentDiagnosticReportKind}});Object.defineProperty(T,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ja.DocumentDiagnosticRequest}});Object.defineProperty(T,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ja.WorkspaceDiagnosticRequest}});Object.defineProperty(T,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ja.DiagnosticRefreshRequest}});var Mr=yw();Object.defineProperty(T,"NotebookCellKind",{enumerable:!0,get:function(){return Mr.NotebookCellKind}});Object.defineProperty(T,"ExecutionSummary",{enumerable:!0,get:function(){return Mr.ExecutionSummary}});Object.defineProperty(T,"NotebookCell",{enumerable:!0,get:function(){return Mr.NotebookCell}});Object.defineProperty(T,"NotebookDocument",{enumerable:!0,get:function(){return Mr.NotebookDocument}});Object.defineProperty(T,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Mr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(T,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidOpenNotebookDocumentNotification}});Object.defineProperty(T,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Mr.NotebookCellArrayChange}});Object.defineProperty(T,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidChangeNotebookDocumentNotification}});Object.defineProperty(T,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidSaveNotebookDocumentNotification}});Object.defineProperty(T,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidCloseNotebookDocumentNotification}});var bD=_w();Object.defineProperty(T,"InlineCompletionRequest",{enumerable:!0,get:function(){return bD.InlineCompletionRequest}});var jg;(function(t){function e(n){let r=n;return Ft.string(r)||Ft.string(r.language)||Ft.string(r.scheme)||Ft.string(r.pattern)}t.is=e})(jg||(T.TextDocumentFilter=jg={}));var Fg;(function(t){function e(n){let r=n;return Ft.objectLiteral(r)&&(Ft.string(r.notebookType)||Ft.string(r.scheme)||Ft.string(r.pattern))}t.is=e})(Fg||(T.NotebookDocumentFilter=Fg={}));var $g;(function(t){function e(n){let r=n;return Ft.objectLiteral(r)&&(Ft.string(r.notebook)||Fg.is(r.notebook))&&(r.language===void 0||Ft.string(r.language))}t.is=e})($g||(T.NotebookCellTextDocumentFilter=$g={}));var Bg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Ft.string(r)&&!jg.is(r)&&!$g.is(r))return!1;return!0}t.is=e})(Bg||(T.DocumentSelector=Bg={}));var Sw;(function(t){t.method="client/registerCapability",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(Sw||(T.RegistrationRequest=Sw={}));var kw;(function(t){t.method="client/unregisterCapability",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(kw||(T.UnregistrationRequest=kw={}));var ww;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(ww||(T.ResourceOperationKind=ww={}));var xw;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(xw||(T.FailureHandlingKind=xw={}));var Ew;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(Ew||(T.PositionEncodingKind=Ew={}));var Aw;(function(t){function e(n){let r=n;return r&&Ft.string(r.id)&&r.id.length>0}t.hasId=e})(Aw||(T.StaticRegistrationOptions=Aw={}));var Ow;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Bg.is(r.documentSelector))}t.is=e})(Ow||(T.TextDocumentRegistrationOptions=Ow={}));var Cw;(function(t){function e(r){let i=r;return Ft.objectLiteral(i)&&(i.workDoneProgress===void 0||Ft.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Ft.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(Cw||(T.WorkDoneProgressOptions=Cw={}));var Rw;(function(t){t.method="initialize",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(Rw||(T.InitializeRequest=Rw={}));var Pw;(function(t){t.unknownProtocolVersion=1})(Pw||(T.InitializeErrorCodes=Pw={}));var Dw;(function(t){t.method="initialized",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Dw||(T.InitializedNotification=Dw={}));var Iw;(function(t){t.method="shutdown",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType0(t.method)})(Iw||(T.ShutdownRequest=Iw={}));var Mw;(function(t){t.method="exit",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType0(t.method)})(Mw||(T.ExitNotification=Mw={}));var Lw;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Lw||(T.DidChangeConfigurationNotification=Lw={}));var Nw;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Nw||(T.MessageType=Nw={}));var qw;(function(t){t.method="window/showMessage",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(qw||(T.ShowMessageNotification=qw={}));var jw;(function(t){t.method="window/showMessageRequest",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(jw||(T.ShowMessageRequest=jw={}));var Fw;(function(t){t.method="window/logMessage",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(Fw||(T.LogMessageNotification=Fw={}));var $w;(function(t){t.method="telemetry/event",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})($w||(T.TelemetryEventNotification=$w={}));var Bw;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Bw||(T.TextDocumentSyncKind=Bw={}));var Uw;(function(t){t.method="textDocument/didOpen",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Uw||(T.DidOpenTextDocumentNotification=Uw={}));var Ww;(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})(Ww||(T.TextDocumentContentChangeEvent=Ww={}));var Hw;(function(t){t.method="textDocument/didChange",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Hw||(T.DidChangeTextDocumentNotification=Hw={}));var Gw;(function(t){t.method="textDocument/didClose",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Gw||(T.DidCloseTextDocumentNotification=Gw={}));var Kw;(function(t){t.method="textDocument/didSave",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Kw||(T.DidSaveTextDocumentNotification=Kw={}));var zw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(zw||(T.TextDocumentSaveReason=zw={}));var Vw;(function(t){t.method="textDocument/willSave",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Vw||(T.WillSaveTextDocumentNotification=Vw={}));var Xw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(Xw||(T.WillSaveTextDocumentWaitUntilRequest=Xw={}));var Yw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(Yw||(T.DidChangeWatchedFilesNotification=Yw={}));var Jw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Jw||(T.FileChangeType=Jw={}));var Qw;(function(t){function e(n){let r=n;return Ft.objectLiteral(r)&&(Tw.URI.is(r.baseUri)||Tw.WorkspaceFolder.is(r.baseUri))&&Ft.string(r.pattern)}t.is=e})(Qw||(T.RelativePattern=Qw={}));var Zw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Zw||(T.WatchKind=Zw={}));var e0;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(e0||(T.PublishDiagnosticsNotification=e0={}));var t0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(t0||(T.CompletionTriggerKind=t0={}));var n0;(function(t){t.method="textDocument/completion",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(n0||(T.CompletionRequest=n0={}));var r0;(function(t){t.method="completionItem/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(r0||(T.CompletionResolveRequest=r0={}));var i0;(function(t){t.method="textDocument/hover",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(i0||(T.HoverRequest=i0={}));var s0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(s0||(T.SignatureHelpTriggerKind=s0={}));var o0;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(o0||(T.SignatureHelpRequest=o0={}));var a0;(function(t){t.method="textDocument/definition",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(a0||(T.DefinitionRequest=a0={}));var u0;(function(t){t.method="textDocument/references",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(u0||(T.ReferencesRequest=u0={}));var l0;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(l0||(T.DocumentHighlightRequest=l0={}));var c0;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(c0||(T.DocumentSymbolRequest=c0={}));var h0;(function(t){t.method="textDocument/codeAction",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(h0||(T.CodeActionRequest=h0={}));var f0;(function(t){t.method="codeAction/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(f0||(T.CodeActionResolveRequest=f0={}));var d0;(function(t){t.method="workspace/symbol",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(d0||(T.WorkspaceSymbolRequest=d0={}));var p0;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(p0||(T.WorkspaceSymbolResolveRequest=p0={}));var g0;(function(t){t.method="textDocument/codeLens",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(g0||(T.CodeLensRequest=g0={}));var m0;(function(t){t.method="codeLens/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(m0||(T.CodeLensResolveRequest=m0={}));var y0;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType0(t.method)})(y0||(T.CodeLensRefreshRequest=y0={}));var b0;(function(t){t.method="textDocument/documentLink",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(b0||(T.DocumentLinkRequest=b0={}));var v0;(function(t){t.method="documentLink/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(v0||(T.DocumentLinkResolveRequest=v0={}));var _0;(function(t){t.method="textDocument/formatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(_0||(T.DocumentFormattingRequest=_0={}));var T0;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(T0||(T.DocumentRangeFormattingRequest=T0={}));var S0;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(S0||(T.DocumentRangesFormattingRequest=S0={}));var k0;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(k0||(T.DocumentOnTypeFormattingRequest=k0={}));var w0;(function(t){t.Identifier=1})(w0||(T.PrepareSupportDefaultBehavior=w0={}));var x0;(function(t){t.method="textDocument/rename",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(x0||(T.RenameRequest=x0={}));var E0;(function(t){t.method="textDocument/prepareRename",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(E0||(T.PrepareRenameRequest=E0={}));var A0;(function(t){t.method="workspace/executeCommand",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(A0||(T.ExecuteCommandRequest=A0={}));var O0;(function(t){t.method="workspace/applyEdit",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType("workspace/applyEdit")})(O0||(T.ApplyWorkspaceEditRequest=O0={}))});var L0=m(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.createProtocolConnection=void 0;var M0=ds();function vD(t,e,n,r){return M0.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,M0.createMessageConnection)(t,e,n,r)}_c.createProtocolConnection=vD});var q0=m(xn=>{"use strict";var _D=xn&&xn.__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]}),Tc=xn&&xn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_D(e,t,n)};Object.defineProperty(xn,"__esModule",{value:!0});xn.LSPErrorCodes=xn.createProtocolConnection=void 0;Tc(ds(),xn);Tc(ic(),xn);Tc(st(),xn);Tc(I0(),xn);var TD=L0();Object.defineProperty(xn,"createProtocolConnection",{enumerable:!0,get:function(){return TD.createProtocolConnection}});var N0;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(N0||(xn.LSPErrorCodes=N0={}))});var St=m(Lr=>{"use strict";var SD=Lr&&Lr.__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]}),j0=Lr&&Lr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&SD(e,t,n)};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.createProtocolConnection=void 0;var kD=Rg();j0(Rg(),Lr);j0(q0(),Lr);function wD(t,e,n,r){return(0,kD.createMessageConnection)(t,e,n,r)}Lr.createProtocolConnection=wD});var zg=m(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.generateUuid=Gn.parse=Gn.isUUID=Gn.v4=Gn.empty=void 0;var Fa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},$a=class t extends Fa{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};$a._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];$a._timeHighBits=["8","9","a","b"];Gn.empty=new Fa("00000000-0000-0000-0000-000000000000");function F0(){return new $a}Gn.v4=F0;var xD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function $0(t){return xD.test(t)}Gn.isUUID=$0;function ED(t){if(!$0(t))throw new Error("invalid uuid");return new Fa(t)}Gn.parse=ED;function AD(){return F0().asHex()}Gn.generateUuid=AD});var B0=m(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.attachPartialResult=Li.ProgressFeature=Li.attachWorkDone=void 0;var Mi=St(),OD=zg(),gs=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(Mi.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(Mi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Mi.WorkDoneProgress.type,this._token,{kind:"end"})}};gs.Instances=new Map;var Sc=class extends gs{constructor(e,n){super(e,n),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ba=class{constructor(){}begin(){}report(){}done(){}},kc=class extends Ba{constructor(){super(),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function CD(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ba;let n=e.workDoneToken;return delete e.workDoneToken,new gs(t,n)}Li.attachWorkDone=CD;var RD=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Mi.WorkDoneProgressCancelNotification.type,n=>{let r=gs.Instances.get(n.token);(r instanceof Sc||r instanceof kc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ba:new gs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,OD.generateUuid)();return this.connection.sendRequest(Mi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Sc(this.connection,e))}else return Promise.resolve(new kc)}};Li.ProgressFeature=RD;var Vg;(function(t){t.type=new Mi.ProgressType})(Vg||(Vg={}));var Xg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Vg.type,this._token,e)}};function PD(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Xg(t,n)}Li.attachPartialResult=PD});var U0=m(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.ConfigurationFeature=void 0;var DD=St(),ID=Ll(),MD=t=>class extends t{getConfiguration(e){return e?ID.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(DD.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};wc.ConfigurationFeature=MD});var W0=m(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.WorkspaceFoldersFeature=void 0;var xc=St(),LD=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new xc.Emitter,this.connection.onNotification(xc.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(xc.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(xc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ec.WorkspaceFoldersFeature=LD});var H0=m(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.CallHierarchyFeature=void 0;var Yg=St(),ND=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Yg.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Yg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Yg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ac.CallHierarchyFeature=ND});var Qg=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.SemanticTokensBuilder=Ni.SemanticTokensDiff=Ni.SemanticTokensFeature=void 0;var Oc=St(),qD=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Oc.SemanticTokensRefreshRequest.type),on:e=>{let n=Oc.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Oc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Oc.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ni.SemanticTokensFeature=qD;var Cc=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}]:[]}};Ni.SemanticTokensDiff=Cc;var Jg=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 Cc(this._prevData,this._data).computeDiff()}:this.build()}};Ni.SemanticTokensBuilder=Jg});var G0=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.ShowDocumentFeature=void 0;var jD=St(),FD=t=>class extends t{showDocument(e){return this.connection.sendRequest(jD.ShowDocumentRequest.type,e)}};Rc.ShowDocumentFeature=FD});var K0=m(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.FileOperationsFeature=void 0;var So=St(),$D=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(So.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(So.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(So.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(So.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(So.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(So.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Pc.FileOperationsFeature=$D});var z0=m(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.LinkedEditingRangeFeature=void 0;var BD=St(),UD=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(BD.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Dc.LinkedEditingRangeFeature=UD});var V0=m(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.TypeHierarchyFeature=void 0;var Zg=St(),WD=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Zg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Zg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Zg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ic.TypeHierarchyFeature=WD});var Y0=m(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.InlineValueFeature=void 0;var X0=St(),HD=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(X0.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(X0.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Mc.InlineValueFeature=HD});var Q0=m(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.FoldingRangeFeature=void 0;var J0=St(),GD=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(J0.FoldingRangeRefreshRequest.type),on:e=>{let n=J0.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Lc.FoldingRangeFeature=GD});var Z0=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.InlayHintFeature=void 0;var em=St(),KD=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(em.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(em.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(em.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Nc.InlayHintFeature=KD});var ex=m(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.DiagnosticFeature=void 0;var Ua=St(),zD=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ua.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ua.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Ua.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.WorkspaceDiagnosticRequest.partialResult,n)))}}};qc.DiagnosticFeature=zD});var nm=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.TextDocuments=void 0;var ms=St(),tm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ms.Emitter,this._onDidOpen=new ms.Emitter,this._onDidClose=new ms.Emitter,this._onDidSave=new ms.Emitter,this._onWillSave=new ms.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=ms.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}))})),ms.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};jc.TextDocuments=tm});var im=m(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.NotebookDocuments=ko.NotebookSyncFeature=void 0;var Kn=St(),tx=nm(),VD=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Kn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Kn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Kn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Kn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};ko.NotebookSyncFeature=VD;var Fc=class t{onDidOpenTextDocument(e){return this.openHandler=e,Kn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Kn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Kn.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}};Fc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var rm=class{constructor(e){e instanceof tx.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new tx.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Kn.Emitter,this._onDidChange=new Kn.Emitter,this._onDidSave=new Kn.Emitter,this._onDidClose=new Kn.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 Fc,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 l=[],c=[],h=[],f=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let k=A.structure.array;if(s.cells.splice(k.start,k.deleteCount,...k.cells!==void 0?k.cells:[]),A.structure.didOpen!==void 0)for(let S of A.structure.didOpen)n.openTextDocument({textDocument:S}),l.push(S.uri);if(A.structure.didClose)for(let S of A.structure.didClose)n.closeTextDocument({textDocument:S}),c.push(S.uri)}if(A.data!==void 0){let k=new Map(A.data.map(S=>[S.document,S]));for(let S=0;S<=s.cells.length;S++){let _=k.get(s.cells[S].document);if(_!==void 0){let N=s.cells.splice(S,1,_);if(h.push({old:N[0],new:_}),k.delete(_.document),k.size===0)break}}}if(A.textContent!==void 0)for(let k of A.textContent)n.changeTextDocument({textDocument:k.document,contentChanges:k.changes}),f.push(k.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let v=[];for(let A of l)v.push(this.getNotebookCell(A));let b=[];for(let A of c)b.push(this.getNotebookCell(A));let O=[];for(let A of f)O.push(this.getNotebookCell(A));(v.length>0||b.length>0||h.length>0||O.length>0)&&(g.cells={added:v,removed:b,changed:{data:h,textContent:O}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),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)}})),Kn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};ko.NotebookDocuments=rm});var nx=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.MonikerFeature=void 0;var XD=St(),YD=t=>class extends t{get moniker(){return{on:e=>{let n=XD.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$c.MonikerFeature=YD});var cm=m(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.createConnection=Le.combineFeatures=Le.combineNotebooksFeatures=Le.combineLanguagesFeatures=Le.combineWorkspaceFeatures=Le.combineWindowFeatures=Le.combineClientFeatures=Le.combineTracerFeatures=Le.combineTelemetryFeatures=Le.combineConsoleFeatures=Le._NotebooksImpl=Le._LanguagesImpl=Le.BulkUnregistration=Le.BulkRegistration=Le.ErrorMessageTracker=void 0;var J=St(),zn=Ll(),om=zg(),ye=B0(),JD=U0(),QD=W0(),ZD=H0(),eI=Qg(),tI=G0(),nI=K0(),rI=z0(),iI=V0(),sI=Y0(),oI=Q0(),aI=Z0(),uI=ex(),lI=im(),cI=nx();function sm(t){if(t!==null)return t}var am=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)})}};Le.ErrorMessageTracker=am;var Bc=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(J.MessageType.Error,e)}warn(e){this.send(J.MessageType.Warning,e)}info(e){this.send(J.MessageType.Info,e)}log(e){this.send(J.MessageType.Log,e)}debug(e){this.send(J.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(J.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,J.RAL)().console.error("Sending log message failed")})}},um=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:J.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}showWarningMessage(e,...n){let r={type:J.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}showInformationMessage(e,...n){let r={type:J.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}},rx=(0,tI.ShowDocumentFeature)((0,ye.ProgressFeature)(um)),ix;(function(t){function e(){return new Uc}t.create=e})(ix||(Le.BulkRegistration=ix={}));var Uc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=zn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=om.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},sx;(function(t){function e(){return new Wa(void 0,[])}t.create=e})(sx||(Le.BulkUnregistration=sx={}));var Wa=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(J.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=zn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(J.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Wc=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 Uc?this.registerMany(e):e instanceof Wa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=zn.string(n)?n:n.method,s=om.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(J.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=zn.string(e)?e:e.method,i=om.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(J.RegistrationRequest.type,s).then(o=>J.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(J.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(J.RegistrationRequest.type,n).then(()=>new Wa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},lm=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(J.ApplyWorkspaceEditRequest.type,r)}},ox=(0,nI.FileOperationsFeature)((0,QD.WorkspaceFoldersFeature)((0,JD.ConfigurationFeature)(lm))),Hc=class{constructor(){this._trace=J.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!==J.Trace.Off&&this.connection.sendNotification(J.LogTraceNotification.type,{message:e,verbose:this._trace===J.Trace.Verbose?n:void 0}).catch(()=>{})}},Gc=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(J.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Kc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._LanguagesImpl=Kc;var ax=(0,oI.FoldingRangeFeature)((0,cI.MonikerFeature)((0,uI.DiagnosticFeature)((0,aI.InlayHintFeature)((0,sI.InlineValueFeature)((0,iI.TypeHierarchyFeature)((0,rI.LinkedEditingRangeFeature)((0,eI.SemanticTokensFeature)((0,ZD.CallHierarchyFeature)(Kc))))))))),zc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._NotebooksImpl=zc;var ux=(0,lI.NotebookSyncFeature)(zc);function lx(t,e){return function(n){return e(t(n))}}Le.combineConsoleFeatures=lx;function cx(t,e){return function(n){return e(t(n))}}Le.combineTelemetryFeatures=cx;function hx(t,e){return function(n){return e(t(n))}}Le.combineTracerFeatures=hx;function fx(t,e){return function(n){return e(t(n))}}Le.combineClientFeatures=fx;function dx(t,e){return function(n){return e(t(n))}}Le.combineWindowFeatures=dx;function px(t,e){return function(n){return e(t(n))}}Le.combineWorkspaceFeatures=px;function gx(t,e){return function(n){return e(t(n))}}Le.combineLanguagesFeatures=gx;function mx(t,e){return function(n){return e(t(n))}}Le.combineNotebooksFeatures=mx;function hI(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,lx),tracer:n(t.tracer,e.tracer,hx),telemetry:n(t.telemetry,e.telemetry,cx),client:n(t.client,e.client,fx),window:n(t.window,e.window,dx),workspace:n(t.workspace,e.workspace,px),languages:n(t.languages,e.languages,gx),notebooks:n(t.notebooks,e.notebooks,mx)}}Le.combineFeatures=hI;function fI(t,e,n){let r=n&&n.console?new(n.console(Bc)):new Bc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Hc)):new Hc,o=n&&n.telemetry?new(n.telemetry(Gc)):new Gc,a=n&&n.client?new(n.client(Wc)):new Wc,u=n&&n.window?new(n.window(rx)):new rx,l=n&&n.workspace?new(n.workspace(ox)):new ox,c=n&&n.languages?new(n.languages(ax)):new ax,h=n&&n.notebooks?new(n.notebooks(ux)):new ux,f=[r,s,o,a,u,l,c,h];function g(k){return k instanceof Promise?k:zn.thenable(k)?new Promise((S,_)=>{k.then(N=>S(N),N=>_(N))}):Promise.resolve(k)}let v,b,O,A={listen:()=>i.listen(),sendRequest:(k,...S)=>i.sendRequest(zn.string(k)?k:k.method,...S),onRequest:(k,S)=>i.onRequest(k,S),sendNotification:(k,S)=>{let _=zn.string(k)?k:k.method;return i.sendNotification(_,S)},onNotification:(k,S)=>i.onNotification(k,S),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:k=>(b=k,{dispose:()=>{b=void 0}}),onInitialized:k=>i.onNotification(J.InitializedNotification.type,k),onShutdown:k=>(v=k,{dispose:()=>{v=void 0}}),onExit:k=>(O=k,{dispose:()=>{O=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 l},get languages(){return c},get notebooks(){return h},onDidChangeConfiguration:k=>i.onNotification(J.DidChangeConfigurationNotification.type,k),onDidChangeWatchedFiles:k=>i.onNotification(J.DidChangeWatchedFilesNotification.type,k),__textDocumentSync:void 0,onDidOpenTextDocument:k=>i.onNotification(J.DidOpenTextDocumentNotification.type,k),onDidChangeTextDocument:k=>i.onNotification(J.DidChangeTextDocumentNotification.type,k),onDidCloseTextDocument:k=>i.onNotification(J.DidCloseTextDocumentNotification.type,k),onWillSaveTextDocument:k=>i.onNotification(J.WillSaveTextDocumentNotification.type,k),onWillSaveTextDocumentWaitUntil:k=>i.onRequest(J.WillSaveTextDocumentWaitUntilRequest.type,k),onDidSaveTextDocument:k=>i.onNotification(J.DidSaveTextDocumentNotification.type,k),sendDiagnostics:k=>i.sendNotification(J.PublishDiagnosticsNotification.type,k),onHover:k=>i.onRequest(J.HoverRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onCompletion:k=>i.onRequest(J.CompletionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCompletionResolve:k=>i.onRequest(J.CompletionResolveRequest.type,k),onSignatureHelp:k=>i.onRequest(J.SignatureHelpRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDeclaration:k=>i.onRequest(J.DeclarationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDefinition:k=>i.onRequest(J.DefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onTypeDefinition:k=>i.onRequest(J.TypeDefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onImplementation:k=>i.onRequest(J.ImplementationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onReferences:k=>i.onRequest(J.ReferencesRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentHighlight:k=>i.onRequest(J.DocumentHighlightRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentSymbol:k=>i.onRequest(J.DocumentSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onWorkspaceSymbol:k=>i.onRequest(J.WorkspaceSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onWorkspaceSymbolResolve:k=>i.onRequest(J.WorkspaceSymbolResolveRequest.type,k),onCodeAction:k=>i.onRequest(J.CodeActionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCodeActionResolve:k=>i.onRequest(J.CodeActionResolveRequest.type,(S,_)=>k(S,_)),onCodeLens:k=>i.onRequest(J.CodeLensRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCodeLensResolve:k=>i.onRequest(J.CodeLensResolveRequest.type,(S,_)=>k(S,_)),onDocumentFormatting:k=>i.onRequest(J.DocumentFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDocumentRangeFormatting:k=>i.onRequest(J.DocumentRangeFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDocumentOnTypeFormatting:k=>i.onRequest(J.DocumentOnTypeFormattingRequest.type,(S,_)=>k(S,_)),onRenameRequest:k=>i.onRequest(J.RenameRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onPrepareRename:k=>i.onRequest(J.PrepareRenameRequest.type,(S,_)=>k(S,_)),onDocumentLinks:k=>i.onRequest(J.DocumentLinkRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentLinkResolve:k=>i.onRequest(J.DocumentLinkResolveRequest.type,(S,_)=>k(S,_)),onDocumentColor:k=>i.onRequest(J.DocumentColorRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onColorPresentation:k=>i.onRequest(J.ColorPresentationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onFoldingRanges:k=>i.onRequest(J.FoldingRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onSelectionRanges:k=>i.onRequest(J.SelectionRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onExecuteCommand:k=>i.onRequest(J.ExecuteCommandRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),dispose:()=>i.dispose()};for(let k of f)k.attach(A);return i.onRequest(J.InitializeRequest.type,k=>{e.initialize(k),zn.string(k.trace)&&(s.trace=J.Trace.fromString(k.trace));for(let S of f)S.initialize(k.capabilities);if(b){let S=b(k,new J.CancellationTokenSource().token,(0,ye.attachWorkDone)(i,k),void 0);return g(S).then(_=>{if(_ instanceof J.ResponseError)return _;let N=_;N||(N={capabilities:{}});let R=N.capabilities;R||(R={},N.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=zn.number(A.__textDocumentSync)?A.__textDocumentSync:J.TextDocumentSyncKind.None:!zn.number(R.textDocumentSync)&&!zn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=zn.number(A.__textDocumentSync)?A.__textDocumentSync:J.TextDocumentSyncKind.None);for(let G of f)G.fillServerCapabilities(R);return N})}else{let S={capabilities:{textDocumentSync:J.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(S.capabilities);return S}}),i.onRequest(J.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,v)return v(new J.CancellationTokenSource().token)}),i.onNotification(J.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(J.SetTraceNotification.type,k=>{s.trace=J.Trace.fromString(k.value)}),A}Le.createConnection=fI});var yx=m(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.resolveModulePath=En.FileSystem=En.resolveGlobalYarnPath=En.resolveGlobalNodePath=En.resolve=En.uriToFilePath=void 0;var dI=require("url"),br=require("path"),hm=require("fs"),gm=require("child_process");function pI(t){let e=dI.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 br.normalize(n.join("/"))}En.uriToFilePath=pI;function fm(){return process.platform==="win32"}function Vc(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,l=Object.create(null);Object.keys(u).forEach(c=>l[c]=u[c]),e&&hm.existsSync(e)&&(l[i]?l[i]=e+br.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let c=(0,gm.fork)("",[],{cwd:n,env:l,execArgv:["-e",s]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",f=>{a(f)}),c.on("message",f=>{f.c==="r"&&(c.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};c.send(h)}catch(c){a(c)}})}En.resolve=Vc;function dm(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};fm()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,gm.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?fm()?br.join(o,"node_modules"):br.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}En.resolveGlobalNodePath=dm;function gI(t){let e="yarn",n={encoding:"utf8"};fm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,gm.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 br.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}En.resolveGlobalYarnPath=gI;var pm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!hm.existsSync(__filename.toUpperCase())||!hm.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?br.normalize(s).indexOf(br.normalize(i))===0:br.normalize(s).toLowerCase().indexOf(br.normalize(i).toLowerCase())===0}t.isParent=r})(pm||(En.FileSystem=pm={}));function mI(t,e,n,r){return n?(br.isAbsolute(n)||(n=br.join(t,n)),Vc(e,n,n,r).then(i=>pm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Vc(e,dm(r),t,r))):Vc(e,dm(r),t,r)}En.resolveModulePath=mI});var mm=m((SG,bx)=>{"use strict";bx.exports=St()});var vx=m(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.InlineCompletionFeature=void 0;var yI=St(),bI=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(yI.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Xc.InlineCompletionFeature=bI});var Sx=m(rn=>{"use strict";var vI=rn&&rn.__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]}),Tx=rn&&rn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vI(e,t,n)};Object.defineProperty(rn,"__esModule",{value:!0});rn.ProposedFeatures=rn.NotebookDocuments=rn.TextDocuments=rn.SemanticTokensBuilder=void 0;var _I=Qg();Object.defineProperty(rn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return _I.SemanticTokensBuilder}});var TI=vx();Tx(St(),rn);var SI=nm();Object.defineProperty(rn,"TextDocuments",{enumerable:!0,get:function(){return SI.TextDocuments}});var kI=im();Object.defineProperty(rn,"NotebookDocuments",{enumerable:!0,get:function(){return kI.NotebookDocuments}});Tx(cm(),rn);var _x;(function(t){t.all={__brand:"features",languages:TI.InlineCompletionFeature}})(_x||(rn.ProposedFeatures=_x={}))});var bm=m(Vn=>{"use strict";var wI=Vn&&Vn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ex=Vn&&Vn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&wI(e,t,n)};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createConnection=Vn.Files=void 0;var kx=require("node:util"),ym=Ll(),xI=cm(),Ha=yx(),ys=mm();Ex(mm(),Vn);Ex(Sx(),Vn);var wx;(function(t){t.uriToFilePath=Ha.uriToFilePath,t.resolveGlobalNodePath=Ha.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ha.resolveGlobalYarnPath,t.resolve=Ha.resolve,t.resolveModulePath=Ha.resolveModulePath})(wx||(Vn.Files=wx={}));var xx;function Yc(){if(xx!==void 0)try{xx.end()}catch{}}var wo=!1,Ax;function EI(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ax=setInterval(()=>{try{process.kill(r,0)}catch{Yc(),process.exit(wo?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}EI();var AI={initialize:t=>{let e=t.processId;ym.number(e)&&Ax===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(wo?0:1)}},3e3)},get shutdownReceived(){return wo},set shutdownReceived(t){wo=t},exit:t=>{Yc(),process.exit(t)}};function OI(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),ys.ConnectionStrategy.is(t)||ys.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),CI(s,o,a,i)}Vn.createConnection=OI;function CI(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,l,c=process.argv.slice(2);for(let h=0;h<c.length;h++){let f=c[h];if(f==="--node-ipc"){t=new ys.IPCMessageReader(process),e=new ys.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){u=parseInt(c[h+1]);break}else if(f==="--pipe"){l=c[h+1];break}else{var s=f.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(u){let h=(0,ys.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(l){let h=(0,ys.createServerPipeTransport)(l);t=h[0],e=h[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(ym.func(t.read)&&ym.func(t.on)){let u=t;u.on("end",()=>{Yc(),process.exit(wo?0:1)}),u.on("close",()=>{Yc(),process.exit(wo?0:1)})}let a=u=>{let l=(0,ys.createProtocolConnection)(t,e,u,n);return i&&RI(u),l};return(0,xI.createConnection)(a,AI,r)}function RI(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,kx.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,kx.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 vm=m((AG,Ox)=>{"use strict";Ox.exports=bm()});var bs=m(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.TypeAnalyzerStrategy=An.IndentationType=An.DefaultFileExtensions=An.ConfigurationNamespace=An.LanguageId=void 0;An.LanguageId="miniscript";An.ConfigurationNamespace="miniscript";An.DefaultFileExtensions=["ms"];var PI;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(PI=An.IndentationType||(An.IndentationType={}));var DI;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(DI=An.TypeAnalyzerStrategy||(An.TypeAnalyzerStrategy={}))});var Ga=m(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.Position=void 0;var _m=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Jc.Position=_m});var qi=m(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LiteralToken=Ln.Token=Ln.BaseToken=Ln.BaseTokenOptions=Ln.TokenType=void 0;var Cx=Ga(),II;(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"})(II=Ln.TokenType||(Ln.TokenType={}));var Tm=class{};Ln.BaseTokenOptions=Tm;var Ka=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 Cx.Position(this.line,r[0]-n[0]+1),this.end=new Cx.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}']`}};Ln.BaseToken=Ka;var Sm=class extends Ka{};Ln.Token=Sm;var km=class extends Ka{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}]`}};Ln.LiteralToken=km});var Qc=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.CharacterCode=void 0;var MI;(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"})(MI=za.CharacterCode||(za.CharacterCode={}))});var xo=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.Keyword=void 0;var LI;(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"})(LI=Va.Keyword||(Va.Keyword={}))});var Em=m(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var Xn=Qc(),NI=xo(),wm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(NI.Keyword)))}isWhitespace(e){return Xn.CharacterCode.WHITESPACE===e||Xn.CharacterCode.TAB===e}isEndOfLine(e){return Xn.CharacterCode.NEW_LINE===e||Xn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Xn.CharacterCode.SLASH===e&&Xn.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>=Xn.CharacterCode.NUMBER_0&&e<=Xn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Xn.CharacterCode.RETURN_LINE:return Xn.CharacterCode.NEW_LINE===n;case Xn.CharacterCode.NEW_LINE:return Xn.CharacterCode.RETURN_LINE===n}return!1}};xm.default=wm});var Zc=m(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ParserException=Eo.LexerException=void 0;var Am=class extends Error{constructor(e,n){super(e),this.range=n}};Eo.LexerException=Am;var Om=class extends Error{constructor(e,n){super(e),this.range=n}};Eo.ParserException=Om});var Cm=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.Literal=void 0;var qI;(function(t){t.True="true",t.False="false",t.Null="null"})(qI=Xa.Literal||(Xa.Literal={}))});var Ao=m(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.Operator=void 0;var jI;(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"})(jI=Ya.Operator||(Ya.Operator={}))});var Ja=m(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.Range=void 0;var Rm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};eh.Range=Rm});var Im=m(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var Pm=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}};Dm.default=Pm});var Nm=m(Za=>{"use strict";var Px=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var ot=qi(),FI=Px(Em()),Te=Qc(),$I=Zc(),Mm=xo(),Qa=Cm(),at=Ao(),Oo=Ga(),Lm=Ja(),Rx=Px(Im());function ji(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var th=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 FI.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Rx.default,r.snapshot=new Rx.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 ot.Token({type:ot.TokenType.EOL,value:at.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 ot.Token({type:ot.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 ot.Token({type:ot.TokenType.EOF,value:at.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 ot.LiteralToken({type:ot.TokenType.BooleanLiteral,value:e===Qa.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 ot.LiteralToken({type:ot.TokenType.NilLiteral,value:null,raw:Qa.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 ot.Token({type:ot.TokenType.SliceOperator,value:at.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 ot.Token({type:ot.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 ot.LiteralToken({type:ot.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,l=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(Te.CharacterCode.QUOTE===g){if(Te.CharacterCode.QUOTE!==n.codeAt(1)){l=!0;break}n.index++}}if(!l)return n.raise("Unexpected string end of file.",new Lm.Range(new Oo.Position(i,o-a+1),new Oo.Position(n.line,n.index-u+2)));n.index++;let c=n.content.slice(n.tokenStart,n.index),h=c.slice(1,-1).replace(/""/g,at.Operator.Escape),f=new ot.LiteralToken({type:ot.TokenType.StringLiteral,value:h,raw:c,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(f),f}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 ot.Token({type:ot.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)||Te.CharacterCode.DOT===i||Te.CharacterCode.LETTER_E===i||Te.CharacterCode.LETTER_e===i||(Te.CharacterCode.MINUS===i||Te.CharacterCode.PLUS===i)&&(Te.CharacterCode.LETTER_E===r||Te.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 Lm.Range(new Oo.Position(this.line,this.tokenStart-this.offset+1),new Oo.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 Mm.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Mm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Mm.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new ot.Token({type:ot.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 Qa.Literal.True:case Qa.Literal.False:return n.createBoolean(i,e);case Qa.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 Lm.Range(new Oo.Position(s,e.tokenStart-e.offset+1),new Oo.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 $I.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new ot.Token({type:ot.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Za.default=th;th.scanHandlers={[Te.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[Te.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(at.Operator.Member,e))},[Te.CharacterCode.EQUAL]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.Equal,e):this.scanPunctuator(at.Operator.Assign,e)},[Te.CharacterCode.ARROW_LEFT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.LessThanOrEqual,e):this.scanPunctuator(at.Operator.LessThan,e)},[Te.CharacterCode.ARROW_RIGHT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.GreaterThanOrEqual,e):this.scanPunctuator(at.Operator.GreaterThan,e)},[Te.CharacterCode.EXCLAMATION_MARK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.NotEqual,e):(this.index++,null)},[Te.CharacterCode.MINUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.SubtractShorthand,e):this.scanPunctuator(at.Operator.Minus,e)},[Te.CharacterCode.PLUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.AddShorthand,e):this.scanPunctuator(at.Operator.Plus,e)},[Te.CharacterCode.ASTERISK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.MultiplyShorthand,e):this.scanPunctuator(at.Operator.Asterik,e)},[Te.CharacterCode.SLASH]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.DivideShorthand,e):this.scanPunctuator(at.Operator.Slash,e)},[Te.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[Te.CharacterCode.CARET]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.PowerShorthand,e):this.scanPunctuator(at.Operator.Power,e)},[Te.CharacterCode.PERCENT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.ModuloShorthand,e):this.scanPunctuator(at.Operator.Modulo,e)},[Te.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[Te.CharacterCode.COMMA]:ji,[Te.CharacterCode.CURLY_BRACKET_LEFT]:ji,[Te.CharacterCode.CURLY_BRACKET_RIGHT]:ji,[Te.CharacterCode.SQUARE_BRACKETS_LEFT]:ji,[Te.CharacterCode.SQUARE_BRACKETS_RIGHT]:ji,[Te.CharacterCode.PARENTHESIS_LEFT]:ji,[Te.CharacterCode.PARENTHESIS_RIGHT]:ji,[Te.CharacterCode.AT_SIGN]:ji}});var mt=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ASTComment=Nn.ASTBaseBlockWithScope=Nn.ASTBaseBlock=Nn.ASTBase=Nn.ASTType=void 0;var Dx;(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"})(Dx=Nn.ASTType||(Nn.ASTType={}));var eu=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})}};Nn.ASTBase=eu;var nh=class t extends eu{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
|
35
|
+
`&&d++}y&&E.length>0&&x.push(E.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var E=this.getLineOffsets(),y=0,d=E.length;if(d===0)return o.create(0,x);for(;y<d;){var D=Math.floor((y+d)/2);E[D]>x?d=D:y=D+1}var U=y-1;return o.create(U,x-E[U])},p.prototype.offsetAt=function(x){var E=this.getLineOffsets();if(x.line>=E.length)return this._content.length;if(x.line<0)return 0;var y=E[x.line],d=x.line+1<E.length?E[x.line+1]:this._content.length;return Math.max(Math.min(y+x.character,d),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function E(Oe){return typeof Oe<"u"}p.defined=E;function y(Oe){return typeof Oe>"u"}p.undefined=y;function d(Oe){return Oe===!0||Oe===!1}p.boolean=d;function D(Oe){return x.call(Oe)==="[object String]"}p.string=D;function U(Oe){return x.call(Oe)==="[object Number]"}p.number=U;function ve(Oe,to,Ml){return x.call(Oe)==="[object Number]"&&to<=Oe&&Oe<=Ml}p.numberRange=ve;function pt(Oe){return x.call(Oe)==="[object Number]"&&-2147483648<=Oe&&Oe<=2147483647}p.integer=pt;function Ye(Oe){return x.call(Oe)==="[object Number]"&&0<=Oe&&Oe<=2147483647}p.uinteger=Ye;function gr(Oe){return x.call(Oe)==="[object Function]"}p.func=gr;function mr(Oe){return Oe!==null&&typeof Oe=="object"}p.objectLiteral=mr;function si(Oe,to){return Array.isArray(Oe)&&Oe.every(to)}p.typedArray=si})(I||(I={}))})});var st=m(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ProtocolNotificationType=kn.ProtocolNotificationType0=kn.ProtocolRequestType=kn.ProtocolRequestType0=kn.RegistrationType=kn.MessageDirection=void 0;var co=ds(),$S;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})($S||(kn.MessageDirection=$S={}));var Pg=class{constructor(e){this.method=e}};kn.RegistrationType=Pg;var Dg=class extends co.RequestType0{constructor(e){super(e)}};kn.ProtocolRequestType0=Dg;var Ig=class extends co.RequestType{constructor(e){super(e,co.ParameterStructures.byName)}};kn.ProtocolRequestType=Ig;var Mg=class extends co.NotificationType0{constructor(e){super(e)}};kn.ProtocolNotificationType0=Mg;var Lg=class extends co.NotificationType{constructor(e){super(e,co.ParameterStructures.byName)}};kn.ProtocolNotificationType=Lg});var sc=m(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.objectLiteral=Ct.typedArray=Ct.stringArray=Ct.array=Ct.func=Ct.error=Ct.number=Ct.string=Ct.boolean=void 0;function nD(t){return t===!0||t===!1}Ct.boolean=nD;function BS(t){return typeof t=="string"||t instanceof String}Ct.string=BS;function rD(t){return typeof t=="number"||t instanceof Number}Ct.number=rD;function iD(t){return t instanceof Error}Ct.error=iD;function sD(t){return typeof t=="function"}Ct.func=sD;function US(t){return Array.isArray(t)}Ct.array=US;function oD(t){return US(t)&&t.every(e=>BS(e))}Ct.stringArray=oD;function aD(t,e){return Array.isArray(t)&&t.every(e)}Ct.typedArray=aD;function uD(t){return t!==null&&typeof t=="object"}Ct.objectLiteral=uD});var GS=m(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.ImplementationRequest=void 0;var WS=st(),HS;(function(t){t.method="textDocument/implementation",t.messageDirection=WS.MessageDirection.clientToServer,t.type=new WS.ProtocolRequestType(t.method)})(HS||(oc.ImplementationRequest=HS={}))});var VS=m(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.TypeDefinitionRequest=void 0;var zS=st(),KS;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=zS.MessageDirection.clientToServer,t.type=new zS.ProtocolRequestType(t.method)})(KS||(ac.TypeDefinitionRequest=KS={}))});var JS=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.DidChangeWorkspaceFoldersNotification=ho.WorkspaceFoldersRequest=void 0;var uc=st(),XS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=uc.MessageDirection.serverToClient,t.type=new uc.ProtocolRequestType0(t.method)})(XS||(ho.WorkspaceFoldersRequest=XS={}));var YS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=uc.MessageDirection.clientToServer,t.type=new uc.ProtocolNotificationType(t.method)})(YS||(ho.DidChangeWorkspaceFoldersNotification=YS={}))});var ek=m(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.ConfigurationRequest=void 0;var QS=st(),ZS;(function(t){t.method="workspace/configuration",t.messageDirection=QS.MessageDirection.serverToClient,t.type=new QS.ProtocolRequestType(t.method)})(ZS||(lc.ConfigurationRequest=ZS={}))});var rk=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ColorPresentationRequest=fo.DocumentColorRequest=void 0;var cc=st(),tk;(function(t){t.method="textDocument/documentColor",t.messageDirection=cc.MessageDirection.clientToServer,t.type=new cc.ProtocolRequestType(t.method)})(tk||(fo.DocumentColorRequest=tk={}));var nk;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=cc.MessageDirection.clientToServer,t.type=new cc.ProtocolRequestType(t.method)})(nk||(fo.ColorPresentationRequest=nk={}))});var ok=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.FoldingRangeRefreshRequest=po.FoldingRangeRequest=void 0;var hc=st(),ik;(function(t){t.method="textDocument/foldingRange",t.messageDirection=hc.MessageDirection.clientToServer,t.type=new hc.ProtocolRequestType(t.method)})(ik||(po.FoldingRangeRequest=ik={}));var sk;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=hc.MessageDirection.serverToClient,t.type=new hc.ProtocolRequestType0(t.method)})(sk||(po.FoldingRangeRefreshRequest=sk={}))});var lk=m(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.DeclarationRequest=void 0;var ak=st(),uk;(function(t){t.method="textDocument/declaration",t.messageDirection=ak.MessageDirection.clientToServer,t.type=new ak.ProtocolRequestType(t.method)})(uk||(fc.DeclarationRequest=uk={}))});var fk=m(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.SelectionRangeRequest=void 0;var ck=st(),hk;(function(t){t.method="textDocument/selectionRange",t.messageDirection=ck.MessageDirection.clientToServer,t.type=new ck.ProtocolRequestType(t.method)})(hk||(dc.SelectionRangeRequest=hk={}))});var mk=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WorkDoneProgressCancelNotification=Ci.WorkDoneProgressCreateRequest=Ci.WorkDoneProgress=void 0;var lD=ds(),pc=st(),dk;(function(t){t.type=new lD.ProgressType;function e(n){return n===t.type}t.is=e})(dk||(Ci.WorkDoneProgress=dk={}));var pk;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=pc.MessageDirection.serverToClient,t.type=new pc.ProtocolRequestType(t.method)})(pk||(Ci.WorkDoneProgressCreateRequest=pk={}));var gk;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=pc.MessageDirection.clientToServer,t.type=new pc.ProtocolNotificationType(t.method)})(gk||(Ci.WorkDoneProgressCancelNotification=gk={}))});var _k=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.CallHierarchyOutgoingCallsRequest=Ri.CallHierarchyIncomingCallsRequest=Ri.CallHierarchyPrepareRequest=void 0;var go=st(),yk;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(yk||(Ri.CallHierarchyPrepareRequest=yk={}));var bk;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(bk||(Ri.CallHierarchyIncomingCallsRequest=bk={}));var vk;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(vk||(Ri.CallHierarchyOutgoingCallsRequest=vk={}))});var Ek=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.SemanticTokensRefreshRequest=wn.SemanticTokensRangeRequest=wn.SemanticTokensDeltaRequest=wn.SemanticTokensRequest=wn.SemanticTokensRegistrationType=wn.TokenFormat=void 0;var ai=st(),Tk;(function(t){t.Relative="relative"})(Tk||(wn.TokenFormat=Tk={}));var Na;(function(t){t.method="textDocument/semanticTokens",t.type=new ai.RegistrationType(t.method)})(Na||(wn.SemanticTokensRegistrationType=Na={}));var Sk;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(Sk||(wn.SemanticTokensRequest=Sk={}));var kk;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(kk||(wn.SemanticTokensDeltaRequest=kk={}));var wk;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=Na.method})(wk||(wn.SemanticTokensRangeRequest=wk={}));var xk;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(xk||(wn.SemanticTokensRefreshRequest=xk={}))});var Ck=m(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.ShowDocumentRequest=void 0;var Ak=st(),Ok;(function(t){t.method="window/showDocument",t.messageDirection=Ak.MessageDirection.serverToClient,t.type=new Ak.ProtocolRequestType(t.method)})(Ok||(gc.ShowDocumentRequest=Ok={}))});var Dk=m(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.LinkedEditingRangeRequest=void 0;var Rk=st(),Pk;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=Rk.MessageDirection.clientToServer,t.type=new Rk.ProtocolRequestType(t.method)})(Pk||(mc.LinkedEditingRangeRequest=Pk={}))});var $k=m(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.WillDeleteFilesRequest=nn.DidDeleteFilesNotification=nn.DidRenameFilesNotification=nn.WillRenameFilesRequest=nn.DidCreateFilesNotification=nn.WillCreateFilesRequest=nn.FileOperationPatternKind=void 0;var Wn=st(),Ik;(function(t){t.file="file",t.folder="folder"})(Ik||(nn.FileOperationPatternKind=Ik={}));var Mk;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(Mk||(nn.WillCreateFilesRequest=Mk={}));var Lk;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(Lk||(nn.DidCreateFilesNotification=Lk={}));var Nk;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(Nk||(nn.WillRenameFilesRequest=Nk={}));var qk;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(qk||(nn.DidRenameFilesNotification=qk={}));var jk;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(jk||(nn.DidDeleteFilesNotification=jk={}));var Fk;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(Fk||(nn.WillDeleteFilesRequest=Fk={}))});var Gk=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.MonikerRequest=Pi.MonikerKind=Pi.UniquenessLevel=void 0;var Bk=st(),Uk;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Uk||(Pi.UniquenessLevel=Uk={}));var Wk;(function(t){t.$import="import",t.$export="export",t.local="local"})(Wk||(Pi.MonikerKind=Wk={}));var Hk;(function(t){t.method="textDocument/moniker",t.messageDirection=Bk.MessageDirection.clientToServer,t.type=new Bk.ProtocolRequestType(t.method)})(Hk||(Pi.MonikerRequest=Hk={}))});var Xk=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.TypeHierarchySubtypesRequest=Di.TypeHierarchySupertypesRequest=Di.TypeHierarchyPrepareRequest=void 0;var mo=st(),zk;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(zk||(Di.TypeHierarchyPrepareRequest=zk={}));var Kk;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(Kk||(Di.TypeHierarchySupertypesRequest=Kk={}));var Vk;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(Vk||(Di.TypeHierarchySubtypesRequest=Vk={}))});var Qk=m(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InlineValueRefreshRequest=yo.InlineValueRequest=void 0;var yc=st(),Yk;(function(t){t.method="textDocument/inlineValue",t.messageDirection=yc.MessageDirection.clientToServer,t.type=new yc.ProtocolRequestType(t.method)})(Yk||(yo.InlineValueRequest=Yk={}));var Jk;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=yc.MessageDirection.serverToClient,t.type=new yc.ProtocolRequestType0(t.method)})(Jk||(yo.InlineValueRefreshRequest=Jk={}))});var nw=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.InlayHintRefreshRequest=Ii.InlayHintResolveRequest=Ii.InlayHintRequest=void 0;var bo=st(),Zk;(function(t){t.method="textDocument/inlayHint",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(Zk||(Ii.InlayHintRequest=Zk={}));var ew;(function(t){t.method="inlayHint/resolve",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(ew||(Ii.InlayHintResolveRequest=ew={}));var tw;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(tw||(Ii.InlayHintRefreshRequest=tw={}))});var lw=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.DiagnosticRefreshRequest=Hn.WorkspaceDiagnosticRequest=Hn.DocumentDiagnosticRequest=Hn.DocumentDiagnosticReportKind=Hn.DiagnosticServerCancellationData=void 0;var uw=ds(),cD=sc(),vo=st(),rw;(function(t){function e(n){let r=n;return r&&cD.boolean(r.retriggerRequest)}t.is=e})(rw||(Hn.DiagnosticServerCancellationData=rw={}));var iw;(function(t){t.Full="full",t.Unchanged="unchanged"})(iw||(Hn.DocumentDiagnosticReportKind=iw={}));var sw;(function(t){t.method="textDocument/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new uw.ProgressType})(sw||(Hn.DocumentDiagnosticRequest=sw={}));var ow;(function(t){t.method="workspace/diagnostic",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method),t.partialResult=new uw.ProgressType})(ow||(Hn.WorkspaceDiagnosticRequest=ow={}));var aw;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=vo.MessageDirection.serverToClient,t.type=new vo.ProtocolRequestType0(t.method)})(aw||(Hn.DiagnosticRefreshRequest=aw={}))});var mw=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.DidCloseNotebookDocumentNotification=gt.DidSaveNotebookDocumentNotification=gt.DidChangeNotebookDocumentNotification=gt.NotebookCellArrayChange=gt.DidOpenNotebookDocumentNotification=gt.NotebookDocumentSyncRegistrationType=gt.NotebookDocument=gt.NotebookCell=gt.ExecutionSummary=gt.NotebookCellKind=void 0;var qa=ic(),br=sc(),Ir=st(),Ng;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ng||(gt.NotebookCellKind=Ng={}));var qg;(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 br.objectLiteral(s)&&qa.uinteger.is(s.executionOrder)&&(s.success===void 0||br.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})(qg||(gt.ExecutionSummary=qg={}));var bc;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return br.objectLiteral(o)&&Ng.is(o.kind)&&qa.DocumentUri.is(o.document)&&(o.metadata===void 0||br.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)&&!qg.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 l=0;l<s.length;l++)if(!i(s[l],o[l]))return!1}if(br.objectLiteral(s)&&br.objectLiteral(o)){let l=Object.keys(s),c=Object.keys(o);if(l.length!==c.length||(l.sort(),c.sort(),!i(l,c)))return!1;for(let h=0;h<l.length;h++){let f=l[h];if(!i(s[f],o[f]))return!1}}return!0}})(bc||(gt.NotebookCell=bc={}));var cw;(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 br.objectLiteral(i)&&br.string(i.uri)&&qa.integer.is(i.version)&&br.typedArray(i.cells,bc.is)}t.is=n})(cw||(gt.NotebookDocument=cw={}));var _o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.RegistrationType(t.method)})(_o||(gt.NotebookDocumentSyncRegistrationType=_o={}));var hw;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(hw||(gt.DidOpenNotebookDocumentNotification=hw={}));var fw;(function(t){function e(r){let i=r;return br.objectLiteral(i)&&qa.uinteger.is(i.start)&&qa.uinteger.is(i.deleteCount)&&(i.cells===void 0||br.typedArray(i.cells,bc.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})(fw||(gt.NotebookCellArrayChange=fw={}));var dw;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(dw||(gt.DidChangeNotebookDocumentNotification=dw={}));var pw;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(pw||(gt.DidSaveNotebookDocumentNotification=pw={}));var gw;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(gw||(gt.DidCloseNotebookDocumentNotification=gw={}))});var vw=m(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.InlineCompletionRequest=void 0;var yw=st(),bw;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=yw.MessageDirection.clientToServer,t.type=new yw.ProtocolRequestType(t.method)})(bw||(vc.InlineCompletionRequest=bw={}))});var D0=m(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.WorkspaceSymbolRequest=T.CodeActionResolveRequest=T.CodeActionRequest=T.DocumentSymbolRequest=T.DocumentHighlightRequest=T.ReferencesRequest=T.DefinitionRequest=T.SignatureHelpRequest=T.SignatureHelpTriggerKind=T.HoverRequest=T.CompletionResolveRequest=T.CompletionRequest=T.CompletionTriggerKind=T.PublishDiagnosticsNotification=T.WatchKind=T.RelativePattern=T.FileChangeType=T.DidChangeWatchedFilesNotification=T.WillSaveTextDocumentWaitUntilRequest=T.WillSaveTextDocumentNotification=T.TextDocumentSaveReason=T.DidSaveTextDocumentNotification=T.DidCloseTextDocumentNotification=T.DidChangeTextDocumentNotification=T.TextDocumentContentChangeEvent=T.DidOpenTextDocumentNotification=T.TextDocumentSyncKind=T.TelemetryEventNotification=T.LogMessageNotification=T.ShowMessageRequest=T.ShowMessageNotification=T.MessageType=T.DidChangeConfigurationNotification=T.ExitNotification=T.ShutdownRequest=T.InitializedNotification=T.InitializeErrorCodes=T.InitializeRequest=T.WorkDoneProgressOptions=T.TextDocumentRegistrationOptions=T.StaticRegistrationOptions=T.PositionEncodingKind=T.FailureHandlingKind=T.ResourceOperationKind=T.UnregistrationRequest=T.RegistrationRequest=T.DocumentSelector=T.NotebookCellTextDocumentFilter=T.NotebookDocumentFilter=T.TextDocumentFilter=void 0;T.MonikerRequest=T.MonikerKind=T.UniquenessLevel=T.WillDeleteFilesRequest=T.DidDeleteFilesNotification=T.WillRenameFilesRequest=T.DidRenameFilesNotification=T.WillCreateFilesRequest=T.DidCreateFilesNotification=T.FileOperationPatternKind=T.LinkedEditingRangeRequest=T.ShowDocumentRequest=T.SemanticTokensRegistrationType=T.SemanticTokensRefreshRequest=T.SemanticTokensRangeRequest=T.SemanticTokensDeltaRequest=T.SemanticTokensRequest=T.TokenFormat=T.CallHierarchyPrepareRequest=T.CallHierarchyOutgoingCallsRequest=T.CallHierarchyIncomingCallsRequest=T.WorkDoneProgressCancelNotification=T.WorkDoneProgressCreateRequest=T.WorkDoneProgress=T.SelectionRangeRequest=T.DeclarationRequest=T.FoldingRangeRefreshRequest=T.FoldingRangeRequest=T.ColorPresentationRequest=T.DocumentColorRequest=T.ConfigurationRequest=T.DidChangeWorkspaceFoldersNotification=T.WorkspaceFoldersRequest=T.TypeDefinitionRequest=T.ImplementationRequest=T.ApplyWorkspaceEditRequest=T.ExecuteCommandRequest=T.PrepareRenameRequest=T.RenameRequest=T.PrepareSupportDefaultBehavior=T.DocumentOnTypeFormattingRequest=T.DocumentRangesFormattingRequest=T.DocumentRangeFormattingRequest=T.DocumentFormattingRequest=T.DocumentLinkResolveRequest=T.DocumentLinkRequest=T.CodeLensRefreshRequest=T.CodeLensResolveRequest=T.CodeLensRequest=T.WorkspaceSymbolResolveRequest=void 0;T.InlineCompletionRequest=T.DidCloseNotebookDocumentNotification=T.DidSaveNotebookDocumentNotification=T.DidChangeNotebookDocumentNotification=T.NotebookCellArrayChange=T.DidOpenNotebookDocumentNotification=T.NotebookDocumentSyncRegistrationType=T.NotebookDocument=T.NotebookCell=T.ExecutionSummary=T.NotebookCellKind=T.DiagnosticRefreshRequest=T.WorkspaceDiagnosticRequest=T.DocumentDiagnosticRequest=T.DocumentDiagnosticReportKind=T.DiagnosticServerCancellationData=T.InlayHintRefreshRequest=T.InlayHintResolveRequest=T.InlayHintRequest=T.InlineValueRefreshRequest=T.InlineValueRequest=T.TypeHierarchySupertypesRequest=T.TypeHierarchySubtypesRequest=T.TypeHierarchyPrepareRequest=void 0;var K=st(),_w=ic(),$t=sc(),hD=GS();Object.defineProperty(T,"ImplementationRequest",{enumerable:!0,get:function(){return hD.ImplementationRequest}});var fD=VS();Object.defineProperty(T,"TypeDefinitionRequest",{enumerable:!0,get:function(){return fD.TypeDefinitionRequest}});var O0=JS();Object.defineProperty(T,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return O0.WorkspaceFoldersRequest}});Object.defineProperty(T,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return O0.DidChangeWorkspaceFoldersNotification}});var dD=ek();Object.defineProperty(T,"ConfigurationRequest",{enumerable:!0,get:function(){return dD.ConfigurationRequest}});var C0=rk();Object.defineProperty(T,"DocumentColorRequest",{enumerable:!0,get:function(){return C0.DocumentColorRequest}});Object.defineProperty(T,"ColorPresentationRequest",{enumerable:!0,get:function(){return C0.ColorPresentationRequest}});var R0=ok();Object.defineProperty(T,"FoldingRangeRequest",{enumerable:!0,get:function(){return R0.FoldingRangeRequest}});Object.defineProperty(T,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return R0.FoldingRangeRefreshRequest}});var pD=lk();Object.defineProperty(T,"DeclarationRequest",{enumerable:!0,get:function(){return pD.DeclarationRequest}});var gD=fk();Object.defineProperty(T,"SelectionRangeRequest",{enumerable:!0,get:function(){return gD.SelectionRangeRequest}});var Ug=mk();Object.defineProperty(T,"WorkDoneProgress",{enumerable:!0,get:function(){return Ug.WorkDoneProgress}});Object.defineProperty(T,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCreateRequest}});Object.defineProperty(T,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCancelNotification}});var Wg=_k();Object.defineProperty(T,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(T,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(T,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyPrepareRequest}});var To=Ek();Object.defineProperty(T,"TokenFormat",{enumerable:!0,get:function(){return To.TokenFormat}});Object.defineProperty(T,"SemanticTokensRequest",{enumerable:!0,get:function(){return To.SemanticTokensRequest}});Object.defineProperty(T,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return To.SemanticTokensDeltaRequest}});Object.defineProperty(T,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return To.SemanticTokensRangeRequest}});Object.defineProperty(T,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return To.SemanticTokensRefreshRequest}});Object.defineProperty(T,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return To.SemanticTokensRegistrationType}});var mD=Ck();Object.defineProperty(T,"ShowDocumentRequest",{enumerable:!0,get:function(){return mD.ShowDocumentRequest}});var yD=Dk();Object.defineProperty(T,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return yD.LinkedEditingRangeRequest}});var ps=$k();Object.defineProperty(T,"FileOperationPatternKind",{enumerable:!0,get:function(){return ps.FileOperationPatternKind}});Object.defineProperty(T,"DidCreateFilesNotification",{enumerable:!0,get:function(){return ps.DidCreateFilesNotification}});Object.defineProperty(T,"WillCreateFilesRequest",{enumerable:!0,get:function(){return ps.WillCreateFilesRequest}});Object.defineProperty(T,"DidRenameFilesNotification",{enumerable:!0,get:function(){return ps.DidRenameFilesNotification}});Object.defineProperty(T,"WillRenameFilesRequest",{enumerable:!0,get:function(){return ps.WillRenameFilesRequest}});Object.defineProperty(T,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return ps.DidDeleteFilesNotification}});Object.defineProperty(T,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return ps.WillDeleteFilesRequest}});var Hg=Gk();Object.defineProperty(T,"UniquenessLevel",{enumerable:!0,get:function(){return Hg.UniquenessLevel}});Object.defineProperty(T,"MonikerKind",{enumerable:!0,get:function(){return Hg.MonikerKind}});Object.defineProperty(T,"MonikerRequest",{enumerable:!0,get:function(){return Hg.MonikerRequest}});var Gg=Xk();Object.defineProperty(T,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchyPrepareRequest}});Object.defineProperty(T,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySubtypesRequest}});Object.defineProperty(T,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySupertypesRequest}});var P0=Qk();Object.defineProperty(T,"InlineValueRequest",{enumerable:!0,get:function(){return P0.InlineValueRequest}});Object.defineProperty(T,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return P0.InlineValueRefreshRequest}});var zg=nw();Object.defineProperty(T,"InlayHintRequest",{enumerable:!0,get:function(){return zg.InlayHintRequest}});Object.defineProperty(T,"InlayHintResolveRequest",{enumerable:!0,get:function(){return zg.InlayHintResolveRequest}});Object.defineProperty(T,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return zg.InlayHintRefreshRequest}});var ja=lw();Object.defineProperty(T,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return ja.DiagnosticServerCancellationData}});Object.defineProperty(T,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return ja.DocumentDiagnosticReportKind}});Object.defineProperty(T,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return ja.DocumentDiagnosticRequest}});Object.defineProperty(T,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return ja.WorkspaceDiagnosticRequest}});Object.defineProperty(T,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return ja.DiagnosticRefreshRequest}});var Mr=mw();Object.defineProperty(T,"NotebookCellKind",{enumerable:!0,get:function(){return Mr.NotebookCellKind}});Object.defineProperty(T,"ExecutionSummary",{enumerable:!0,get:function(){return Mr.ExecutionSummary}});Object.defineProperty(T,"NotebookCell",{enumerable:!0,get:function(){return Mr.NotebookCell}});Object.defineProperty(T,"NotebookDocument",{enumerable:!0,get:function(){return Mr.NotebookDocument}});Object.defineProperty(T,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Mr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(T,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidOpenNotebookDocumentNotification}});Object.defineProperty(T,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Mr.NotebookCellArrayChange}});Object.defineProperty(T,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidChangeNotebookDocumentNotification}});Object.defineProperty(T,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidSaveNotebookDocumentNotification}});Object.defineProperty(T,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidCloseNotebookDocumentNotification}});var bD=vw();Object.defineProperty(T,"InlineCompletionRequest",{enumerable:!0,get:function(){return bD.InlineCompletionRequest}});var jg;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(jg||(T.TextDocumentFilter=jg={}));var Fg;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Fg||(T.NotebookDocumentFilter=Fg={}));var $g;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Fg.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})($g||(T.NotebookCellTextDocumentFilter=$g={}));var Bg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!jg.is(r)&&!$g.is(r))return!1;return!0}t.is=e})(Bg||(T.DocumentSelector=Bg={}));var Tw;(function(t){t.method="client/registerCapability",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(Tw||(T.RegistrationRequest=Tw={}));var Sw;(function(t){t.method="client/unregisterCapability",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(Sw||(T.UnregistrationRequest=Sw={}));var kw;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(kw||(T.ResourceOperationKind=kw={}));var ww;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(ww||(T.FailureHandlingKind=ww={}));var xw;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(xw||(T.PositionEncodingKind=xw={}));var Ew;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(Ew||(T.StaticRegistrationOptions=Ew={}));var Aw;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Bg.is(r.documentSelector))}t.is=e})(Aw||(T.TextDocumentRegistrationOptions=Aw={}));var Ow;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(Ow||(T.WorkDoneProgressOptions=Ow={}));var Cw;(function(t){t.method="initialize",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(Cw||(T.InitializeRequest=Cw={}));var Rw;(function(t){t.unknownProtocolVersion=1})(Rw||(T.InitializeErrorCodes=Rw={}));var Pw;(function(t){t.method="initialized",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Pw||(T.InitializedNotification=Pw={}));var Dw;(function(t){t.method="shutdown",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType0(t.method)})(Dw||(T.ShutdownRequest=Dw={}));var Iw;(function(t){t.method="exit",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType0(t.method)})(Iw||(T.ExitNotification=Iw={}));var Mw;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Mw||(T.DidChangeConfigurationNotification=Mw={}));var Lw;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Lw||(T.MessageType=Lw={}));var Nw;(function(t){t.method="window/showMessage",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Nw||(T.ShowMessageNotification=Nw={}));var qw;(function(t){t.method="window/showMessageRequest",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType(t.method)})(qw||(T.ShowMessageRequest=qw={}));var jw;(function(t){t.method="window/logMessage",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(jw||(T.LogMessageNotification=jw={}));var Fw;(function(t){t.method="telemetry/event",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Fw||(T.TelemetryEventNotification=Fw={}));var $w;(function(t){t.None=0,t.Full=1,t.Incremental=2})($w||(T.TextDocumentSyncKind=$w={}));var Bw;(function(t){t.method="textDocument/didOpen",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Bw||(T.DidOpenTextDocumentNotification=Bw={}));var Uw;(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})(Uw||(T.TextDocumentContentChangeEvent=Uw={}));var Ww;(function(t){t.method="textDocument/didChange",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Ww||(T.DidChangeTextDocumentNotification=Ww={}));var Hw;(function(t){t.method="textDocument/didClose",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Hw||(T.DidCloseTextDocumentNotification=Hw={}));var Gw;(function(t){t.method="textDocument/didSave",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Gw||(T.DidSaveTextDocumentNotification=Gw={}));var zw;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(zw||(T.TextDocumentSaveReason=zw={}));var Kw;(function(t){t.method="textDocument/willSave",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Kw||(T.WillSaveTextDocumentNotification=Kw={}));var Vw;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(Vw||(T.WillSaveTextDocumentWaitUntilRequest=Vw={}));var Xw;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolNotificationType(t.method)})(Xw||(T.DidChangeWatchedFilesNotification=Xw={}));var Yw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Yw||(T.FileChangeType=Yw={}));var Jw;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(_w.URI.is(r.baseUri)||_w.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(Jw||(T.RelativePattern=Jw={}));var Qw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Qw||(T.WatchKind=Qw={}));var Zw;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolNotificationType(t.method)})(Zw||(T.PublishDiagnosticsNotification=Zw={}));var e0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(e0||(T.CompletionTriggerKind=e0={}));var t0;(function(t){t.method="textDocument/completion",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(t0||(T.CompletionRequest=t0={}));var n0;(function(t){t.method="completionItem/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(n0||(T.CompletionResolveRequest=n0={}));var r0;(function(t){t.method="textDocument/hover",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(r0||(T.HoverRequest=r0={}));var i0;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(i0||(T.SignatureHelpTriggerKind=i0={}));var s0;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(s0||(T.SignatureHelpRequest=s0={}));var o0;(function(t){t.method="textDocument/definition",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(o0||(T.DefinitionRequest=o0={}));var a0;(function(t){t.method="textDocument/references",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(a0||(T.ReferencesRequest=a0={}));var u0;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(u0||(T.DocumentHighlightRequest=u0={}));var l0;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(l0||(T.DocumentSymbolRequest=l0={}));var c0;(function(t){t.method="textDocument/codeAction",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(c0||(T.CodeActionRequest=c0={}));var h0;(function(t){t.method="codeAction/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(h0||(T.CodeActionResolveRequest=h0={}));var f0;(function(t){t.method="workspace/symbol",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(f0||(T.WorkspaceSymbolRequest=f0={}));var d0;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(d0||(T.WorkspaceSymbolResolveRequest=d0={}));var p0;(function(t){t.method="textDocument/codeLens",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(p0||(T.CodeLensRequest=p0={}));var g0;(function(t){t.method="codeLens/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(g0||(T.CodeLensResolveRequest=g0={}));var m0;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType0(t.method)})(m0||(T.CodeLensRefreshRequest=m0={}));var y0;(function(t){t.method="textDocument/documentLink",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(y0||(T.DocumentLinkRequest=y0={}));var b0;(function(t){t.method="documentLink/resolve",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(b0||(T.DocumentLinkResolveRequest=b0={}));var v0;(function(t){t.method="textDocument/formatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(v0||(T.DocumentFormattingRequest=v0={}));var _0;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(_0||(T.DocumentRangeFormattingRequest=_0={}));var T0;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(T0||(T.DocumentRangesFormattingRequest=T0={}));var S0;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(S0||(T.DocumentOnTypeFormattingRequest=S0={}));var k0;(function(t){t.Identifier=1})(k0||(T.PrepareSupportDefaultBehavior=k0={}));var w0;(function(t){t.method="textDocument/rename",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(w0||(T.RenameRequest=w0={}));var x0;(function(t){t.method="textDocument/prepareRename",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(x0||(T.PrepareRenameRequest=x0={}));var E0;(function(t){t.method="workspace/executeCommand",t.messageDirection=K.MessageDirection.clientToServer,t.type=new K.ProtocolRequestType(t.method)})(E0||(T.ExecuteCommandRequest=E0={}));var A0;(function(t){t.method="workspace/applyEdit",t.messageDirection=K.MessageDirection.serverToClient,t.type=new K.ProtocolRequestType("workspace/applyEdit")})(A0||(T.ApplyWorkspaceEditRequest=A0={}))});var M0=m(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.createProtocolConnection=void 0;var I0=ds();function vD(t,e,n,r){return I0.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,I0.createMessageConnection)(t,e,n,r)}_c.createProtocolConnection=vD});var N0=m(xn=>{"use strict";var _D=xn&&xn.__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]}),Tc=xn&&xn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_D(e,t,n)};Object.defineProperty(xn,"__esModule",{value:!0});xn.LSPErrorCodes=xn.createProtocolConnection=void 0;Tc(ds(),xn);Tc(ic(),xn);Tc(st(),xn);Tc(D0(),xn);var TD=M0();Object.defineProperty(xn,"createProtocolConnection",{enumerable:!0,get:function(){return TD.createProtocolConnection}});var L0;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(L0||(xn.LSPErrorCodes=L0={}))});var St=m(Lr=>{"use strict";var SD=Lr&&Lr.__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]}),q0=Lr&&Lr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&SD(e,t,n)};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.createProtocolConnection=void 0;var kD=Rg();q0(Rg(),Lr);q0(N0(),Lr);function wD(t,e,n,r){return(0,kD.createMessageConnection)(t,e,n,r)}Lr.createProtocolConnection=wD});var Kg=m(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.generateUuid=Gn.parse=Gn.isUUID=Gn.v4=Gn.empty=void 0;var Fa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},$a=class t extends Fa{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};$a._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];$a._timeHighBits=["8","9","a","b"];Gn.empty=new Fa("00000000-0000-0000-0000-000000000000");function j0(){return new $a}Gn.v4=j0;var xD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function F0(t){return xD.test(t)}Gn.isUUID=F0;function ED(t){if(!F0(t))throw new Error("invalid uuid");return new Fa(t)}Gn.parse=ED;function AD(){return j0().asHex()}Gn.generateUuid=AD});var $0=m(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.attachPartialResult=Li.ProgressFeature=Li.attachWorkDone=void 0;var Mi=St(),OD=Kg(),gs=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(Mi.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(Mi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Mi.WorkDoneProgress.type,this._token,{kind:"end"})}};gs.Instances=new Map;var Sc=class extends gs{constructor(e,n){super(e,n),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ba=class{constructor(){}begin(){}report(){}done(){}},kc=class extends Ba{constructor(){super(),this._source=new Mi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function CD(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ba;let n=e.workDoneToken;return delete e.workDoneToken,new gs(t,n)}Li.attachWorkDone=CD;var RD=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Mi.WorkDoneProgressCancelNotification.type,n=>{let r=gs.Instances.get(n.token);(r instanceof Sc||r instanceof kc)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ba:new gs(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,OD.generateUuid)();return this.connection.sendRequest(Mi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Sc(this.connection,e))}else return Promise.resolve(new kc)}};Li.ProgressFeature=RD;var Vg;(function(t){t.type=new Mi.ProgressType})(Vg||(Vg={}));var Xg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Vg.type,this._token,e)}};function PD(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Xg(t,n)}Li.attachPartialResult=PD});var B0=m(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.ConfigurationFeature=void 0;var DD=St(),ID=Ll(),MD=t=>class extends t{getConfiguration(e){return e?ID.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(DD.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};wc.ConfigurationFeature=MD});var U0=m(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.WorkspaceFoldersFeature=void 0;var xc=St(),LD=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new xc.Emitter,this.connection.onNotification(xc.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(xc.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(xc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ec.WorkspaceFoldersFeature=LD});var W0=m(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.CallHierarchyFeature=void 0;var Yg=St(),ND=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Yg.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Yg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Yg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ac.CallHierarchyFeature=ND});var Qg=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.SemanticTokensBuilder=Ni.SemanticTokensDiff=Ni.SemanticTokensFeature=void 0;var Oc=St(),qD=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Oc.SemanticTokensRefreshRequest.type),on:e=>{let n=Oc.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Oc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Oc.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ni.SemanticTokensFeature=qD;var Cc=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}]:[]}};Ni.SemanticTokensDiff=Cc;var Jg=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 Cc(this._prevData,this._data).computeDiff()}:this.build()}};Ni.SemanticTokensBuilder=Jg});var H0=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.ShowDocumentFeature=void 0;var jD=St(),FD=t=>class extends t{showDocument(e){return this.connection.sendRequest(jD.ShowDocumentRequest.type,e)}};Rc.ShowDocumentFeature=FD});var G0=m(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.FileOperationsFeature=void 0;var So=St(),$D=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(So.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(So.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(So.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(So.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(So.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(So.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Pc.FileOperationsFeature=$D});var z0=m(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.LinkedEditingRangeFeature=void 0;var BD=St(),UD=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(BD.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Dc.LinkedEditingRangeFeature=UD});var K0=m(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.TypeHierarchyFeature=void 0;var Zg=St(),WD=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Zg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Zg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Zg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ic.TypeHierarchyFeature=WD});var X0=m(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.InlineValueFeature=void 0;var V0=St(),HD=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(V0.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(V0.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Mc.InlineValueFeature=HD});var J0=m(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.FoldingRangeFeature=void 0;var Y0=St(),GD=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Y0.FoldingRangeRefreshRequest.type),on:e=>{let n=Y0.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Lc.FoldingRangeFeature=GD});var Q0=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.InlayHintFeature=void 0;var em=St(),zD=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(em.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(em.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(em.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Nc.InlayHintFeature=zD});var Z0=m(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.DiagnosticFeature=void 0;var Ua=St(),KD=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ua.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ua.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Ua.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.WorkspaceDiagnosticRequest.partialResult,n)))}}};qc.DiagnosticFeature=KD});var nm=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.TextDocuments=void 0;var ms=St(),tm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ms.Emitter,this._onDidOpen=new ms.Emitter,this._onDidClose=new ms.Emitter,this._onDidSave=new ms.Emitter,this._onWillSave=new ms.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=ms.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}))})),ms.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};jc.TextDocuments=tm});var im=m(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.NotebookDocuments=ko.NotebookSyncFeature=void 0;var zn=St(),ex=nm(),VD=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(zn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(zn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(zn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(zn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};ko.NotebookSyncFeature=VD;var Fc=class t{onDidOpenTextDocument(e){return this.openHandler=e,zn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,zn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,zn.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}};Fc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var rm=class{constructor(e){e instanceof ex.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ex.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new zn.Emitter,this._onDidChange=new zn.Emitter,this._onDidSave=new zn.Emitter,this._onDidClose=new zn.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 Fc,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 l=[],c=[],h=[],f=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let k=A.structure.array;if(s.cells.splice(k.start,k.deleteCount,...k.cells!==void 0?k.cells:[]),A.structure.didOpen!==void 0)for(let S of A.structure.didOpen)n.openTextDocument({textDocument:S}),l.push(S.uri);if(A.structure.didClose)for(let S of A.structure.didClose)n.closeTextDocument({textDocument:S}),c.push(S.uri)}if(A.data!==void 0){let k=new Map(A.data.map(S=>[S.document,S]));for(let S=0;S<=s.cells.length;S++){let _=k.get(s.cells[S].document);if(_!==void 0){let N=s.cells.splice(S,1,_);if(h.push({old:N[0],new:_}),k.delete(_.document),k.size===0)break}}}if(A.textContent!==void 0)for(let k of A.textContent)n.changeTextDocument({textDocument:k.document,contentChanges:k.changes}),f.push(k.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let v=[];for(let A of l)v.push(this.getNotebookCell(A));let b=[];for(let A of c)b.push(this.getNotebookCell(A));let O=[];for(let A of f)O.push(this.getNotebookCell(A));(v.length>0||b.length>0||h.length>0||O.length>0)&&(g.cells={added:v,removed:b,changed:{data:h,textContent:O}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),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)}})),zn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};ko.NotebookDocuments=rm});var tx=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.MonikerFeature=void 0;var XD=St(),YD=t=>class extends t{get moniker(){return{on:e=>{let n=XD.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};$c.MonikerFeature=YD});var cm=m(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.createConnection=Le.combineFeatures=Le.combineNotebooksFeatures=Le.combineLanguagesFeatures=Le.combineWorkspaceFeatures=Le.combineWindowFeatures=Le.combineClientFeatures=Le.combineTracerFeatures=Le.combineTelemetryFeatures=Le.combineConsoleFeatures=Le._NotebooksImpl=Le._LanguagesImpl=Le.BulkUnregistration=Le.BulkRegistration=Le.ErrorMessageTracker=void 0;var J=St(),Kn=Ll(),om=Kg(),ye=$0(),JD=B0(),QD=U0(),ZD=W0(),eI=Qg(),tI=H0(),nI=G0(),rI=z0(),iI=K0(),sI=X0(),oI=J0(),aI=Q0(),uI=Z0(),lI=im(),cI=tx();function sm(t){if(t!==null)return t}var am=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)})}};Le.ErrorMessageTracker=am;var Bc=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(J.MessageType.Error,e)}warn(e){this.send(J.MessageType.Warning,e)}info(e){this.send(J.MessageType.Info,e)}log(e){this.send(J.MessageType.Log,e)}debug(e){this.send(J.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(J.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,J.RAL)().console.error("Sending log message failed")})}},um=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:J.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}showWarningMessage(e,...n){let r={type:J.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}showInformationMessage(e,...n){let r={type:J.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(J.ShowMessageRequest.type,r).then(sm)}},nx=(0,tI.ShowDocumentFeature)((0,ye.ProgressFeature)(um)),rx;(function(t){function e(){return new Uc}t.create=e})(rx||(Le.BulkRegistration=rx={}));var Uc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Kn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=om.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},ix;(function(t){function e(){return new Wa(void 0,[])}t.create=e})(ix||(Le.BulkUnregistration=ix={}));var Wa=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(J.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Kn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(J.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Wc=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 Uc?this.registerMany(e):e instanceof Wa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Kn.string(n)?n:n.method,s=om.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(J.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=Kn.string(e)?e:e.method,i=om.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(J.RegistrationRequest.type,s).then(o=>J.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(J.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(J.RegistrationRequest.type,n).then(()=>new Wa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},lm=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(J.ApplyWorkspaceEditRequest.type,r)}},sx=(0,nI.FileOperationsFeature)((0,QD.WorkspaceFoldersFeature)((0,JD.ConfigurationFeature)(lm))),Hc=class{constructor(){this._trace=J.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!==J.Trace.Off&&this.connection.sendNotification(J.LogTraceNotification.type,{message:e,verbose:this._trace===J.Trace.Verbose?n:void 0}).catch(()=>{})}},Gc=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(J.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},zc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._LanguagesImpl=zc;var ox=(0,oI.FoldingRangeFeature)((0,cI.MonikerFeature)((0,uI.DiagnosticFeature)((0,aI.InlayHintFeature)((0,sI.InlineValueFeature)((0,iI.TypeHierarchyFeature)((0,rI.LinkedEditingRangeFeature)((0,eI.SemanticTokensFeature)((0,ZD.CallHierarchyFeature)(zc))))))))),Kc=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,ye.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ye.attachPartialResult)(this.connection,n)}};Le._NotebooksImpl=Kc;var ax=(0,lI.NotebookSyncFeature)(Kc);function ux(t,e){return function(n){return e(t(n))}}Le.combineConsoleFeatures=ux;function lx(t,e){return function(n){return e(t(n))}}Le.combineTelemetryFeatures=lx;function cx(t,e){return function(n){return e(t(n))}}Le.combineTracerFeatures=cx;function hx(t,e){return function(n){return e(t(n))}}Le.combineClientFeatures=hx;function fx(t,e){return function(n){return e(t(n))}}Le.combineWindowFeatures=fx;function dx(t,e){return function(n){return e(t(n))}}Le.combineWorkspaceFeatures=dx;function px(t,e){return function(n){return e(t(n))}}Le.combineLanguagesFeatures=px;function gx(t,e){return function(n){return e(t(n))}}Le.combineNotebooksFeatures=gx;function hI(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,ux),tracer:n(t.tracer,e.tracer,cx),telemetry:n(t.telemetry,e.telemetry,lx),client:n(t.client,e.client,hx),window:n(t.window,e.window,fx),workspace:n(t.workspace,e.workspace,dx),languages:n(t.languages,e.languages,px),notebooks:n(t.notebooks,e.notebooks,gx)}}Le.combineFeatures=hI;function fI(t,e,n){let r=n&&n.console?new(n.console(Bc)):new Bc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Hc)):new Hc,o=n&&n.telemetry?new(n.telemetry(Gc)):new Gc,a=n&&n.client?new(n.client(Wc)):new Wc,u=n&&n.window?new(n.window(nx)):new nx,l=n&&n.workspace?new(n.workspace(sx)):new sx,c=n&&n.languages?new(n.languages(ox)):new ox,h=n&&n.notebooks?new(n.notebooks(ax)):new ax,f=[r,s,o,a,u,l,c,h];function g(k){return k instanceof Promise?k:Kn.thenable(k)?new Promise((S,_)=>{k.then(N=>S(N),N=>_(N))}):Promise.resolve(k)}let v,b,O,A={listen:()=>i.listen(),sendRequest:(k,...S)=>i.sendRequest(Kn.string(k)?k:k.method,...S),onRequest:(k,S)=>i.onRequest(k,S),sendNotification:(k,S)=>{let _=Kn.string(k)?k:k.method;return i.sendNotification(_,S)},onNotification:(k,S)=>i.onNotification(k,S),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:k=>(b=k,{dispose:()=>{b=void 0}}),onInitialized:k=>i.onNotification(J.InitializedNotification.type,k),onShutdown:k=>(v=k,{dispose:()=>{v=void 0}}),onExit:k=>(O=k,{dispose:()=>{O=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 l},get languages(){return c},get notebooks(){return h},onDidChangeConfiguration:k=>i.onNotification(J.DidChangeConfigurationNotification.type,k),onDidChangeWatchedFiles:k=>i.onNotification(J.DidChangeWatchedFilesNotification.type,k),__textDocumentSync:void 0,onDidOpenTextDocument:k=>i.onNotification(J.DidOpenTextDocumentNotification.type,k),onDidChangeTextDocument:k=>i.onNotification(J.DidChangeTextDocumentNotification.type,k),onDidCloseTextDocument:k=>i.onNotification(J.DidCloseTextDocumentNotification.type,k),onWillSaveTextDocument:k=>i.onNotification(J.WillSaveTextDocumentNotification.type,k),onWillSaveTextDocumentWaitUntil:k=>i.onRequest(J.WillSaveTextDocumentWaitUntilRequest.type,k),onDidSaveTextDocument:k=>i.onNotification(J.DidSaveTextDocumentNotification.type,k),sendDiagnostics:k=>i.sendNotification(J.PublishDiagnosticsNotification.type,k),onHover:k=>i.onRequest(J.HoverRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onCompletion:k=>i.onRequest(J.CompletionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCompletionResolve:k=>i.onRequest(J.CompletionResolveRequest.type,k),onSignatureHelp:k=>i.onRequest(J.SignatureHelpRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDeclaration:k=>i.onRequest(J.DeclarationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDefinition:k=>i.onRequest(J.DefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onTypeDefinition:k=>i.onRequest(J.TypeDefinitionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onImplementation:k=>i.onRequest(J.ImplementationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onReferences:k=>i.onRequest(J.ReferencesRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentHighlight:k=>i.onRequest(J.DocumentHighlightRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentSymbol:k=>i.onRequest(J.DocumentSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onWorkspaceSymbol:k=>i.onRequest(J.WorkspaceSymbolRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onWorkspaceSymbolResolve:k=>i.onRequest(J.WorkspaceSymbolResolveRequest.type,k),onCodeAction:k=>i.onRequest(J.CodeActionRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCodeActionResolve:k=>i.onRequest(J.CodeActionResolveRequest.type,(S,_)=>k(S,_)),onCodeLens:k=>i.onRequest(J.CodeLensRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onCodeLensResolve:k=>i.onRequest(J.CodeLensResolveRequest.type,(S,_)=>k(S,_)),onDocumentFormatting:k=>i.onRequest(J.DocumentFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDocumentRangeFormatting:k=>i.onRequest(J.DocumentRangeFormattingRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onDocumentOnTypeFormatting:k=>i.onRequest(J.DocumentOnTypeFormattingRequest.type,(S,_)=>k(S,_)),onRenameRequest:k=>i.onRequest(J.RenameRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),onPrepareRename:k=>i.onRequest(J.PrepareRenameRequest.type,(S,_)=>k(S,_)),onDocumentLinks:k=>i.onRequest(J.DocumentLinkRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onDocumentLinkResolve:k=>i.onRequest(J.DocumentLinkResolveRequest.type,(S,_)=>k(S,_)),onDocumentColor:k=>i.onRequest(J.DocumentColorRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onColorPresentation:k=>i.onRequest(J.ColorPresentationRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onFoldingRanges:k=>i.onRequest(J.FoldingRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onSelectionRanges:k=>i.onRequest(J.SelectionRangeRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),(0,ye.attachPartialResult)(i,S))),onExecuteCommand:k=>i.onRequest(J.ExecuteCommandRequest.type,(S,_)=>k(S,_,(0,ye.attachWorkDone)(i,S),void 0)),dispose:()=>i.dispose()};for(let k of f)k.attach(A);return i.onRequest(J.InitializeRequest.type,k=>{e.initialize(k),Kn.string(k.trace)&&(s.trace=J.Trace.fromString(k.trace));for(let S of f)S.initialize(k.capabilities);if(b){let S=b(k,new J.CancellationTokenSource().token,(0,ye.attachWorkDone)(i,k),void 0);return g(S).then(_=>{if(_ instanceof J.ResponseError)return _;let N=_;N||(N={capabilities:{}});let R=N.capabilities;R||(R={},N.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=Kn.number(A.__textDocumentSync)?A.__textDocumentSync:J.TextDocumentSyncKind.None:!Kn.number(R.textDocumentSync)&&!Kn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Kn.number(A.__textDocumentSync)?A.__textDocumentSync:J.TextDocumentSyncKind.None);for(let G of f)G.fillServerCapabilities(R);return N})}else{let S={capabilities:{textDocumentSync:J.TextDocumentSyncKind.None}};for(let _ of f)_.fillServerCapabilities(S.capabilities);return S}}),i.onRequest(J.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,v)return v(new J.CancellationTokenSource().token)}),i.onNotification(J.ExitNotification.type,()=>{try{O&&O()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(J.SetTraceNotification.type,k=>{s.trace=J.Trace.fromString(k.value)}),A}Le.createConnection=fI});var mx=m(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.resolveModulePath=En.FileSystem=En.resolveGlobalYarnPath=En.resolveGlobalNodePath=En.resolve=En.uriToFilePath=void 0;var dI=require("url"),vr=require("path"),hm=require("fs"),gm=require("child_process");function pI(t){let e=dI.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 vr.normalize(n.join("/"))}En.uriToFilePath=pI;function fm(){return process.platform==="win32"}function Vc(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,l=Object.create(null);Object.keys(u).forEach(c=>l[c]=u[c]),e&&hm.existsSync(e)&&(l[i]?l[i]=e+vr.delimiter+l[i]:l[i]=e,r&&r(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let c=(0,gm.fork)("",[],{cwd:n,env:l,execArgv:["-e",s]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",f=>{a(f)}),c.on("message",f=>{f.c==="r"&&(c.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};c.send(h)}catch(c){a(c)}})}En.resolve=Vc;function dm(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};fm()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,gm.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?fm()?vr.join(o,"node_modules"):vr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}En.resolveGlobalNodePath=dm;function gI(t){let e="yarn",n={encoding:"utf8"};fm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,gm.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 vr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}En.resolveGlobalYarnPath=gI;var pm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!hm.existsSync(__filename.toUpperCase())||!hm.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?vr.normalize(s).indexOf(vr.normalize(i))===0:vr.normalize(s).toLowerCase().indexOf(vr.normalize(i).toLowerCase())===0}t.isParent=r})(pm||(En.FileSystem=pm={}));function mI(t,e,n,r){return n?(vr.isAbsolute(n)||(n=vr.join(t,n)),Vc(e,n,n,r).then(i=>pm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Vc(e,dm(r),t,r))):Vc(e,dm(r),t,r)}En.resolveModulePath=mI});var mm=m((kG,yx)=>{"use strict";yx.exports=St()});var bx=m(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.InlineCompletionFeature=void 0;var yI=St(),bI=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(yI.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Xc.InlineCompletionFeature=bI});var Tx=m(rn=>{"use strict";var vI=rn&&rn.__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]}),_x=rn&&rn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vI(e,t,n)};Object.defineProperty(rn,"__esModule",{value:!0});rn.ProposedFeatures=rn.NotebookDocuments=rn.TextDocuments=rn.SemanticTokensBuilder=void 0;var _I=Qg();Object.defineProperty(rn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return _I.SemanticTokensBuilder}});var TI=bx();_x(St(),rn);var SI=nm();Object.defineProperty(rn,"TextDocuments",{enumerable:!0,get:function(){return SI.TextDocuments}});var kI=im();Object.defineProperty(rn,"NotebookDocuments",{enumerable:!0,get:function(){return kI.NotebookDocuments}});_x(cm(),rn);var vx;(function(t){t.all={__brand:"features",languages:TI.InlineCompletionFeature}})(vx||(rn.ProposedFeatures=vx={}))});var bm=m(Vn=>{"use strict";var wI=Vn&&Vn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xx=Vn&&Vn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&wI(e,t,n)};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createConnection=Vn.Files=void 0;var Sx=require("node:util"),ym=Ll(),xI=cm(),Ha=mx(),ys=mm();xx(mm(),Vn);xx(Tx(),Vn);var kx;(function(t){t.uriToFilePath=Ha.uriToFilePath,t.resolveGlobalNodePath=Ha.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ha.resolveGlobalYarnPath,t.resolve=Ha.resolve,t.resolveModulePath=Ha.resolveModulePath})(kx||(Vn.Files=kx={}));var wx;function Yc(){if(wx!==void 0)try{wx.end()}catch{}}var wo=!1,Ex;function EI(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ex=setInterval(()=>{try{process.kill(r,0)}catch{Yc(),process.exit(wo?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let i=r.split("=");i[0]===t&&e(i[1])}}}EI();var AI={initialize:t=>{let e=t.processId;ym.number(e)&&Ex===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(wo?0:1)}},3e3)},get shutdownReceived(){return wo},set shutdownReceived(t){wo=t},exit:t=>{Yc(),process.exit(t)}};function OI(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),ys.ConnectionStrategy.is(t)||ys.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),CI(s,o,a,i)}Vn.createConnection=OI;function CI(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,l,c=process.argv.slice(2);for(let h=0;h<c.length;h++){let f=c[h];if(f==="--node-ipc"){t=new ys.IPCMessageReader(process),e=new ys.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){u=parseInt(c[h+1]);break}else if(f==="--pipe"){l=c[h+1];break}else{var s=f.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(u){let h=(0,ys.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(l){let h=(0,ys.createServerPipeTransport)(l);t=h[0],e=h[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(ym.func(t.read)&&ym.func(t.on)){let u=t;u.on("end",()=>{Yc(),process.exit(wo?0:1)}),u.on("close",()=>{Yc(),process.exit(wo?0:1)})}let a=u=>{let l=(0,ys.createProtocolConnection)(t,e,u,n);return i&&RI(u),l};return(0,xI.createConnection)(a,AI,r)}function RI(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Sx.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,Sx.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 vm=m((OG,Ax)=>{"use strict";Ax.exports=bm()});var bs=m(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.TypeAnalyzerStrategy=An.IndentationType=An.DefaultFileExtensions=An.ConfigurationNamespace=An.LanguageId=void 0;An.LanguageId="miniscript";An.ConfigurationNamespace="miniscript";An.DefaultFileExtensions=["ms"];var PI;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(PI=An.IndentationType||(An.IndentationType={}));var DI;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(DI=An.TypeAnalyzerStrategy||(An.TypeAnalyzerStrategy={}))});var Ga=m(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.Position=void 0;var _m=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Jc.Position=_m});var qi=m(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LiteralToken=Ln.Token=Ln.BaseToken=Ln.BaseTokenOptions=Ln.TokenType=void 0;var Ox=Ga(),II;(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"})(II=Ln.TokenType||(Ln.TokenType={}));var Tm=class{};Ln.BaseTokenOptions=Tm;var za=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 Ox.Position(this.line,r[0]-n[0]+1),this.end=new Ox.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}']`}};Ln.BaseToken=za;var Sm=class extends za{};Ln.Token=Sm;var km=class extends za{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}]`}};Ln.LiteralToken=km});var Qc=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.CharacterCode=void 0;var MI;(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"})(MI=Ka.CharacterCode||(Ka.CharacterCode={}))});var xo=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.Keyword=void 0;var LI;(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"})(LI=Va.Keyword||(Va.Keyword={}))});var Em=m(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var Xn=Qc(),NI=xo(),wm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(NI.Keyword)))}isWhitespace(e){return Xn.CharacterCode.WHITESPACE===e||Xn.CharacterCode.TAB===e}isEndOfLine(e){return Xn.CharacterCode.NEW_LINE===e||Xn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Xn.CharacterCode.SLASH===e&&Xn.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>=Xn.CharacterCode.NUMBER_0&&e<=Xn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Xn.CharacterCode.RETURN_LINE:return Xn.CharacterCode.NEW_LINE===n;case Xn.CharacterCode.NEW_LINE:return Xn.CharacterCode.RETURN_LINE===n}return!1}};xm.default=wm});var Zc=m(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ParserException=Eo.LexerException=void 0;var Am=class extends Error{constructor(e,n){super(e),this.range=n}};Eo.LexerException=Am;var Om=class extends Error{constructor(e,n){super(e),this.range=n}};Eo.ParserException=Om});var Cm=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.Literal=void 0;var qI;(function(t){t.True="true",t.False="false",t.Null="null"})(qI=Xa.Literal||(Xa.Literal={}))});var Ao=m(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.Operator=void 0;var jI;(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"})(jI=Ya.Operator||(Ya.Operator={}))});var Ja=m(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.Range=void 0;var Rm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};eh.Range=Rm});var Im=m(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var Pm=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}};Dm.default=Pm});var Nm=m(Za=>{"use strict";var Rx=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var ot=qi(),FI=Rx(Em()),Te=Qc(),$I=Zc(),Mm=xo(),Qa=Cm(),at=Ao(),Oo=Ga(),Lm=Ja(),Cx=Rx(Im());function ji(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var th=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 FI.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Cx.default,r.snapshot=new Cx.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 ot.Token({type:ot.TokenType.EOL,value:at.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 ot.Token({type:ot.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 ot.Token({type:ot.TokenType.EOF,value:at.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 ot.LiteralToken({type:ot.TokenType.BooleanLiteral,value:e===Qa.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 ot.LiteralToken({type:ot.TokenType.NilLiteral,value:null,raw:Qa.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 ot.Token({type:ot.TokenType.SliceOperator,value:at.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 ot.Token({type:ot.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 ot.LiteralToken({type:ot.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,l=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(Te.CharacterCode.QUOTE===g){if(Te.CharacterCode.QUOTE!==n.codeAt(1)){l=!0;break}n.index++}}if(!l)return n.raise("Unexpected string end of file.",new Lm.Range(new Oo.Position(i,o-a+1),new Oo.Position(n.line,n.index-u+2)));n.index++;let c=n.content.slice(n.tokenStart,n.index),h=c.slice(1,-1).replace(/""/g,at.Operator.Escape),f=new ot.LiteralToken({type:ot.TokenType.StringLiteral,value:h,raw:c,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(f),f}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 ot.Token({type:ot.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)||Te.CharacterCode.DOT===i||Te.CharacterCode.LETTER_E===i||Te.CharacterCode.LETTER_e===i||(Te.CharacterCode.MINUS===i||Te.CharacterCode.PLUS===i)&&(Te.CharacterCode.LETTER_E===r||Te.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 Lm.Range(new Oo.Position(this.line,this.tokenStart-this.offset+1),new Oo.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 Mm.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Mm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Mm.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new ot.Token({type:ot.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 Qa.Literal.True:case Qa.Literal.False:return n.createBoolean(i,e);case Qa.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 Lm.Range(new Oo.Position(s,e.tokenStart-e.offset+1),new Oo.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 $I.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new ot.Token({type:ot.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Za.default=th;th.scanHandlers={[Te.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[Te.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(at.Operator.Member,e))},[Te.CharacterCode.EQUAL]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.Equal,e):this.scanPunctuator(at.Operator.Assign,e)},[Te.CharacterCode.ARROW_LEFT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.LessThanOrEqual,e):this.scanPunctuator(at.Operator.LessThan,e)},[Te.CharacterCode.ARROW_RIGHT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.GreaterThanOrEqual,e):this.scanPunctuator(at.Operator.GreaterThan,e)},[Te.CharacterCode.EXCLAMATION_MARK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.NotEqual,e):(this.index++,null)},[Te.CharacterCode.MINUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.SubtractShorthand,e):this.scanPunctuator(at.Operator.Minus,e)},[Te.CharacterCode.PLUS]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.AddShorthand,e):this.scanPunctuator(at.Operator.Plus,e)},[Te.CharacterCode.ASTERISK]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.MultiplyShorthand,e):this.scanPunctuator(at.Operator.Asterik,e)},[Te.CharacterCode.SLASH]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.DivideShorthand,e):this.scanPunctuator(at.Operator.Slash,e)},[Te.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[Te.CharacterCode.CARET]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.PowerShorthand,e):this.scanPunctuator(at.Operator.Power,e)},[Te.CharacterCode.PERCENT]:function(e){return Te.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(at.Operator.ModuloShorthand,e):this.scanPunctuator(at.Operator.Modulo,e)},[Te.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[Te.CharacterCode.COMMA]:ji,[Te.CharacterCode.CURLY_BRACKET_LEFT]:ji,[Te.CharacterCode.CURLY_BRACKET_RIGHT]:ji,[Te.CharacterCode.SQUARE_BRACKETS_LEFT]:ji,[Te.CharacterCode.SQUARE_BRACKETS_RIGHT]:ji,[Te.CharacterCode.PARENTHESIS_LEFT]:ji,[Te.CharacterCode.PARENTHESIS_RIGHT]:ji,[Te.CharacterCode.AT_SIGN]:ji}});var mt=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ASTComment=Nn.ASTBaseBlockWithScope=Nn.ASTBaseBlock=Nn.ASTBase=Nn.ASTType=void 0;var Px;(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"})(Px=Nn.ASTType||(Nn.ASTType={}));var eu=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})}};Nn.ASTBase=eu;var nh=class t extends eu{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?`
|
40
40
|
${e}
|
41
|
-
`:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nn.ASTBaseBlock=nh;var qm=class t extends nh{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.assignments=n.assignments||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,assignments:this.assignments.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nn.ASTBaseBlockWithScope=qm;var jm=class t extends eu{constructor(e){super(
|
41
|
+
`:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nn.ASTBaseBlock=nh;var qm=class t extends nh{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.assignments=n.assignments||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,assignments:this.assignments.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nn.ASTBaseBlockWithScope=qm;var jm=class t extends eu{constructor(e){super(Px.Comment,e),this.value=e.value,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nn.ASTComment=jm});var $m=m(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.ASTAssignmentStatement=void 0;var Dx=mt(),Fm=class t extends Dx.ASTBase{constructor(e){super(Dx.ASTType.AssignmentStatement,e),this.variable=e.variable,this.init=e.init}toString(){return`AssignmentStatement[${this.start}-${this.end}][${this.variable} = ${this.init}]`}clone(){return new t({variable:this.variable.clone(),init:this.init.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};rh.ASTAssignmentStatement=Fm});var Um=m(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.ASTBinaryExpression=void 0;var Ix=mt(),Bm=class t extends Ix.ASTBase{constructor(e){super(Ix.ASTType.BinaryExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ih.ASTBinaryExpression=Bm});var Gm=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ASTCallExpression=Co.ASTCallStatement=void 0;var sh=mt(),Wm=class t extends sh.ASTBase{constructor(e){super(sh.ASTType.CallStatement,e),this.expression=e.expression}toString(){return`CallStatment[${this.start}-${this.end}][${this.expression}]`}clone(){return new t({expression:this.expression,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Co.ASTCallStatement=Wm;var Hm=class t extends sh.ASTBase{constructor(e){super(sh.ASTType.CallExpression,e),this.base=e.base,this.arguments=e.arguments||[]}toString(){return`CallExpression[${this.start}-${this.end}][${this.base}(${this.arguments.map(e=>e.toString()).join(", ")})]`}clone(){return new t({base:this.base.clone(),arguments:this.arguments.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Co.ASTCallExpression=Hm});var Km=m(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.ASTChunk=void 0;var Mx=mt(),zm=class t extends Mx.ASTBaseBlockWithScope{constructor(e){super(Mx.ASTType.Chunk,e),this.literals=e.literals||[],this.scopes=e.scopes||[],this.lines=e.lines||{}}toString(){if(this.body.length===0)return`Chunk[${this.start}-${this.end}][]`;let e=this.body.map(n=>`${n}`).join(`
|
42
42
|
`).split(`
|
43
43
|
`).map(n=>` ${n}`).join(`
|
44
44
|
`);return`Chunk[${this.start}-${this.end}][
|
45
45
|
${e}
|
46
|
-
]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};oh.ASTChunk=
|
46
|
+
]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};oh.ASTChunk=zm});var Xm=m(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.ASTComparisonGroupExpression=void 0;var Lx=mt(),Vm=class t extends Lx.ASTBase{constructor(e){super(Lx.ASTType.ComparisonGroupExpression,e),this.operators=e.operators,this.expressions=e.expressions}toString(){let e=[this.expressions[0].toString()];for(let n=1;n<this.expressions.length;n++)e.push(this.operators[n-1],this.expressions[n].toString());return`${this.type}[${this.start}-${this.end}][${e.join(" ")}]`}clone(){return new t({operators:this.operators,expressions:this.expressions,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ah.ASTComparisonGroupExpression=Vm});var Jm=m(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.ASTForGenericStatement=void 0;var Nx=mt(),Ym=class t extends Nx.ASTBaseBlock{constructor(e){super(Nx.ASTType.ForGenericStatement,e),this.variable=e.variable,this.iterator=e.iterator}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.variable} in ${this.iterator}]`;let e=this.body.map(n=>`${n}`).join(`
|
47
47
|
`).split(`
|
48
48
|
`).map(n=>` ${n}`).join(`
|
49
49
|
`);return`For[${this.start}-${this.end}][${this.variable} in ${this.iterator}
|
50
50
|
${e}
|
51
|
-
]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};uh.ASTForGenericStatement=Ym});var Zm=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.ASTFunctionStatement=void 0;var
|
51
|
+
]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};uh.ASTForGenericStatement=Ym});var Zm=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.ASTFunctionStatement=void 0;var qx=mt(),Qm=class t extends qx.ASTBaseBlockWithScope{constructor(e){super(qx.ASTType.FunctionDeclaration,e),this.parameters=e.parameters||[],this.assignment=e.assignment}toString(){let e=this.parameters.map(r=>r).join(", ");if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${e}]`;let n=this.body.map(r=>`${r}`).join(`
|
52
52
|
`).split(`
|
53
53
|
`).map(r=>` ${r}`).join(`
|
54
54
|
`);return`Function[${this.start}-${this.end}][${e} =>
|
55
55
|
${n}
|
56
|
-
]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};lh.ASTFunctionStatement=Qm});var ry=m(
|
56
|
+
]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};lh.ASTFunctionStatement=Qm});var ry=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ASTIndexExpression=_r.ASTMemberExpression=_r.ASTIdentifier=_r.ASTIdentifierKind=void 0;var Ro=mt(),BI;(function(t){t.Variable="variable",t.Argument="argument",t.ForInVariable="for-in-variable",t.ForInIdxVariable="for-in-idx-variable",t.Property="property"})(BI=_r.ASTIdentifierKind||(_r.ASTIdentifierKind={}));var ey=class t extends Ro.ASTBase{constructor(e){super(Ro.ASTType.Identifier,e),this.name=e.name,this.kind=e.kind}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,kind:this.kind,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIdentifier=ey;var ty=class t extends Ro.ASTBase{constructor(e){super(Ro.ASTType.MemberExpression,e),this.indexer=e.indexer,this.identifier=e.identifier,this.base=e.base}toString(){return`MemberExpression[${this.start}-${this.end}][${this.base}.${this.identifier}]`}clone(){return new t({indexer:this.indexer,identifier:this.identifier.clone(),base:this.base,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTMemberExpression=ty;var ny=class t extends Ro.ASTBase{constructor(e){super(Ro.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index}toString(){return`IndexExpression[${this.start}-${this.end}][${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIndexExpression=ny});var ay=m(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ASTElseClause=Nr.ASTIfClause=Nr.ASTIfStatement=Nr.ASTClause=void 0;var jx=mt(),tu=class extends jx.ASTBaseBlock{};Nr.ASTClause=tu;var iy=class t extends jx.ASTBase{constructor(e,n){super(e,n),this.clauses=n.clauses||[]}toString(){if(this.clauses.length===0)return`IfStatement[${this.start}-${this.end}][]`;let e=this.clauses.map(n=>`${n}`).join(`
|
57
57
|
`).split(`
|
58
58
|
`).map(n=>` ${n}`).join(`
|
59
59
|
`);return`IfStatement[${this.start}-${this.end}][
|
@@ -68,22 +68,22 @@ ${e}
|
|
68
68
|
`).map(n=>` ${n}`).join(`
|
69
69
|
`);return`${this.type}[${this.start}-${this.end}][
|
70
70
|
${e}
|
71
|
-
}]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nr.ASTElseClause=oy});var ly=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ASTIsaExpression=void 0;var
|
71
|
+
}]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nr.ASTElseClause=oy});var ly=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ASTIsaExpression=void 0;var Fx=mt(),uy=class t extends Fx.ASTBase{constructor(e){super(Fx.ASTType.IsaExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ch.ASTIsaExpression=uy});var fy=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ASTListConstructorExpression=Po.ASTListValue=void 0;var hh=mt(),cy=class t extends hh.ASTBase{constructor(e){super(hh.ASTType.ListValue,e),this.value=e.value}toString(){return`ListValue[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTListValue=cy;var hy=class t extends hh.ASTBase{constructor(e){super(hh.ASTType.ListConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`ListConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
|
72
72
|
`).split(`
|
73
73
|
`).map(n=>` ${n}`).join(`
|
74
74
|
`);return`ListConstructor[${this.start}-${this.end}][
|
75
75
|
${e}
|
76
|
-
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTListConstructorExpression=hy});var by=m(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ASTNilLiteral=Yn.ASTStringLiteral=Yn.ASTBooleanLiteral=Yn.ASTNumericLiteral=Yn.ASTLiteral=void 0;var
|
76
|
+
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTListConstructorExpression=hy});var by=m(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ASTNilLiteral=Yn.ASTStringLiteral=Yn.ASTBooleanLiteral=Yn.ASTNumericLiteral=Yn.ASTLiteral=void 0;var $x=qi(),yy=mt(),vs=class extends yy.ASTBase{};Yn.ASTLiteral=vs;var dy=class t extends vs{constructor(e){super($x.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Yn.ASTNumericLiteral=dy;var py=class t extends vs{constructor(e){super($x.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Yn.ASTBooleanLiteral=py;var gy=class t extends vs{constructor(e){super(yy.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Yn.ASTStringLiteral=gy;var my=class t extends vs{constructor(e){super(yy.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Yn.ASTNilLiteral=my});var _y=m(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.ASTLogicalExpression=void 0;var Bx=mt(),vy=class t extends Bx.ASTBase{constructor(e){super(Bx.ASTType.LogicalExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};fh.ASTLogicalExpression=vy});var ky=m(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ASTMapConstructorExpression=Do.ASTMapKeyString=void 0;var dh=mt(),Ty=class t extends dh.ASTBase{constructor(e){super(dh.ASTType.MapKeyString,e),this.key=e.key,this.value=e.value}toString(){return`MapKeyString[${this.start}-${this.end}][${this.key}: ${this.value}]`}clone(){return new t({key:this.key.clone(),value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Do.ASTMapKeyString=Ty;var Sy=class t extends dh.ASTBase{constructor(e){super(dh.ASTType.MapConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`MapConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
|
77
77
|
`).split(`
|
78
78
|
`).map(n=>` ${n}`).join(`
|
79
79
|
`);return`MapConstructor[${this.start}-${this.end}][
|
80
80
|
${e}
|
81
|
-
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Do.ASTMapConstructorExpression=Sy});var xy=m(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.ASTParenthesisExpression=void 0;var
|
81
|
+
]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Do.ASTMapConstructorExpression=Sy});var xy=m(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.ASTParenthesisExpression=void 0;var Ux=mt(),wy=class t extends Ux.ASTBase{constructor(e){super(Ux.ASTType.ParenthesisExpression,e),this.expression=e.expression}toString(){return this.expression.toString()}clone(){return new t({expression:this.expression.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ph.ASTParenthesisExpression=wy});var Ay=m(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.ASTReturnStatement=void 0;var Wx=mt(),Ey=class t extends Wx.ASTBase{constructor(e){super(Wx.ASTType.ReturnStatement,e),this.argument=e.argument}toString(){return`ReturnStatement[${this.start}-${this.end}][${this.argument}]`}clone(){return new t({argument:this.argument.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};gh.ASTReturnStatement=Ey});var Cy=m(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.ASTSliceExpression=void 0;var Hx=mt(),Oy=class t extends Hx.ASTBase{constructor(e){super(Hx.ASTType.SliceExpression,e),this.left=e.left,this.right=e.right,this.base=e.base}toString(){return`SliceExpression[${this.start}-${this.end}][${this.base}[${this.left}:${this.right}]]`}clone(){return new t({base:this.base.clone(),left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};mh.ASTSliceExpression=Oy});var Dy=m(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.ASTUnaryExpression=void 0;var Ry=Ao(),yh=mt(),Py=class t extends yh.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Ry.Operator.Not:return yh.ASTType.NegationExpression;case Ry.Operator.Plus:case Ry.Operator.Minus:return yh.ASTType.BinaryNegatedExpression;default:return yh.ASTType.UnaryExpression}}toString(){return`${this.type}[${this.start}-${this.end}][${this.operator} ${this.argument}]`}clone(){return new t({argument:this.argument.clone(),operator:this.operator,start:this.start,end:this.end,range:this.range,scope:this.scope})}};bh.ASTUnaryExpression=Py});var My=m(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.ASTWhileStatement=void 0;var Gx=mt(),Iy=class t extends Gx.ASTBaseBlock{constructor(e){super(Gx.ASTType.WhileStatement,e),this.condition=e.condition}toString(){if(this.body.length===0)return`WhileStatement[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
|
82
82
|
`).split(`
|
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})}};vh.ASTWhileStatement=Iy});var qy=m(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.ASTWhileStatement=Y.ASTUnaryExpression=Y.ASTSliceExpression=Y.ASTReturnStatement=Y.ASTParenthesisExpression=Y.ASTMapKeyString=Y.ASTMapConstructorExpression=Y.ASTLogicalExpression=Y.ASTStringLiteral=Y.ASTNumericLiteral=Y.ASTNilLiteral=Y.ASTLiteral=Y.ASTBooleanLiteral=Y.ASTListValue=Y.ASTListConstructorExpression=Y.ASTIsaExpression=Y.ASTIfStatement=Y.ASTIfClause=Y.ASTElseClause=Y.ASTClause=Y.ASTMemberExpression=Y.ASTIndexExpression=Y.ASTIdentifierKind=Y.ASTIdentifier=Y.ASTFunctionStatement=Y.ASTForGenericStatement=Y.ASTComparisonGroupExpression=Y.ASTChunk=Y.ASTCallStatement=Y.ASTCallExpression=Y.ASTBinaryExpression=Y.ASTType=Y.ASTComment=Y.ASTBaseBlockWithScope=Y.ASTBaseBlock=Y.ASTBase=Y.ASTAssignmentStatement=Y.ASTProvider=void 0;var _h=qi(),UI=$m(),Pt=mt(),WI=Um(),zx=Gm(),HI=zm(),GI=Xm(),KI=Jm(),zI=Zm(),Ly=ry(),Fi=ay(),VI=ly(),Vx=fy(),Th=by(),XI=_y(),Xx=ky(),YI=xy(),JI=Ay(),QI=Cy(),ZI=Dy(),eM=My(),Ny=class{breakStatement(e){return new Pt.ASTBase(Pt.ASTType.BreakStatement,e)}continueStatement(e){return new Pt.ASTBase(Pt.ASTType.ContinueStatement,e)}returnStatement(e){return new JI.ASTReturnStatement(e)}ifShortcutStatement(e){return new Fi.ASTIfStatement(Pt.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Fi.ASTIfClause(Pt.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Fi.ASTIfClause(Pt.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Fi.ASTElseClause(Pt.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Fi.ASTIfStatement(Pt.ASTType.IfStatement,e)}ifClause(e){return new Fi.ASTIfClause(Pt.ASTType.IfClause,e)}elseifClause(e){return new Fi.ASTIfClause(Pt.ASTType.ElseifClause,e)}elseClause(e){return new Fi.ASTElseClause(Pt.ASTType.ElseClause,e)}whileStatement(e){return new eM.ASTWhileStatement(e)}assignmentStatement(e){return new UI.ASTAssignmentStatement(e)}callStatement(e){return new zx.ASTCallStatement(e)}functionStatement(e){return new zI.ASTFunctionStatement(e)}forGenericStatement(e){return new KI.ASTForGenericStatement(e)}chunk(e){return new HI.ASTChunk(e)}identifier(e){return new Ly.ASTIdentifier(e)}literal(e,n){switch(e){case _h.TokenType.StringLiteral:return new Th.ASTStringLiteral(n);case _h.TokenType.NumericLiteral:return new Th.ASTNumericLiteral(n);case _h.TokenType.BooleanLiteral:return new Th.ASTBooleanLiteral(n);case _h.TokenType.NilLiteral:return new Th.ASTNilLiteral(n)}}memberExpression(e){return new Ly.ASTMemberExpression(e)}callExpression(e){return new zx.ASTCallExpression(e)}comment(e){return new Pt.ASTComment(e)}unaryExpression(e){return new ZI.ASTUnaryExpression(e)}mapKeyString(e){return new Xx.ASTMapKeyString(e)}mapConstructorExpression(e){return new Xx.ASTMapConstructorExpression(e)}listValue(e){return new Vx.ASTListValue(e)}listConstructorExpression(e){return new Vx.ASTListConstructorExpression(e)}unknown(e){return new Pt.ASTBase(Pt.ASTType.Unknown,e)}emptyExpression(e){return new Pt.ASTBase(Pt.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Pt.ASTBase(Pt.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Ly.ASTIndexExpression(e)}logicalExpression(e){return new XI.ASTLogicalExpression(e)}isaExpression(e){return new VI.ASTIsaExpression(e)}binaryExpression(e){return new WI.ASTBinaryExpression(e)}sliceExpression(e){return new QI.ASTSliceExpression(e)}parenthesisExpression(e){return new YI.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new GI.ASTComparisonGroupExpression(e)}};Y.ASTProvider=Ny;var tM=$m();Object.defineProperty(Y,"ASTAssignmentStatement",{enumerable:!0,get:function(){return tM.ASTAssignmentStatement}});var nu=mt();Object.defineProperty(Y,"ASTBase",{enumerable:!0,get:function(){return nu.ASTBase}});Object.defineProperty(Y,"ASTBaseBlock",{enumerable:!0,get:function(){return nu.ASTBaseBlock}});Object.defineProperty(Y,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return nu.ASTBaseBlockWithScope}});Object.defineProperty(Y,"ASTComment",{enumerable:!0,get:function(){return nu.ASTComment}});Object.defineProperty(Y,"ASTType",{enumerable:!0,get:function(){return nu.ASTType}});var nM=Um();Object.defineProperty(Y,"ASTBinaryExpression",{enumerable:!0,get:function(){return nM.ASTBinaryExpression}});var Yx=Gm();Object.defineProperty(Y,"ASTCallExpression",{enumerable:!0,get:function(){return Yx.ASTCallExpression}});Object.defineProperty(Y,"ASTCallStatement",{enumerable:!0,get:function(){return Yx.ASTCallStatement}});var rM=zm();Object.defineProperty(Y,"ASTChunk",{enumerable:!0,get:function(){return rM.ASTChunk}});var iM=Xm();Object.defineProperty(Y,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return iM.ASTComparisonGroupExpression}});var sM=Jm();Object.defineProperty(Y,"ASTForGenericStatement",{enumerable:!0,get:function(){return sM.ASTForGenericStatement}});var oM=Zm();Object.defineProperty(Y,"ASTFunctionStatement",{enumerable:!0,get:function(){return oM.ASTFunctionStatement}});var Sh=ry();Object.defineProperty(Y,"ASTIdentifier",{enumerable:!0,get:function(){return Sh.ASTIdentifier}});Object.defineProperty(Y,"ASTIdentifierKind",{enumerable:!0,get:function(){return Sh.ASTIdentifierKind}});Object.defineProperty(Y,"ASTIndexExpression",{enumerable:!0,get:function(){return Sh.ASTIndexExpression}});Object.defineProperty(Y,"ASTMemberExpression",{enumerable:!0,get:function(){return Sh.ASTMemberExpression}});var kh=ay();Object.defineProperty(Y,"ASTClause",{enumerable:!0,get:function(){return kh.ASTClause}});Object.defineProperty(Y,"ASTElseClause",{enumerable:!0,get:function(){return kh.ASTElseClause}});Object.defineProperty(Y,"ASTIfClause",{enumerable:!0,get:function(){return kh.ASTIfClause}});Object.defineProperty(Y,"ASTIfStatement",{enumerable:!0,get:function(){return kh.ASTIfStatement}});var aM=ly();Object.defineProperty(Y,"ASTIsaExpression",{enumerable:!0,get:function(){return aM.ASTIsaExpression}});var Jx=fy();Object.defineProperty(Y,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Jx.ASTListConstructorExpression}});Object.defineProperty(Y,"ASTListValue",{enumerable:!0,get:function(){return Jx.ASTListValue}});var ru=by();Object.defineProperty(Y,"ASTBooleanLiteral",{enumerable:!0,get:function(){return ru.ASTBooleanLiteral}});Object.defineProperty(Y,"ASTLiteral",{enumerable:!0,get:function(){return ru.ASTLiteral}});Object.defineProperty(Y,"ASTNilLiteral",{enumerable:!0,get:function(){return ru.ASTNilLiteral}});Object.defineProperty(Y,"ASTNumericLiteral",{enumerable:!0,get:function(){return ru.ASTNumericLiteral}});Object.defineProperty(Y,"ASTStringLiteral",{enumerable:!0,get:function(){return ru.ASTStringLiteral}});var uM=_y();Object.defineProperty(Y,"ASTLogicalExpression",{enumerable:!0,get:function(){return uM.ASTLogicalExpression}});var Qx=ky();Object.defineProperty(Y,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Qx.ASTMapConstructorExpression}});Object.defineProperty(Y,"ASTMapKeyString",{enumerable:!0,get:function(){return Qx.ASTMapKeyString}});var lM=xy();Object.defineProperty(Y,"ASTParenthesisExpression",{enumerable:!0,get:function(){return lM.ASTParenthesisExpression}});var cM=Ay();Object.defineProperty(Y,"ASTReturnStatement",{enumerable:!0,get:function(){return cM.ASTReturnStatement}});var hM=Cy();Object.defineProperty(Y,"ASTSliceExpression",{enumerable:!0,get:function(){return hM.ASTSliceExpression}});var fM=Dy();Object.defineProperty(Y,"ASTUnaryExpression",{enumerable:!0,get:function(){return fM.ASTUnaryExpression}});var dM=My();Object.defineProperty(Y,"ASTWhileStatement",{enumerable:!0,get:function(){return dM.ASTWhileStatement}})});var $y=m(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});var $i=qi(),jy=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([$i.TokenType.StringLiteral,$i.TokenType.NumericLiteral,$i.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([$i.TokenType.StringLiteral,$i.TokenType.NumericLiteral,$i.TokenType.BooleanLiteral,$i.TokenType.NilLiteral]))}isComment(e){return e===$i.TokenType.Comment}};Fy.default=jy});var Uy=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.SelectorGroups=he.SelectorGroupType=he.getSelectorsFromGroup=he.createSelectorGroup=he.Selectors=he.getSelectorValue=he.createSelector=he.createSelectorOptions=he.SelectorType=void 0;var fe=qi(),_r=xo(),Se=Ao(),pM;(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"})(pM=he.SelectorType||(he.SelectorType={}));var By=class{};he.createSelectorOptions=By;function ce(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}he.createSelector=ce;function gM(t){return t.data.value}he.getSelectorValue=gM;he.Selectors={EndOfLine:ce({type:fe.TokenType.EOL,value:Se.Operator.EndOfLine}),EndOfFile:ce({type:fe.TokenType.EOF,value:Se.Operator.EndOfFile}),LParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LParenthesis}),RParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.RParenthesis}),CLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CLBracket}),CRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CRBracket}),SLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SLBracket}),SRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SRBracket}),Assign:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Assign}),AddShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.AddShorthand}),SubtractShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SubtractShorthand}),MultiplyShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.MultiplyShorthand}),DivideShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.DivideShorthand}),PowerShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.PowerShorthand}),ModuloShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.ModuloShorthand}),Seperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),Function:ce({type:fe.TokenType.Keyword,value:_r.Keyword.Function}),EndFunction:ce({type:fe.TokenType.Keyword,value:_r.Keyword.EndFunction}),EndWhile:ce({type:fe.TokenType.Keyword,value:_r.Keyword.EndWhile}),EndFor:ce({type:fe.TokenType.Keyword,value:_r.Keyword.EndFor}),EndIf:ce({type:fe.TokenType.Keyword,value:_r.Keyword.EndIf}),SliceSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapKeyValueSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ListSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),CallSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ArgumentSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ImportCodeSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),ElseIf:ce({type:fe.TokenType.Keyword,value:_r.Keyword.ElseIf}),Then:ce({type:fe.TokenType.Keyword,value:_r.Keyword.Then}),Else:ce({type:fe.TokenType.Keyword,value:_r.Keyword.Else}),In:ce({type:fe.TokenType.Keyword,value:_r.Keyword.In}),MemberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),NumberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),Reference:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Reference}),Isa:ce({type:fe.TokenType.Keyword,value:Se.Operator.Isa}),Or:ce({type:fe.TokenType.Keyword,value:Se.Operator.Or}),And:ce({type:fe.TokenType.Keyword,value:Se.Operator.And}),Minus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Minus}),Plus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Plus}),Times:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Asterik}),Power:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Power}),Divide:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Slash}),Mod:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Modulo}),Equal:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Equal}),NotEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.NotEqual}),Greater:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThan}),GreaterEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThanOrEqual}),Lesser:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThan}),LessEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThanOrEqual}),New:ce({type:fe.TokenType.Keyword,value:_r.Keyword.New}),Not:ce({type:fe.TokenType.Keyword,value:_r.Keyword.Not}),Comment:ce({type:fe.TokenType.Comment})};function qr(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})}};vh.ASTWhileStatement=Iy});var qy=m(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.ASTWhileStatement=Y.ASTUnaryExpression=Y.ASTSliceExpression=Y.ASTReturnStatement=Y.ASTParenthesisExpression=Y.ASTMapKeyString=Y.ASTMapConstructorExpression=Y.ASTLogicalExpression=Y.ASTStringLiteral=Y.ASTNumericLiteral=Y.ASTNilLiteral=Y.ASTLiteral=Y.ASTBooleanLiteral=Y.ASTListValue=Y.ASTListConstructorExpression=Y.ASTIsaExpression=Y.ASTIfStatement=Y.ASTIfClause=Y.ASTElseClause=Y.ASTClause=Y.ASTMemberExpression=Y.ASTIndexExpression=Y.ASTIdentifierKind=Y.ASTIdentifier=Y.ASTFunctionStatement=Y.ASTForGenericStatement=Y.ASTComparisonGroupExpression=Y.ASTChunk=Y.ASTCallStatement=Y.ASTCallExpression=Y.ASTBinaryExpression=Y.ASTType=Y.ASTComment=Y.ASTBaseBlockWithScope=Y.ASTBaseBlock=Y.ASTBase=Y.ASTAssignmentStatement=Y.ASTProvider=void 0;var _h=qi(),UI=$m(),Pt=mt(),WI=Um(),zx=Gm(),HI=Km(),GI=Xm(),zI=Jm(),KI=Zm(),Ly=ry(),Fi=ay(),VI=ly(),Kx=fy(),Th=by(),XI=_y(),Vx=ky(),YI=xy(),JI=Ay(),QI=Cy(),ZI=Dy(),eM=My(),Ny=class{breakStatement(e){return new Pt.ASTBase(Pt.ASTType.BreakStatement,e)}continueStatement(e){return new Pt.ASTBase(Pt.ASTType.ContinueStatement,e)}returnStatement(e){return new JI.ASTReturnStatement(e)}ifShortcutStatement(e){return new Fi.ASTIfStatement(Pt.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Fi.ASTIfClause(Pt.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Fi.ASTIfClause(Pt.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Fi.ASTElseClause(Pt.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Fi.ASTIfStatement(Pt.ASTType.IfStatement,e)}ifClause(e){return new Fi.ASTIfClause(Pt.ASTType.IfClause,e)}elseifClause(e){return new Fi.ASTIfClause(Pt.ASTType.ElseifClause,e)}elseClause(e){return new Fi.ASTElseClause(Pt.ASTType.ElseClause,e)}whileStatement(e){return new eM.ASTWhileStatement(e)}assignmentStatement(e){return new UI.ASTAssignmentStatement(e)}callStatement(e){return new zx.ASTCallStatement(e)}functionStatement(e){return new KI.ASTFunctionStatement(e)}forGenericStatement(e){return new zI.ASTForGenericStatement(e)}chunk(e){return new HI.ASTChunk(e)}identifier(e){return new Ly.ASTIdentifier(e)}literal(e,n){switch(e){case _h.TokenType.StringLiteral:return new Th.ASTStringLiteral(n);case _h.TokenType.NumericLiteral:return new Th.ASTNumericLiteral(n);case _h.TokenType.BooleanLiteral:return new Th.ASTBooleanLiteral(n);case _h.TokenType.NilLiteral:return new Th.ASTNilLiteral(n)}}memberExpression(e){return new Ly.ASTMemberExpression(e)}callExpression(e){return new zx.ASTCallExpression(e)}comment(e){return new Pt.ASTComment(e)}unaryExpression(e){return new ZI.ASTUnaryExpression(e)}mapKeyString(e){return new Vx.ASTMapKeyString(e)}mapConstructorExpression(e){return new Vx.ASTMapConstructorExpression(e)}listValue(e){return new Kx.ASTListValue(e)}listConstructorExpression(e){return new Kx.ASTListConstructorExpression(e)}unknown(e){return new Pt.ASTBase(Pt.ASTType.Unknown,e)}emptyExpression(e){return new Pt.ASTBase(Pt.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Pt.ASTBase(Pt.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Ly.ASTIndexExpression(e)}logicalExpression(e){return new XI.ASTLogicalExpression(e)}isaExpression(e){return new VI.ASTIsaExpression(e)}binaryExpression(e){return new WI.ASTBinaryExpression(e)}sliceExpression(e){return new QI.ASTSliceExpression(e)}parenthesisExpression(e){return new YI.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new GI.ASTComparisonGroupExpression(e)}};Y.ASTProvider=Ny;var tM=$m();Object.defineProperty(Y,"ASTAssignmentStatement",{enumerable:!0,get:function(){return tM.ASTAssignmentStatement}});var nu=mt();Object.defineProperty(Y,"ASTBase",{enumerable:!0,get:function(){return nu.ASTBase}});Object.defineProperty(Y,"ASTBaseBlock",{enumerable:!0,get:function(){return nu.ASTBaseBlock}});Object.defineProperty(Y,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return nu.ASTBaseBlockWithScope}});Object.defineProperty(Y,"ASTComment",{enumerable:!0,get:function(){return nu.ASTComment}});Object.defineProperty(Y,"ASTType",{enumerable:!0,get:function(){return nu.ASTType}});var nM=Um();Object.defineProperty(Y,"ASTBinaryExpression",{enumerable:!0,get:function(){return nM.ASTBinaryExpression}});var Xx=Gm();Object.defineProperty(Y,"ASTCallExpression",{enumerable:!0,get:function(){return Xx.ASTCallExpression}});Object.defineProperty(Y,"ASTCallStatement",{enumerable:!0,get:function(){return Xx.ASTCallStatement}});var rM=Km();Object.defineProperty(Y,"ASTChunk",{enumerable:!0,get:function(){return rM.ASTChunk}});var iM=Xm();Object.defineProperty(Y,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return iM.ASTComparisonGroupExpression}});var sM=Jm();Object.defineProperty(Y,"ASTForGenericStatement",{enumerable:!0,get:function(){return sM.ASTForGenericStatement}});var oM=Zm();Object.defineProperty(Y,"ASTFunctionStatement",{enumerable:!0,get:function(){return oM.ASTFunctionStatement}});var Sh=ry();Object.defineProperty(Y,"ASTIdentifier",{enumerable:!0,get:function(){return Sh.ASTIdentifier}});Object.defineProperty(Y,"ASTIdentifierKind",{enumerable:!0,get:function(){return Sh.ASTIdentifierKind}});Object.defineProperty(Y,"ASTIndexExpression",{enumerable:!0,get:function(){return Sh.ASTIndexExpression}});Object.defineProperty(Y,"ASTMemberExpression",{enumerable:!0,get:function(){return Sh.ASTMemberExpression}});var kh=ay();Object.defineProperty(Y,"ASTClause",{enumerable:!0,get:function(){return kh.ASTClause}});Object.defineProperty(Y,"ASTElseClause",{enumerable:!0,get:function(){return kh.ASTElseClause}});Object.defineProperty(Y,"ASTIfClause",{enumerable:!0,get:function(){return kh.ASTIfClause}});Object.defineProperty(Y,"ASTIfStatement",{enumerable:!0,get:function(){return kh.ASTIfStatement}});var aM=ly();Object.defineProperty(Y,"ASTIsaExpression",{enumerable:!0,get:function(){return aM.ASTIsaExpression}});var Yx=fy();Object.defineProperty(Y,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Yx.ASTListConstructorExpression}});Object.defineProperty(Y,"ASTListValue",{enumerable:!0,get:function(){return Yx.ASTListValue}});var ru=by();Object.defineProperty(Y,"ASTBooleanLiteral",{enumerable:!0,get:function(){return ru.ASTBooleanLiteral}});Object.defineProperty(Y,"ASTLiteral",{enumerable:!0,get:function(){return ru.ASTLiteral}});Object.defineProperty(Y,"ASTNilLiteral",{enumerable:!0,get:function(){return ru.ASTNilLiteral}});Object.defineProperty(Y,"ASTNumericLiteral",{enumerable:!0,get:function(){return ru.ASTNumericLiteral}});Object.defineProperty(Y,"ASTStringLiteral",{enumerable:!0,get:function(){return ru.ASTStringLiteral}});var uM=_y();Object.defineProperty(Y,"ASTLogicalExpression",{enumerable:!0,get:function(){return uM.ASTLogicalExpression}});var Jx=ky();Object.defineProperty(Y,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Jx.ASTMapConstructorExpression}});Object.defineProperty(Y,"ASTMapKeyString",{enumerable:!0,get:function(){return Jx.ASTMapKeyString}});var lM=xy();Object.defineProperty(Y,"ASTParenthesisExpression",{enumerable:!0,get:function(){return lM.ASTParenthesisExpression}});var cM=Ay();Object.defineProperty(Y,"ASTReturnStatement",{enumerable:!0,get:function(){return cM.ASTReturnStatement}});var hM=Cy();Object.defineProperty(Y,"ASTSliceExpression",{enumerable:!0,get:function(){return hM.ASTSliceExpression}});var fM=Dy();Object.defineProperty(Y,"ASTUnaryExpression",{enumerable:!0,get:function(){return fM.ASTUnaryExpression}});var dM=My();Object.defineProperty(Y,"ASTWhileStatement",{enumerable:!0,get:function(){return dM.ASTWhileStatement}})});var $y=m(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});var $i=qi(),jy=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([$i.TokenType.StringLiteral,$i.TokenType.NumericLiteral,$i.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([$i.TokenType.StringLiteral,$i.TokenType.NumericLiteral,$i.TokenType.BooleanLiteral,$i.TokenType.NilLiteral]))}isComment(e){return e===$i.TokenType.Comment}};Fy.default=jy});var Uy=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.SelectorGroups=he.SelectorGroupType=he.getSelectorsFromGroup=he.createSelectorGroup=he.Selectors=he.getSelectorValue=he.createSelector=he.createSelectorOptions=he.SelectorType=void 0;var fe=qi(),Tr=xo(),Se=Ao(),pM;(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"})(pM=he.SelectorType||(he.SelectorType={}));var By=class{};he.createSelectorOptions=By;function ce(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}he.createSelector=ce;function gM(t){return t.data.value}he.getSelectorValue=gM;he.Selectors={EndOfLine:ce({type:fe.TokenType.EOL,value:Se.Operator.EndOfLine}),EndOfFile:ce({type:fe.TokenType.EOF,value:Se.Operator.EndOfFile}),LParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LParenthesis}),RParenthesis:ce({type:fe.TokenType.Punctuator,value:Se.Operator.RParenthesis}),CLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CLBracket}),CRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.CRBracket}),SLBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SLBracket}),SRBracket:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SRBracket}),Assign:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Assign}),AddShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.AddShorthand}),SubtractShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.SubtractShorthand}),MultiplyShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.MultiplyShorthand}),DivideShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.DivideShorthand}),PowerShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.PowerShorthand}),ModuloShorthand:ce({type:fe.TokenType.Punctuator,value:Se.Operator.ModuloShorthand}),Seperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),Function:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.Function}),EndFunction:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.EndFunction}),EndWhile:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.EndWhile}),EndFor:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.EndFor}),EndIf:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.EndIf}),SliceSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapKeyValueSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),MapSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ListSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),CallSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ArgumentSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Comma}),ImportCodeSeperator:ce({type:fe.TokenType.SliceOperator,value:Se.Operator.SliceSeperator}),ElseIf:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.ElseIf}),Then:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.Then}),Else:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.Else}),In:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.In}),MemberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),NumberSeperator:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Member}),Reference:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Reference}),Isa:ce({type:fe.TokenType.Keyword,value:Se.Operator.Isa}),Or:ce({type:fe.TokenType.Keyword,value:Se.Operator.Or}),And:ce({type:fe.TokenType.Keyword,value:Se.Operator.And}),Minus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Minus}),Plus:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Plus}),Times:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Asterik}),Power:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Power}),Divide:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Slash}),Mod:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Modulo}),Equal:ce({type:fe.TokenType.Punctuator,value:Se.Operator.Equal}),NotEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.NotEqual}),Greater:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThan}),GreaterEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.GreaterThanOrEqual}),Lesser:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThan}),LessEqual:ce({type:fe.TokenType.Punctuator,value:Se.Operator.LessThanOrEqual}),New:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.New}),Not:ce({type:fe.TokenType.Keyword,value:Tr.Keyword.Not}),Comment:ce({type:fe.TokenType.Comment})};function qr(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,28 +93,28 @@ ${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}he.createSelectorGroup=qr;function mM(t){return t.selectors}he.getSelectorsFromGroup=mM;var jr;(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"})(jr=he.SelectorGroupType||(he.SelectorGroupType={}));he.SelectorGroups={BlockEndOfLine:qr(jr.AssignmentEndOfExpr,[he.Selectors.EndOfLine,he.Selectors.Comment]),AssignmentEndOfExpr:qr(jr.AssignmentEndOfExpr,[he.Selectors.EndOfFile,he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),AssignmentShorthand:qr(jr.AssignmentShorthand,[he.Selectors.AddShorthand,he.Selectors.SubtractShorthand,he.Selectors.MultiplyShorthand,he.Selectors.DivideShorthand,he.Selectors.PowerShorthand,he.Selectors.ModuloShorthand]),AssignmentCommandArgs:qr(jr.AssignmentCommandArgs,[he.Selectors.ArgumentSeperator,he.Selectors.EndOfLine,he.Selectors.EndOfFile]),ReturnStatementEnd:qr(jr.ReturnStatementEnd,[he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),FunctionDeclarationArgEnd:qr(jr.FunctionDeclarationArgEnd,[he.Selectors.RParenthesis,he.Selectors.EndOfFile,he.Selectors.EndOfLine]),ComparisonOperators:qr(jr.ComparisonOperators,[he.Selectors.Equal,he.Selectors.NotEqual,he.Selectors.Greater,he.Selectors.GreaterEqual,he.Selectors.Lesser,he.Selectors.LessEqual]),MultiDivOperators:qr(jr.MultiDivOperators,[he.Selectors.Times,he.Selectors.Divide,he.Selectors.Mod]),CallArgsEnd:qr(jr.CallArgsEnd,[he.Selectors.ArgumentSeperator,he.Selectors.RParenthesis])}});var Hy=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.Stack=void 0;var Wy=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}};wh.Stack=Wy});var Yy=m(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.PendingWhile=et.isPendingWhile=et.PendingIf=et.isPendingIf=et.PendingFunction=et.isPendingFunction=et.PendingFor=et.isPendingFor=et.PendingChunk=et.isPendingChunk=et.PendingBlockType=void 0;var Tr;(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"})(Tr=et.PendingBlockType||(et.PendingBlockType={}));var _s=class{constructor(e,n){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 yM(t){return t.type===Tr.Chunk}et.isPendingChunk=yM;var Gy=class extends _s{constructor(e){super(e,Tr.Chunk)}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)}};et.PendingChunk=Gy;function bM(t){return t.type===Tr.For}et.isPendingFor=bM;var Ky=class extends _s{constructor(e){super(e,Tr.For)}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)}};et.PendingFor=Ky;function vM(t){return t.type===Tr.Function}et.isPendingFunction=vM;var zy=class extends _s{constructor(e){super(e,Tr.Function)}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)}};et.PendingFunction=zy;function _M(t){return t.type===Tr.If}et.isPendingIf=_M;var Vy=class extends _s{constructor(e,n){super(e,Tr.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],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]],super.complete(e)}};et.PendingIf=Vy;function TM(t){return t.type===Tr.While}et.isPendingWhile=TM;var Xy=class extends _s{constructor(e){super(e,Tr.While)}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)}};et.PendingWhile=Xy});var eE=m(iu=>{"use strict";var Zx=iu&&iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0});var SM=Zx(Nm()),Ts=qi(),sn=qy(),kM=Zx($y()),wM=Zc(),Xt=xo(),ui=Ao(),hn=Ja(),Q=Uy(),xM=Hy(),Fr=Yy(),Jy=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new xM.Stack,r.statementErrors=[],r.lexer=n.lexer||new SM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new kM.default,r.astProvider=n.astProvider||new sn.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 hn.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,Q.getSelectorValue)(e)}" is required`,new hn.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,Q.getSelectorsFromGroup)(e).map(i=>`"${(0,Q.getSelectorValue)(i)}"`).join(", ")} is required`,new hn.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(Q.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Q.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==Ts.TokenType.EOL&&e.token.type!==Ts.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,Fr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new hn.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 Fr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Q.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Q.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.scopes=e.scopes,r.lines=e.lines,r}parseStatement(){let e=this;if(Ts.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Xt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.If:{e.next(),e.parseIfStatement();return}case Xt.Keyword.ElseIf:{e.next(),e.nextIfClause(sn.ASTType.ElseifClause);return}case Xt.Keyword.Else:{e.next(),e.nextIfClause(sn.ASTType.ElseClause);return}case Xt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Xt.Keyword.For:{e.next(),e.parseForStatement();return}case Xt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Xt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Xt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Xt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Xt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new hn.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(Ts.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value)switch(e.token.value){case Xt.Keyword.Return:return e.next(),e.parseReturnStatement();case Xt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Xt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new hn.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(Q.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(Q.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;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],o.init.type===sn.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=l=>{o.end=l.block.end,o.range[1]=l.block.range[1]}}return e.currentAssignment=a,n.assignments.push(o),o}else if(Q.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 l=e.token,c=o.value.charAt(0),h=e.parseExpr(a),f=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:c,left:i.clone(),right:f,start:l.start,end:e.previousToken.end,range:[l.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.assignments.push(a),a}let s=[];for(;!Q.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),Q.SelectorGroups.BlockEndOfLine(e.token)||Q.Selectors.Else(e.token))break;if(Q.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(Q.SelectorGroups.AssignmentCommandArgs,r.start);if(Q.Selectors.EndOfLine(a)||Q.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});if(Q.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1];else{if(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],i.type===sn.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>{s.end=a.block.end,s.range[1]=a.block.range[1]}}s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(Q.Selectors.Then,n.start),!Q.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 Fr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,Fr.isPendingIf)(r)){n.raise("no matching open if block",new hn.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case sn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(Q.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 sn.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.addItemToLines(r.block),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})),Q.Selectors.Else(r.token)){r.next();let u=r.token,l=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[l],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.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 hn.Range(n.start,e.token.end));return}if(!Q.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 Fr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingWhile)(n)){e.raise("no matching open while block",new hn.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}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.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(sn.ASTIdentifierKind.ForInVariable),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({kind:sn.ASTIdentifierKind.ForInIdxVariable,name:`__${i.name}_idx`,start:i.start,end:i.end,range:i.range,scope:n}),init:e.astProvider.literal(Ts.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n});n.assignments.push(s,o),e.requireToken(Q.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new hn.Range(r.start,e.token.end));return}if(!Q.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),l=new Fr.PendingFor(u);e.backpatches.push(l)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFor)(n)){e.raise("no matching open for block",new hn.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.backpatches.peek(),o=i.parseShortcutStatement(),a=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});i.addItemToLines(a),s.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!Q.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),!Q.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(Q.Selectors.LParenthesis,s.start);!Q.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let l=i.parseIdentifier(sn.ASTIdentifierKind.Argument),c=l;if(i.consume(Q.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof sn.ASTLiteral){let f=i.astProvider.assignmentStatement({variable:l,init:h,start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(f),a.push(f)}else i.raise("parameter default value must be a literal value",new hn.Range(c.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:l,init:i.astProvider.unknown({start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(h),a.push(l)}if(Q.Selectors.RParenthesis(i.token))break;if(i.requireToken(Q.Selectors.ArgumentSeperator,s.start),Q.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new hn.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(Q.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new Fr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=l=>{e!==null?(e.end=l.block.end,e.range[1]=l.block.range[1],i.addItemToLines(e)):i.addItemToLines(l.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFunction)(n)){e.raise("no matching open function block",new hn.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(;Q.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:ui.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(;Q.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:ui.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(Q.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:ui.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(Q.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:ui.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(!Q.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let l=r.parseAddSub();a.push(u.value),o.push(l)}while(Q.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(;Q.Selectors.Plus(r.token)||Q.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(;Q.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(!Q.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof sn.ASTNumericLiteral||s instanceof sn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:ui.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(!Q.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:ui.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(!Q.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:ui.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(Q.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:ui.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(;!Q.Selectors.EndOfFile(r.token);)if(Q.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(sn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:ui.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(Q.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),Q.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=Q.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(Q.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=Q.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,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(Q.Selectors.SRBracket,i.start)}else if(Q.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(Q.Selectors.LParenthesis(e.token))if(e.next(),Q.Selectors.RParenthesis(e.token))e.next();else for(;!Q.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),Q.Selectors.RParenthesis(e.requireTokenOfAny(Q.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!Q.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(),Q.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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(Q.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.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(),Q.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.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(Q.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(Ts.TokenType.Identifier)?r.parseIdentifier(sn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new hn.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(Ts.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!==sn.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 wM.ParserException(e,n);return r.statementErrors.push(i),i}};iu.default=Jy});var Ee=m(je=>{"use strict";var EM=je&&je.__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]}),Sr=je&&je.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&EM(e,t,n)},xh=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.ASTRange=je.ASTPosition=je.ParserValidatorm=je.Parser=je.LexerValidator=je.Lexer=void 0;var AM=Nm();Object.defineProperty(je,"Lexer",{enumerable:!0,get:function(){return xh(AM).default}});Sr(qi(),je);var OM=Em();Object.defineProperty(je,"LexerValidator",{enumerable:!0,get:function(){return xh(OM).default}});var CM=eE();Object.defineProperty(je,"Parser",{enumerable:!0,get:function(){return xh(CM).default}});Sr(qy(),je);var RM=$y();Object.defineProperty(je,"ParserValidatorm",{enumerable:!0,get:function(){return xh(RM).default}});Sr(Yy(),je);Sr(Hy(),je);Sr(Im(),je);Sr(Qc(),je);Sr(Zc(),je);Sr(xo(),je);Sr(Cm(),je);Sr(Ao(),je);var PM=Ga();Object.defineProperty(je,"ASTPosition",{enumerable:!0,get:function(){return PM.Position}});var DM=Ja();Object.defineProperty(je,"ASTRange",{enumerable:!0,get:function(){return DM.Range}});Sr(Uy(),je)});var su=m(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.isValidIdentifierLiteral=void 0;var IM=Ee(),MM=t=>{if(t.type!==IM.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Eh.isValidIdentifierLiteral=MM});var Qy=m(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.getStringHashCode=Bi.getHashCode=Bi.rotateBits=void 0;function LM(t){return t>>1|t<<31}Bi.rotateBits=LM;function NM(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}Bi.getHashCode=NM;Bi.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 tE=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.createExpressionHash=void 0;var Je=Ee(),kt=Qy(),qM=su(),Yt=(t,e)=>t.$$hash=e,jM=t=>t.$$hash??null;function ut(t){let e=jM(t);if(e!==null)return e;let n=(0,kt.getStringHashCode)(t.type);switch(t.type){case Je.ASTType.BinaryExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Je.ASTType.LogicalExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Je.ASTType.IsaExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Je.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=ut(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,kt.getStringHashCode)(r.operators[i]);return Yt(t,n)}case Je.ASTType.FunctionDeclaration:{let r=t;n^=(0,kt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===Je.ASTType.Identifier){n^=(0,kt.getStringHashCode)(s.name);continue}let o=s;n^=(0,kt.getStringHashCode)(o.variable.name),n^=ut(o.init)}return Yt(t,n)}case Je.ASTType.ParenthesisExpression:return ut(t.expression);case Je.ASTType.MemberExpression:{let r=t;if(r.base.type===Je.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,kt.getStringHashCode)(Je.ASTType.Identifier),n^=(0,kt.getStringHashCode)(r.identifier.name),Yt(t,n)}return n^=ut(r.base),n^=ut(r.identifier),Yt(t,n)}case Je.ASTType.IndexExpression:{let r=t;if((0,qM.isValidIdentifierLiteral)(r.index)){if(r.base.type===Je.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,kt.getStringHashCode)(Je.ASTType.Identifier),n^=(0,kt.getStringHashCode)(r.index.value.toString()),Yt(t,n)}n=(0,kt.getStringHashCode)(Je.ASTType.MemberExpression),n^=ut(r.base);let i=(0,kt.getStringHashCode)(Je.ASTType.Identifier);i^=(0,kt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=ut(r.base),n^=ut(r.index);return Yt(t,n)}case Je.ASTType.CallExpression:{let r=t;n^=ut(r.base),n^=(0,kt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=ut(s)}return Yt(t,n)}case Je.ASTType.NegationExpression:case Je.ASTType.BinaryNegatedExpression:case Je.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,kt.getStringHashCode)(r.operator):1,n^=ut(r.argument),Yt(t,n)}case Je.ASTType.Identifier:{let r=t;return n^=(0,kt.getStringHashCode)(r.name),Yt(t,n)}case Je.ASTType.NumericLiteral:case Je.ASTType.StringLiteral:case Je.ASTType.NilLiteral:return n^=(0,kt.getStringHashCode)(t.value.toString()),Yt(t,n);case Je.ASTType.MapConstructorExpression:{let r=t;n^=(0,kt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ut(s.key),n^=ut(s.value)}return Yt(t,n)}case Je.ASTType.ListConstructorExpression:{let r=t;n^=(0,kt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ut(s.value)}return Yt(t,n)}case Je.ASTType.SliceExpression:{let r=t;return n^=ut(r.base),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}}return Yt(t,n)}function FM(t){return ut(t)}Ah.createExpressionHash=FM});var Zy=m(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.createExpressionId=void 0;var Ct=Ee(),$M=su(),Dt=(t,e)=>t.$$id=e,BM=t=>t.$$id??null;function tt(t){let e=BM(t);if(e!==null)return e;switch(t.type){case Ct.ASTType.BinaryExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case Ct.ASTType.LogicalExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case Ct.ASTType.IsaExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case Ct.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>tt(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Dt(t,i.join(" "))}case Ct.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===Ct.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+tt(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Dt(t,r)}case Ct.ASTType.ParenthesisExpression:return Dt(t,tt(t.expression));case Ct.ASTType.MemberExpression:{let n=t;return Dt(t,tt(n.base)+"."+n.identifier.name)}case Ct.ASTType.IndexExpression:{let n=t;return(0,$M.isValidIdentifierLiteral)(n.index)?Dt(t,tt(n.base)+"."+n.index.value.toString()):Dt(t,tt(n.base)+"["+tt(n.index)+"]")}case Ct.ASTType.CallExpression:{let n=t,r=tt(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(tt(o))}return i.length>0&&(r+="("+i.join(",")+")"),Dt(t,r)}case Ct.ASTType.NegationExpression:case Ct.ASTType.BinaryNegatedExpression:case Ct.ASTType.UnaryExpression:{let n=t;return n.operator==null?Dt(t,tt(n.argument)):n.operator==="@"?Dt(t,n.operator+tt(n.argument)):Dt(t,n.operator+" "+tt(n.argument))}case Ct.ASTType.Identifier:return Dt(t,t.name);case Ct.ASTType.NumericLiteral:case Ct.ASTType.StringLiteral:case Ct.ASTType.NilLiteral:return Dt(t,t.raw.toString());case Ct.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(tt(s.key)+":"+tt(s.value))}return Dt(t,"{"+r.join(",")+"}")}case Ct.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(tt(s.value))}return Dt(t,"["+r.join(",")+"]")}case Ct.ASTType.SliceExpression:{let n=t;return Dt(t,tt(n.base)+"["+tt(n.left)+":"+tt(n.right)+"]")}}return Dt(t,"")}function UM(t){return tt(t)}Oh.createExpressionId=UM});var Io=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.Markers=void 0;var WM;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(WM=ou.Markers||(ou.Markers={}))});var kr=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.rewireSpecs=yt.rewireSource=yt.seedTokens=yt.seedSpec=yt.seedBlock=yt.splitLines=yt.splitSpace=yt.splitCR=yt.hasCR=yt.isSpace=void 0;function HM(t){return/^\s+$/.test(t)}yt.isSpace=HM;function GM(t){return/\r$/.test(t)}yt.hasCR=GM;function KM(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}yt.splitCR=KM;function zM(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}yt.splitSpace=zM;function VM(t){return t.split(/\n/)}yt.splitLines=VM;function XM(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}yt.seedBlock=XM;function YM(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}yt.seedSpec=YM;function JM(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}yt.seedTokens=JM;function QM(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}yt.rewireSource=QM;function ZM(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}yt.rewireSpecs=ZM});var nE=m(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var eL=/^@\S+/;function tL({fence:t="```"}={}){let e=nL(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)eL.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}eb.default=tL;function nL(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var rE=m(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var rL=Io(),au=kr();function iL({startLine:t=0,markers:e=rL.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,au.seedTokens)();if([a.lineEnd,o]=(0,au.splitCR)(o),[a.start,o]=(0,au.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,au.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,au.splitSpace)(o)),u){let l=o.trimRight();a.end=o.slice(l.length-e.end.length),o=l.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let l=n.slice();return n=null,l}return null}}tb.default=iL});var iE=m(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var sL=kr();function oL({tokenizers:t}){return function(n){var r;let i=(0,sL.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}}nb.default=oL});var ib=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});function aL(){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)}}rb.default=aL});var ob=m(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var uL=kr();function lL(t="compact"){let e=hL(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let l="";if(a===0&&u.description[0]!=="{")return n;for(let c of u.description)if(c==="{"&&r++,c==="}"&&r--,l+=c,r===0)break;if(i.push([u,l]),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,l]]of i.entries())u.type=l,a>0&&(u.type=u.postDelimiter.slice(o)+l,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,uL.splitSpace)(u.description.slice(l.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}}sb.default=lL;var cL=t=>t.trim();function hL(t){return t==="compact"?e=>e.map(cL).join(""):t==="preserve"?e=>e.join(`
|
97
|
-
`):t}});var lb=m(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var ab=
|
98
|
-
`)}});var
|
99
|
-
`)}db.default=CL});var
|
100
|
-
`)}gb.default=zL});var mb=m(It=>{"use strict";var VL=It&&It.__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]}),XL=It&&It.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&VL(e,t,n)};Object.defineProperty(It,"__esModule",{value:!0});It.util=It.tokenizers=It.transforms=It.inspect=It.stringify=It.parse=void 0;var YL=aE(),JL=hb(),QL=lb(),ZL=ib(),eN=ob(),tN=uE(),nN=cE(),rN=hE(),iN=fE(),sN=dE(),Rh=kr();XL(Io(),It);function oN(t,e={}){return(0,YL.default)(e)(t)}It.parse=oN;It.stringify=(0,tN.default)();var aN=yE();Object.defineProperty(It,"inspect",{enumerable:!0,get:function(){return aN.default}});It.transforms={flow:sN.flow,align:nN.default,indent:rN.default,crlf:iN.default};It.tokenizers={tag:ZL.default,type:eN.default,name:QL.default,description:JL.default};It.util={rewireSpecs:Rh.rewireSpecs,rewireSource:Rh.rewireSource,seedBlock:Rh.seedBlock,seedTokens:Rh.seedTokens}});var ks=m(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.SignatureDefinitionBaseType=void 0;var uN;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(uN=fu.SignatureDefinitionBaseType||(fu.SignatureDefinitionBaseType={}))});var du=m(Mo=>{"use strict";var bE=Mo&&Mo.__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};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SignatureDefinitionTypeMeta=void 0;var fn=ks(),lN=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=e.match(/^([a-zA-Z]+)(?:<([^>]+)>)?$/);if(!n)return null;var r=null,i=null,s=bE(n,3),o=s[0],a=s[1],u=s[2];if(a===fn.SignatureDefinitionBaseType.Map?(r=fn.SignatureDefinitionBaseType.Any,i=fn.SignatureDefinitionBaseType.Any):a===fn.SignatureDefinitionBaseType.List&&(r=fn.SignatureDefinitionBaseType.Any),u){var l=u.split(",").map(function(g){return g.trim()});if(l.length>2)return null;var c=bE(l,2),h=c[0],f=c[1];f!=null?(r=f,i=h):r=h}return new t({type:a,keyType:i,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var i=e,s=null,o=null;return i===fn.SignatureDefinitionBaseType.Map?(s=fn.SignatureDefinitionBaseType.Any,o=fn.SignatureDefinitionBaseType.Any):i===fn.SignatureDefinitionBaseType.List&&(s=fn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}else if(typeof e=="object"){var i=e.type,s=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return i===fn.SignatureDefinitionBaseType.Map?(s=s??fn.SignatureDefinitionBaseType.Any,o=o??fn.SignatureDefinitionBaseType.Any):i===fn.SignatureDefinitionBaseType.List&&(s=s??fn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}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===e.keyType&&this.valueType===e.valueType},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType,">"):"".concat(this.type,"<").concat(this.keyType,",").concat(this.valueType,">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType}:{type:this.type,keyType:this.keyType,valueType:this.valueType}},t.prototype.copy=function(){return new t({type:this.type,keyType:this.keyType,valueType:this.valueType})},t}();Mo.SignatureDefinitionTypeMeta=lN});var yb=m(Ui=>{"use strict";var vE=Ui&&Ui.__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},_E=Ui&&Ui.__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(Ui,"__esModule",{value:!0});Ui.SignatureDefinitionFunctionArg=void 0;var TE=du(),cN=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(TE.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,_E([],vE(e.types.map(TE.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 _E([],vE(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}();Ui.SignatureDefinitionFunctionArg=cN});var Ph=m($r=>{"use strict";var ws=$r&&$r.__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},xs=$r&&$r.__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))},hN=$r&&$r.__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($r,"__esModule",{value:!0});$r.VariationRegistry=void 0;var fN=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(xs(xs([],ws(e),!1),ws(this._variations),!1)),this},t.prototype.getAll=function(){return xs([],ws(this._variations),!1)},t}(),dN=function(){function t(){}return t.add=function(e,n){var r=new fN(e);return r.push.apply(r,xs([],ws(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){var n,r,i=new Set;try{for(var s=hN(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),l=this.get(u);if(l!==null)i=new Set(xs(xs([],ws(l.getAll()),!1),ws(i),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}i.add(a)}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return xs([],ws(i),!1)},t.variationContainers=new Map,t}();$r.VariationRegistry=dN});var Dh=m(Wi=>{"use strict";var pN=Wi&&Wi.__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},gN=Wi&&Wi.__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(Wi,"__esModule",{value:!0});Wi.SignatureDefinition=void 0;var mN=Ph(),yN=du(),bN=function(){function t(e){this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations}return t.parse=function(e){var n,r,i;return new t({type:yN.SignatureDefinitionTypeMeta.parse(e.type),isProtected:!!e.isProtected,description:(n=e.description)!==null&&n!==void 0?n:null,example:(r=e.example)!==null&&r!==void 0?r:null,variations:(i=e.variations)!==null&&i!==void 0?i:null})},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.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 mN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?gN([],pN(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({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})},t.prototype.copy=function(){return new t({type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations})},t}();Wi.SignatureDefinition=bN});var bb=m(Jn=>{"use strict";var vN=Jn&&Jn.__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)}}(),Ih=Jn&&Jn.__assign||function(){return Ih=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},Ih.apply(this,arguments)},_N=Jn&&Jn.__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},TN=Jn&&Jn.__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(Jn,"__esModule",{value:!0});Jn.SignatureDefinitionFunction=void 0;var SN=ks(),kN=Ph(),wN=Dh(),xN=yb(),SE=du(),EN=function(t){vN(e,t);function e(n){var r=t.call(this,{type:n.type,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations})||this;return r._argList=n.arguments.map(function(i){return i.getLabel()}),r._argRefs=n.arguments.reduce(function(i,s){return i.set(s.getLabel(),s)},new Map),r._returns=n.returns.reduce(function(i,s){return i.set(s.type,s)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,i,s,o,a,u;return new e({type:new SE.SignatureDefinitionTypeMeta({type:SN.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(i=n.description)!==null&&i!==void 0?i:null,example:(s=n.example)!==null&&s!==void 0?s:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(xN.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(SE.SignatureDefinitionTypeMeta.parse),variations:n.variations,returnVariations:(u=n.returnVariations)!==null&&u!==void 0?u:null})},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 TN([],_N(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=[]),kN.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Ih(Ih({},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({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})},e.prototype.copy=function(){return new e({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})},e}(wN.SignatureDefinition);Jn.SignatureDefinitionFunction=EN});var wE=m(($3,kE)=>{"use strict";kE.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var vb=m((xE,EE)=>{"use strict";var AN=wE();EE.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:AN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xE.assert)}}});var Ne=m((U3,AE)=>{"use strict";var ON=vb();AE.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new ON(e)}});var Es=m((W3,CE)=>{"use strict";var _b=Ne(),OE={};CE.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);_b(!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&&OE.iterables(s);if(Array.isArray(s)||u==="set"){let l=Number(a);Number.isInteger(l)&&(a=l<0?s.length+l:l)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){_b(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),_b(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};OE.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Tb=m((dn,PE)=>{"use strict";var RE={};dn=PE.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};RE.typeMap=new Map([["[object Error]",dn.error],["[object Map]",dn.map],["[object Promise]",dn.promise],["[object Set]",dn.set],["[object WeakMap]",dn.weakMap],["[object WeakSet]",dn.weakSet]]);dn.getInternalProto=function(t){if(Array.isArray(t))return dn.array;if(Buffer&&t instanceof Buffer)return dn.buffer;if(t instanceof Date)return dn.date;if(t instanceof RegExp)return dn.regex;if(t instanceof Error)return dn.error;let e=Object.prototype.toString.call(t);return RE.typeMap.get(e)||dn.generic}});var Sb=m(DE=>{"use strict";DE.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var pn=m((G3,IE)=>{"use strict";var CN=Es(),qn=Tb(),RN=Sb(),li={needsProtoHack:new Set([qn.set,qn.map,qn.weakSet,qn.weakMap])};IE.exports=li.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=li.clone,i=n;if(e.shallow){if(e.shallow!==!0)return li.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=qn.getInternalProto(t);if(s===qn.buffer)return Buffer&&Buffer.from(t);if(s===qn.date)return new Date(t.getTime());if(s===qn.regex)return new RegExp(t);let o=li.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===qn.set)for(let u of t)o.add(r(u,e,i));else if(s===qn.map)for(let[u,l]of t)o.set(u,r(l,e,i));let a=RN.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===qn.array&&u==="length"){o.length=t.length;continue}let l=Object.getOwnPropertyDescriptor(t,u);l?l.get||l.set?Object.defineProperty(o,u,l):l.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};li.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=CN(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return li.clone(t,e,r)};li.base=function(t,e,n){if(n.prototype===!1)return li.needsProtoHack.has(e)?new e.constructor:e===qn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===qn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(li.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var ME=m((K3,PN)=>{PN.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 Mh=m(pu=>{"use strict";var P=Lh(),be={};be.wrap=P.string().min(1).max(2).allow(!1);pu.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:be.wrap,array:be.wrap,string:be.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();be.nameRx=/^[a-zA-Z0-9]\w*$/;be.rule=P.object({alias:P.array().items(P.string().pattern(be.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(be.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});pu.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(be.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(be.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(be.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(be.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(be.nameRx,be.rule),terms:P.object().pattern(be.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();pu.extensions=P.array().items(P.object(),P.function().arity(1)).strict();be.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};be.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),be.desc.buffer,be.desc.func,be.desc.ref,be.desc.regex,be.desc.special,be.desc.template,be.desc.value,P.link("/")]);be.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),be.desc.buffer,be.desc.func,be.desc.override,be.desc.ref,be.desc.regex,be.desc.template,be.desc.value);be.desc.messages=P.object().pattern(/.+/,[P.string(),be.desc.template,P.object().pattern(/.+/,[P.string(),be.desc.template])]);pu.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:be.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),be.desc.ref],wrap:{label:be.wrap,array:be.wrap}},externals:P.boolean(),messages:be.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:be.desc.values,invalid:be.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),be.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:be.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var NE=m((V3,LE)=>{"use strict";var Hi={};LE.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Hi.isSafe(r)?e+=t[n]:e+=Hi.escapeHtmlChar(r)}return e};Hi.escapeHtmlChar=function(t){let e=Hi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Hi.isSafe=function(t){return Hi.safeCharCodes.has(t)};Hi.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);Hi.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 qE=m(gu=>{"use strict";var De={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};gu.Parser=class{constructor(t,e={}){if(!e[De.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[De.settings]?e:Object.assign({[De.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 l=new gu.Parser(n,this.settings);e.push({type:"segment",value:l})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(De.operatorCharacters.includes(n))u&&u.type==="operator"&&De.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(De.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(De.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 De.literals?i=De.literals[a]:a==="("?(s(),++r):De.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(De.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!De.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 De.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):De.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 l=t[u];o?(i+=l,l===o&&(o=!1)):l in De.literals&&!s?(i+=l,o=De.literals[l]):l===","&&!s?a():(i+=l,l==="("?++s:l===")"&&--s)}a()}return r=r.map(i=>new gu.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=De.evaluate(i,t);e[n]=De.single(r.value,s)}}return De.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=De.evaluate(e[r-1],t),o=De.evaluate(e[r+1],t);e.splice(r,2);let a=De.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),De.evaluate(e[0],t)}};gu.Parser.prototype[De.symbol]=!0;De.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};De.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[De.symbol]?t.evaluate(e):t};De.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};De.calculate=function(t,e,n){if(t==="??")return De.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=De.exists(e)?e:"",n=De.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};De.exists=function(t){return t!=null}});var FE=m(jE=>{"use strict";var DN=pn(),IN=nt(),As={annotations:Symbol("annotations")};jE.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=DN(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,l=this.details[a],c=l.path,h=i;for(let f=0;;++f){let g=c[f];if(IN.isSchema(h)&&(h=h.clone()),f+1<c.length&&typeof h[g]!="string")h=h[g];else{let v=h[As.annotations]||{errors:{},missing:{}};h[As.annotations]=v;let b=g||l.context.key;h[g]!==void 0?(v.errors[b]=v.errors[b]||[],v.errors[b].push(u)):v.missing[b]=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=As.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,l)=>`${n}"${u}"${r}${e} [${l}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,l)=>`
|
96
|
+
return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}he.createSelectorGroup=qr;function mM(t){return t.selectors}he.getSelectorsFromGroup=mM;var jr;(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"})(jr=he.SelectorGroupType||(he.SelectorGroupType={}));he.SelectorGroups={BlockEndOfLine:qr(jr.AssignmentEndOfExpr,[he.Selectors.EndOfLine,he.Selectors.Comment]),AssignmentEndOfExpr:qr(jr.AssignmentEndOfExpr,[he.Selectors.EndOfFile,he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),AssignmentShorthand:qr(jr.AssignmentShorthand,[he.Selectors.AddShorthand,he.Selectors.SubtractShorthand,he.Selectors.MultiplyShorthand,he.Selectors.DivideShorthand,he.Selectors.PowerShorthand,he.Selectors.ModuloShorthand]),AssignmentCommandArgs:qr(jr.AssignmentCommandArgs,[he.Selectors.ArgumentSeperator,he.Selectors.EndOfLine,he.Selectors.EndOfFile]),ReturnStatementEnd:qr(jr.ReturnStatementEnd,[he.Selectors.EndOfLine,he.Selectors.Else,he.Selectors.Comment]),FunctionDeclarationArgEnd:qr(jr.FunctionDeclarationArgEnd,[he.Selectors.RParenthesis,he.Selectors.EndOfFile,he.Selectors.EndOfLine]),ComparisonOperators:qr(jr.ComparisonOperators,[he.Selectors.Equal,he.Selectors.NotEqual,he.Selectors.Greater,he.Selectors.GreaterEqual,he.Selectors.Lesser,he.Selectors.LessEqual]),MultiDivOperators:qr(jr.MultiDivOperators,[he.Selectors.Times,he.Selectors.Divide,he.Selectors.Mod]),CallArgsEnd:qr(jr.CallArgsEnd,[he.Selectors.ArgumentSeperator,he.Selectors.RParenthesis])}});var Hy=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.Stack=void 0;var Wy=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}};wh.Stack=Wy});var Yy=m(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.PendingWhile=et.isPendingWhile=et.PendingIf=et.isPendingIf=et.PendingFunction=et.isPendingFunction=et.PendingFor=et.isPendingFor=et.PendingChunk=et.isPendingChunk=et.PendingBlockType=void 0;var Sr;(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"})(Sr=et.PendingBlockType||(et.PendingBlockType={}));var _s=class{constructor(e,n){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 yM(t){return t.type===Sr.Chunk}et.isPendingChunk=yM;var Gy=class extends _s{constructor(e){super(e,Sr.Chunk)}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)}};et.PendingChunk=Gy;function bM(t){return t.type===Sr.For}et.isPendingFor=bM;var zy=class extends _s{constructor(e){super(e,Sr.For)}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)}};et.PendingFor=zy;function vM(t){return t.type===Sr.Function}et.isPendingFunction=vM;var Ky=class extends _s{constructor(e){super(e,Sr.Function)}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)}};et.PendingFunction=Ky;function _M(t){return t.type===Sr.If}et.isPendingIf=_M;var Vy=class extends _s{constructor(e,n){super(e,Sr.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],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]],super.complete(e)}};et.PendingIf=Vy;function TM(t){return t.type===Sr.While}et.isPendingWhile=TM;var Xy=class extends _s{constructor(e){super(e,Sr.While)}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)}};et.PendingWhile=Xy});var Zx=m(iu=>{"use strict";var Qx=iu&&iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0});var SM=Qx(Nm()),Ts=qi(),sn=qy(),kM=Qx($y()),wM=Zc(),Xt=xo(),ui=Ao(),hn=Ja(),Q=Uy(),xM=Hy(),Fr=Yy(),Jy=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new xM.Stack,r.statementErrors=[],r.lexer=n.lexer||new SM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new kM.default,r.astProvider=n.astProvider||new sn.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 hn.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,Q.getSelectorValue)(e)}" is required`,new hn.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,Q.getSelectorsFromGroup)(e).map(i=>`"${(0,Q.getSelectorValue)(i)}"`).join(", ")} is required`,new hn.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(Q.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Q.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==Ts.TokenType.EOL&&e.token.type!==Ts.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,Fr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new hn.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 Fr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Q.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Q.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.scopes=e.scopes,r.lines=e.lines,r}parseStatement(){let e=this;if(Ts.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Xt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.If:{e.next(),e.parseIfStatement();return}case Xt.Keyword.ElseIf:{e.next(),e.nextIfClause(sn.ASTType.ElseifClause);return}case Xt.Keyword.Else:{e.next(),e.nextIfClause(sn.ASTType.ElseClause);return}case Xt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Xt.Keyword.For:{e.next(),e.parseForStatement();return}case Xt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Xt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Xt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Xt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Xt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new hn.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(Ts.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value)switch(e.token.value){case Xt.Keyword.Return:return e.next(),e.parseReturnStatement();case Xt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Xt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new hn.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(Q.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(Q.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;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],o.init.type===sn.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=l=>{o.end=l.block.end,o.range[1]=l.block.range[1]}}return e.currentAssignment=a,n.assignments.push(o),o}else if(Q.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 l=e.token,c=o.value.charAt(0),h=e.parseExpr(a),f=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:c,left:i.clone(),right:f,start:l.start,end:e.previousToken.end,range:[l.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.assignments.push(a),a}let s=[];for(;!Q.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),Q.SelectorGroups.BlockEndOfLine(e.token)||Q.Selectors.Else(e.token))break;if(Q.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(Q.SelectorGroups.AssignmentCommandArgs,r.start);if(Q.Selectors.EndOfLine(a)||Q.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});if(Q.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1];else{if(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],i.type===sn.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>{s.end=a.block.end,s.range[1]=a.block.range[1]}}s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(Q.Selectors.Then,n.start),!Q.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 Fr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,Fr.isPendingIf)(r)){n.raise("no matching open if block",new hn.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case sn.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(Q.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 sn.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.addItemToLines(r.block),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})),Q.Selectors.Else(r.token)){r.next();let u=r.token,l=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[l],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.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 hn.Range(n.start,e.token.end));return}if(!Q.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 Fr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingWhile)(n)){e.raise("no matching open while block",new hn.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}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.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(sn.ASTIdentifierKind.ForInVariable),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({kind:sn.ASTIdentifierKind.ForInIdxVariable,name:`__${i.name}_idx`,start:i.start,end:i.end,range:i.range,scope:n}),init:e.astProvider.literal(Ts.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n});n.assignments.push(s,o),e.requireToken(Q.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new hn.Range(r.start,e.token.end));return}if(!Q.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),l=new Fr.PendingFor(u);e.backpatches.push(l)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFor)(n)){e.raise("no matching open for block",new hn.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.backpatches.peek(),o=i.parseShortcutStatement(),a=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});i.addItemToLines(a),s.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!Q.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),!Q.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(Q.Selectors.LParenthesis,s.start);!Q.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let l=i.parseIdentifier(sn.ASTIdentifierKind.Argument),c=l;if(i.consume(Q.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof sn.ASTLiteral){let f=i.astProvider.assignmentStatement({variable:l,init:h,start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(f),a.push(f)}else i.raise("parameter default value must be a literal value",new hn.Range(c.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:l,init:i.astProvider.unknown({start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:c.start,end:i.previousToken.end,range:[c.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(h),a.push(l)}if(Q.Selectors.RParenthesis(i.token))break;if(i.requireToken(Q.Selectors.ArgumentSeperator,s.start),Q.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new hn.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(Q.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new Fr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=l=>{e!==null?(e.end=l.block.end,e.range[1]=l.block.range[1],i.addItemToLines(e)):i.addItemToLines(l.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFunction)(n)){e.raise("no matching open function block",new hn.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(;Q.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:ui.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(;Q.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:ui.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(Q.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:ui.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(Q.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:ui.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(!Q.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let l=r.parseAddSub();a.push(u.value),o.push(l)}while(Q.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(;Q.Selectors.Plus(r.token)||Q.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(;Q.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(!Q.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof sn.ASTNumericLiteral||s instanceof sn.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:ui.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(!Q.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:ui.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(!Q.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:ui.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(Q.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:ui.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(;!Q.Selectors.EndOfFile(r.token);)if(Q.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(sn.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:ui.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(Q.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),Q.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=Q.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(Q.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=Q.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,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(Q.Selectors.SRBracket,i.start)}else if(Q.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(Q.Selectors.LParenthesis(e.token))if(e.next(),Q.Selectors.RParenthesis(e.token))e.next();else for(;!Q.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),Q.Selectors.RParenthesis(e.requireTokenOfAny(Q.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!Q.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(),Q.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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(Q.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.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(),Q.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!Q.Selectors.EndOfFile(r.token);){if(Q.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),Q.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),Q.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(!Q.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(Q.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(Ts.TokenType.Identifier)?r.parseIdentifier(sn.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new hn.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(Ts.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!==sn.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 wM.ParserException(e,n);return r.statementErrors.push(i),i}};iu.default=Jy});var Ee=m(je=>{"use strict";var EM=je&&je.__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]}),kr=je&&je.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&EM(e,t,n)},xh=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.ASTRange=je.ASTPosition=je.ParserValidatorm=je.Parser=je.LexerValidator=je.Lexer=void 0;var AM=Nm();Object.defineProperty(je,"Lexer",{enumerable:!0,get:function(){return xh(AM).default}});kr(qi(),je);var OM=Em();Object.defineProperty(je,"LexerValidator",{enumerable:!0,get:function(){return xh(OM).default}});var CM=Zx();Object.defineProperty(je,"Parser",{enumerable:!0,get:function(){return xh(CM).default}});kr(qy(),je);var RM=$y();Object.defineProperty(je,"ParserValidatorm",{enumerable:!0,get:function(){return xh(RM).default}});kr(Yy(),je);kr(Hy(),je);kr(Im(),je);kr(Qc(),je);kr(Zc(),je);kr(xo(),je);kr(Cm(),je);kr(Ao(),je);var PM=Ga();Object.defineProperty(je,"ASTPosition",{enumerable:!0,get:function(){return PM.Position}});var DM=Ja();Object.defineProperty(je,"ASTRange",{enumerable:!0,get:function(){return DM.Range}});kr(Uy(),je)});var su=m(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.isValidIdentifierLiteral=void 0;var IM=Ee(),MM=t=>{if(t.type!==IM.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Eh.isValidIdentifierLiteral=MM});var Qy=m(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.getStringHashCode=Bi.getHashCode=Bi.rotateBits=void 0;function LM(t){return t>>1|t<<31}Bi.rotateBits=LM;function NM(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}Bi.getHashCode=NM;Bi.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 eE=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.createExpressionHash=void 0;var Xe=Ee(),kt=Qy(),qM=su(),Yt=(t,e)=>t.$$hash=e,jM=t=>t.$$hash??null;function ut(t){let e=jM(t);if(e!==null)return e;let n=(0,kt.getStringHashCode)(t.type);switch(t.type){case Xe.ASTType.BinaryExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Xe.ASTType.LogicalExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Xe.ASTType.IsaExpression:{let r=t;return n^=(0,kt.getStringHashCode)(r.operator),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}case Xe.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=ut(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,kt.getStringHashCode)(r.operators[i]);return Yt(t,n)}case Xe.ASTType.FunctionDeclaration:{let r=t;n^=(0,kt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===Xe.ASTType.Identifier){n^=(0,kt.getStringHashCode)(s.name);continue}let o=s;n^=(0,kt.getStringHashCode)(o.variable.name),n^=ut(o.init)}return Yt(t,n)}case Xe.ASTType.ParenthesisExpression:return ut(t.expression);case Xe.ASTType.MemberExpression:{let r=t;if(r.base.type===Xe.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,kt.getStringHashCode)(Xe.ASTType.Identifier),n^=(0,kt.getStringHashCode)(r.identifier.name),Yt(t,n)}return n^=ut(r.base),n^=ut(r.identifier),Yt(t,n)}case Xe.ASTType.IndexExpression:{let r=t;if((0,qM.isValidIdentifierLiteral)(r.index)){if(r.base.type===Xe.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,kt.getStringHashCode)(Xe.ASTType.Identifier),n^=(0,kt.getStringHashCode)(r.index.value.toString()),Yt(t,n)}n=(0,kt.getStringHashCode)(Xe.ASTType.MemberExpression),n^=ut(r.base);let i=(0,kt.getStringHashCode)(Xe.ASTType.Identifier);i^=(0,kt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=ut(r.base),n^=ut(r.index);return Yt(t,n)}case Xe.ASTType.CallExpression:{let r=t;n^=ut(r.base),n^=(0,kt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=ut(s)}return Yt(t,n)}case Xe.ASTType.NegationExpression:case Xe.ASTType.BinaryNegatedExpression:case Xe.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,kt.getStringHashCode)(r.operator):1,n^=ut(r.argument),Yt(t,n)}case Xe.ASTType.Identifier:{let r=t;return n^=(0,kt.getStringHashCode)(r.name),Yt(t,n)}case Xe.ASTType.BooleanLiteral:case Xe.ASTType.NumericLiteral:case Xe.ASTType.StringLiteral:case Xe.ASTType.NilLiteral:return n^=(0,kt.getStringHashCode)(t.value.toString()),Yt(t,n);case Xe.ASTType.MapConstructorExpression:{let r=t;n^=(0,kt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ut(s.key),n^=ut(s.value)}return Yt(t,n)}case Xe.ASTType.ListConstructorExpression:{let r=t;n^=(0,kt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=ut(s.value)}return Yt(t,n)}case Xe.ASTType.SliceExpression:{let r=t;return n^=ut(r.base),n^=ut(r.left),n^=ut(r.right),Yt(t,n)}}return Yt(t,n)}function FM(t){return ut(t)}Ah.createExpressionHash=FM});var Zy=m(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.createExpressionId=void 0;var wt=Ee(),$M=su(),Dt=(t,e)=>t.$$id=e,BM=t=>t.$$id??null;function tt(t){let e=BM(t);if(e!==null)return e;switch(t.type){case wt.ASTType.BinaryExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case wt.ASTType.LogicalExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case wt.ASTType.IsaExpression:{let n=t;return Dt(t,tt(n.left)+n.operator+tt(n.right))}case wt.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>tt(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Dt(t,i.join(" "))}case wt.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===wt.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+tt(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Dt(t,r)}case wt.ASTType.ParenthesisExpression:return Dt(t,tt(t.expression));case wt.ASTType.MemberExpression:{let n=t;return Dt(t,tt(n.base)+"."+n.identifier.name)}case wt.ASTType.IndexExpression:{let n=t;return(0,$M.isValidIdentifierLiteral)(n.index)?Dt(t,tt(n.base)+"."+n.index.value.toString()):Dt(t,tt(n.base)+"["+tt(n.index)+"]")}case wt.ASTType.CallExpression:{let n=t,r=tt(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(tt(o))}return i.length>0&&(r+="("+i.join(",")+")"),Dt(t,r)}case wt.ASTType.NegationExpression:case wt.ASTType.BinaryNegatedExpression:case wt.ASTType.UnaryExpression:{let n=t;return n.operator==null?Dt(t,tt(n.argument)):n.operator==="@"?Dt(t,n.operator+tt(n.argument)):Dt(t,n.operator+" "+tt(n.argument))}case wt.ASTType.Identifier:return Dt(t,t.name);case wt.ASTType.NumericLiteral:case wt.ASTType.BooleanLiteral:case wt.ASTType.StringLiteral:case wt.ASTType.NilLiteral:return Dt(t,t.raw.toString());case wt.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(tt(s.key)+":"+tt(s.value))}return Dt(t,"{"+r.join(",")+"}")}case wt.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(tt(s.value))}return Dt(t,"["+r.join(",")+"]")}case wt.ASTType.SliceExpression:{let n=t;return Dt(t,tt(n.base)+"["+tt(n.left)+":"+tt(n.right)+"]")}}return Dt(t,"")}function UM(t){return tt(t)}Oh.createExpressionId=UM});var Io=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.Markers=void 0;var WM;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(WM=ou.Markers||(ou.Markers={}))});var wr=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.rewireSpecs=yt.rewireSource=yt.seedTokens=yt.seedSpec=yt.seedBlock=yt.splitLines=yt.splitSpace=yt.splitCR=yt.hasCR=yt.isSpace=void 0;function HM(t){return/^\s+$/.test(t)}yt.isSpace=HM;function GM(t){return/\r$/.test(t)}yt.hasCR=GM;function zM(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}yt.splitCR=zM;function KM(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}yt.splitSpace=KM;function VM(t){return t.split(/\n/)}yt.splitLines=VM;function XM(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}yt.seedBlock=XM;function YM(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}yt.seedSpec=YM;function JM(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}yt.seedTokens=JM;function QM(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}yt.rewireSource=QM;function ZM(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}yt.rewireSpecs=ZM});var tE=m(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var eL=/^@\S+/;function tL({fence:t="```"}={}){let e=nL(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)eL.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}eb.default=tL;function nL(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var nE=m(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var rL=Io(),au=wr();function iL({startLine:t=0,markers:e=rL.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,au.seedTokens)();if([a.lineEnd,o]=(0,au.splitCR)(o),[a.start,o]=(0,au.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,au.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,au.splitSpace)(o)),u){let l=o.trimRight();a.end=o.slice(l.length-e.end.length),o=l.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let l=n.slice();return n=null,l}return null}}tb.default=iL});var rE=m(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var sL=wr();function oL({tokenizers:t}){return function(n){var r;let i=(0,sL.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}}nb.default=oL});var ib=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});function aL(){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)}}rb.default=aL});var ob=m(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var uL=wr();function lL(t="compact"){let e=hL(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let l="";if(a===0&&u.description[0]!=="{")return n;for(let c of u.description)if(c==="{"&&r++,c==="}"&&r--,l+=c,r===0)break;if(i.push([u,l]),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,l]]of i.entries())u.type=l,a>0&&(u.type=u.postDelimiter.slice(o)+l,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,uL.splitSpace)(u.description.slice(l.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}}sb.default=lL;var cL=t=>t.trim();function hL(t){return t==="compact"?e=>e.map(cL).join(""):t==="preserve"?e=>e.join(`
|
97
|
+
`):t}});var lb=m(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var ab=wr(),fL=t=>t&&t.startsWith('"')&&t.endsWith('"');function dL(){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,ab.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let c of r){if(s===0&&(0,ab.isSpace)(c))break;c==="["&&s++,c==="]"&&s--,o+=c}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let l=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let c=o.split("=");if(o=c[0].trim(),c[1]!==void 0&&(u=c.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(!fL(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=l,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,ab.splitSpace)(r.slice(n.name.length)),e}}ub.default=dL});var hb=m(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.getJoiner=void 0;var cb=Io();function pL(t="compact",e=cb.Markers){let n=iE(t);return r=>(r.description=n(r.source,e),r)}uu.default=pL;function iE(t){return t==="compact"?gL:t==="preserve"?bL:t}uu.getJoiner=iE;function gL(t,e=cb.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var mL=(t,{tokens:e},n)=>e.type===""?t:n,yL=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function bL(t,e=cb.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(mL,0)),t.map(yL).join(`
|
98
|
+
`)}});var oE=m(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var vL=Io(),_L=wr(),TL=tE(),SL=nE(),kL=rE(),wL=ib(),xL=ob(),EL=lb(),sE=hb();function AL({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=vL.Markers,tokenizers:i=[(0,wL.default)(),(0,xL.default)(n),(0,EL.default)(),(0,sE.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,SL.default)({startLine:t,markers:r}),o=(0,TL.default)({fence:e}),a=(0,kL.default)({tokenizers:i}),u=(0,sE.getJoiner)(n);return function(l){let c=[];for(let h of(0,_L.splitLines)(l)){let f=s(h);if(f===null)continue;let g=o(f),v=g.slice(1).map(a);c.push({description:u(g[0],r),tags:v,source:f,problems:v.reduce((b,O)=>b.concat(O.problems),[])})}return c}}fb.default=AL});var aE=m(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});function OL(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 CL(){return t=>t.source.map(({tokens:e})=>OL(e)).join(`
|
99
|
+
`)}db.default=CL});var lE=m(lu=>{"use strict";var RL=lu&&lu.__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(lu,"__esModule",{value:!0});var uE=Io(),PL=wr(),DL={start:0,tag:0,type:0,name:0},IL=(t=uE.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)}),Ss=t=>"".padStart(t," ");function ML(t=uE.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=Ss(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Ss(n.start);break;case t.delim:s.start=Ss(n.start+1);break;default:s.delimiter="",s.start=Ss(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=Ss(n.tag-s.tag.length+1)),a.type||(s.postType=Ss(n.type-s.type.length+1)),a.name||(s.postName=Ss(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=RL(i,["source"]);return n=s.reduce(IL(t),Object.assign({},DL)),(0,PL.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}lu.default=ML});var cE=m(cu=>{"use strict";var LL=cu&&cu.__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(cu,"__esModule",{value:!0});var NL=wr(),qL=t=>e=>e.slice(t),jL=t=>{let e="".padStart(t," ");return n=>n+e};function FL(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?jL(s):qL(-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=LL(i,["source"]);return(0,NL.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}cu.default=FL});var hE=m(hu=>{"use strict";var $L=hu&&hu.__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(hu,"__esModule",{value:!0});var BL=wr();function UL(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=$L(n,["source"]);return(0,BL.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}hu.default=UL});var fE=m(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.flow=void 0;function WL(...t){return e=>t.reduce((n,r)=>r(n),e)}Ch.flow=WL});var mE=m(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var HL=wr(),pE={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},dE={lineEnd:"CR"},pb=Object.keys(pE),gE=t=>(0,HL.isSpace)(t)?`{${t.length}}`:t,GL=t=>"|"+t.join("|")+"|",zL=(t,e)=>Object.keys(e).map(n=>gE(e[n]).padEnd(t[n]));function KL({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},pE);for(let s of pb)r[s]=((e=dE[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],gE(o[a]).length)}let i=[[],[]];for(let s of pb)i[0].push(((n=dE[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of pb)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...zL(r,o)])}return i.map(GL).join(`
|
100
|
+
`)}gb.default=KL});var mb=m(It=>{"use strict";var VL=It&&It.__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]}),XL=It&&It.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&VL(e,t,n)};Object.defineProperty(It,"__esModule",{value:!0});It.util=It.tokenizers=It.transforms=It.inspect=It.stringify=It.parse=void 0;var YL=oE(),JL=hb(),QL=lb(),ZL=ib(),eN=ob(),tN=aE(),nN=lE(),rN=cE(),iN=hE(),sN=fE(),Rh=wr();XL(Io(),It);function oN(t,e={}){return(0,YL.default)(e)(t)}It.parse=oN;It.stringify=(0,tN.default)();var aN=mE();Object.defineProperty(It,"inspect",{enumerable:!0,get:function(){return aN.default}});It.transforms={flow:sN.flow,align:nN.default,indent:rN.default,crlf:iN.default};It.tokenizers={tag:ZL.default,type:eN.default,name:QL.default,description:JL.default};It.util={rewireSpecs:Rh.rewireSpecs,rewireSource:Rh.rewireSource,seedBlock:Rh.seedBlock,seedTokens:Rh.seedTokens}});var ks=m(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.SignatureDefinitionBaseType=void 0;var uN;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(uN=fu.SignatureDefinitionBaseType||(fu.SignatureDefinitionBaseType={}))});var du=m(Mo=>{"use strict";var yE=Mo&&Mo.__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};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SignatureDefinitionTypeMeta=void 0;var fn=ks(),lN=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=e.match(/^([a-zA-Z]+)(?:<([^>]+)>)?$/);if(!n)return null;var r=null,i=null,s=yE(n,3),o=s[0],a=s[1],u=s[2];if(a===fn.SignatureDefinitionBaseType.Map?(r=fn.SignatureDefinitionBaseType.Any,i=fn.SignatureDefinitionBaseType.Any):a===fn.SignatureDefinitionBaseType.List&&(r=fn.SignatureDefinitionBaseType.Any),u){var l=u.split(",").map(function(g){return g.trim()});if(l.length>2)return null;var c=yE(l,2),h=c[0],f=c[1];f!=null?(r=f,i=h):r=h}return new t({type:a,keyType:i,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var i=e,s=null,o=null;return i===fn.SignatureDefinitionBaseType.Map?(s=fn.SignatureDefinitionBaseType.Any,o=fn.SignatureDefinitionBaseType.Any):i===fn.SignatureDefinitionBaseType.List&&(s=fn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}else if(typeof e=="object"){var i=e.type,s=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return i===fn.SignatureDefinitionBaseType.Map?(s=s??fn.SignatureDefinitionBaseType.Any,o=o??fn.SignatureDefinitionBaseType.Any):i===fn.SignatureDefinitionBaseType.List&&(s=s??fn.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}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===e.keyType&&this.valueType===e.valueType},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType,">"):"".concat(this.type,"<").concat(this.keyType,",").concat(this.valueType,">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType}:{type:this.type,keyType:this.keyType,valueType:this.valueType}},t.prototype.copy=function(){return new t({type:this.type,keyType:this.keyType,valueType:this.valueType})},t}();Mo.SignatureDefinitionTypeMeta=lN});var yb=m(Ui=>{"use strict";var bE=Ui&&Ui.__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},vE=Ui&&Ui.__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(Ui,"__esModule",{value:!0});Ui.SignatureDefinitionFunctionArg=void 0;var _E=du(),cN=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(_E.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,vE([],bE(e.types.map(_E.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 vE([],bE(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}();Ui.SignatureDefinitionFunctionArg=cN});var Ph=m($r=>{"use strict";var ws=$r&&$r.__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},xs=$r&&$r.__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))},hN=$r&&$r.__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($r,"__esModule",{value:!0});$r.VariationRegistry=void 0;var fN=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(xs(xs([],ws(e),!1),ws(this._variations),!1)),this},t.prototype.getAll=function(){return xs([],ws(this._variations),!1)},t}(),dN=function(){function t(){}return t.add=function(e,n){var r=new fN(e);return r.push.apply(r,xs([],ws(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){var n,r,i=new Set;try{for(var s=hN(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),l=this.get(u);if(l!==null)i=new Set(xs(xs([],ws(l.getAll()),!1),ws(i),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}i.add(a)}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return xs([],ws(i),!1)},t.variationContainers=new Map,t}();$r.VariationRegistry=dN});var Dh=m(Wi=>{"use strict";var pN=Wi&&Wi.__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},gN=Wi&&Wi.__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(Wi,"__esModule",{value:!0});Wi.SignatureDefinition=void 0;var mN=Ph(),yN=du(),bN=function(){function t(e){this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations}return t.parse=function(e){var n,r,i;return new t({type:yN.SignatureDefinitionTypeMeta.parse(e.type),isProtected:!!e.isProtected,description:(n=e.description)!==null&&n!==void 0?n:null,example:(r=e.example)!==null&&r!==void 0?r:null,variations:(i=e.variations)!==null&&i!==void 0?i:null})},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.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 mN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?gN([],pN(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({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})},t.prototype.copy=function(){return new t({type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations})},t}();Wi.SignatureDefinition=bN});var bb=m(Jn=>{"use strict";var vN=Jn&&Jn.__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)}}(),Ih=Jn&&Jn.__assign||function(){return Ih=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},Ih.apply(this,arguments)},_N=Jn&&Jn.__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},TN=Jn&&Jn.__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(Jn,"__esModule",{value:!0});Jn.SignatureDefinitionFunction=void 0;var SN=ks(),kN=Ph(),wN=Dh(),xN=yb(),TE=du(),EN=function(t){vN(e,t);function e(n){var r=t.call(this,{type:n.type,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations})||this;return r._argList=n.arguments.map(function(i){return i.getLabel()}),r._argRefs=n.arguments.reduce(function(i,s){return i.set(s.getLabel(),s)},new Map),r._returns=n.returns.reduce(function(i,s){return i.set(s.type,s)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,i,s,o,a,u;return new e({type:new TE.SignatureDefinitionTypeMeta({type:SN.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(i=n.description)!==null&&i!==void 0?i:null,example:(s=n.example)!==null&&s!==void 0?s:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(xN.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(TE.SignatureDefinitionTypeMeta.parse),variations:n.variations,returnVariations:(u=n.returnVariations)!==null&&u!==void 0?u:null})},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 TN([],_N(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=[]),kN.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Ih(Ih({},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({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})},e.prototype.copy=function(){return new e({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})},e}(wN.SignatureDefinition);Jn.SignatureDefinitionFunction=EN});var kE=m((B3,SE)=>{"use strict";SE.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var vb=m((wE,xE)=>{"use strict";var AN=kE();xE.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:AN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,wE.assert)}}});var Ne=m((W3,EE)=>{"use strict";var ON=vb();EE.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new ON(e)}});var Es=m((H3,OE)=>{"use strict";var _b=Ne(),AE={};OE.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);_b(!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&&AE.iterables(s);if(Array.isArray(s)||u==="set"){let l=Number(a);Number.isInteger(l)&&(a=l<0?s.length+l:l)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){_b(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),_b(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};AE.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Tb=m((dn,RE)=>{"use strict";var CE={};dn=RE.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};CE.typeMap=new Map([["[object Error]",dn.error],["[object Map]",dn.map],["[object Promise]",dn.promise],["[object Set]",dn.set],["[object WeakMap]",dn.weakMap],["[object WeakSet]",dn.weakSet]]);dn.getInternalProto=function(t){if(Array.isArray(t))return dn.array;if(Buffer&&t instanceof Buffer)return dn.buffer;if(t instanceof Date)return dn.date;if(t instanceof RegExp)return dn.regex;if(t instanceof Error)return dn.error;let e=Object.prototype.toString.call(t);return CE.typeMap.get(e)||dn.generic}});var Sb=m(PE=>{"use strict";PE.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var pn=m((z3,DE)=>{"use strict";var CN=Es(),qn=Tb(),RN=Sb(),li={needsProtoHack:new Set([qn.set,qn.map,qn.weakSet,qn.weakMap])};DE.exports=li.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=li.clone,i=n;if(e.shallow){if(e.shallow!==!0)return li.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=qn.getInternalProto(t);if(s===qn.buffer)return Buffer&&Buffer.from(t);if(s===qn.date)return new Date(t.getTime());if(s===qn.regex)return new RegExp(t);let o=li.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===qn.set)for(let u of t)o.add(r(u,e,i));else if(s===qn.map)for(let[u,l]of t)o.set(u,r(l,e,i));let a=RN.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===qn.array&&u==="length"){o.length=t.length;continue}let l=Object.getOwnPropertyDescriptor(t,u);l?l.get||l.set?Object.defineProperty(o,u,l):l.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};li.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=CN(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return li.clone(t,e,r)};li.base=function(t,e,n){if(n.prototype===!1)return li.needsProtoHack.has(e)?new e.constructor:e===qn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===qn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(li.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var IE=m((K3,PN)=>{PN.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 Mh=m(pu=>{"use strict";var P=Lh(),be={};be.wrap=P.string().min(1).max(2).allow(!1);pu.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:be.wrap,array:be.wrap,string:be.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();be.nameRx=/^[a-zA-Z0-9]\w*$/;be.rule=P.object({alias:P.array().items(P.string().pattern(be.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(be.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});pu.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(be.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(be.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(be.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(be.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(be.nameRx,be.rule),terms:P.object().pattern(be.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();pu.extensions=P.array().items(P.object(),P.function().arity(1)).strict();be.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};be.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),be.desc.buffer,be.desc.func,be.desc.ref,be.desc.regex,be.desc.special,be.desc.template,be.desc.value,P.link("/")]);be.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),be.desc.buffer,be.desc.func,be.desc.override,be.desc.ref,be.desc.regex,be.desc.template,be.desc.value);be.desc.messages=P.object().pattern(/.+/,[P.string(),be.desc.template,P.object().pattern(/.+/,[P.string(),be.desc.template])]);pu.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:be.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),be.desc.ref],wrap:{label:be.wrap,array:be.wrap}},externals:P.boolean(),messages:be.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:be.desc.values,invalid:be.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),be.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:be.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var LE=m((X3,ME)=>{"use strict";var Hi={};ME.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Hi.isSafe(r)?e+=t[n]:e+=Hi.escapeHtmlChar(r)}return e};Hi.escapeHtmlChar=function(t){let e=Hi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Hi.isSafe=function(t){return Hi.safeCharCodes.has(t)};Hi.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);Hi.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 NE=m(gu=>{"use strict";var De={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};gu.Parser=class{constructor(t,e={}){if(!e[De.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[De.settings]?e:Object.assign({[De.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 l=new gu.Parser(n,this.settings);e.push({type:"segment",value:l})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(De.operatorCharacters.includes(n))u&&u.type==="operator"&&De.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(De.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(De.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 De.literals?i=De.literals[a]:a==="("?(s(),++r):De.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(De.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!De.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 De.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):De.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 l=t[u];o?(i+=l,l===o&&(o=!1)):l in De.literals&&!s?(i+=l,o=De.literals[l]):l===","&&!s?a():(i+=l,l==="("?++s:l===")"&&--s)}a()}return r=r.map(i=>new gu.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=De.evaluate(i,t);e[n]=De.single(r.value,s)}}return De.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=De.evaluate(e[r-1],t),o=De.evaluate(e[r+1],t);e.splice(r,2);let a=De.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),De.evaluate(e[0],t)}};gu.Parser.prototype[De.symbol]=!0;De.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};De.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[De.symbol]?t.evaluate(e):t};De.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};De.calculate=function(t,e,n){if(t==="??")return De.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=De.exists(e)?e:"",n=De.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};De.exists=function(t){return t!=null}});var jE=m(qE=>{"use strict";var DN=pn(),IN=nt(),As={annotations:Symbol("annotations")};qE.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=DN(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,l=this.details[a],c=l.path,h=i;for(let f=0;;++f){let g=c[f];if(IN.isSchema(h)&&(h=h.clone()),f+1<c.length&&typeof h[g]!="string")h=h[g];else{let v=h[As.annotations]||{errors:{},missing:{}};h[As.annotations]=v;let b=g||l.context.key;h[g]!==void 0?(v.errors[b]=v.errors[b]||[],v.errors[b].push(u)):v.missing[b]=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=As.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,l)=>`${n}"${u}"${r}${e} [${l}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,l)=>`
|
101
101
|
${l} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
|
102
102
|
${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
103
|
-
[${u}] ${this.details[a].message}`}return o=o+r,o};As.safeStringify=function(t,e){return JSON.stringify(t,As.serializer(),e)};As.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[As.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 ci=m(Rt=>{"use strict";var MN=FE(),LN=nt(),NN=Gi();Rt.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=Rt.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 Rt.template(this.value,t,e||this.code,this.state,this.prefs)}};Rt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Rt.template=function(t,e,n,r,i){if(!e)return;if(NN.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(LN.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["*"]};Rt.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=Rt.path(i);return s||Rt.template(null,n.messages,"root",e,n)||r&&Rt.template(null,r,"root",e,n)||"value"};Rt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Rt.details(t);if(r)return r;if(n.errors.stack)return new Rt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Rt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Rt.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}};Rt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Rt.ValidationError}};Rt.ValidationError.prototype.isJoi=!0;Rt.ValidationError.prototype.name="ValidationError";Rt.ValidationError.prototype.annotate=MN.error});var hi=m(er=>{"use strict";var Qn=Ne(),qN=pn(),jN=Es(),mu=nt(),kb,Zn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};er.create=function(t,e={}){Qn(typeof t=="string","Invalid reference key:",t),mu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Qn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Zn.defaults,e);delete n.prefix;let r=n.separator,i=Zn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Qn(!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)Qn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Zn.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 Zn.Ref(n)};er.in=function(t,e={}){return er.create(t,{...e,in:!0})};er.isRef=function(t){return t?!!t[mu.symbols.ref]:!1};Zn.Ref=class{constructor(t){Qn(typeof t=="object","Invalid reference construction"),mu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Qn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Qn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Qn(!t.map||Array.isArray(t.map),"options.map must be an array"),Qn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Zn.defaults,t),Qn(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 Qn(!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):(Qn(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=jN(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 Zn.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||""}`}};Zn.Ref.prototype[mu.symbols.ref]=!0;er.build=function(t){return t=Object.assign({},Zn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Zn.Ref(t)};Zn.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"}};Zn.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]};er.toSibling=0;er.toParent=1;er.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?er.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(mu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}er.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),kb=kb||Gi(),kb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new er.Manager;return t.refs=qN(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Gi=m((WE,HE)=>{"use strict";var Nh=Ne(),FN=pn(),$N=NE(),BN=qE(),BE=nt(),$E=ci(),UE=hi(),We={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}};HE.exports=WE=We.Template=class{constructor(t,e){if(Nh(typeof t=="string","Template source must be a string"),Nh(!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?FN(r):void 0,this._functions=n,this._functions&&(Nh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Nh(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=We.encode(this.source),e=We.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(`{${We.decode(s)}`);continue}let l=s.slice(o?0:1,u),c=l[0]===":";c&&(l=l.slice(1));let h=this._ref(We.decode(l),{raw:o,wrapped:c});r.push(h),typeof h!="string"&&(n=!0);let f=s.slice(u+a.length);f&&r.push(We.decode(f))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return We.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 We.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[BE.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=We.stringify(a,t,e,n,r,i);if(u!==void 0){let l=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:$N(u);s.push(We.wrap(l,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=UE.create(o,this._settings);return r.push(a),u=>{let l=a.resolve(...u);return l!==void 0?l:null}};try{let o=this._functions?{...We.functions,...this._functions}:We.functions;var s=new BN.Parser(t,{reference:i,functions:o,constants:We.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 We.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};We.Template.prototype[BE.symbols.template]=!0;We.Template.prototype.isImmutable=!0;We.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>We.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>We.closes.slice(0,n.length))};We.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};We.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};We.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};We.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(UE.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 We.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 We.Template.date(t,r);if(t instanceof Map){let c=[];for(let[h,f]of t.entries())c.push(`${h.toString()} -> ${f.toString()}`);t=c}if(!Array.isArray(t))return t.toString();let l=[];for(let c of t)l.push(We.stringify(c,e,n,r,i,{arrayItems:!0,...s}));return We.wrap(l.join(", "),!u&&a.array)};We.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};We.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=$E.template(e,o[0],t,n,r)||$E.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 Lo=m(yu=>{"use strict";var Os=Ne(),GE=pn(),jn=Gi();yu.compile=function(t,e){if(typeof t=="string")return Os(!e,"Cannot set single message string"),new jn(t);if(jn.isTemplate(t))return Os(!e,"Cannot set single message template"),t;Os(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?GE(e):{};for(let n in t){let r=t[n];if(n==="root"||jn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new jn(r);continue}Os(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"||jn.isTemplate(s)){e[i][n]=s;continue}Os(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new jn(s)}}return e};yu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(jn.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};yu.merge=function(t,e){if(!t)return yu.compile(e);if(!e)return t;if(typeof e=="string")return new jn(e);if(jn.isTemplate(e))return e;let n=GE(t);for(let r in e){let i=e[r];if(r==="root"||jn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new jn(i);continue}Os(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"||jn.isTemplate(o)){n[s][r]=o;continue}Os(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new jn(o)}}return n}});var nt=m(rt=>{"use strict";var qh=Ne(),UN=vb(),WN=ME(),wb,xb,HN={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)?)?)?)?$/};rt.version=WN.version;rt.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};rt.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")};rt.assertOptions=function(t,e,n="Options"){qh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));qh(r.length===0,`${n} contain unknown keys: ${r}`)};rt.checkPreferences=function(t){xb=xb||Mh();let e=xb.preferences.validate(t);if(e.error)throw new UN([e.error.details[0].message])};rt.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}};rt.default=function(t,e){return t===void 0?e:t};rt.isIsoDate=function(t){return HN.isoDate.test(t)};rt.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};rt.isResolvable=function(t){return t?t[rt.symbols.ref]||t[rt.symbols.template]:!1};rt.isSchema=function(t,e={}){let n=t&&t[rt.symbols.any];return n?(qh(e.legacy||n.version===rt.version,"Cannot mix different versions of joi schemas"),!0):!1};rt.isValues=function(t){return t[rt.symbols.values]};rt.limit=function(t){return Number.isSafeInteger(t)&&t>=0};rt.preferences=function(t,e){wb=wb||Lo(),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=wb.compile(e.messages,t.messages)),delete n[rt.symbols.prefs],n};rt.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}};rt.validateArg=function(t,e,{assert:n,message:r}){if(rt.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};rt.verifyFlat=function(t,e){for(let n of t)qh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Eb=m(KE=>{"use strict";var GN=Ne(),KN=pn(),zN=nt(),No={max:1e3,supported:new Set(["undefined","boolean","number","string"])};KE.provider={provision(t){return new No.Cache(t)}};No.Cache=class{constructor(t={}){zN.assertOptions(t,["max"]),GN(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||No.max,this._map=new Map,this._list=new No.List}get length(){return this._map.size}set(t,e){if(t!==null&&!No.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),KN(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};No.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 Cs=m(fi=>{"use strict";var bt=Ne(),Fn=nt(),qo=hi(),tr={};fi.schema=function(t,e,n={}){Fn.assertOptions(n,["appendPath","override"]);try{return tr.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};tr.schema=function(t,e,n){bt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(bt(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(tr.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(bt(typeof e=="object","Invalid schema content:",typeof e),Fn.isResolvable(e))return r(t,e);if(Fn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!tr.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):(bt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};fi.ref=function(t,e){return qo.isRef(t)?t:qo.create(t,e)};fi.compile=function(t,e,n={}){Fn.assertOptions(n,["legacy"]);let r=e&&e[Fn.symbols.any];if(r)return bt(n.legacy||r.version===Fn.version,"Cannot mix different versions of joi schemas:",r.version,Fn.version),e;if(typeof e!="object"||!n.legacy)return fi.schema(t,e,{appendPath:!0});let i=tr.walk(e);return i?i.compile(i.root,e):fi.schema(t,e,{appendPath:!0})};tr.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=tr.walk(n);if(r)return r}return null}let e=t[Fn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};bt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=tr.walk(t[n]);if(r)return r}return null};tr.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};fi.when=function(t,e,n){if(n===void 0&&(bt(e&&typeof e=="object","Missing options"),n=e,e=qo.create(".")),Array.isArray(n)&&(n={switch:n}),Fn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Fn.isSchema(e))return bt(n.is===void 0,'"is" can not be used with a schema condition'),bt(n.not===void 0,'"not" can not be used with a schema condition'),bt(n.switch===void 0,'"switch" can not be used with a schema condition'),tr.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(bt(qo.isRef(e)||typeof e=="string","Invalid condition:",e),bt(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 bt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),bt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!qo.isRef(n.is)&&!Fn.isSchema(n.is)&&(s=s.required()),tr.condition(t,{ref:fi.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}bt(Array.isArray(n.switch),'"switch" must be an array'),bt(n.is===void 0,'Cannot combine "switch" with "is"'),bt(n.not===void 0,'Cannot combine "switch" with "not"'),bt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:fi.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;Fn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),bt(s.is!==void 0,'Switch statement missing "is"'),bt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!qo.isRef(s.is)&&!Fn.isSchema(s.is)&&(a.is=a.is.required()),o){bt(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&&(bt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};tr.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 Ab=m(VE=>{"use strict";var Ki=Ne(),VN=pn(),zE=nt(),XN=Lo(),Br={};VE.type=function(t,e){let n=Object.getPrototypeOf(t),r=VN(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=XN.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 h in s.terms){let f=s.terms[h];Ki(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=f.init,a[h]=f}s.terms=a,s.args||(s.args=o.args),s.prepare=Br.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=Br.coerce(s.coerce,o.coerce),s.validate=Br.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let f=s.rules[h];Ki(typeof f=="object","Invalid rule definition for",s.type,h);let g=f.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(Ki(!r[h],"Rule conflict in",s.type,h),r[h]=g),Ki(!u[h],"Rule conflict in",s.type,h),u[h]=f,f.alias){let v=[].concat(f.alias);for(let b of v)r[b]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(v=>(typeof v=="string"&&(v={name:v}),Ki(!f.argsByName.has(v.name),"Duplicated argument name",v.name),zE.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),f.argsByName.set(v.name,v),v)))}s.rules=u;let l=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){Ki(!r[h],"Rule conflict in",s.type,h);let f=s.modifiers[h];Ki(typeof f=="function","Invalid modifier definition for",s.type,h);let g=function(v){return this.rule({[h]:v})};r[h]=g,l[h]=f}if(s.modifiers=l,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)Ki(n[h],"Cannot override missing",h),s.overrides[h][zE.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let c=Object.assign({},o.manifest,s.manifest);return c.build=Br.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=c,s.rebuild=Br.rebuild(s.rebuild,o.rebuild),i};Br.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Br.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}}};Br.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}};Br.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Br.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 Rb=m(Cb=>{"use strict";var Ur=Ne(),jh=pn(),Rs=nt(),YN=Lo(),XE=hi(),JN=Gi(),Ob,gn={};Cb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=gn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=jh(t._preferences,{shallow:["messages"]}),delete n.preferences[Rs.symbols.prefs],n.preferences.messages&&(n.preferences.messages=YN.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]=gn.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]=gn.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;Ur(!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(Rs.isValues(i)){n[r]=i.describe();continue}Ur(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(gn.describe(u));if(o){let{from:u,to:l}=s.mapped;n[r]={};for(let c of a)n[r][c[l]]=c[u];continue}if(s==="single"){Ur(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return gn.validate(t.$_root,n),n};gn.describe=function(t,e={}){if(Array.isArray(t))return t.map(gn.describe);if(t===Rs.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return jh(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[Rs.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]=gn.describe(i,{assign:r}))}return n};Cb.build=function(t,e){return new gn.Builder(t).parse(e)};gn.Builder=class{constructor(t){this.joi=t}parse(t){gn.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;Ur(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){Ur(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let c in i.args)a[c]=this.build(i.args[c],{assign:c});let u=Object.keys(a),l=n.rules[i.name].args;if(l){Ur(u.length<=l.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",l.length,", found",u.length,")");for(let{name:c}of l)s.push(a[c])}else Ur(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;Ur(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 jh(t);if(e.assign==="regex")return gn.regex(t);if(e.assign==="ref")return XE.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Ur(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Rs.symbols.literal]:!0,literal:t.function};if(t.override)return Rs.symbols.override;if(t.ref)return XE.build(t.ref);if(t.regex)return gn.regex(t.regex);if(t.special)return Ur(["deep"].includes(t.special),"Unknown special value",t.special),Rs.symbols.deepDefault;if(t.value)return jh(t.value)}if(t.type)return this.parse(t);if(t.template)return JN.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};gn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};gn.validate=function(t,e){Ob=Ob||Mh(),t.assert(e,Ob.description)}});var bu=m((p4,YE)=>{"use strict";var Wr=Tb(),on={mismatched:null};YE.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!on.isDeepEqual(t,e,n,[])};on.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=on.getSharedType(t,e,!!n.prototype);switch(s){case Wr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Wr.promise:return t===e;case Wr.regex:return t.toString()===e.toString();case on.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new on.SeenEntry(t,e));try{return!!on.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};on.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?on.mismatched:Wr.getInternalProto(t);let r=Wr.getInternalProto(t);return r!==Wr.getInternalProto(e)?on.mismatched:r};on.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};on.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};on.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};on.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=on,{keys:u,getOwnPropertySymbols:l}=Object;if(t===Wr.array)if(r.part){for(let v of e)for(let b of n)if(s(v,b,r,i))return!0}else{if(e.length!==n.length)return!1;for(let v=0;v<e.length;++v)if(!s(e[v],n[v],r,i))return!1;return!0}else if(t===Wr.set){if(e.size!==n.size)return!1;if(!on.isSetSimpleEqual(e,n)){let v=new Set(Set.prototype.values.call(n));for(let b of Set.prototype.values.call(e)){if(v.delete(b))continue;let O=!1;for(let A of v)if(s(b,A,r,i)){v.delete(A),O=!0;break}if(!O)return!1}}}else if(t===Wr.map){if(e.size!==n.size)return!1;for(let[v,b]of Map.prototype.entries.call(e))if(b===void 0&&!Map.prototype.has.call(n,v)||!s(b,Map.prototype.get.call(n,v),r,i))return!1}else if(t===Wr.error&&(e.name!==n.name||e.message!==n.message))return!1;let c=o(e),h=o(n);if((e!==c||n!==h)&&!s(c,h,r,i))return!1;let f=u(e);if(!r.part&&f.length!==u(n).length&&!r.skip)return!1;let g=0;for(let v of f){if(r.skip&&r.skip.includes(v)){n[v]===void 0&&++g;continue}if(!a(n,v)||!s(e[v],n[v],r,i))return!1}if(!r.part&&f.length-g!==u(n).length)return!1;if(r.symbols!==!1){let v=l(e),b=new Set(l(n));for(let O of v){if(!r.skip||!r.skip.includes(O)){if(a(e,O)){if(!a(n,O)||!s(e[O],n[O],r,i))return!1}else if(a(n,O))return!1}b.delete(O)}for(let O of b)if(a(n,O))return!1}return!0};on.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var QE=m(JE=>{"use strict";JE.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 Db=m(Pb=>{"use strict";var ZE=bu(),eA=QE(),QN=ci(),an={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Pb.setup=function(t){let e=function(){return t._tracer=t._tracer||new an.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Pb.location=function(t){return t.$_setFlag("_tracerLocation",eA.location(2))};an.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 an.Store(t),{filename:r,line:i}=t._flags._tracerLocation||eA.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(an.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let c of["valid","invalid"]){let h=a[`_${c}s`];if(!h)continue;let f=new Set(h._values),g=new Set(h._refs);for(let{value:v,ref:b}of u[c])f.delete(v),g.delete(b);(f.size||g.size)&&s.push({status:[...f,...[...g].map(v=>v.display)],rule:`${c}s`})}let l=a._rules.map(c=>c.name);for(let c of["default","failover"])a._flags[c]!==void 0&&l.push(c);for(let c of l){let h=an.labels[u.rule[c]||0];if(h){let f={rule:c,status:h};u.paths.size&&(f.paths=[...u.paths]),s.push(f)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(an.message).join(", ")}`})}return e.length?e:null}};an.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){an.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){an.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){an.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]|=an.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||ZE(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=an.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};an.message=function(t){return`${t.paths?QN.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};an.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)};an.sub=function(t,e){for(let n of t)for(let r of e)if(ZE(n.slice(0,r.length),r))return!0;return!1};an.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Fh=m((_4,rA)=>{"use strict";var Ib=Ne(),tA=pn(),ZN=Sb(),nA={};rA.exports=nA.merge=function(t,e,n){if(Ib(t&&typeof t=="object","Invalid target value: must be an object"),Ib(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)){Ib(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(tA(e[i],{symbols:n.symbols}));return t}let r=ZN.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]=tA(o,{symbols:n.symbols}):nA.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var iA=m($h=>{"use strict";var di=Ne(),Mb=nt(),eq=hi(),Hr={};$h.Ids=Hr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Hr.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())di(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())di(!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)};di(Mb.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Hr.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);di(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||!Mb.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);di(!r||r.schema===t,"Cannot add different schemas with the same id:",n),di(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(di(!this._byKey.has(e),"Schema already contains key:",e),di(!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);di(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)}};Hr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=$h.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};$h.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Hr.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=Hr.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=Hr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Hr.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,l=Hr.scan(t[a],e,n,[a,...s],u);l!==void 0&&(o=o||t.slice(),o[a]=l)}return o}if(n.schema!==!1&&Mb.isSchema(t)||n.ref!==!1&&eq.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=Hr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var oA=m((k4,sA)=>{"use strict";sA.exports=function(){}});var lA=m((w4,uA)=>{"use strict";var tq=pn(),aA=Es(),nq=nt(),Gr={value:Symbol("value")};uA.exports=Gr.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 Gr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Gr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Gr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Gr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Gr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=tq(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()}};Gr.schemas=function(t){return nq.isSchema(t)?{schema:t}:t};Gr.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[Gr.value]=e}get(t){let e=this.node(t);if(e)return e[Gr.value]}node(t){if(this._values)return aA(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=aA(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var hA=m(_u=>{"use strict";var vu=Ne(),cA=pn(),jo=oA(),rq=Es(),Mt=nt(),zi=ci(),iq=lA(),ke={result:Symbol("result")};_u.entry=function(t,e,n){let r=Mt.defaults;n&&(vu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),vu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Mt.preferences(Mt.defaults,n));let i=ke.entry(t,e,r);vu(!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=zi.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};_u.entryAsync=async function(t,e,n){let r=Mt.defaults;n&&(r=Mt.preferences(Mt.defaults,n));let i=ke.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 l of s.externals){let c=l.state.path,h=l.schema.type==="link"?s.links.get(l.schema):null,f=a,g,v,b=c.length?[a]:[],O=c.length?rq(t,c):t;if(c.length){g=c[c.length-1];let A=a;for(let k of c.slice(0,-1))A=A[k],b.unshift(A);v=b[0],f=v[g]}try{let A=(S,_)=>(h||l.schema).$_createError(S,f,_,l.state,r),k=await l.method(f,{schema:l.schema,linked:h,state:l.state,prefs:n,original:O,error:A,errorsArray:ke.errorsArray,warn:(S,_)=>s.warnings.push((h||l.schema).$_createError(S,f,_,l.state,r)),message:(S,_)=>(h||l.schema).$_createError("external",f,_,l.state,r,{messages:S})});if(k===void 0||k===f)continue;if(k instanceof zi.Report){if(s.tracer.log(l.schema,l.state,"rule","external","error"),u.push(k),r.abortEarly)break;continue}if(Array.isArray(k)&&k[Mt.symbols.errors]){if(s.tracer.log(l.schema,l.state,"rule","external","error"),u.push(...k),r.abortEarly)break;continue}v?(s.tracer.value(l.state,"rule",f,k,"external"),v[g]=k):(s.tracer.value(l.state,"rule",a,k,"external"),a=k)}catch(A){throw r.errors.label&&(A.message+=` (${l.label})`),A}}if(i.value=a,u.length)throw i.error=zi.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=zi.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ke.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()}};ke.entry=function(t,e,n){let{tracer:r,cleanup:i}=ke.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ke.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,l=new iq([],[],{mainstay:a,schemas:u}),c=_u.validate(t,e,l,n);i&&e.$_root.untrace();let h=zi.process(c.errors,t,n);return{value:c.value,error:h,mainstay:a}};ke.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(vu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ke.ignore}};_u.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ke.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,f,g)=>e.$_createError(h,t,f,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ke.errorsArray,warn:(h,f,g)=>n.mainstay.warnings.push(s(h,f,g)),message:(h,f)=>e.$_createError("custom",t,f,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(ke.trim(t,e),n.nest(u),Mt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let l=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(l==="forbidden")return ke.finalize(t,null,o);if(l==="required")return ke.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(l==="optional"){if(e._flags.default!==Mt.symbols.deepDefault)return ke.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(l==="forbidden")return ke.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let c=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),ke.finalize(t,null,o);if(e._flags.only){let f=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let f=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return c.push(h.errors),ke.finalize(t,c,o);if(h.errors.length)return c.push(...h.errors),ke.finalize(t,c,o)}}return e._rules.length?ke.rules(t,c,o):ke.finalize(t,c,o)};ke.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,l=o.args;if(o._resolve.length){l=Object.assign({},l);for(let h of o._resolve){let f=a.argsByName.get(h),g=l[h].resolve(t,i,s),v=f.normalize?f.normalize(g):g,b=Mt.validateArg(v,null,f);if(b){u=r.$_createError("any.ref",g,{arg:h,ref:l[h],reason:b},i,s);break}l[h]=v}}u=u||a.validate(t,n,l,o);let c=ke.rule(u,o);if(c.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...c.errors);continue}if(s.abortEarly)return ke.finalize(t,c.errors,n);e.push(...c.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,c.value,o.name),t=c.value}return ke.finalize(t,e,n)};ke.rule=function(t,e){return t instanceof zi.Report?(ke.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Mt.symbols.errors]?(t.forEach(n=>ke.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ke.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ke.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ke.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)vu(a instanceof Error||a instanceof zi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ke.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:zi.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};ke.prefs=function(t,e){let n=e===Mt.defaults;return n&&t._preferences[Mt.symbols.prefs]?t._preferences[Mt.symbols.prefs]:(e=Mt.preferences(e,t._preferences),n&&(t._preferences[Mt.symbols.prefs]=e),e)};ke.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?[cA(s.ancestors[0]),r]:[];try{return a(...u)}catch(l){n.push(i.$_createError(`any.${t}`,null,{error:l},s,o));return}}return typeof a!="object"?a:a[Mt.symbols.literal]?a.literal:Mt.isResolvable(a)?a.resolve(e,s,o):cA(a)};ke.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ke.ignore={active:!1,debug:jo,entry:jo,filter:jo,log:jo,resolve:jo,value:jo};ke.errorsArray=function(){let t=[];return t[Mt.symbols.errors]=!0,t}});var Nb=m((C4,dA)=>{"use strict";var sq=Ne(),fA=bu(),Lb=nt(),pi={};dA.exports=pi.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=pi.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Lb.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 pi.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(Lb.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(fA(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(fA(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 pi.Values(this._values,this._refs);return t._override=this._override,t}concat(t){sq(!t._override,"Cannot concat override set of values");let e=new pi.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}};pi.Values.prototype[Lb.symbols.values]=!0;pi.Values.prototype.slice=pi.Values.prototype.clone;pi.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 TA=m((P4,_A)=>{"use strict";var ne=Ne(),pA=pn(),gA=bu(),qb=Fh(),oq=Eb(),wt=nt(),jb=Cs(),aq=ci(),uq=Ab(),mA=Rb(),lq=Lo(),yA=iA(),bA=hi(),vA=Db(),Bh=hA(),Uh=Nb(),$t={};$t.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new yA.Ids,this._preferences=null,this._refs=new bA.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 ne(typeof mA.describe=="function","Manifest functionality disabled"),mA.describe(this)}allow(...t){return wt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){ne(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),ne(!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];ne(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 ne(t!==void 0,"Artifact cannot be undefined"),ne(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return ne(t===!1||typeof t=="string","Invalid to value"),ne(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 ne(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 ne(t,"Missing error"),ne(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return ne(t!==void 0,"Missing example"),wt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(ne(!e,"Cannot combine options with description"),e=t.description,t=t.method),ne(typeof t=="function","Method must be a function"),ne(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?(ne(typeof t=="string","id must be a non-empty string"),ne(/^[^\.]+$/.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 ne(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return ne(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){ne(t.length,"Missing notes");for(let e of t)ne(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return ne(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){ne(t,"Missing preferences"),ne(t.context===void 0,"Cannot override context"),ne(t.externals===void 0,"Cannot override externals"),ne(t.warnings===void 0,"Cannot override warnings"),ne(t.debug===void 0,"Cannot override debug"),wt.checkPreferences(t);let e=this.clone();return e._preferences=wt.preferences(e._preferences,t),e}presence(t){return ne(["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 ne(["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=wt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){ne(t.length,"Missing tags");for(let e of t)ne(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return ne(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){wt.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=jb.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)ne(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),ne(!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){ne(!this._inRuleset(),"Cannot set caching inside a ruleset"),ne(!this._cache,"Cannot override schema cache"),ne(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||oq.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){ne(wt.isSchema(t),"Invalid schema object"),ne(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),ne(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),ne(!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,bA.toSibling),e._preferences=e._preferences?wt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Uh.merge(e._valids,t._valids,t._invalids),e._invalids=Uh.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,qb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,qb(e._flags,n)}else qb(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 ne(!t.base,"Cannot extend type with another base"),uq.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){ne(!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;wt.assertOptions(t,Object.keys(e.modifiers)),ne(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;ne(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=pA(s);for(let a in t)e.modifiers[a](o,t[a]),ne(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(){ne(!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),ne(!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),ne(wt.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 vA.location?vA.location(this):this}validate(t,e){return Bh.entry(t,this,e)}validateAsync(t,e){return Bh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),ne(t&&typeof t=="object","Invalid options"),ne(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)ne(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;ne(n,"Unknown rule",e.method);let i=this.clone();if(r){ne(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&&wt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=wt.validateArg(o,s,a);ne(!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 jb.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?lq.merge(this._definition.messages,s.messages):this._definition.messages;return new aq.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=!Bh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return wt.assertOptions(t,["each","once","ref","schema"]),yA.schema(this,t)||this}$_mutateRebuild(){ne(!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={}){ne(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(gA(e,r.default)&&(e=void 0),gA(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][wt.symbols.parent].call(this,...e)}$_validate(t,e,n){return Bh.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=pA(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 wt.assertOptions(n,"literal"),ne(e!==void 0,"Missing",t,"value"),ne(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[wt.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 l=u.ref?u.ref.resolve(t,e,n):t,c=u.is?[u]:u.switch,h=i.length;for(let f=0;f<c.length;++f){let{is:g,then:v,otherwise:b}=c[f],O=`${a}${u.switch?"."+f:""}`;if(g.$_match(l,e.nest(g,`${O}.is`),n)){if(v){let A=e.localize([...e.path,`${O}.then`],e.ancestors,e.schemas),{schema:k,id:S}=v._generate(t,A,n);r.push(k),i.push(`${O}.then${S?`(${S})`:""}`);break}}else if(b){let A=e.localize([...e.path,`${O}.otherwise`],e.ancestors,e.schemas),{schema:k,id:S}=b._generate(t,A,n);r.push(k),i.push(`${O}.otherwise${S?`(${S})`:""}`);break}}if(u.break&&i.length>h)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={}){ne(!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){wt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===wt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Uh:r&&(n[e]=t.length?new Uh:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){ne(i!==void 0,"Cannot call allow/valid/invalid with undefined"),ne(i!==wt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(ne(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}};$t.Base.prototype[wt.symbols.any]={version:wt.version,compile:jb.compile,root:"$_root"};$t.Base.prototype.isImmutable=!0;$t.Base.prototype.deny=$t.Base.prototype.invalid;$t.Base.prototype.disallow=$t.Base.prototype.invalid;$t.Base.prototype.equal=$t.Base.prototype.valid;$t.Base.prototype.exist=$t.Base.prototype.required;$t.Base.prototype.not=$t.Base.prototype.invalid;$t.Base.prototype.options=$t.Base.prototype.prefs;$t.Base.prototype.preferences=$t.Base.prototype.prefs;_A.exports=new $t.Base});var nr=m((I4,SA)=>{"use strict";var Wh=Ne(),cq=TA(),hq=nt(),fq=Lo();SA.exports=cq.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 Wh(typeof t=="function","Method must be a function"),Wh(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){Wh(hq.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 Wh(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=fq.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:l,concat:c}=i;c?t=t.concat(c):s?t=t.when(s,{is:o,not:a,then:u,otherwise:l,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:l,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 xA=m((M4,wA)=>{"use strict";var Ps=Ne(),dq=Fh(),pq=nr(),kA=nt(),gq=Cs(),Hh=ci(),mq=hi(),Fo={};wA.exports=pq.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:mq.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 c=0;c<n.$_terms.matches.length;++c){let h=n.$_terms.matches[c],f=i.nest(h.schema,`match.${c}`);f.snapshot();let g=h.schema.$_validate(t,f,s);g.errors?(u.push(g.errors),f.restore()):(a.push(g.value),f.commit())}if(a.length===0){let c={details:u.map(h=>Hh.details(h,{override:!1}))};return{errors:r("alternatives.any",c)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let c={details:u.map(h=>Hh.details(h,{override:!1}))};return{errors:r("alternatives.all",c)}}let l=c=>c.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&l(h.schema));return l(n)?{value:a.reduce((c,h)=>dq(c,h,{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 h=i.nest(u.schema,`match.${a}`);h.snapshot();let f=u.schema.$_validate(t,h,s);if(!f.errors)return h.commit(),f;h.restore(),o.push({schema:u.schema,reports:f.errors});continue}let l=u.ref?u.ref.resolve(t,i,s):t,c=u.is?[u]:u.switch;for(let h=0;h<c.length;++h){let f=c[h],{is:g,then:v,otherwise:b}=f,O=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(l,i.nest(g,`${O}.is`),s)){if(v)return v.$_validate(t,i.nest(v,`${O}.then`),s)}else if(b)return b.$_validate(t,i.nest(b,`${O}.otherwise`),s)}}return Fo.errors(o,e)},rules:{conditional:{method(t,e){Ps(!this._flags._endedSwitch,"Unreachable condition"),Ps(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ps(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=gq.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(Ps(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ps(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ps(t.length,"Missing alternative schemas"),kA.verifyFlat(t,"try"),Ps(!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=>{kA.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}}"}});Fo.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 Fo.unmatched(t,e);let a=s[0];if(!(a instanceof Hh.Report))return Fo.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 c of a.local.valids)r.add(c);continue}let[u,l]=a.code.split(".");l!=="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}:Fo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Fo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Hh.details(n,{override:!1}))}}});var AA=m((L4,EA)=>{"use strict";var Tu=Ne(),yq=bu(),bq=Es(),vq=nr(),rr=nt(),_q=Cs(),ht={};EA.exports=vq.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 ht.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[rr.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){rr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=rr.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],l=!t[rr.symbols.arraySingle];delete t[rr.symbols.arraySingle];let c=s(),h=t.length;for(let f=0;f<h;++f){let g=t[f],v=!1,b=!1,O=l?f:new Number(f),A=[...r.path,O];if(!e._flags.sparse&&g===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly)return c;a.shift();continue}let k=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(A,k,R),i,{presence:"ignore"})){if(c.push(n("array.excludes",{pos:f,value:g},r.localize(A))),i.abortEarly)return c;v=!0,a.shift();break}if(v)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),G=R.$_validate(g,r.localize(A,k,R),i);if(G.errors){if(c.push(...G.errors),i.abortEarly)return c}else if(R._flags.result==="strip")ht.fastSplice(t,f),--f,--h;else if(!e._flags.sparse&&G.value===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly)return c;continue}else t[f]=G.value;continue}else if(!e.$_terms.items.length){if(c.push(n("array.orderedLength",{pos:f,limit:e.$_terms.ordered.length})),i.abortEarly)return c;break}}let S=[],_=o.length;for(let R=0;R<_;++R){let G=r.localize(A,k,o[R]);G.snapshot();let ie=o[R].$_validate(g,G,i);if(S[R]=ie,!ie.errors){if(G.commit(),t[f]=ie.value,b=!0,ht.fastSplice(o,R),--R,--_,!e._flags.sparse&&ie.value===void 0&&(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly))return c;break}G.restore()}if(b)continue;let N=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let R of u){let G,ie=o.indexOf(R);if(ie!==-1)G=S[ie];else{let ue=r.localize(A,k,R);if(ue.snapshot(),G=R.$_validate(g,ue,i),!G.errors){ue.commit(),R._flags.result==="strip"?(ht.fastSplice(t,f),--f,--h):!e._flags.sparse&&G.value===void 0?(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),v=!0):t[f]=G.value,b=!0;break}ue.restore()}if(_===1){if(N){ht.fastSplice(t,f),--f,--h,b=!0;break}if(c.push(...G.errors),i.abortEarly)return c;v=!0;break}}if(!v&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!b){if(N){ht.fastSplice(t,f),--f,--h;continue}if(c.push(n("array.includes",{pos:f,value:g},r.localize(A))),i.abortEarly)return c}}return o.length&&ht.fillMissedErrors(e,c,o,t,r,i),a.length&&(ht.fillOrderedErrors(e,c,a,t,r,i),c.length||ht.fillDefault(a,t,r,i)),c.length?c: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 rr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:rr.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){rr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=rr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ht.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 Tu(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){rr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=_q.ref(t.by,{ancestor:0}),Tu(!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}=ht.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={}){Tu(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),rr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=rr.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},l=o||yq,c=s.ignoreUndefined;for(let h=0;h<t.length;++h){let f=a?bq(t[h],a):t[h],g=o?u.custom:u[typeof f];if(Tu(g,"Failed to find unique map container for type",typeof f),g instanceof Map){let v=g.entries(),b;for(;!(b=v.next()).done;)if(l(b.value[0],f)){let O=e.localize([...e.path,h],[t,...e.ancestors]),A={pos:h,value:t[h],dupePos:b.value[1],dupeValue:t[b.value[1]]};return a&&(A.path=i),n("array.unique",A,O)}g.set(f,h)}else{if((!c||f!==void 0)&&g[f]!==void 0){let v={pos:h,value:t[h],dupePos:g[f],dupeValue:t[g[f]]};a&&(v.path=i);let b=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",v,b)}g[f]=h}}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)ht.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)ht.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"}});ht.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let l=u._flags.label;l?o.push(l):++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))};ht.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ht.fillMissedErrors(t,e,o,r,i,s)};ht.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],l=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(l===void 0)continue;s=!1}i.unshift(l)}i.length&&e.push(...i)};ht.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ht.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(Tu(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ht.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(l,c)=>{let h=ht.compare(l,c,o,a);if(h!==null||(n.by&&(l=n.by.resolve(l,r,i),c=n.by.resolve(c,r,i)),h=ht.compare(l,c,o,a),h!==null))return h;let f=typeof l;if(f!==typeof c)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(f!=="number"&&f!=="string")throw t.$_createError("array.sort.unsupported",e,{type:f},r,i);return f==="number"?(l-c)*s:l<c?o:a};try{return{value:e.slice().sort(u)}}catch(l){return{errors:l}}};ht.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 DA=m((N4,PA)=>{"use strict";var OA=Ne(),Tq=nr(),CA=nt(),RA=Nb(),Fb={};Fb.isBool=function(t){return typeof t=="boolean"};PA.exports=Tq.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){CA.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new RA;for(let n=0;n<t.length;++n){let r=t[n];OA(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){CA.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new RA;for(let n=0;n<t.length;++n){let r=t[n];OA(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:Fb.isBool,to(t,e){return t?1:0}},string:{from:Fb.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 NA=m((q4,LA)=>{"use strict";var IA=Ne(),Sq=nr(),MA=nt(),kq=Gi(),wr={};wr.isDate=function(t){return t instanceof Date};LA.exports=Sq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:wr.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 MA.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:wr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return IA(["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 IA(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:wr.isDate,to(t,e){return t.getTime()}},string:{from:wr.isDate,to(t,{prefs:e}){return kq.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"}});wr.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 MA.isIsoDate(t)?wr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return wr.date(1*t);if(e==="unix")return wr.date(1e3*t);if(typeof n=="string")return null}return wr.date(t)};wr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var BA=m((j4,$A)=>{"use strict";var Gh=Ne(),jA=pn(),FA=Fh(),qA=Es(),Kh={};$A.exports=function(t,e,n={}){if(Gh(t&&typeof t=="object","Invalid defaults value: must be an object"),Gh(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Gh(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Kh.applyToDefaultsWithShallow(t,e,n);let r=jA(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return FA(r,e,{nullOverride:i,mergeArrays:!1})};Kh.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Gh(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 l=qA(t,u);l&&typeof l=="object"?i.set(l,s&&qA(e,u)||l):s&&s.add(u)}let o=jA(t,{},i);if(!s)return o;for(let u of s)Kh.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return FA(o,e,{nullOverride:a,mergeArrays:!1})};Kh.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 HA=m(WA=>{"use strict";var Ds=Ne(),UA={};WA.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;Ds(!n.includes(i),`Item cannot come before itself: ${i}`),Ds(!n.includes("?"),"Item cannot come before unassociated items"),Ds(!r.includes(i),`Item cannot come after itself: ${i}`),Ds(!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();Ds(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(UA.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Ds(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Ds(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,l=a.group;n[l]=n[l]||[],n[l].push(u),t[u]=a.before;for(let c of a.after)e[c]=e[c]||[],e[c].push(u)}for(let a in t){let u=[];for(let l in t[a]){let c=t[a][l];n[c]=n[c]||[],u.push(...n[c])}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 l of u)r[l]=r[l]||[],r[l].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let l=0;l<this._items.length;++l){if(i[l]===!0)continue;r[l]||(r[l]=[]);let c=r[l].length,h=0;for(let f=0;f<c;++f)i[r[l][f]]&&++h;if(h===c){u=l;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}};UA.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Bb=m((B4,zA)=>{"use strict";var wq=BA(),ir=Ne(),GA=pn(),xq=HA(),Eq=nr(),un=nt(),$b=Cs(),Aq=ci(),KA=hi(),zh=Gi(),ge={renameDefaults:{alias:!1,multiple:!1,override:!1}};zA.exports=Eq.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=ge.clone(t,i);let s=[];if(e.$_terms.renames&&!ge.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 l=u.key,c=t[l];o.delete(l);let h=r.localize([...r.path,l],a,u),f=u.schema.$_validate(c,h,i);if(f.errors){if(i.abortEarly)return{value:t,errors:f.errors};f.value!==void 0&&(t[l]=f.value),s.push(...f.errors)}else u.schema._flags.result==="strip"||f.value===void 0&&c!==void 0?delete t[l]:f.value!==void 0&&(t[l]=f.value)}}if(o.size||e._flags._hasPatternMatch){let a=ge.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&&ge.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=ge.dependencies[a.rel](e,a,t,r,i);if(u){let l=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:l};s.push(l)}}return{value:t,errors:s}},rules:{and:{method(...t){return un.verifyFlat(t,"and"),ge.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){zh.isTemplate(t)||(t=$b.ref(t)),ir(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=KA.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 ir(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){ir(t===void 0||typeof t=="object","Object schema must be a valid object"),ir(!un.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 ge.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new ge.Keys;for(let n in t)un.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 un.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:un.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 un.verifyFlat(t,"nand"),ge.dependency(this,"nand",null,t)}},or:{method(...t){return un.verifyFlat(t,"or"),ge.dependency(this,"or",null,t)}},oxor:{method(...t){return ge.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),ir(e!==void 0,"Invalid rule"),un.assertOptions(n,["fallthrough","matches"]),r&&ir(!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 KA.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={}){ir(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),ir(typeof e=="string"||e instanceof zh,"Invalid rename to argument"),ir(e!==t,"Cannot rename key to same name:",t),un.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)ir(i.from!==t,"Cannot rename the same key multiple times");return e instanceof zh&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:wq(ge.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return un.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 ge.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return ge.dependency(this,"without",t,e,n)}},xor:{method(...t){return un.verifyFlat(t,"xor"),ge.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=un.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new xq.Sorter;for(let n of t.$_terms.keys)un.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new ge.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=ge.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}}"}});ge.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return GA(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=GA(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};ge.dependency=function(t,e,n,r,i){ir(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),un.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=un.default(i.separator,"."),o=[];for(let u of r)ir(typeof u=="string",e,"peers must be strings"),o.push($b.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=$b.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new ge.Dependency(e,n,o,r,i)),a};ge.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=ge.isPresent(e.options);for(let l of e.peers)u(l.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(l.key):o.push(l.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:ge.keysToLabels(t,o),missing:s,missingWithLabels:ge.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=ge.isPresent(e.options);for(let l of e.peers)o(l.resolve(n,r,i,null,{shadow:!1}))&&s.push(l.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:ge.keysToLabels(t,a),peers:u,peersWithLabels:ge.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=ge.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:ge.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=ge.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=ge.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:ge.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=ge.keysToLabels(t,s),{code:"object.xor",context:a})}};ge.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};ge.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};ge.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 l in e){if(e[l]===void 0&&o.options.ignoreUndefined||l===o.to)continue;let c=o.from.exec(l);c&&a.push({from:l,to:o.to,match:c})}for(let l of a){let c=l.from,h=l.to;if(h instanceof zh&&(h=h.render(e,n,r,l.match)),c!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[c]===void 0?delete e[h]:e[h]=e[c],s[h]=!0,o.options.alias||delete e[c]}}}return!0};ge.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(c=>{if(c.matches)return a=!0,[]}),l=[e,...i.ancestors];for(let c of n){let h=e[c],f=[...i.path,c];for(let g=0;g<t.$_terms.patterns.length;++g){let v=t.$_terms.patterns[g];if(v.regex){let A=v.regex.test(c);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,A?"pass":"error"),!A)continue}else if(!v.schema.$_match(c,i.nest(v.schema,`pattern.${g}`),s))continue;n.delete(c);let b=i.localize(f,l,{schema:v.rule,key:c}),O=v.rule.$_validate(h,b,s);if(O.errors){if(s.abortEarly)return{value:e,errors:O.errors};r.push(...O.errors)}if(v.matches&&u[g].push(c),e[c]=O.value,!v.fallthrough)break}}if(a)for(let c=0;c<u.length;++c){let h=u[c];if(!h)continue;let f=t.$_terms.patterns[c].matches,g=i.localize(i.path,l,f),v=f.$_validate(h,g,s);if(v.errors){let b=Aq.details(v.errors,{override:!1});b.matches=h;let O=t.$_createError("object.pattern.match",e,b,i,s);if(s.abortEarly)return{value:e,errors:O};r.push(O)}}}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(!un.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),l=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:l};r.push(l)}};ge.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}};ge.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 XA=m((H4,VA)=>{"use strict";var Ub=Ne(),Oq=Bb();VA.exports=Oq.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Ub(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 Ub(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 Ub(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 JA=m((G4,YA)=>{"use strict";var gi=Ne(),Cq=nr(),Rq=nt(),Pq=Cs(),Dq=ci(),mi={};YA.exports=Cq.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}){gi(e.$_terms.link,"Uninitialized link schema");let i=mi.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 mi.generate(t,e,n,r)},rules:{ref:{method(t){gi(!this.$_terms.link,"Cannot reinitialize schema"),t=Pq.ref(t),gi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),gi(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){gi(this.$_terms.link,"Uninitialized link schema"),gi(Rq.isSchema(t),"Invalid schema object"),gi(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 gi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});mi.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}=mi.perspective(s,n);mi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{mi.assert(!1,"to non-existing schema",s,t,n,r)}return mi.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};mi.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}};mi.assert=function(t,e,n,r,i,s){t||gi(!1,`"${Dq.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var ZA=m((K4,QA)=>{"use strict";var Wb=Ne(),Iq=nr(),Hb=nt(),$n={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))))}};QA.exports=Iq.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match($n.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($n.extractSignificantDigits(t)!==$n.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!==$n.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(!Hb.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 Hb.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Hb.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"?$n.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 $n.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 Wb(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($n.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 Wb(["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 Wb(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"}});$n.extractSignificantDigits=function(t){return t.replace($n.exponentialPartRegex,"").replace($n.dotRegex,"").replace($n.trailingZerosRegex,"").replace($n.leadingSignAndZerosRegex,"")};$n.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 t1=m((z4,e1)=>{"use strict";var Mq=Bb();e1.exports=Mq.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Gb=m(Vh=>{"use strict";Vh.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"};Vh.code=function(t){return{code:t,error:Vh.codes[t]}}});var Kb=m(Xh=>{"use strict";var Lq=require("url"),xr=Gb(),Vi={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:Lq.URL||URL};Xh.analyze=function(t,e={}){if(!t)return xr.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return xr.code("DOMAIN_TOO_LONG");if(!!Vi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return xr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Vi.domainControlRx.test(t))return xr.code("DOMAIN_INVALID_CHARS");t=Vi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Vi.minDomainSegments,i=t.split(".");if(i.length<r)return xr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return xr.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 xr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return xr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return xr.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Vi.domainSegmentRx.test(a))return xr.code("DOMAIN_INVALID_CHARS")}else if(!Vi.tldSegmentRx.test(a))return xr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Xh.isValid=function(t,e){return!Xh.analyze(t,e)};Vi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Vi.URL(`http://${t}`).host}catch{return t}}});var n1=m(zb=>{"use strict";var Nq=require("util"),qq=Kb(),Kr=Gb(),mn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(Nq.TextEncoder||TextEncoder)};zb.analyze=function(t,e){return mn.email(t,e)};zb.isValid=function(t,e){return!mn.email(t,e)};mn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return Kr.code("EMPTY_STRING");let n=!mn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return Kr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?Kr.code("MULTIPLE_AT_CHAR"):Kr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return Kr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return Kr.code("ADDRESS_TOO_LONG");if(mn.encoder.encode(i).length>64)return Kr.code("LOCAL_TOO_LONG")}return mn.local(i,n)||qq.analyze(s,e)};mn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return Kr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!mn.atextRx.test(r))return Kr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(mn.atextRx.test(i))continue;let s=mn.binary(i);if(!mn.atomRx.test(s))return Kr.code("INVALID_LOCAL_CHARS")}}};mn.binary=function(t){return Array.from(mn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};mn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;mn.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 Vb=m((J4,r1)=>{"use strict";r1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Yb=m(Xb=>{"use strict";var Yh=Ne(),jq=Vb(),Jt={};Jt.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 l=n+"{1,4}",c="(?:"+l+":"+l+"|"+t.ipv4address+")",h="(?:"+l+":){6}"+c,f="::(?:"+l+":){5}"+c,g="(?:"+l+")?::(?:"+l+":){4}"+c,v="(?:(?:"+l+":){0,1}"+l+")?::(?:"+l+":){3}"+c,b="(?:(?:"+l+":){0,2}"+l+")?::(?:"+l+":){2}"+c,O="(?:(?:"+l+":){0,3}"+l+")?::"+l+":"+c,A="(?:(?:"+l+":){0,4}"+l+")?::"+c,k="(?:(?:"+l+":){0,5}"+l+")?::"+l,S="(?:(?:"+l+":){0,6}"+l+")?::";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="(?:"+h+"|"+f+"|"+g+"|"+v+"|"+b+"|"+O+"|"+A+"|"+k+"|"+S+")",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+")\\]",R="["+r+s+i+"]{1,255}",G="(?:"+N+"|"+t.ipv4address+"|"+R+")",ie="\\d*",ue="(?:"+_+"@)?"+G+"(?::"+ie+")?",K="(?:"+_+"@)?("+G+")(?::"+ie+")?",C=a+"*",M=a+"+",L="["+r+s+i+"@]+",F="",me="(?:\\/"+C+")*",pe="\\/(?:"+M+me+")?",qt=M+me,Tt=L+me,Ue="(?:\\/\\/\\/"+C+me+")";return t.hierPart="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+qt+"|"+Ue+")",t.hierPartCapture="(?:(?:\\/\\/"+K+me+")|"+pe+"|"+qt+")",t.relativeRef="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+Tt+"|"+F+")",t.relativeRefCapture="(?:(?:\\/\\/"+K+me+")|"+pe+"|"+Tt+"|"+F+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Jt.rfc3986=Jt.generate();Xb.ip={v4Cidr:Jt.rfc3986.ipv4Cidr,v6Cidr:Jt.rfc3986.ipv6Cidr,ipv4:Jt.rfc3986.ipv4address,ipv6:Jt.rfc3986.ipv6address,ipvfuture:Jt.rfc3986.ipvFuture};Jt.createRegex=function(t){let e=Jt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Jt.wrap(i+r);let s="";if(t.scheme){Yh(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let l=[].concat(t.scheme);Yh(l.length>=1,"scheme must have at least 1 scheme specified");let c=[];for(let h=0;h<l.length;++h){let f=l[h];Yh(f instanceof RegExp||typeof f=="string","scheme at position "+h+" must be a RegExp or String"),f instanceof RegExp?c.push(f.source.toString()):(Yh(e.schemeRegex.test(f),"scheme at position "+h+" must be a valid scheme"),c.push(jq(f)))}s=c.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Jt.wrap(u+r,s)};Jt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Jt.uriRegex=Jt.createRegex({});Xb.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Jt.createRegex(t):Jt.uriRegex}});var s1=m(i1=>{"use strict";var $o=Ne(),Su=Yb();i1.regex=function(t={}){$o(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";$o(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),$o(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]),$o(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)$o(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),$o(["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 Su.ip[o];let a=`\\/${o==="ipv4"?Su.ip.v4Cidr:Su.ip.v6Cidr}`;return e==="required"?`${Su.ip[o]}${a}`:`${Su.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var u1=m((eK,a1)=>{"use strict";var o1={};o1.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"];a1.exports=new Set(o1.tlds.map(t=>t.toLowerCase()))});var d1=m((tK,f1)=>{"use strict";var He=Ne(),Jh=Kb(),Fq=n1(),h1=s1(),l1=Vb(),c1=u1(),$q=Yb(),Bq=nr(),yn=nt(),Ie={tlds:c1 instanceof Set?{tlds:{allow:c1,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:h1.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"]};f1.exports=Bq.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=Ie.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let l=u.args.limit;if(yn.isResolvable(l)&&(l=l.resolve(t,n,r),!yn.limit(l)))return{value:t,errors:e.$_createError("any.ref",l,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,l)}}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 yn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},He(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),He(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Ie.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return He(["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 yn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},He(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Ie.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Ie.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&yn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Ie.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Jh.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){yn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),He(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Ie.addressOptions(t),n=new RegExp(`\\s*[${t.separator?l1(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)Fq.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){yn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);He(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];He(typeof a=="string","version at position "+o+" must be a string");let u=Ie.guidVersions[a.toLowerCase()];He(u,"version at position "+o+" must be one of "+Object.keys(Ie.guidVersions).join(", ")),He(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}He(Ie.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||Ie.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return yn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},He(typeof t.byteAligned=="boolean","byteAligned must be boolean"),He(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"?Ie.hexRegex.withOptionalPrefix:n.prefix===!0?Ie.hexRegex.withPrefix:Ie.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 Jh.isValid(t,{minDomainSegments:1})||Ie.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){yn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=h1.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 Ie.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Ie.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Ie.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 yn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:yn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Ie.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Ie.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return He(Ie.normalizationForms.includes(t),"normalization form must be one of "+Ie.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={}){He(t instanceof RegExp,"regex must be a RegExp"),He(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),yn.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(l1(t),"g")),He(t instanceof RegExp,"pattern must be a RegExp"),He(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 He(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 He(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){yn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&yn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=$q.regex(t),r=t.domain?Ie.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)&&!Jh.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"}});Ie.addressOptions=function(t){if(!t)return Ie.tlds||t;if(He(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),He(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 He(Ie.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ie.tlds);He(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)}})),He(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),He(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Ie.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(He(Ie.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ie.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),He(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Ie.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Ie.validateTlds=function(t,e){for(let n of t)He(Jh.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Ie.isoDate=function(t){if(!yn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Ie.length=function(t,e,n,r,i){return He(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var g1=m((nK,p1)=>{"use strict";var Qh=Ne(),Uq=nr(),Jb={};Jb.Map=class extends Map{slice(){return new Jb.Map(this)}};p1.exports=Uq.extend({type:"symbol",terms:{map:{init:new Jb.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)),Qh(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Qh(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;Qh(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),Qh(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 b1=m((iK,y1)=>{"use strict";var Wq=Ne(),Hq=nr(),m1=nt();y1.exports=Hq.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 Wq(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 m1.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:m1.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 Lh=m((sK,S1)=>{"use strict";var Ms=Ne(),Gq=pn(),Kq=Eb(),Is=nt(),zq=Cs(),Zb=ci(),Vq=Ab(),v1=Rb(),Qb=hi(),_1=Gi(),T1=Db(),Zh,Lt={types:{alternatives:xA(),any:nr(),array:AA(),boolean:DA(),date:NA(),function:XA(),link:JA(),number:ZA(),object:t1(),string:d1(),symbol:g1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Lt.types.binary=b1());Lt.root=function(){let t={_types:new Set(Object.keys(Lt.types))};for(let e of t._types)t[e]=function(...n){return Ms(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Lt.generate(this,Lt.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,Lt.methods);for(let e in Lt.aliases){let n=Lt.aliases[e];t[e]=t[n]}return t.x=t.expression,T1.setup&&T1.setup(t),t};Lt.methods={ValidationError:Zb.ValidationError,version:Is.version,cache:Kq.provider,assert(t,e,...n){Lt.assert(t,e,!0,n)},attempt(t,e,...n){return Lt.assert(t,e,!1,n)},build(t){return Ms(typeof v1.build=="function","Manifest functionality disabled"),v1.build(this,t)},checkPreferences(t){Is.checkPreferences(t)},compile(t,e){return zq.compile(this,t,e)},defaults(t){Ms(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ms(Is.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Lt.generate(this,r,i)}}return e},expression(...t){return new _1(...t)},extend(...t){Is.verifyFlat(t,"extend"),Zh=Zh||Mh(),Ms(t.length,"You need to provide at least one extension"),this.assert(t,Zh.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,Zh.extension);let r=Lt.expandExtension(n,e);for(let i of r){Ms(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=Vq.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Lt.generate(this,o,a)}}}return e},isError:Zb.ValidationError.isError,isExpression:_1.isTemplate,isRef:Qb.isRef,isSchema:Is.isSchema,in(...t){return Qb.in(...t)},override:Is.symbols.override,ref(...t){return Qb.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Lt.aliases)t[e]=this[e]();return t}};Lt.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,Is.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 Zb.ValidationError||(a=Gq(a)),a.message=i?`${i} ${u}`:u,a};Lt.generate=function(t,e,n){return Ms(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Lt.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};S1.exports=Lt.root()});var k1=m(we=>{"use strict";var Xq=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.descriptionContainerSchema=we.signatureSchema=we.signatureDefinitionContainerSchema=we.signatureDefinitionSchema=we.signatureDefinitionFunctionSchema=we.signatureDefinitionFunctionSchemaArg=we.signatureDefinitionFunctionSchemaArgMultiTypes=we.signatureDefinitionFunctionSchemaArgDefaultNumber=we.signatureDefinitionFunctionSchemaArgDefaultString=we.signatureDefinitionTypeSchema=we.variationsSchema=void 0;var le=Xq(Lh()),ef=ks();we.variationsSchema=le.default.array().items(le.default.alternatives(le.default.string(),le.default.number()));we.signatureDefinitionTypeSchema=le.default.alternatives(le.default.string(),le.default.object({type:le.default.string().required(),keyType:le.default.string().optional(),valueType:le.default.string().optional()}));we.signatureDefinitionFunctionSchemaArgDefaultString=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.String).required(),value:le.default.string().allow("").required()});we.signatureDefinitionFunctionSchemaArgDefaultNumber=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.Number).required(),value:le.default.number().required()});we.signatureDefinitionFunctionSchemaArgMultiTypes=le.default.object({label:le.default.string().required(),types:le.default.array().items(we.signatureDefinitionTypeSchema).required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchemaArg=le.default.object({label:le.default.string().required(),type:we.signatureDefinitionTypeSchema.required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchema=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),arguments:le.default.array().items(le.default.alternatives(we.signatureDefinitionFunctionSchemaArg,we.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:le.default.array().items(we.signatureDefinitionTypeSchema).required(),variations:we.variationsSchema.optional(),returnVariations:we.variationsSchema.optional()});we.signatureDefinitionSchema=le.default.object({type:we.signatureDefinitionTypeSchema.invalid(ef.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),variations:we.variationsSchema.optional()});we.signatureDefinitionContainerSchema=le.default.object().pattern(le.default.string(),le.default.alternatives(we.signatureDefinitionFunctionSchema,we.signatureDefinitionSchema));we.signatureSchema=le.default.object({type:le.default.string().required(),hidden:le.default.boolean().optional(),extends:le.default.string().optional(),definitions:le.default.object().required()});we.descriptionContainerSchema=le.default.object({$meta:le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}).optional()}).pattern(le.default.string(),le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}))});var rv=m(On=>{"use strict";var Bo=On&&On.__assign||function(){return Bo=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},Bo.apply(this,arguments)},Yq=On&&On.__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},Xi=On&&On.__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.")},ev=On&&On.__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},Jq=On&&On.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(On,"__esModule",{value:!0});On.Signature=void 0;var tv=Jq(Lh()),nv=k1(),Qq=ks(),Zq=Dh(),ej=bb(),tj=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){var n,r;tv.default.assert(e,nv.signatureDefinitionContainerSchema);var i={};try{for(var s=Xi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=ev(o.value,2),u=a[0],l=a[1],c=l.type===Qq.SignatureDefinitionBaseType.Function?ej.SignatureDefinitionFunction.parse(l):Zq.SignatureDefinition.parse(l);i[u]=c}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.parseDescriptions=function(e){var n,r,i,s,o;tv.default.assert(e,nv.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var l=e.$meta,c=Yq(e,["$meta"]);u=l,a=c}var h={};try{for(var f=Xi(Object.entries(a)),g=f.next();!g.done;g=f.next()){var v=ev(g.value,2),b=v[0],O=v[1];h[b]={description:O.description,example:(i=O.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return Bo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;tv.default.assert(e,nv.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(s.setDefinition(o),n!=null)try{for(var a=Xi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var l=ev(u.value,2),c=l[0],h=l[1],f=t.parseDescriptions(h);s.addDescriptions(c,f)}}catch(g){r={error:g}}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.setDefinition=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){var n,r,i=Object.keys(e);try{for(var s=Xi(i),o=s.next();!o.done;o=s.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}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,i,s=this._descriptions[e];s==null&&(s={},this._descriptions[e]=s);var o=Object.keys(n);try{for(var a=Xi(o),u=a.next();!u.done;u=a.next()){var l=u.value;s[l]=Bo(Bo({},s[l]),n[l])}}catch(c){r={error:c}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){var e,n,r={},i=Object.keys(this._definitions);try{for(var s=Xi(i),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:r}},t.prototype.copy=function(){var e,n,r,i,s=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=Xi(a),l=u.next();!l.done;l=u.next()){var c=l.value;o[c]=this._definitions[c].copy()}}catch(b){e={error:b}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},f=Object.keys(this._descriptions);try{for(var g=Xi(f),v=g.next();!v.done;v=g.next()){var c=v.value;h[c]=Bo({},h[c])}}catch(b){r={error:b}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}return s._descriptions=h,s._definitions=o,s},t}();On.Signature=tj});var w1=m(Vr=>{"use strict";var Yi=Vr&&Vr.__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},Uo=Vr&&Vr.__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))},ku=Vr&&Vr.__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(Vr,"__esModule",{value:!0});Vr.Container=void 0;var zr=rv(),xt=ks(),nj=function(){function t(){this._primitives=new Map([[xt.SignatureDefinitionBaseType.Any,new zr.Signature({type:xt.SignatureDefinitionBaseType.Any})],[xt.SignatureDefinitionBaseType.General,new zr.Signature({type:xt.SignatureDefinitionBaseType.General})],[xt.SignatureDefinitionBaseType.String,new zr.Signature({type:xt.SignatureDefinitionBaseType.String})],[xt.SignatureDefinitionBaseType.Function,new zr.Signature({type:xt.SignatureDefinitionBaseType.Function})],[xt.SignatureDefinitionBaseType.Number,new zr.Signature({type:xt.SignatureDefinitionBaseType.Number})],[xt.SignatureDefinitionBaseType.List,new zr.Signature({type:xt.SignatureDefinitionBaseType.List})],[xt.SignatureDefinitionBaseType.Map,new zr.Signature({type:xt.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 zr.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.getAllVisibleTypes=function(){var e=this;return Uo(Uo([],Yi(this._primitives.keys()),!1),Yi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==xt.SignatureDefinitionBaseType.Any&&n!==xt.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 Uo(Uo([],Yi(this.getAllPrimitiveSignatures()),!1),Yi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Uo(Uo([],Yi(this.getAllPrimitiveSignatures()),!1),Yi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=zr.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){var r,i,s={},o=Object.keys(n);try{for(var a=ku(o),u=a.next();!u.done;u=a.next()){var l=u.value,c=zr.Signature.parseDescriptions(n[l]);s[l]=c}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,s),this},t.prototype.addMeta=function(e,n){var r,i,s=Object.keys(n);try{for(var o=ku(s),a=o.next();!a.done;a=o.next()){var u=a.value,l=this.getOrCreateTypeSignature(u);l.addDescriptions(e,n[u])}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}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(xt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var l=ku(o),c=l.next();!c.done;c=l.next()){var h=c.value;if(!this._excludeFromSearch.has(h)){for(var f=h,g=this.getTypeSignature(h),v=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(v=g.getDefinition(n,r)),v===null);)f=g.getExtendedType(),g=this.getTypeSignature(f);v!==null&&u.set(f,v)}}}catch(b){i={error:b}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}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(xt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(xt.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(xt.SignatureDefinitionBaseType.Any)?s.get(xt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=ku(this._primitives),a=o.next();!a.done;a=o.next()){var u=Yi(a.value,2),l=u[0],c=u[1];s._primitives.set(l,c.copy())}}catch(v){e={error:v}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=ku(this._types),f=h.next();!f.done;f=h.next()){var g=Yi(f.value,2),l=g[0],c=g[1];s._types.set(l,c.copy())}}catch(v){r={error:v}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Vr.Container=nj});var E1=m(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0})});var sr=m(vt=>{"use strict";var rj=vt&&vt.__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]}),A1=vt&&vt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rj(e,t,n)};Object.defineProperty(vt,"__esModule",{value:!0});vt.VariationRegistry=vt.Container=vt.Signature=vt.SignatureDefinition=vt.SignatureDefinitionTypeMeta=vt.SignatureDefinitionFunction=vt.SignatureDefinitionFunctionArg=void 0;var ij=yb();Object.defineProperty(vt,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return ij.SignatureDefinitionFunctionArg}});var sj=bb();Object.defineProperty(vt,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return sj.SignatureDefinitionFunction}});var oj=du();Object.defineProperty(vt,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return oj.SignatureDefinitionTypeMeta}});var aj=Dh();Object.defineProperty(vt,"SignatureDefinition",{enumerable:!0,get:function(){return aj.SignatureDefinition}});var uj=rv();Object.defineProperty(vt,"Signature",{enumerable:!0,get:function(){return uj.Signature}});var lj=w1();Object.defineProperty(vt,"Container",{enumerable:!0,get:function(){return lj.Container}});var cj=Ph();Object.defineProperty(vt,"VariationRegistry",{enumerable:!0,get:function(){return cj.VariationRegistry}});A1(E1(),vt);A1(ks(),vt)});var iv=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.enrichWithMetaInformation=Ls.FunctionBlockTag=void 0;var hj=mb(),O1=sr();function C1(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var wu;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(wu=Ls.FunctionBlockTag||(Ls.FunctionBlockTag={}));function fj(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===wu.Description).map(C1)].join(`
|
103
|
+
[${u}] ${this.details[a].message}`}return o=o+r,o};As.safeStringify=function(t,e){return JSON.stringify(t,As.serializer(),e)};As.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[As.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 ci=m(Rt=>{"use strict";var MN=jE(),LN=nt(),NN=Gi();Rt.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=Rt.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 Rt.template(this.value,t,e||this.code,this.state,this.prefs)}};Rt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Rt.template=function(t,e,n,r,i){if(!e)return;if(NN.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(LN.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["*"]};Rt.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=Rt.path(i);return s||Rt.template(null,n.messages,"root",e,n)||r&&Rt.template(null,r,"root",e,n)||"value"};Rt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Rt.details(t);if(r)return r;if(n.errors.stack)return new Rt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Rt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Rt.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}};Rt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Rt.ValidationError}};Rt.ValidationError.prototype.isJoi=!0;Rt.ValidationError.prototype.name="ValidationError";Rt.ValidationError.prototype.annotate=MN.error});var hi=m(er=>{"use strict";var Qn=Ne(),qN=pn(),jN=Es(),mu=nt(),kb,Zn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};er.create=function(t,e={}){Qn(typeof t=="string","Invalid reference key:",t),mu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Qn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Zn.defaults,e);delete n.prefix;let r=n.separator,i=Zn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Qn(!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)Qn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Zn.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 Zn.Ref(n)};er.in=function(t,e={}){return er.create(t,{...e,in:!0})};er.isRef=function(t){return t?!!t[mu.symbols.ref]:!1};Zn.Ref=class{constructor(t){Qn(typeof t=="object","Invalid reference construction"),mu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Qn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Qn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Qn(!t.map||Array.isArray(t.map),"options.map must be an array"),Qn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Zn.defaults,t),Qn(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 Qn(!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):(Qn(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=jN(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 Zn.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||""}`}};Zn.Ref.prototype[mu.symbols.ref]=!0;er.build=function(t){return t=Object.assign({},Zn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Zn.Ref(t)};Zn.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"}};Zn.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]};er.toSibling=0;er.toParent=1;er.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?er.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(mu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}er.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),kb=kb||Gi(),kb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new er.Manager;return t.refs=qN(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Gi=m((UE,WE)=>{"use strict";var Nh=Ne(),FN=pn(),$N=LE(),BN=NE(),$E=nt(),FE=ci(),BE=hi(),He={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}};WE.exports=UE=He.Template=class{constructor(t,e){if(Nh(typeof t=="string","Template source must be a string"),Nh(!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?FN(r):void 0,this._functions=n,this._functions&&(Nh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Nh(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=He.encode(this.source),e=He.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(`{${He.decode(s)}`);continue}let l=s.slice(o?0:1,u),c=l[0]===":";c&&(l=l.slice(1));let h=this._ref(He.decode(l),{raw:o,wrapped:c});r.push(h),typeof h!="string"&&(n=!0);let f=s.slice(u+a.length);f&&r.push(He.decode(f))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return He.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 He.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[$E.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=He.stringify(a,t,e,n,r,i);if(u!==void 0){let l=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:$N(u);s.push(He.wrap(l,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=BE.create(o,this._settings);return r.push(a),u=>{let l=a.resolve(...u);return l!==void 0?l:null}};try{let o=this._functions?{...He.functions,...this._functions}:He.functions;var s=new BN.Parser(t,{reference:i,functions:o,constants:He.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 He.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};He.Template.prototype[$E.symbols.template]=!0;He.Template.prototype.isImmutable=!0;He.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>He.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>He.closes.slice(0,n.length))};He.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};He.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};He.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};He.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(BE.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 He.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 He.Template.date(t,r);if(t instanceof Map){let c=[];for(let[h,f]of t.entries())c.push(`${h.toString()} -> ${f.toString()}`);t=c}if(!Array.isArray(t))return t.toString();let l=[];for(let c of t)l.push(He.stringify(c,e,n,r,i,{arrayItems:!0,...s}));return He.wrap(l.join(", "),!u&&a.array)};He.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};He.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=FE.template(e,o[0],t,n,r)||FE.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 Lo=m(yu=>{"use strict";var Os=Ne(),HE=pn(),jn=Gi();yu.compile=function(t,e){if(typeof t=="string")return Os(!e,"Cannot set single message string"),new jn(t);if(jn.isTemplate(t))return Os(!e,"Cannot set single message template"),t;Os(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?HE(e):{};for(let n in t){let r=t[n];if(n==="root"||jn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new jn(r);continue}Os(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"||jn.isTemplate(s)){e[i][n]=s;continue}Os(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new jn(s)}}return e};yu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(jn.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};yu.merge=function(t,e){if(!t)return yu.compile(e);if(!e)return t;if(typeof e=="string")return new jn(e);if(jn.isTemplate(e))return e;let n=HE(t);for(let r in e){let i=e[r];if(r==="root"||jn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new jn(i);continue}Os(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"||jn.isTemplate(o)){n[s][r]=o;continue}Os(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new jn(o)}}return n}});var nt=m(rt=>{"use strict";var qh=Ne(),UN=vb(),WN=IE(),wb,xb,HN={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)?)?)?)?$/};rt.version=WN.version;rt.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};rt.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")};rt.assertOptions=function(t,e,n="Options"){qh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));qh(r.length===0,`${n} contain unknown keys: ${r}`)};rt.checkPreferences=function(t){xb=xb||Mh();let e=xb.preferences.validate(t);if(e.error)throw new UN([e.error.details[0].message])};rt.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}};rt.default=function(t,e){return t===void 0?e:t};rt.isIsoDate=function(t){return HN.isoDate.test(t)};rt.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};rt.isResolvable=function(t){return t?t[rt.symbols.ref]||t[rt.symbols.template]:!1};rt.isSchema=function(t,e={}){let n=t&&t[rt.symbols.any];return n?(qh(e.legacy||n.version===rt.version,"Cannot mix different versions of joi schemas"),!0):!1};rt.isValues=function(t){return t[rt.symbols.values]};rt.limit=function(t){return Number.isSafeInteger(t)&&t>=0};rt.preferences=function(t,e){wb=wb||Lo(),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=wb.compile(e.messages,t.messages)),delete n[rt.symbols.prefs],n};rt.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}};rt.validateArg=function(t,e,{assert:n,message:r}){if(rt.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};rt.verifyFlat=function(t,e){for(let n of t)qh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Eb=m(GE=>{"use strict";var GN=Ne(),zN=pn(),KN=nt(),No={max:1e3,supported:new Set(["undefined","boolean","number","string"])};GE.provider={provision(t){return new No.Cache(t)}};No.Cache=class{constructor(t={}){KN.assertOptions(t,["max"]),GN(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||No.max,this._map=new Map,this._list=new No.List}get length(){return this._map.size}set(t,e){if(t!==null&&!No.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),zN(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};No.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 Cs=m(fi=>{"use strict";var bt=Ne(),Fn=nt(),qo=hi(),tr={};fi.schema=function(t,e,n={}){Fn.assertOptions(n,["appendPath","override"]);try{return tr.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};tr.schema=function(t,e,n){bt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(bt(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(tr.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(bt(typeof e=="object","Invalid schema content:",typeof e),Fn.isResolvable(e))return r(t,e);if(Fn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!tr.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):(bt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};fi.ref=function(t,e){return qo.isRef(t)?t:qo.create(t,e)};fi.compile=function(t,e,n={}){Fn.assertOptions(n,["legacy"]);let r=e&&e[Fn.symbols.any];if(r)return bt(n.legacy||r.version===Fn.version,"Cannot mix different versions of joi schemas:",r.version,Fn.version),e;if(typeof e!="object"||!n.legacy)return fi.schema(t,e,{appendPath:!0});let i=tr.walk(e);return i?i.compile(i.root,e):fi.schema(t,e,{appendPath:!0})};tr.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=tr.walk(n);if(r)return r}return null}let e=t[Fn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};bt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=tr.walk(t[n]);if(r)return r}return null};tr.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};fi.when=function(t,e,n){if(n===void 0&&(bt(e&&typeof e=="object","Missing options"),n=e,e=qo.create(".")),Array.isArray(n)&&(n={switch:n}),Fn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Fn.isSchema(e))return bt(n.is===void 0,'"is" can not be used with a schema condition'),bt(n.not===void 0,'"not" can not be used with a schema condition'),bt(n.switch===void 0,'"switch" can not be used with a schema condition'),tr.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(bt(qo.isRef(e)||typeof e=="string","Invalid condition:",e),bt(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 bt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),bt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!qo.isRef(n.is)&&!Fn.isSchema(n.is)&&(s=s.required()),tr.condition(t,{ref:fi.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}bt(Array.isArray(n.switch),'"switch" must be an array'),bt(n.is===void 0,'Cannot combine "switch" with "is"'),bt(n.not===void 0,'Cannot combine "switch" with "not"'),bt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:fi.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;Fn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),bt(s.is!==void 0,'Switch statement missing "is"'),bt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!qo.isRef(s.is)&&!Fn.isSchema(s.is)&&(a.is=a.is.required()),o){bt(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&&(bt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};tr.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 Ab=m(KE=>{"use strict";var zi=Ne(),VN=pn(),zE=nt(),XN=Lo(),Br={};KE.type=function(t,e){let n=Object.getPrototypeOf(t),r=VN(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=XN.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 h in s.terms){let f=s.terms[h];zi(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=f.init,a[h]=f}s.terms=a,s.args||(s.args=o.args),s.prepare=Br.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=Br.coerce(s.coerce,o.coerce),s.validate=Br.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let f=s.rules[h];zi(typeof f=="object","Invalid rule definition for",s.type,h);let g=f.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(zi(!r[h],"Rule conflict in",s.type,h),r[h]=g),zi(!u[h],"Rule conflict in",s.type,h),u[h]=f,f.alias){let v=[].concat(f.alias);for(let b of v)r[b]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(v=>(typeof v=="string"&&(v={name:v}),zi(!f.argsByName.has(v.name),"Duplicated argument name",v.name),zE.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),f.argsByName.set(v.name,v),v)))}s.rules=u;let l=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){zi(!r[h],"Rule conflict in",s.type,h);let f=s.modifiers[h];zi(typeof f=="function","Invalid modifier definition for",s.type,h);let g=function(v){return this.rule({[h]:v})};r[h]=g,l[h]=f}if(s.modifiers=l,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)zi(n[h],"Cannot override missing",h),s.overrides[h][zE.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let c=Object.assign({},o.manifest,s.manifest);return c.build=Br.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=c,s.rebuild=Br.rebuild(s.rebuild,o.rebuild),i};Br.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Br.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}}};Br.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}};Br.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Br.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 Rb=m(Cb=>{"use strict";var Ur=Ne(),jh=pn(),Rs=nt(),YN=Lo(),VE=hi(),JN=Gi(),Ob,gn={};Cb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=gn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=jh(t._preferences,{shallow:["messages"]}),delete n.preferences[Rs.symbols.prefs],n.preferences.messages&&(n.preferences.messages=YN.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]=gn.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]=gn.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;Ur(!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(Rs.isValues(i)){n[r]=i.describe();continue}Ur(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(gn.describe(u));if(o){let{from:u,to:l}=s.mapped;n[r]={};for(let c of a)n[r][c[l]]=c[u];continue}if(s==="single"){Ur(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return gn.validate(t.$_root,n),n};gn.describe=function(t,e={}){if(Array.isArray(t))return t.map(gn.describe);if(t===Rs.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return jh(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[Rs.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]=gn.describe(i,{assign:r}))}return n};Cb.build=function(t,e){return new gn.Builder(t).parse(e)};gn.Builder=class{constructor(t){this.joi=t}parse(t){gn.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;Ur(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){Ur(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let c in i.args)a[c]=this.build(i.args[c],{assign:c});let u=Object.keys(a),l=n.rules[i.name].args;if(l){Ur(u.length<=l.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",l.length,", found",u.length,")");for(let{name:c}of l)s.push(a[c])}else Ur(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;Ur(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 jh(t);if(e.assign==="regex")return gn.regex(t);if(e.assign==="ref")return VE.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Ur(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Rs.symbols.literal]:!0,literal:t.function};if(t.override)return Rs.symbols.override;if(t.ref)return VE.build(t.ref);if(t.regex)return gn.regex(t.regex);if(t.special)return Ur(["deep"].includes(t.special),"Unknown special value",t.special),Rs.symbols.deepDefault;if(t.value)return jh(t.value)}if(t.type)return this.parse(t);if(t.template)return JN.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};gn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};gn.validate=function(t,e){Ob=Ob||Mh(),t.assert(e,Ob.description)}});var bu=m((g4,XE)=>{"use strict";var Wr=Tb(),on={mismatched:null};XE.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!on.isDeepEqual(t,e,n,[])};on.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=on.getSharedType(t,e,!!n.prototype);switch(s){case Wr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Wr.promise:return t===e;case Wr.regex:return t.toString()===e.toString();case on.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new on.SeenEntry(t,e));try{return!!on.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};on.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?on.mismatched:Wr.getInternalProto(t);let r=Wr.getInternalProto(t);return r!==Wr.getInternalProto(e)?on.mismatched:r};on.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};on.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};on.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};on.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=on,{keys:u,getOwnPropertySymbols:l}=Object;if(t===Wr.array)if(r.part){for(let v of e)for(let b of n)if(s(v,b,r,i))return!0}else{if(e.length!==n.length)return!1;for(let v=0;v<e.length;++v)if(!s(e[v],n[v],r,i))return!1;return!0}else if(t===Wr.set){if(e.size!==n.size)return!1;if(!on.isSetSimpleEqual(e,n)){let v=new Set(Set.prototype.values.call(n));for(let b of Set.prototype.values.call(e)){if(v.delete(b))continue;let O=!1;for(let A of v)if(s(b,A,r,i)){v.delete(A),O=!0;break}if(!O)return!1}}}else if(t===Wr.map){if(e.size!==n.size)return!1;for(let[v,b]of Map.prototype.entries.call(e))if(b===void 0&&!Map.prototype.has.call(n,v)||!s(b,Map.prototype.get.call(n,v),r,i))return!1}else if(t===Wr.error&&(e.name!==n.name||e.message!==n.message))return!1;let c=o(e),h=o(n);if((e!==c||n!==h)&&!s(c,h,r,i))return!1;let f=u(e);if(!r.part&&f.length!==u(n).length&&!r.skip)return!1;let g=0;for(let v of f){if(r.skip&&r.skip.includes(v)){n[v]===void 0&&++g;continue}if(!a(n,v)||!s(e[v],n[v],r,i))return!1}if(!r.part&&f.length-g!==u(n).length)return!1;if(r.symbols!==!1){let v=l(e),b=new Set(l(n));for(let O of v){if(!r.skip||!r.skip.includes(O)){if(a(e,O)){if(!a(n,O)||!s(e[O],n[O],r,i))return!1}else if(a(n,O))return!1}b.delete(O)}for(let O of b)if(a(n,O))return!1}return!0};on.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var JE=m(YE=>{"use strict";YE.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 Db=m(Pb=>{"use strict";var QE=bu(),ZE=JE(),QN=ci(),an={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Pb.setup=function(t){let e=function(){return t._tracer=t._tracer||new an.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Pb.location=function(t){return t.$_setFlag("_tracerLocation",ZE.location(2))};an.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 an.Store(t),{filename:r,line:i}=t._flags._tracerLocation||ZE.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(an.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let c of["valid","invalid"]){let h=a[`_${c}s`];if(!h)continue;let f=new Set(h._values),g=new Set(h._refs);for(let{value:v,ref:b}of u[c])f.delete(v),g.delete(b);(f.size||g.size)&&s.push({status:[...f,...[...g].map(v=>v.display)],rule:`${c}s`})}let l=a._rules.map(c=>c.name);for(let c of["default","failover"])a._flags[c]!==void 0&&l.push(c);for(let c of l){let h=an.labels[u.rule[c]||0];if(h){let f={rule:c,status:h};u.paths.size&&(f.paths=[...u.paths]),s.push(f)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(an.message).join(", ")}`})}return e.length?e:null}};an.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){an.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){an.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){an.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]|=an.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||QE(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=an.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};an.message=function(t){return`${t.paths?QN.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};an.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)};an.sub=function(t,e){for(let n of t)for(let r of e)if(QE(n.slice(0,r.length),r))return!0;return!1};an.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Fh=m((T4,nA)=>{"use strict";var Ib=Ne(),eA=pn(),ZN=Sb(),tA={};nA.exports=tA.merge=function(t,e,n){if(Ib(t&&typeof t=="object","Invalid target value: must be an object"),Ib(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)){Ib(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(eA(e[i],{symbols:n.symbols}));return t}let r=ZN.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]=eA(o,{symbols:n.symbols}):tA.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var rA=m($h=>{"use strict";var di=Ne(),Mb=nt(),eq=hi(),Hr={};$h.Ids=Hr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Hr.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())di(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())di(!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)};di(Mb.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Hr.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);di(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||!Mb.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);di(!r||r.schema===t,"Cannot add different schemas with the same id:",n),di(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(di(!this._byKey.has(e),"Schema already contains key:",e),di(!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);di(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)}};Hr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=$h.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};$h.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Hr.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=Hr.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=Hr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Hr.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,l=Hr.scan(t[a],e,n,[a,...s],u);l!==void 0&&(o=o||t.slice(),o[a]=l)}return o}if(n.schema!==!1&&Mb.isSchema(t)||n.ref!==!1&&eq.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=Hr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var sA=m((w4,iA)=>{"use strict";iA.exports=function(){}});var uA=m((x4,aA)=>{"use strict";var tq=pn(),oA=Es(),nq=nt(),Gr={value:Symbol("value")};aA.exports=Gr.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 Gr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Gr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Gr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Gr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Gr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=tq(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()}};Gr.schemas=function(t){return nq.isSchema(t)?{schema:t}:t};Gr.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[Gr.value]=e}get(t){let e=this.node(t);if(e)return e[Gr.value]}node(t){if(this._values)return oA(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=oA(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var cA=m(_u=>{"use strict";var vu=Ne(),lA=pn(),jo=sA(),rq=Es(),Mt=nt(),Ki=ci(),iq=uA(),ke={result:Symbol("result")};_u.entry=function(t,e,n){let r=Mt.defaults;n&&(vu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),vu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Mt.preferences(Mt.defaults,n));let i=ke.entry(t,e,r);vu(!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=Ki.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};_u.entryAsync=async function(t,e,n){let r=Mt.defaults;n&&(r=Mt.preferences(Mt.defaults,n));let i=ke.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 l of s.externals){let c=l.state.path,h=l.schema.type==="link"?s.links.get(l.schema):null,f=a,g,v,b=c.length?[a]:[],O=c.length?rq(t,c):t;if(c.length){g=c[c.length-1];let A=a;for(let k of c.slice(0,-1))A=A[k],b.unshift(A);v=b[0],f=v[g]}try{let A=(S,_)=>(h||l.schema).$_createError(S,f,_,l.state,r),k=await l.method(f,{schema:l.schema,linked:h,state:l.state,prefs:n,original:O,error:A,errorsArray:ke.errorsArray,warn:(S,_)=>s.warnings.push((h||l.schema).$_createError(S,f,_,l.state,r)),message:(S,_)=>(h||l.schema).$_createError("external",f,_,l.state,r,{messages:S})});if(k===void 0||k===f)continue;if(k instanceof Ki.Report){if(s.tracer.log(l.schema,l.state,"rule","external","error"),u.push(k),r.abortEarly)break;continue}if(Array.isArray(k)&&k[Mt.symbols.errors]){if(s.tracer.log(l.schema,l.state,"rule","external","error"),u.push(...k),r.abortEarly)break;continue}v?(s.tracer.value(l.state,"rule",f,k,"external"),v[g]=k):(s.tracer.value(l.state,"rule",a,k,"external"),a=k)}catch(A){throw r.errors.label&&(A.message+=` (${l.label})`),A}}if(i.value=a,u.length)throw i.error=Ki.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=Ki.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ke.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()}};ke.entry=function(t,e,n){let{tracer:r,cleanup:i}=ke.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ke.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,l=new iq([],[],{mainstay:a,schemas:u}),c=_u.validate(t,e,l,n);i&&e.$_root.untrace();let h=Ki.process(c.errors,t,n);return{value:c.value,error:h,mainstay:a}};ke.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(vu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ke.ignore}};_u.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ke.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,f,g)=>e.$_createError(h,t,f,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ke.errorsArray,warn:(h,f,g)=>n.mainstay.warnings.push(s(h,f,g)),message:(h,f)=>e.$_createError("custom",t,f,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return ke.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(ke.trim(t,e),n.nest(u),Mt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let l=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(l==="forbidden")return ke.finalize(t,null,o);if(l==="required")return ke.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(l==="optional"){if(e._flags.default!==Mt.symbols.deepDefault)return ke.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(l==="forbidden")return ke.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let c=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),ke.finalize(t,null,o);if(e._flags.only){let f=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let f=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ke.finalize(t,[f],o);c.push(f)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return c.push(h.errors),ke.finalize(t,c,o);if(h.errors.length)return c.push(...h.errors),ke.finalize(t,c,o)}}return e._rules.length?ke.rules(t,c,o):ke.finalize(t,c,o)};ke.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,l=o.args;if(o._resolve.length){l=Object.assign({},l);for(let h of o._resolve){let f=a.argsByName.get(h),g=l[h].resolve(t,i,s),v=f.normalize?f.normalize(g):g,b=Mt.validateArg(v,null,f);if(b){u=r.$_createError("any.ref",g,{arg:h,ref:l[h],reason:b},i,s);break}l[h]=v}}u=u||a.validate(t,n,l,o);let c=ke.rule(u,o);if(c.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...c.errors);continue}if(s.abortEarly)return ke.finalize(t,c.errors,n);e.push(...c.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,c.value,o.name),t=c.value}return ke.finalize(t,e,n)};ke.rule=function(t,e){return t instanceof Ki.Report?(ke.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Mt.symbols.errors]?(t.forEach(n=>ke.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ke.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ke.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ke.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)vu(a instanceof Error||a instanceof Ki.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ke.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:Ki.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};ke.prefs=function(t,e){let n=e===Mt.defaults;return n&&t._preferences[Mt.symbols.prefs]?t._preferences[Mt.symbols.prefs]:(e=Mt.preferences(e,t._preferences),n&&(t._preferences[Mt.symbols.prefs]=e),e)};ke.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?[lA(s.ancestors[0]),r]:[];try{return a(...u)}catch(l){n.push(i.$_createError(`any.${t}`,null,{error:l},s,o));return}}return typeof a!="object"?a:a[Mt.symbols.literal]?a.literal:Mt.isResolvable(a)?a.resolve(e,s,o):lA(a)};ke.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ke.ignore={active:!1,debug:jo,entry:jo,filter:jo,log:jo,resolve:jo,value:jo};ke.errorsArray=function(){let t=[];return t[Mt.symbols.errors]=!0,t}});var Nb=m((R4,fA)=>{"use strict";var sq=Ne(),hA=bu(),Lb=nt(),pi={};fA.exports=pi.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=pi.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Lb.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 pi.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(Lb.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(hA(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(hA(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 pi.Values(this._values,this._refs);return t._override=this._override,t}concat(t){sq(!t._override,"Cannot concat override set of values");let e=new pi.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}};pi.Values.prototype[Lb.symbols.values]=!0;pi.Values.prototype.slice=pi.Values.prototype.clone;pi.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 _A=m((D4,vA)=>{"use strict";var ne=Ne(),dA=pn(),pA=bu(),qb=Fh(),oq=Eb(),xt=nt(),jb=Cs(),aq=ci(),uq=Ab(),gA=Rb(),lq=Lo(),mA=rA(),yA=hi(),bA=Db(),Bh=cA(),Uh=Nb(),Bt={};Bt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new mA.Ids,this._preferences=null,this._refs=new yA.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 ne(typeof gA.describe=="function","Manifest functionality disabled"),gA.describe(this)}allow(...t){return xt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){ne(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),ne(!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];ne(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 ne(t!==void 0,"Artifact cannot be undefined"),ne(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return ne(t===!1||typeof t=="string","Invalid to value"),ne(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 ne(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 ne(t,"Missing error"),ne(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return ne(t!==void 0,"Missing example"),xt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(ne(!e,"Cannot combine options with description"),e=t.description,t=t.method),ne(typeof t=="function","Method must be a function"),ne(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?(ne(typeof t=="string","id must be a non-empty string"),ne(/^[^\.]+$/.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 ne(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return ne(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){ne(t.length,"Missing notes");for(let e of t)ne(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return ne(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){ne(t,"Missing preferences"),ne(t.context===void 0,"Cannot override context"),ne(t.externals===void 0,"Cannot override externals"),ne(t.warnings===void 0,"Cannot override warnings"),ne(t.debug===void 0,"Cannot override debug"),xt.checkPreferences(t);let e=this.clone();return e._preferences=xt.preferences(e._preferences,t),e}presence(t){return ne(["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 ne(["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=xt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){ne(t.length,"Missing tags");for(let e of t)ne(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return ne(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){xt.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=jb.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)ne(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),ne(!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){ne(!this._inRuleset(),"Cannot set caching inside a ruleset"),ne(!this._cache,"Cannot override schema cache"),ne(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||oq.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){ne(xt.isSchema(t),"Invalid schema object"),ne(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),ne(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),ne(!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,yA.toSibling),e._preferences=e._preferences?xt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Uh.merge(e._valids,t._valids,t._invalids),e._invalids=Uh.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,qb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,qb(e._flags,n)}else qb(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 ne(!t.base,"Cannot extend type with another base"),uq.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){ne(!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;xt.assertOptions(t,Object.keys(e.modifiers)),ne(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;ne(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=dA(s);for(let a in t)e.modifiers[a](o,t[a]),ne(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(){ne(!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),ne(!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),ne(xt.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 bA.location?bA.location(this):this}validate(t,e){return Bh.entry(t,this,e)}validateAsync(t,e){return Bh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),ne(t&&typeof t=="object","Invalid options"),ne(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)ne(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;ne(n,"Unknown rule",e.method);let i=this.clone();if(r){ne(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&&xt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=xt.validateArg(o,s,a);ne(!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 jb.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?lq.merge(this._definition.messages,s.messages):this._definition.messages;return new aq.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=!Bh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return xt.assertOptions(t,["each","once","ref","schema"]),mA.schema(this,t)||this}$_mutateRebuild(){ne(!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={}){ne(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(pA(e,r.default)&&(e=void 0),pA(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][xt.symbols.parent].call(this,...e)}$_validate(t,e,n){return Bh.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=dA(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 xt.assertOptions(n,"literal"),ne(e!==void 0,"Missing",t,"value"),ne(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[xt.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 l=u.ref?u.ref.resolve(t,e,n):t,c=u.is?[u]:u.switch,h=i.length;for(let f=0;f<c.length;++f){let{is:g,then:v,otherwise:b}=c[f],O=`${a}${u.switch?"."+f:""}`;if(g.$_match(l,e.nest(g,`${O}.is`),n)){if(v){let A=e.localize([...e.path,`${O}.then`],e.ancestors,e.schemas),{schema:k,id:S}=v._generate(t,A,n);r.push(k),i.push(`${O}.then${S?`(${S})`:""}`);break}}else if(b){let A=e.localize([...e.path,`${O}.otherwise`],e.ancestors,e.schemas),{schema:k,id:S}=b._generate(t,A,n);r.push(k),i.push(`${O}.otherwise${S?`(${S})`:""}`);break}}if(u.break&&i.length>h)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={}){ne(!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){xt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===xt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Uh:r&&(n[e]=t.length?new Uh:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){ne(i!==void 0,"Cannot call allow/valid/invalid with undefined"),ne(i!==xt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(ne(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}};Bt.Base.prototype[xt.symbols.any]={version:xt.version,compile:jb.compile,root:"$_root"};Bt.Base.prototype.isImmutable=!0;Bt.Base.prototype.deny=Bt.Base.prototype.invalid;Bt.Base.prototype.disallow=Bt.Base.prototype.invalid;Bt.Base.prototype.equal=Bt.Base.prototype.valid;Bt.Base.prototype.exist=Bt.Base.prototype.required;Bt.Base.prototype.not=Bt.Base.prototype.invalid;Bt.Base.prototype.options=Bt.Base.prototype.prefs;Bt.Base.prototype.preferences=Bt.Base.prototype.prefs;vA.exports=new Bt.Base});var nr=m((M4,TA)=>{"use strict";var Wh=Ne(),cq=_A(),hq=nt(),fq=Lo();TA.exports=cq.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 Wh(typeof t=="function","Method must be a function"),Wh(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){Wh(hq.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 Wh(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=fq.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:l,concat:c}=i;c?t=t.concat(c):s?t=t.when(s,{is:o,not:a,then:u,otherwise:l,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:l,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 wA=m((L4,kA)=>{"use strict";var Ps=Ne(),dq=Fh(),pq=nr(),SA=nt(),gq=Cs(),Hh=ci(),mq=hi(),Fo={};kA.exports=pq.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:mq.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 c=0;c<n.$_terms.matches.length;++c){let h=n.$_terms.matches[c],f=i.nest(h.schema,`match.${c}`);f.snapshot();let g=h.schema.$_validate(t,f,s);g.errors?(u.push(g.errors),f.restore()):(a.push(g.value),f.commit())}if(a.length===0){let c={details:u.map(h=>Hh.details(h,{override:!1}))};return{errors:r("alternatives.any",c)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let c={details:u.map(h=>Hh.details(h,{override:!1}))};return{errors:r("alternatives.all",c)}}let l=c=>c.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&l(h.schema));return l(n)?{value:a.reduce((c,h)=>dq(c,h,{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 h=i.nest(u.schema,`match.${a}`);h.snapshot();let f=u.schema.$_validate(t,h,s);if(!f.errors)return h.commit(),f;h.restore(),o.push({schema:u.schema,reports:f.errors});continue}let l=u.ref?u.ref.resolve(t,i,s):t,c=u.is?[u]:u.switch;for(let h=0;h<c.length;++h){let f=c[h],{is:g,then:v,otherwise:b}=f,O=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(l,i.nest(g,`${O}.is`),s)){if(v)return v.$_validate(t,i.nest(v,`${O}.then`),s)}else if(b)return b.$_validate(t,i.nest(b,`${O}.otherwise`),s)}}return Fo.errors(o,e)},rules:{conditional:{method(t,e){Ps(!this._flags._endedSwitch,"Unreachable condition"),Ps(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ps(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=gq.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(Ps(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ps(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ps(t.length,"Missing alternative schemas"),SA.verifyFlat(t,"try"),Ps(!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=>{SA.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}}"}});Fo.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 Fo.unmatched(t,e);let a=s[0];if(!(a instanceof Hh.Report))return Fo.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 c of a.local.valids)r.add(c);continue}let[u,l]=a.code.split(".");l!=="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}:Fo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Fo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Hh.details(n,{override:!1}))}}});var EA=m((N4,xA)=>{"use strict";var Tu=Ne(),yq=bu(),bq=Es(),vq=nr(),rr=nt(),_q=Cs(),ht={};xA.exports=vq.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 ht.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[rr.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){rr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=rr.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],l=!t[rr.symbols.arraySingle];delete t[rr.symbols.arraySingle];let c=s(),h=t.length;for(let f=0;f<h;++f){let g=t[f],v=!1,b=!1,O=l?f:new Number(f),A=[...r.path,O];if(!e._flags.sparse&&g===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly)return c;a.shift();continue}let k=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(A,k,R),i,{presence:"ignore"})){if(c.push(n("array.excludes",{pos:f,value:g},r.localize(A))),i.abortEarly)return c;v=!0,a.shift();break}if(v)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),G=R.$_validate(g,r.localize(A,k,R),i);if(G.errors){if(c.push(...G.errors),i.abortEarly)return c}else if(R._flags.result==="strip")ht.fastSplice(t,f),--f,--h;else if(!e._flags.sparse&&G.value===void 0){if(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly)return c;continue}else t[f]=G.value;continue}else if(!e.$_terms.items.length){if(c.push(n("array.orderedLength",{pos:f,limit:e.$_terms.ordered.length})),i.abortEarly)return c;break}}let S=[],_=o.length;for(let R=0;R<_;++R){let G=r.localize(A,k,o[R]);G.snapshot();let ie=o[R].$_validate(g,G,i);if(S[R]=ie,!ie.errors){if(G.commit(),t[f]=ie.value,b=!0,ht.fastSplice(o,R),--R,--_,!e._flags.sparse&&ie.value===void 0&&(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),i.abortEarly))return c;break}G.restore()}if(b)continue;let N=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let R of u){let G,ie=o.indexOf(R);if(ie!==-1)G=S[ie];else{let ue=r.localize(A,k,R);if(ue.snapshot(),G=R.$_validate(g,ue,i),!G.errors){ue.commit(),R._flags.result==="strip"?(ht.fastSplice(t,f),--f,--h):!e._flags.sparse&&G.value===void 0?(c.push(n("array.sparse",{key:O,path:A,pos:f,value:void 0},r.localize(A))),v=!0):t[f]=G.value,b=!0;break}ue.restore()}if(_===1){if(N){ht.fastSplice(t,f),--f,--h,b=!0;break}if(c.push(...G.errors),i.abortEarly)return c;v=!0;break}}if(!v&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!b){if(N){ht.fastSplice(t,f),--f,--h;continue}if(c.push(n("array.includes",{pos:f,value:g},r.localize(A))),i.abortEarly)return c}}return o.length&&ht.fillMissedErrors(e,c,o,t,r,i),a.length&&(ht.fillOrderedErrors(e,c,a,t,r,i),c.length||ht.fillDefault(a,t,r,i)),c.length?c: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 rr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:rr.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){rr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=rr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ht.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 Tu(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){rr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=_q.ref(t.by,{ancestor:0}),Tu(!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}=ht.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={}){Tu(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),rr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=rr.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},l=o||yq,c=s.ignoreUndefined;for(let h=0;h<t.length;++h){let f=a?bq(t[h],a):t[h],g=o?u.custom:u[typeof f];if(Tu(g,"Failed to find unique map container for type",typeof f),g instanceof Map){let v=g.entries(),b;for(;!(b=v.next()).done;)if(l(b.value[0],f)){let O=e.localize([...e.path,h],[t,...e.ancestors]),A={pos:h,value:t[h],dupePos:b.value[1],dupeValue:t[b.value[1]]};return a&&(A.path=i),n("array.unique",A,O)}g.set(f,h)}else{if((!c||f!==void 0)&&g[f]!==void 0){let v={pos:h,value:t[h],dupePos:g[f],dupeValue:t[g[f]]};a&&(v.path=i);let b=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",v,b)}g[f]=h}}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)ht.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)ht.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"}});ht.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let l=u._flags.label;l?o.push(l):++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))};ht.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ht.fillMissedErrors(t,e,o,r,i,s)};ht.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],l=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(l===void 0)continue;s=!1}i.unshift(l)}i.length&&e.push(...i)};ht.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ht.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(Tu(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ht.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(l,c)=>{let h=ht.compare(l,c,o,a);if(h!==null||(n.by&&(l=n.by.resolve(l,r,i),c=n.by.resolve(c,r,i)),h=ht.compare(l,c,o,a),h!==null))return h;let f=typeof l;if(f!==typeof c)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(f!=="number"&&f!=="string")throw t.$_createError("array.sort.unsupported",e,{type:f},r,i);return f==="number"?(l-c)*s:l<c?o:a};try{return{value:e.slice().sort(u)}}catch(l){return{errors:l}}};ht.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 PA=m((q4,RA)=>{"use strict";var AA=Ne(),Tq=nr(),OA=nt(),CA=Nb(),Fb={};Fb.isBool=function(t){return typeof t=="boolean"};RA.exports=Tq.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){OA.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new CA;for(let n=0;n<t.length;++n){let r=t[n];AA(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){OA.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new CA;for(let n=0;n<t.length;++n){let r=t[n];AA(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:Fb.isBool,to(t,e){return t?1:0}},string:{from:Fb.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 LA=m((j4,MA)=>{"use strict";var DA=Ne(),Sq=nr(),IA=nt(),kq=Gi(),xr={};xr.isDate=function(t){return t instanceof Date};MA.exports=Sq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:xr.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 IA.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:xr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return DA(["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 DA(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:xr.isDate,to(t,e){return t.getTime()}},string:{from:xr.isDate,to(t,{prefs:e}){return kq.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"}});xr.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 IA.isIsoDate(t)?xr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return xr.date(1*t);if(e==="unix")return xr.date(1e3*t);if(typeof n=="string")return null}return xr.date(t)};xr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var $A=m((F4,FA)=>{"use strict";var Gh=Ne(),qA=pn(),jA=Fh(),NA=Es(),zh={};FA.exports=function(t,e,n={}){if(Gh(t&&typeof t=="object","Invalid defaults value: must be an object"),Gh(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Gh(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return zh.applyToDefaultsWithShallow(t,e,n);let r=qA(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return jA(r,e,{nullOverride:i,mergeArrays:!1})};zh.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Gh(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 l=NA(t,u);l&&typeof l=="object"?i.set(l,s&&NA(e,u)||l):s&&s.add(u)}let o=qA(t,{},i);if(!s)return o;for(let u of s)zh.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return jA(o,e,{nullOverride:a,mergeArrays:!1})};zh.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 WA=m(UA=>{"use strict";var Ds=Ne(),BA={};UA.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;Ds(!n.includes(i),`Item cannot come before itself: ${i}`),Ds(!n.includes("?"),"Item cannot come before unassociated items"),Ds(!r.includes(i),`Item cannot come after itself: ${i}`),Ds(!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();Ds(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(BA.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Ds(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Ds(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,l=a.group;n[l]=n[l]||[],n[l].push(u),t[u]=a.before;for(let c of a.after)e[c]=e[c]||[],e[c].push(u)}for(let a in t){let u=[];for(let l in t[a]){let c=t[a][l];n[c]=n[c]||[],u.push(...n[c])}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 l of u)r[l]=r[l]||[],r[l].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let l=0;l<this._items.length;++l){if(i[l]===!0)continue;r[l]||(r[l]=[]);let c=r[l].length,h=0;for(let f=0;f<c;++f)i[r[l][f]]&&++h;if(h===c){u=l;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}};BA.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Bb=m((U4,zA)=>{"use strict";var wq=$A(),ir=Ne(),HA=pn(),xq=WA(),Eq=nr(),un=nt(),$b=Cs(),Aq=ci(),GA=hi(),Kh=Gi(),ge={renameDefaults:{alias:!1,multiple:!1,override:!1}};zA.exports=Eq.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=ge.clone(t,i);let s=[];if(e.$_terms.renames&&!ge.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 l=u.key,c=t[l];o.delete(l);let h=r.localize([...r.path,l],a,u),f=u.schema.$_validate(c,h,i);if(f.errors){if(i.abortEarly)return{value:t,errors:f.errors};f.value!==void 0&&(t[l]=f.value),s.push(...f.errors)}else u.schema._flags.result==="strip"||f.value===void 0&&c!==void 0?delete t[l]:f.value!==void 0&&(t[l]=f.value)}}if(o.size||e._flags._hasPatternMatch){let a=ge.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&&ge.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=ge.dependencies[a.rel](e,a,t,r,i);if(u){let l=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:l};s.push(l)}}return{value:t,errors:s}},rules:{and:{method(...t){return un.verifyFlat(t,"and"),ge.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){Kh.isTemplate(t)||(t=$b.ref(t)),ir(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=GA.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 ir(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){ir(t===void 0||typeof t=="object","Object schema must be a valid object"),ir(!un.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 ge.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new ge.Keys;for(let n in t)un.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 un.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:un.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 un.verifyFlat(t,"nand"),ge.dependency(this,"nand",null,t)}},or:{method(...t){return un.verifyFlat(t,"or"),ge.dependency(this,"or",null,t)}},oxor:{method(...t){return ge.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),ir(e!==void 0,"Invalid rule"),un.assertOptions(n,["fallthrough","matches"]),r&&ir(!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 GA.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={}){ir(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),ir(typeof e=="string"||e instanceof Kh,"Invalid rename to argument"),ir(e!==t,"Cannot rename key to same name:",t),un.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)ir(i.from!==t,"Cannot rename the same key multiple times");return e instanceof Kh&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:wq(ge.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return un.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 ge.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return ge.dependency(this,"without",t,e,n)}},xor:{method(...t){return un.verifyFlat(t,"xor"),ge.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=un.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new xq.Sorter;for(let n of t.$_terms.keys)un.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new ge.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=ge.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}}"}});ge.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return HA(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=HA(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};ge.dependency=function(t,e,n,r,i){ir(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),un.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=un.default(i.separator,"."),o=[];for(let u of r)ir(typeof u=="string",e,"peers must be strings"),o.push($b.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=$b.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new ge.Dependency(e,n,o,r,i)),a};ge.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=ge.isPresent(e.options);for(let l of e.peers)u(l.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(l.key):o.push(l.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:ge.keysToLabels(t,o),missing:s,missingWithLabels:ge.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=ge.isPresent(e.options);for(let l of e.peers)o(l.resolve(n,r,i,null,{shadow:!1}))&&s.push(l.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:ge.keysToLabels(t,a),peers:u,peersWithLabels:ge.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=ge.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:ge.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=ge.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=ge.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:ge.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ge.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=ge.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:ge.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=ge.keysToLabels(t,s),{code:"object.xor",context:a})}};ge.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};ge.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};ge.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 l in e){if(e[l]===void 0&&o.options.ignoreUndefined||l===o.to)continue;let c=o.from.exec(l);c&&a.push({from:l,to:o.to,match:c})}for(let l of a){let c=l.from,h=l.to;if(h instanceof Kh&&(h=h.render(e,n,r,l.match)),c!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:c,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[c]===void 0?delete e[h]:e[h]=e[c],s[h]=!0,o.options.alias||delete e[c]}}}return!0};ge.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(c=>{if(c.matches)return a=!0,[]}),l=[e,...i.ancestors];for(let c of n){let h=e[c],f=[...i.path,c];for(let g=0;g<t.$_terms.patterns.length;++g){let v=t.$_terms.patterns[g];if(v.regex){let A=v.regex.test(c);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,A?"pass":"error"),!A)continue}else if(!v.schema.$_match(c,i.nest(v.schema,`pattern.${g}`),s))continue;n.delete(c);let b=i.localize(f,l,{schema:v.rule,key:c}),O=v.rule.$_validate(h,b,s);if(O.errors){if(s.abortEarly)return{value:e,errors:O.errors};r.push(...O.errors)}if(v.matches&&u[g].push(c),e[c]=O.value,!v.fallthrough)break}}if(a)for(let c=0;c<u.length;++c){let h=u[c];if(!h)continue;let f=t.$_terms.patterns[c].matches,g=i.localize(i.path,l,f),v=f.$_validate(h,g,s);if(v.errors){let b=Aq.details(v.errors,{override:!1});b.matches=h;let O=t.$_createError("object.pattern.match",e,b,i,s);if(s.abortEarly)return{value:e,errors:O};r.push(O)}}}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(!un.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),l=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:l};r.push(l)}};ge.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}};ge.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 VA=m((G4,KA)=>{"use strict";var Ub=Ne(),Oq=Bb();KA.exports=Oq.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Ub(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 Ub(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 Ub(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 YA=m((z4,XA)=>{"use strict";var gi=Ne(),Cq=nr(),Rq=nt(),Pq=Cs(),Dq=ci(),mi={};XA.exports=Cq.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}){gi(e.$_terms.link,"Uninitialized link schema");let i=mi.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 mi.generate(t,e,n,r)},rules:{ref:{method(t){gi(!this.$_terms.link,"Cannot reinitialize schema"),t=Pq.ref(t),gi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),gi(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){gi(this.$_terms.link,"Uninitialized link schema"),gi(Rq.isSchema(t),"Invalid schema object"),gi(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 gi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});mi.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}=mi.perspective(s,n);mi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{mi.assert(!1,"to non-existing schema",s,t,n,r)}return mi.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};mi.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}};mi.assert=function(t,e,n,r,i,s){t||gi(!1,`"${Dq.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var QA=m((K4,JA)=>{"use strict";var Wb=Ne(),Iq=nr(),Hb=nt(),$n={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))))}};JA.exports=Iq.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match($n.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($n.extractSignificantDigits(t)!==$n.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!==$n.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(!Hb.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 Hb.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Hb.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"?$n.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 $n.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 Wb(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($n.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 Wb(["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 Wb(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"}});$n.extractSignificantDigits=function(t){return t.replace($n.exponentialPartRegex,"").replace($n.dotRegex,"").replace($n.trailingZerosRegex,"").replace($n.leadingSignAndZerosRegex,"")};$n.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 e1=m((V4,ZA)=>{"use strict";var Mq=Bb();ZA.exports=Mq.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Gb=m(Vh=>{"use strict";Vh.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"};Vh.code=function(t){return{code:t,error:Vh.codes[t]}}});var zb=m(Xh=>{"use strict";var Lq=require("url"),Er=Gb(),Vi={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:Lq.URL||URL};Xh.analyze=function(t,e={}){if(!t)return Er.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return Er.code("DOMAIN_TOO_LONG");if(!!Vi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return Er.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Vi.domainControlRx.test(t))return Er.code("DOMAIN_INVALID_CHARS");t=Vi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Vi.minDomainSegments,i=t.split(".");if(i.length<r)return Er.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return Er.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 Er.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return Er.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return Er.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Vi.domainSegmentRx.test(a))return Er.code("DOMAIN_INVALID_CHARS")}else if(!Vi.tldSegmentRx.test(a))return Er.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Xh.isValid=function(t,e){return!Xh.analyze(t,e)};Vi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Vi.URL(`http://${t}`).host}catch{return t}}});var t1=m(Kb=>{"use strict";var Nq=require("util"),qq=zb(),zr=Gb(),mn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(Nq.TextEncoder||TextEncoder)};Kb.analyze=function(t,e){return mn.email(t,e)};Kb.isValid=function(t,e){return!mn.email(t,e)};mn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return zr.code("EMPTY_STRING");let n=!mn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return zr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?zr.code("MULTIPLE_AT_CHAR"):zr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return zr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return zr.code("ADDRESS_TOO_LONG");if(mn.encoder.encode(i).length>64)return zr.code("LOCAL_TOO_LONG")}return mn.local(i,n)||qq.analyze(s,e)};mn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return zr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!mn.atextRx.test(r))return zr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(mn.atextRx.test(i))continue;let s=mn.binary(i);if(!mn.atomRx.test(s))return zr.code("INVALID_LOCAL_CHARS")}}};mn.binary=function(t){return Array.from(mn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};mn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;mn.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 Vb=m((Q4,n1)=>{"use strict";n1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Yb=m(Xb=>{"use strict";var Yh=Ne(),jq=Vb(),Jt={};Jt.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 l=n+"{1,4}",c="(?:"+l+":"+l+"|"+t.ipv4address+")",h="(?:"+l+":){6}"+c,f="::(?:"+l+":){5}"+c,g="(?:"+l+")?::(?:"+l+":){4}"+c,v="(?:(?:"+l+":){0,1}"+l+")?::(?:"+l+":){3}"+c,b="(?:(?:"+l+":){0,2}"+l+")?::(?:"+l+":){2}"+c,O="(?:(?:"+l+":){0,3}"+l+")?::"+l+":"+c,A="(?:(?:"+l+":){0,4}"+l+")?::"+c,k="(?:(?:"+l+":){0,5}"+l+")?::"+l,S="(?:(?:"+l+":){0,6}"+l+")?::";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="(?:"+h+"|"+f+"|"+g+"|"+v+"|"+b+"|"+O+"|"+A+"|"+k+"|"+S+")",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+")\\]",R="["+r+s+i+"]{1,255}",G="(?:"+N+"|"+t.ipv4address+"|"+R+")",ie="\\d*",ue="(?:"+_+"@)?"+G+"(?::"+ie+")?",z="(?:"+_+"@)?("+G+")(?::"+ie+")?",C=a+"*",M=a+"+",L="["+r+s+i+"@]+",F="",me="(?:\\/"+C+")*",pe="\\/(?:"+M+me+")?",jt=M+me,Tt=L+me,We="(?:\\/\\/\\/"+C+me+")";return t.hierPart="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+jt+"|"+We+")",t.hierPartCapture="(?:(?:\\/\\/"+z+me+")|"+pe+"|"+jt+")",t.relativeRef="(?:(?:\\/\\/"+ue+me+")|"+pe+"|"+Tt+"|"+F+")",t.relativeRefCapture="(?:(?:\\/\\/"+z+me+")|"+pe+"|"+Tt+"|"+F+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Jt.rfc3986=Jt.generate();Xb.ip={v4Cidr:Jt.rfc3986.ipv4Cidr,v6Cidr:Jt.rfc3986.ipv6Cidr,ipv4:Jt.rfc3986.ipv4address,ipv6:Jt.rfc3986.ipv6address,ipvfuture:Jt.rfc3986.ipvFuture};Jt.createRegex=function(t){let e=Jt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Jt.wrap(i+r);let s="";if(t.scheme){Yh(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let l=[].concat(t.scheme);Yh(l.length>=1,"scheme must have at least 1 scheme specified");let c=[];for(let h=0;h<l.length;++h){let f=l[h];Yh(f instanceof RegExp||typeof f=="string","scheme at position "+h+" must be a RegExp or String"),f instanceof RegExp?c.push(f.source.toString()):(Yh(e.schemeRegex.test(f),"scheme at position "+h+" must be a valid scheme"),c.push(jq(f)))}s=c.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Jt.wrap(u+r,s)};Jt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Jt.uriRegex=Jt.createRegex({});Xb.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Jt.createRegex(t):Jt.uriRegex}});var i1=m(r1=>{"use strict";var $o=Ne(),Su=Yb();r1.regex=function(t={}){$o(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";$o(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),$o(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]),$o(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)$o(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),$o(["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 Su.ip[o];let a=`\\/${o==="ipv4"?Su.ip.v4Cidr:Su.ip.v6Cidr}`;return e==="required"?`${Su.ip[o]}${a}`:`${Su.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var a1=m((tz,o1)=>{"use strict";var s1={};s1.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"];o1.exports=new Set(s1.tlds.map(t=>t.toLowerCase()))});var f1=m((nz,h1)=>{"use strict";var Ge=Ne(),Jh=zb(),Fq=t1(),c1=i1(),u1=Vb(),l1=a1(),$q=Yb(),Bq=nr(),yn=nt(),Ie={tlds:l1 instanceof Set?{tlds:{allow:l1,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:c1.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"]};h1.exports=Bq.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=Ie.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let l=u.args.limit;if(yn.isResolvable(l)&&(l=l.resolve(t,n,r),!yn.limit(l)))return{value:t,errors:e.$_createError("any.ref",l,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,l)}}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 yn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Ge(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Ge(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Ie.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Ge(["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 yn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Ge(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Ie.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Ie.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&yn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Ie.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Jh.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){yn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Ge(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Ie.addressOptions(t),n=new RegExp(`\\s*[${t.separator?u1(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)Fq.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){yn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Ge(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];Ge(typeof a=="string","version at position "+o+" must be a string");let u=Ie.guidVersions[a.toLowerCase()];Ge(u,"version at position "+o+" must be one of "+Object.keys(Ie.guidVersions).join(", ")),Ge(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Ge(Ie.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||Ie.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return yn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Ge(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Ge(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"?Ie.hexRegex.withOptionalPrefix:n.prefix===!0?Ie.hexRegex.withPrefix:Ie.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 Jh.isValid(t,{minDomainSegments:1})||Ie.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){yn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=c1.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 Ie.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Ie.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Ie.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 yn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:yn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Ie.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Ie.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Ge(Ie.normalizationForms.includes(t),"normalization form must be one of "+Ie.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={}){Ge(t instanceof RegExp,"regex must be a RegExp"),Ge(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),yn.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(u1(t),"g")),Ge(t instanceof RegExp,"pattern must be a RegExp"),Ge(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 Ge(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 Ge(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){yn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&yn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=$q.regex(t),r=t.domain?Ie.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)&&!Jh.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"}});Ie.addressOptions=function(t){if(!t)return Ie.tlds||t;if(Ge(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Ge(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 Ge(Ie.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ie.tlds);Ge(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)}})),Ge(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Ge(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Ie.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Ge(Ie.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ie.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Ge(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Ie.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Ie.validateTlds=function(t,e){for(let n of t)Ge(Jh.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Ie.isoDate=function(t){if(!yn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Ie.length=function(t,e,n,r,i){return Ge(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var p1=m((rz,d1)=>{"use strict";var Qh=Ne(),Uq=nr(),Jb={};Jb.Map=class extends Map{slice(){return new Jb.Map(this)}};d1.exports=Uq.extend({type:"symbol",terms:{map:{init:new Jb.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)),Qh(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Qh(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;Qh(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),Qh(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 y1=m((sz,m1)=>{"use strict";var Wq=Ne(),Hq=nr(),g1=nt();m1.exports=Hq.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 Wq(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 g1.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:g1.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 Lh=m((oz,T1)=>{"use strict";var Ms=Ne(),Gq=pn(),zq=Eb(),Is=nt(),Kq=Cs(),Zb=ci(),Vq=Ab(),b1=Rb(),Qb=hi(),v1=Gi(),_1=Db(),Zh,Lt={types:{alternatives:wA(),any:nr(),array:EA(),boolean:PA(),date:LA(),function:VA(),link:YA(),number:QA(),object:e1(),string:f1(),symbol:p1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Lt.types.binary=y1());Lt.root=function(){let t={_types:new Set(Object.keys(Lt.types))};for(let e of t._types)t[e]=function(...n){return Ms(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Lt.generate(this,Lt.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,Lt.methods);for(let e in Lt.aliases){let n=Lt.aliases[e];t[e]=t[n]}return t.x=t.expression,_1.setup&&_1.setup(t),t};Lt.methods={ValidationError:Zb.ValidationError,version:Is.version,cache:zq.provider,assert(t,e,...n){Lt.assert(t,e,!0,n)},attempt(t,e,...n){return Lt.assert(t,e,!1,n)},build(t){return Ms(typeof b1.build=="function","Manifest functionality disabled"),b1.build(this,t)},checkPreferences(t){Is.checkPreferences(t)},compile(t,e){return Kq.compile(this,t,e)},defaults(t){Ms(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ms(Is.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Lt.generate(this,r,i)}}return e},expression(...t){return new v1(...t)},extend(...t){Is.verifyFlat(t,"extend"),Zh=Zh||Mh(),Ms(t.length,"You need to provide at least one extension"),this.assert(t,Zh.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,Zh.extension);let r=Lt.expandExtension(n,e);for(let i of r){Ms(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=Vq.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Lt.generate(this,o,a)}}}return e},isError:Zb.ValidationError.isError,isExpression:v1.isTemplate,isRef:Qb.isRef,isSchema:Is.isSchema,in(...t){return Qb.in(...t)},override:Is.symbols.override,ref(...t){return Qb.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Lt.aliases)t[e]=this[e]();return t}};Lt.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,Is.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 Zb.ValidationError||(a=Gq(a)),a.message=i?`${i} ${u}`:u,a};Lt.generate=function(t,e,n){return Ms(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Lt.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};T1.exports=Lt.root()});var S1=m(we=>{"use strict";var Xq=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.descriptionContainerSchema=we.signatureSchema=we.signatureDefinitionContainerSchema=we.signatureDefinitionSchema=we.signatureDefinitionFunctionSchema=we.signatureDefinitionFunctionSchemaArg=we.signatureDefinitionFunctionSchemaArgMultiTypes=we.signatureDefinitionFunctionSchemaArgDefaultNumber=we.signatureDefinitionFunctionSchemaArgDefaultString=we.signatureDefinitionTypeSchema=we.variationsSchema=void 0;var le=Xq(Lh()),ef=ks();we.variationsSchema=le.default.array().items(le.default.alternatives(le.default.string(),le.default.number()));we.signatureDefinitionTypeSchema=le.default.alternatives(le.default.string(),le.default.object({type:le.default.string().required(),keyType:le.default.string().optional(),valueType:le.default.string().optional()}));we.signatureDefinitionFunctionSchemaArgDefaultString=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.String).required(),value:le.default.string().allow("").required()});we.signatureDefinitionFunctionSchemaArgDefaultNumber=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.Number).required(),value:le.default.number().required()});we.signatureDefinitionFunctionSchemaArgMultiTypes=le.default.object({label:le.default.string().required(),types:le.default.array().items(we.signatureDefinitionTypeSchema).required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchemaArg=le.default.object({label:le.default.string().required(),type:we.signatureDefinitionTypeSchema.required(),opt:le.default.boolean().optional(),default:le.default.alternatives(we.signatureDefinitionFunctionSchemaArgDefaultString,we.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});we.signatureDefinitionFunctionSchema=le.default.object({type:le.default.string().valid(ef.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),arguments:le.default.array().items(le.default.alternatives(we.signatureDefinitionFunctionSchemaArg,we.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:le.default.array().items(we.signatureDefinitionTypeSchema).required(),variations:we.variationsSchema.optional(),returnVariations:we.variationsSchema.optional()});we.signatureDefinitionSchema=le.default.object({type:we.signatureDefinitionTypeSchema.invalid(ef.SignatureDefinitionBaseType.Function).required(),description:le.default.string().optional(),example:le.default.string().optional(),isProtected:le.default.boolean().optional(),variations:we.variationsSchema.optional()});we.signatureDefinitionContainerSchema=le.default.object().pattern(le.default.string(),le.default.alternatives(we.signatureDefinitionFunctionSchema,we.signatureDefinitionSchema));we.signatureSchema=le.default.object({type:le.default.string().required(),hidden:le.default.boolean().optional(),extends:le.default.string().optional(),definitions:le.default.object().required()});we.descriptionContainerSchema=le.default.object({$meta:le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}).optional()}).pattern(le.default.string(),le.default.object({description:le.default.string().required(),example:le.default.array().items(le.default.string().allow("")).optional()}))});var rv=m(On=>{"use strict";var Bo=On&&On.__assign||function(){return Bo=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},Bo.apply(this,arguments)},Yq=On&&On.__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},Xi=On&&On.__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.")},ev=On&&On.__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},Jq=On&&On.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(On,"__esModule",{value:!0});On.Signature=void 0;var tv=Jq(Lh()),nv=S1(),Qq=ks(),Zq=Dh(),ej=bb(),tj=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){var n,r;tv.default.assert(e,nv.signatureDefinitionContainerSchema);var i={};try{for(var s=Xi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=ev(o.value,2),u=a[0],l=a[1],c=l.type===Qq.SignatureDefinitionBaseType.Function?ej.SignatureDefinitionFunction.parse(l):Zq.SignatureDefinition.parse(l);i[u]=c}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.parseDescriptions=function(e){var n,r,i,s,o;tv.default.assert(e,nv.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var l=e.$meta,c=Yq(e,["$meta"]);u=l,a=c}var h={};try{for(var f=Xi(Object.entries(a)),g=f.next();!g.done;g=f.next()){var v=ev(g.value,2),b=v[0],O=v[1];h[b]={description:O.description,example:(i=O.example)!==null&&i!==void 0?i:null}}}catch(A){n={error:A}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return Bo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;tv.default.assert(e,nv.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(s.setDefinition(o),n!=null)try{for(var a=Xi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var l=ev(u.value,2),c=l[0],h=l[1],f=t.parseDescriptions(h);s.addDescriptions(c,f)}}catch(g){r={error:g}}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.setDefinition=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){var n,r,i=Object.keys(e);try{for(var s=Xi(i),o=s.next();!o.done;o=s.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}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,i,s=this._descriptions[e];s==null&&(s={},this._descriptions[e]=s);var o=Object.keys(n);try{for(var a=Xi(o),u=a.next();!u.done;u=a.next()){var l=u.value;s[l]=Bo(Bo({},s[l]),n[l])}}catch(c){r={error:c}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){var e,n,r={},i=Object.keys(this._definitions);try{for(var s=Xi(i),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:r}},t.prototype.copy=function(){var e,n,r,i,s=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=Xi(a),l=u.next();!l.done;l=u.next()){var c=l.value;o[c]=this._definitions[c].copy()}}catch(b){e={error:b}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},f=Object.keys(this._descriptions);try{for(var g=Xi(f),v=g.next();!v.done;v=g.next()){var c=v.value;h[c]=Bo({},h[c])}}catch(b){r={error:b}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}return s._descriptions=h,s._definitions=o,s},t}();On.Signature=tj});var k1=m(Vr=>{"use strict";var Yi=Vr&&Vr.__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},Uo=Vr&&Vr.__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))},ku=Vr&&Vr.__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(Vr,"__esModule",{value:!0});Vr.Container=void 0;var Kr=rv(),Et=ks(),nj=function(){function t(){this._primitives=new Map([[Et.SignatureDefinitionBaseType.Any,new Kr.Signature({type:Et.SignatureDefinitionBaseType.Any})],[Et.SignatureDefinitionBaseType.General,new Kr.Signature({type:Et.SignatureDefinitionBaseType.General})],[Et.SignatureDefinitionBaseType.String,new Kr.Signature({type:Et.SignatureDefinitionBaseType.String})],[Et.SignatureDefinitionBaseType.Function,new Kr.Signature({type:Et.SignatureDefinitionBaseType.Function})],[Et.SignatureDefinitionBaseType.Number,new Kr.Signature({type:Et.SignatureDefinitionBaseType.Number})],[Et.SignatureDefinitionBaseType.List,new Kr.Signature({type:Et.SignatureDefinitionBaseType.List})],[Et.SignatureDefinitionBaseType.Map,new Kr.Signature({type:Et.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 Kr.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.getAllVisibleTypes=function(){var e=this;return Uo(Uo([],Yi(this._primitives.keys()),!1),Yi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==Et.SignatureDefinitionBaseType.Any&&n!==Et.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 Uo(Uo([],Yi(this.getAllPrimitiveSignatures()),!1),Yi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Uo(Uo([],Yi(this.getAllPrimitiveSignatures()),!1),Yi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Kr.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){var r,i,s={},o=Object.keys(n);try{for(var a=ku(o),u=a.next();!u.done;u=a.next()){var l=u.value,c=Kr.Signature.parseDescriptions(n[l]);s[l]=c}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,s),this},t.prototype.addMeta=function(e,n){var r,i,s=Object.keys(n);try{for(var o=ku(s),a=o.next();!a.done;a=o.next()){var u=a.value,l=this.getOrCreateTypeSignature(u);l.addDescriptions(e,n[u])}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}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(Et.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var l=ku(o),c=l.next();!c.done;c=l.next()){var h=c.value;if(!this._excludeFromSearch.has(h)){for(var f=h,g=this.getTypeSignature(h),v=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(v=g.getDefinition(n,r)),v===null);)f=g.getExtendedType(),g=this.getTypeSignature(f);v!==null&&u.set(f,v)}}}catch(b){i={error:b}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}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(Et.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(Et.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(Et.SignatureDefinitionBaseType.Any)?s.get(Et.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=ku(this._primitives),a=o.next();!a.done;a=o.next()){var u=Yi(a.value,2),l=u[0],c=u[1];s._primitives.set(l,c.copy())}}catch(v){e={error:v}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=ku(this._types),f=h.next();!f.done;f=h.next()){var g=Yi(f.value,2),l=g[0],c=g[1];s._types.set(l,c.copy())}}catch(v){r={error:v}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Vr.Container=nj});var x1=m(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0})});var sr=m(vt=>{"use strict";var rj=vt&&vt.__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]}),E1=vt&&vt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&rj(e,t,n)};Object.defineProperty(vt,"__esModule",{value:!0});vt.VariationRegistry=vt.Container=vt.Signature=vt.SignatureDefinition=vt.SignatureDefinitionTypeMeta=vt.SignatureDefinitionFunction=vt.SignatureDefinitionFunctionArg=void 0;var ij=yb();Object.defineProperty(vt,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return ij.SignatureDefinitionFunctionArg}});var sj=bb();Object.defineProperty(vt,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return sj.SignatureDefinitionFunction}});var oj=du();Object.defineProperty(vt,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return oj.SignatureDefinitionTypeMeta}});var aj=Dh();Object.defineProperty(vt,"SignatureDefinition",{enumerable:!0,get:function(){return aj.SignatureDefinition}});var uj=rv();Object.defineProperty(vt,"Signature",{enumerable:!0,get:function(){return uj.Signature}});var lj=k1();Object.defineProperty(vt,"Container",{enumerable:!0,get:function(){return lj.Container}});var cj=Ph();Object.defineProperty(vt,"VariationRegistry",{enumerable:!0,get:function(){return cj.VariationRegistry}});E1(x1(),vt);E1(ks(),vt)});var iv=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.enrichWithMetaInformation=Ls.FunctionBlockTag=void 0;var hj=mb(),A1=sr();function O1(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var wu;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(wu=Ls.FunctionBlockTag||(Ls.FunctionBlockTag={}));function fj(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===wu.Description).map(O1)].join(`
|
104
104
|
|
105
|
-
`),n=t.tags.filter(s=>s.tag===wu.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===wu.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===wu.Example).map(
|
105
|
+
`),n=t.tags.filter(s=>s.tag===wu.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===wu.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===wu.Example).map(O1);return{descriptions:e,args:n,returns:r,examples:i}}function dj(t){let e=(0,hj.parse)(`/**
|
106
106
|
${t.getDescription()}
|
107
|
-
*/`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=fj(n);return O1.SignatureDefinitionFunction.parse({type:O1.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let l=a.getLabel(),c=a.getTypes().map(f=>f.toString()),h=a.isOptional();return{types:c,opt:h,...i[u],label:l}}),returns:s.type.split("|"),description:r,example:o})}return t}Ls.enrichWithMetaInformation=dj});var sv=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.createResolveChain=void 0;var Bt=Ee();function Ji(t,e,n=null,r=!1){switch(t.type){case Bt.ASTType.ParenthesisExpression:{Ji(t.expression,e,n);return}case Bt.ASTType.MemberExpression:{let i=t;Ji(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case Bt.ASTType.IndexExpression:{let i=t;Ji(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case Bt.ASTType.CallStatement:{Ji(t.expression,e,n,!0);return}case Bt.ASTType.CallExpression:{Ji(t.base,e,n,!0);return}case Bt.ASTType.NegationExpression:case Bt.ASTType.BinaryNegatedExpression:case Bt.ASTType.UnaryExpression:{let i=t;Ji(i.argument,e,i);return}case Bt.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case Bt.ASTType.NumericLiteral:case Bt.ASTType.StringLiteral:case Bt.ASTType.NilLiteral:case Bt.ASTType.MapConstructorExpression:case Bt.ASTType.ListConstructorExpression:case Bt.ASTType.BinaryExpression:case Bt.ASTType.LogicalExpression:case Bt.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case Bt.ASTType.SliceExpression:Ji(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function pj(t){let e=[];return Ji(t,e),e}tf.createResolveChain=pj});var P1=m(ov=>{function R1(t,e){return t>e?1:-1}ov.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(R1),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var l=0;l<u.length;l++)r=33*r^u.charCodeAt(l);return r},ov.sortNumbers=R1});var lv=m(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.ObjectSet=Wo.ObjectSetIterator=void 0;var av=P1(),nf=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Wo.ObjectSetIterator=nf;var uv=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,av.hash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new nf(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,av.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,av.hash)(e);return this._map.delete(n)}extend(e){for(let[n,r]of e._map)this._map.set(n,r),this._first??(this._first=n),this._last=n;return this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Wo.ObjectSet=uv});var cv=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;rf.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 Ns=m(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CompletionItemKind=void 0;var gj;(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"})(gj=xu.CompletionItemKind||(xu.CompletionItemKind={}))});var hv=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isResolveChainItemWithValue=Xr.isResolveChainItemWithIdentifier=Xr.isResolveChainItemWithMember=Xr.isResolveChainItemWithIndex=void 0;var Er=Ee(),mj=t=>t!=null&&t.ref.type===Er.ASTType.IndexExpression;Xr.isResolveChainItemWithIndex=mj;var yj=t=>t!=null&&t.ref.type===Er.ASTType.MemberExpression;Xr.isResolveChainItemWithMember=yj;var bj=t=>t!=null&&t.ref.type===Er.ASTType.Identifier;Xr.isResolveChainItemWithIdentifier=bj;var vj=t=>t!=null&&(t.ref.type===Er.ASTType.NumericLiteral||t.ref.type===Er.ASTType.StringLiteral||t.ref.type===Er.ASTType.NilLiteral||t.ref.type===Er.ASTType.MapConstructorExpression||t.ref.type===Er.ASTType.ListConstructorExpression||t.ref.type===Er.ASTType.BinaryExpression||t.ref.type===Er.ASTType.LogicalExpression||t.ref.type===Er.ASTType.ComparisonGroupExpression);Xr.isResolveChainItemWithValue=vj});var fv=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.isSignatureDefinitionFunction=void 0;var _j=sr(),Tj=t=>t.getType().type===_j.SignatureDefinitionBaseType.Function;sf.isSignatureDefinitionFunction=Tj});var dv=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.aggregateEntity=void 0;var Sj=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};of.aggregateEntity=Sj});var Eu=m(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.injectIdentifers=void 0;var kj=dv(),wj=(t,e)=>{let n=(0,kj.aggregateEntity)(e);for(let r=0;r<n.length;r++){let i=n[r];for(let[s,o]of i.values)if(s.startsWith("i:")){let a=s.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.source===e.source?o.line:-1})}}};af.injectIdentifers=wj});var lf=m(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.isEligibleForProperties=void 0;var pv=sr(),xj=t=>t.types.has(pv.SignatureDefinitionBaseType.Map)||t.types.has(pv.SignatureDefinitionBaseType.List)||t.types.has(pv.SignatureDefinitionBaseType.Any);uf.isEligibleForProperties=xj});var hf=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.lookupProperty=void 0;var Ej=lf(),Aj=(t,e)=>{let n=t,r=new Set([n]);for(;(0,Ej.isEligibleForProperties)(n);){let i=n.values.get(`i:${e}`);if(i!=null)return i;let s=n.getIsa();if(s==null||r.has(s))break;r.add(s),n=s}return null};cf.lookupProperty=Aj});var gv=m(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.mergeUnique=void 0;function Oj(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}ff.mergeUnique=Oj});var Ko=m(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Entity=Qi.resolveEntity=void 0;var Ho=sr(),Go=Ns(),Cj=fv(),Rj=Eu(),df=lf(),D1=hf(),Pj=gv(),I1=lv(),Dj=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new qs({source:e.source,kind:Go.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addTypes(i):new qs({source:e.source,kind:Go.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(Ho.SignatureDefinitionBaseType.Any)}return e};Qi.resolveEntity=Dj;var mv={hasProperty(t,e,n){return!!(0,D1.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,D1.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Qi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,df.isEligibleForProperties)(t))return!1;let i=`i:${n}`,s=t.values.get(i);return s?s.extend(r):t.values.set(i,r.copy({container:e,label:n,context:t,definitions:[]})),!0}},yv={hasProperty(t,e,n){if(!(0,df.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`t:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,df.isEligibleForProperties)(t))return new qs({source:t.source,kind:Go.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(Ho.SignatureDefinitionBaseType.Any);let i=new qs({source:n.source,kind:Go.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let s of n.types){let o=t.values.get(`t:${s}`);o&&i.extend(o)}return i.types.size===0&&i.addType(Ho.SignatureDefinitionBaseType.Any),(0,Qi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,df.isEligibleForProperties)(t))return!1;for(let i of n.types){let s=`t:${i}`,o=t.values.get(s);o?o.extend(r):t.values.set(s,r.copy({container:e,label:i,context:t,definitions:[]}))}return!0}},qs=class t{get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new I1.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get("i:__isa")??null}hasIsa(){return this._values.has("i:__isa")}isAPI(){return this._isAPI}isCallable(){return this._types.has(Ho.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,Cj.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns()).map(n=>n.type)}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return yv.hasProperty(this,this._container,e);default:return mv.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return yv.resolveProperty(this,this._container,e,n);default:return mv.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return yv.setProperty(this,this._container,e,n);default:return mv.setProperty(this,this._container,e,n)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,Pj.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types));for(let[l,c]of u.values){let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):i.has(c)||(i.add(c),s.push({target:h,source:c}))}}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(Ho.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===Ho.SignatureDefinitionBaseType.Function?Go.CompletionItemKind.InternalFunction:Go.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let i of r)e.set(...i)}return(0,Rj.injectIdentifers)(e,this),e}toJSONInternal(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new I1.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});r.set(o,u);for(let[l,c]of o.values)u._values.set(l,i(u,c));return u._definitions=[...o.definitions],u}n._values=new Map;for(let[s,o]of this._values)n._values.set(s,i(n,o));return n._definitions=[...this._definitions],n}};Qi.Entity=qs});var _v=m(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.Scope=void 0;var pf=sr(),js=Ns(),bv=Eu(),gf=Ko(),vv=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return js.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(pf.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new gf.Entity({source:this._source,kind:js.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(pf.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;if(this._locals.values.has(`i:${e}`)){let r=this._locals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}else if(this._parent?.locals.values.has(`i:${e}`)){let r=this._parent.locals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getAllIdentifier(){let e=new Map([["globals",{kind:js.CompletionItemKind.Constant,line:-1}],["locals",{kind:js.CompletionItemKind.Constant,line:-1}],["outer",{kind:js.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(pf.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,bv.injectIdentifers)(e,this._globals),this._parent&&(0,bv.injectIdentifers)(e,this._parent.locals),(0,bv.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:js.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:js.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(pf.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};mf.Scope=vv});var zo=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.GreybelKeyword=void 0;var Ij;(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"})(Ij=Au.GreybelKeyword||(Au.GreybelKeyword={}))});var kv=m(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});var Fs=Ee(),Mj=zo(),Tv=class extends Fs.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Fs.Keyword),...Object.values(Mj.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Fs.CharacterCode.HASH}isMultilineComment(e,n){return Fs.CharacterCode.SLASH===e&&Fs.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Fs.CharacterCode.ASTERISK===e&&Fs.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Sv.default=Tv});var wv=m(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.CharacterCode=void 0;var Lj;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(Lj=Ou.CharacterCode||(Ou.CharacterCode={}))});var Vo=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.Operator=void 0;var Nj;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(Nj=Cu.Operator||(Cu.Operator={}))});var Ev=m(Ru=>{"use strict";var qj=Ru&&Ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ru,"__esModule",{value:!0});var Ar=Ee(),jj=qj(kv()),M1=wv(),L1=zo(),xv=Vo();function N1(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var yf=class t extends Ar.Lexer{constructor(e,n={}){n.validator=n.validator||new jj.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 h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,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 Ar.ASTRange(new Ar.ASTPosition(r,s-o+1),new Ar.ASTPosition(n.line,n.index-a+3)));let l=n.content.slice(s+2,n.index);n.index+=2;let c=new Ar.Token({type:Ar.TokenType.Comment,value:l,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(c),c}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(L1.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(L1.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Ru.default=yf;yf.greybelScanHandlers={[Ar.CharacterCode.ARROW_LEFT]:function(e){if(Ar.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(xv.Operator.LeftShift,e)},[Ar.CharacterCode.ARROW_RIGHT]:function(e){if(Ar.CharacterCode.ARROW_RIGHT===this.codeAt(1))return Ar.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(xv.Operator.UnsignedRightShift,e):this.scanPunctuator(xv.Operator.RightShift,e)},[M1.CharacterCode.AMPERSAND]:N1,[M1.CharacterCode.VERTICAL_LINE]:N1}});var bf=m(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ASTType=void 0;var Fj;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(Fj=Pu.ASTType||(Pu.ASTType={}))});var Ov=m(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.ASTChunkAdvanced=void 0;var $j=Ee(),Av=class t extends $j.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})}};vf.ASTChunkAdvanced=Av});var Mv=m(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.ASTFeatureFileExpression=or.ASTFeatureInjectExpression=or.ASTFeatureEnvarExpression=or.ASTFeatureIncludeExpression=or.ASTFeatureImportExpression=void 0;var Du=Ee(),Iu=bf(),Cv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};or.ASTFeatureImportExpression=Cv;var Rv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};or.ASTFeatureIncludeExpression=Rv;var Pv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};or.ASTFeatureEnvarExpression=Pv;var Dv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};or.ASTFeatureInjectExpression=Dv;var Iv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};or.ASTFeatureFileExpression=Iv});var qv=m(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ASTFeatureInjectExpression=Ut.ASTFeatureIncludeExpression=Ut.ASTFeatureImportExpression=Ut.ASTFeatureFileExpression=Ut.ASTFeatureEnvarExpression=Ut.ASTChunkAdvanced=Ut.ASTType=Ut.ASTProvider=void 0;var Lv=Ee(),q1=bf(),Bj=Ov(),Mu=Mv(),Nv=class extends Lv.ASTProvider{featureImportExpression(e){return new Mu.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Mu.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Mu.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Mu.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new Lv.ASTBase(q1.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new Lv.ASTBase(q1.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Mu.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new Bj.ASTChunkAdvanced(e)}};Ut.ASTProvider=Nv;var Uj=bf();Object.defineProperty(Ut,"ASTType",{enumerable:!0,get:function(){return Uj.ASTType}});var Wj=Ov();Object.defineProperty(Ut,"ASTChunkAdvanced",{enumerable:!0,get:function(){return Wj.ASTChunkAdvanced}});var Lu=Mv();Object.defineProperty(Ut,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureEnvarExpression}});Object.defineProperty(Ut,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureFileExpression}});Object.defineProperty(Ut,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureImportExpression}});Object.defineProperty(Ut,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureIncludeExpression}});Object.defineProperty(Ut,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureInjectExpression}})});var jv=m(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.SelectorGroups=_t.SelectorGroupType=_t.Selectors=_t.SelectorTypes=void 0;var Ge=Ee(),_f=zo(),Nu=Vo(),Hj;(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"})(Hj=_t.SelectorTypes||(_t.SelectorTypes={}));_t.Selectors=Object.assign(Object.assign({},Ge.Selectors),{From:(0,Ge.createSelector)({type:Ge.TokenType.Identifier,value:"from"}),Envar:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:_f.GreybelKeyword.Envar}),Inject:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:_f.GreybelKeyword.Inject}),Line:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:_f.GreybelKeyword.Line}),File:(0,Ge.createSelector)({type:Ge.TokenType.Keyword,value:_f.GreybelKeyword.File}),LeftShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Nu.Operator.LeftShift}),RightShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Nu.Operator.RightShift}),UnsignedRightShift:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Nu.Operator.UnsignedRightShift}),BitwiseOr:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Nu.Operator.BitwiseOr}),BitwiseAnd:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Nu.Operator.BitwiseAnd}),Escape:(0,Ge.createSelector)({type:Ge.TokenType.Punctuator,value:Ge.Operator.Escape})});var yi;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(yi=_t.SelectorGroupType||(_t.SelectorGroupType={}));_t.SelectorGroups=Object.assign(Object.assign({},Ge.SelectorGroups),{[yi.MapSeparator]:(0,Ge.createSelectorGroup)(yi.MapSeparator,[_t.Selectors.MapSeperator,_t.Selectors.CRBracket]),[yi.ListSeparator]:(0,Ge.createSelectorGroup)(yi.ListSeparator,[_t.Selectors.MapSeperator,_t.Selectors.SRBracket]),[yi.PathSegmentEnd]:(0,Ge.createSelectorGroup)(yi.PathSegmentEnd,[_t.Selectors.EndOfLine,_t.Selectors.Comment,_t.Selectors.EndOfFile]),[yi.BitwiseOperators]:(0,Ge.createSelectorGroup)(yi.BitwiseOperators,[_t.Selectors.LeftShift,_t.Selectors.RightShift,_t.Selectors.UnsignedRightShift])})});var $1=m(qu=>{"use strict";var Gj=qu&&qu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qu,"__esModule",{value:!0});var Cn=Ee(),Kj=Ga(),j1=Ja(),zj=Gj(Ev()),Vj=qv(),$s=zo(),F1=Vo(),$e=jv(),Fv=class extends Cn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new zj.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new Vj.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(){let e=this,n=0;for(;;){if($e.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
|
108
|
-
`)!==-1,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if($e.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!$e.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(),$e.Selectors.CRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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($e.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 l=r.requireTokenOfAny($e.SelectorGroups.MapSeparator,s.start);if($e.Selectors.CRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!$e.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(),$e.Selectors.SRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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 l=r.requireTokenOfAny($e.SelectorGroups.ListSeparator,s.start);if($e.Selectors.SRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Cn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!$e.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany($e.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(Cn.ASTIdentifierKind.Variable);if(!n.consume($e.Selectors.From))return n.raise("expected from keyword",new
|
107
|
+
*/`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=fj(n);return A1.SignatureDefinitionFunction.parse({type:A1.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let l=a.getLabel(),c=a.getTypes().map(f=>f.toString()),h=a.isOptional();return{types:c,opt:h,...i[u],label:l}}),returns:s.type.split("|"),description:r,example:o})}return t}Ls.enrichWithMetaInformation=dj});var sv=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.createResolveChain=void 0;var Nt=Ee();function Ji(t,e,n=null,r=!1){switch(t.type){case Nt.ASTType.ParenthesisExpression:{Ji(t.expression,e,n);return}case Nt.ASTType.MemberExpression:{let i=t;Ji(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case Nt.ASTType.IndexExpression:{let i=t;Ji(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case Nt.ASTType.CallStatement:{Ji(t.expression,e,n,!0);return}case Nt.ASTType.CallExpression:{Ji(t.base,e,n,!0);return}case Nt.ASTType.NegationExpression:case Nt.ASTType.BinaryNegatedExpression:case Nt.ASTType.UnaryExpression:{let i=t;Ji(i.argument,e,i);return}case Nt.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case Nt.ASTType.NumericLiteral:case Nt.ASTType.StringLiteral:case Nt.ASTType.NilLiteral:case Nt.ASTType.BooleanLiteral:case Nt.ASTType.MapConstructorExpression:case Nt.ASTType.ListConstructorExpression:case Nt.ASTType.BinaryExpression:case Nt.ASTType.LogicalExpression:case Nt.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case Nt.ASTType.SliceExpression:Ji(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function pj(t){let e=[];return Ji(t,e),e}tf.createResolveChain=pj});var R1=m(ov=>{function C1(t,e){return t>e?1:-1}ov.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(C1),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var l=0;l<u.length;l++)r=33*r^u.charCodeAt(l);return r},ov.sortNumbers=C1});var lv=m(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.ObjectSet=Wo.ObjectSetIterator=void 0;var av=R1(),nf=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Wo.ObjectSetIterator=nf;var uv=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,av.hash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new nf(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,av.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,av.hash)(e);return this._map.delete(n)}extend(e){for(let[n,r]of e._map)this._map.set(n,r),this._first??(this._first=n),this._last=n;return this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Wo.ObjectSet=uv});var cv=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;rf.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 Ns=m(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CompletionItemKind=void 0;var gj;(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"})(gj=xu.CompletionItemKind||(xu.CompletionItemKind={}))});var hv=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isResolveChainItemWithValue=Xr.isResolveChainItemWithIdentifier=Xr.isResolveChainItemWithMember=Xr.isResolveChainItemWithIndex=void 0;var or=Ee(),mj=t=>t!=null&&t.ref.type===or.ASTType.IndexExpression;Xr.isResolveChainItemWithIndex=mj;var yj=t=>t!=null&&t.ref.type===or.ASTType.MemberExpression;Xr.isResolveChainItemWithMember=yj;var bj=t=>t!=null&&t.ref.type===or.ASTType.Identifier;Xr.isResolveChainItemWithIdentifier=bj;var vj=new Set([or.ASTType.NumericLiteral,or.ASTType.StringLiteral,or.ASTType.NilLiteral,or.ASTType.BooleanLiteral,or.ASTType.MapConstructorExpression,or.ASTType.ListConstructorExpression,or.ASTType.BinaryExpression,or.ASTType.LogicalExpression,or.ASTType.ComparisonGroupExpression]),_j=t=>t!=null&&vj.has(t.ref.type);Xr.isResolveChainItemWithValue=_j});var fv=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.isSignatureDefinitionFunction=void 0;var Tj=sr(),Sj=t=>t.getType().type===Tj.SignatureDefinitionBaseType.Function;sf.isSignatureDefinitionFunction=Sj});var dv=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.aggregateEntity=void 0;var kj=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};of.aggregateEntity=kj});var Eu=m(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.injectIdentifers=void 0;var wj=dv(),xj=(t,e)=>{let n=(0,wj.aggregateEntity)(e);for(let r=0;r<n.length;r++){let i=n[r];for(let[s,o]of i.values)if(s.startsWith("i:")){let a=s.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.source===e.source?o.line:-1})}}};af.injectIdentifers=xj});var lf=m(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.isEligibleForProperties=void 0;var pv=sr(),Ej=t=>t.types.has(pv.SignatureDefinitionBaseType.Map)||t.types.has(pv.SignatureDefinitionBaseType.List)||t.types.has(pv.SignatureDefinitionBaseType.Any);uf.isEligibleForProperties=Ej});var hf=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.lookupProperty=void 0;var Aj=lf(),Oj=(t,e)=>{let n=t,r=new Set([n]);for(;(0,Aj.isEligibleForProperties)(n);){let i=n.values.get(`i:${e}`);if(i!=null)return i;let s=n.getIsa();if(s==null||r.has(s))break;r.add(s),n=s}return null};cf.lookupProperty=Oj});var gv=m(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.mergeUnique=void 0;function Cj(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}ff.mergeUnique=Cj});var zo=m(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Entity=Qi.resolveEntity=void 0;var Ho=sr(),Go=Ns(),Rj=fv(),Pj=Eu(),df=lf(),P1=hf(),Dj=gv(),D1=lv(),Ij=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new qs({source:e.source,kind:Go.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addTypes(i):new qs({source:e.source,kind:Go.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(Ho.SignatureDefinitionBaseType.Any)}return e};Qi.resolveEntity=Ij;var mv={hasProperty(t,e,n){return!!(0,P1.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,P1.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Qi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,df.isEligibleForProperties)(t))return!1;let i=`i:${n}`,s=t.values.get(i);return s?s.extend(r):t.values.set(i,r.copy({container:e,label:n,context:t,definitions:[]})),!0}},yv={hasProperty(t,e,n){if(!(0,df.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`t:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,df.isEligibleForProperties)(t))return new qs({source:t.source,kind:Go.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(Ho.SignatureDefinitionBaseType.Any);let i=new qs({source:n.source,kind:Go.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let s of n.types){let o=t.values.get(`t:${s}`);o&&i.extend(o)}return i.types.size===0&&i.addType(Ho.SignatureDefinitionBaseType.Any),(0,Qi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,df.isEligibleForProperties)(t))return!1;for(let i of n.types){let s=`t:${i}`,o=t.values.get(s);o?o.extend(r):t.values.set(s,r.copy({container:e,label:i,context:t,definitions:[]}))}return!0}},qs=class t{get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new D1.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get("i:__isa")??null}hasIsa(){return this._values.has("i:__isa")}isAPI(){return this._isAPI}isCallable(){return this._types.has(Ho.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,Rj.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns()).map(n=>n.type)}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return yv.hasProperty(this,this._container,e);default:return mv.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return yv.resolveProperty(this,this._container,e,n);default:return mv.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return yv.setProperty(this,this._container,e,n);default:return mv.setProperty(this,this._container,e,n)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,Dj.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types));for(let[l,c]of u.values){let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):i.has(c)||(i.add(c),s.push({target:h,source:c}))}}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(Ho.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===Ho.SignatureDefinitionBaseType.Function?Go.CompletionItemKind.InternalFunction:Go.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let i of r)e.set(...i)}return(0,Pj.injectIdentifers)(e,this),e}toJSONInternal(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new D1.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});r.set(o,u);for(let[l,c]of o.values)u._values.set(l,i(u,c));return u._definitions=[...o.definitions],u}n._values=new Map;for(let[s,o]of this._values)n._values.set(s,i(n,o));return n._definitions=[...this._definitions],n}};Qi.Entity=qs});var _v=m(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.Scope=void 0;var pf=sr(),js=Ns(),bv=Eu(),gf=zo(),vv=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return js.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(pf.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new gf.Entity({source:this._source,kind:js.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(pf.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;if(this._locals.values.has(`i:${e}`)){let r=this._locals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}else if(this._parent?.locals.values.has(`i:${e}`)){let r=this._parent.locals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,gf.resolveEntity)(this._container,r,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getAllIdentifier(){let e=new Map([["globals",{kind:js.CompletionItemKind.Constant,line:-1}],["locals",{kind:js.CompletionItemKind.Constant,line:-1}],["outer",{kind:js.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(pf.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,bv.injectIdentifers)(e,this._globals),this._parent&&(0,bv.injectIdentifers)(e,this._parent.locals),(0,bv.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:js.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:js.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(pf.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};mf.Scope=vv});var Ko=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.GreybelKeyword=void 0;var Mj;(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"})(Mj=Au.GreybelKeyword||(Au.GreybelKeyword={}))});var kv=m(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});var Fs=Ee(),Lj=Ko(),Tv=class extends Fs.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Fs.Keyword),...Object.values(Lj.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Fs.CharacterCode.HASH}isMultilineComment(e,n){return Fs.CharacterCode.SLASH===e&&Fs.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Fs.CharacterCode.ASTERISK===e&&Fs.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Sv.default=Tv});var wv=m(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.CharacterCode=void 0;var Nj;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(Nj=Ou.CharacterCode||(Ou.CharacterCode={}))});var Vo=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.Operator=void 0;var qj;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(qj=Cu.Operator||(Cu.Operator={}))});var Ev=m(Ru=>{"use strict";var jj=Ru&&Ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ru,"__esModule",{value:!0});var Ar=Ee(),Fj=jj(kv()),I1=wv(),M1=Ko(),xv=Vo();function L1(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var yf=class t extends Ar.Lexer{constructor(e,n={}){n.validator=n.validator||new Fj.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 h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,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 Ar.ASTRange(new Ar.ASTPosition(r,s-o+1),new Ar.ASTPosition(n.line,n.index-a+3)));let l=n.content.slice(s+2,n.index);n.index+=2;let c=new Ar.Token({type:Ar.TokenType.Comment,value:l,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(c),c}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(M1.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(M1.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Ru.default=yf;yf.greybelScanHandlers={[Ar.CharacterCode.ARROW_LEFT]:function(e){if(Ar.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(xv.Operator.LeftShift,e)},[Ar.CharacterCode.ARROW_RIGHT]:function(e){if(Ar.CharacterCode.ARROW_RIGHT===this.codeAt(1))return Ar.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(xv.Operator.UnsignedRightShift,e):this.scanPunctuator(xv.Operator.RightShift,e)},[I1.CharacterCode.AMPERSAND]:L1,[I1.CharacterCode.VERTICAL_LINE]:L1}});var bf=m(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ASTType=void 0;var $j;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})($j=Pu.ASTType||(Pu.ASTType={}))});var Ov=m(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.ASTChunkAdvanced=void 0;var Bj=Ee(),Av=class t extends Bj.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})}};vf.ASTChunkAdvanced=Av});var Mv=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.ASTFeatureFileExpression=ar.ASTFeatureInjectExpression=ar.ASTFeatureEnvarExpression=ar.ASTFeatureIncludeExpression=ar.ASTFeatureImportExpression=void 0;var Du=Ee(),Iu=bf(),Cv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};ar.ASTFeatureImportExpression=Cv;var Rv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};ar.ASTFeatureIncludeExpression=Rv;var Pv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};ar.ASTFeatureEnvarExpression=Pv;var Dv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};ar.ASTFeatureInjectExpression=Dv;var Iv=class t extends Du.ASTBase{constructor(e){super(Iu.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})}};ar.ASTFeatureFileExpression=Iv});var qv=m(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ASTFeatureInjectExpression=Ut.ASTFeatureIncludeExpression=Ut.ASTFeatureImportExpression=Ut.ASTFeatureFileExpression=Ut.ASTFeatureEnvarExpression=Ut.ASTChunkAdvanced=Ut.ASTType=Ut.ASTProvider=void 0;var Lv=Ee(),N1=bf(),Uj=Ov(),Mu=Mv(),Nv=class extends Lv.ASTProvider{featureImportExpression(e){return new Mu.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Mu.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Mu.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Mu.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new Lv.ASTBase(N1.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new Lv.ASTBase(N1.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Mu.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new Uj.ASTChunkAdvanced(e)}};Ut.ASTProvider=Nv;var Wj=bf();Object.defineProperty(Ut,"ASTType",{enumerable:!0,get:function(){return Wj.ASTType}});var Hj=Ov();Object.defineProperty(Ut,"ASTChunkAdvanced",{enumerable:!0,get:function(){return Hj.ASTChunkAdvanced}});var Lu=Mv();Object.defineProperty(Ut,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureEnvarExpression}});Object.defineProperty(Ut,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureFileExpression}});Object.defineProperty(Ut,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureImportExpression}});Object.defineProperty(Ut,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureIncludeExpression}});Object.defineProperty(Ut,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureInjectExpression}})});var jv=m(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.SelectorGroups=_t.SelectorGroupType=_t.Selectors=_t.SelectorTypes=void 0;var ze=Ee(),_f=Ko(),Nu=Vo(),Gj;(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"})(Gj=_t.SelectorTypes||(_t.SelectorTypes={}));_t.Selectors=Object.assign(Object.assign({},ze.Selectors),{From:(0,ze.createSelector)({type:ze.TokenType.Identifier,value:"from"}),Envar:(0,ze.createSelector)({type:ze.TokenType.Keyword,value:_f.GreybelKeyword.Envar}),Inject:(0,ze.createSelector)({type:ze.TokenType.Keyword,value:_f.GreybelKeyword.Inject}),Line:(0,ze.createSelector)({type:ze.TokenType.Keyword,value:_f.GreybelKeyword.Line}),File:(0,ze.createSelector)({type:ze.TokenType.Keyword,value:_f.GreybelKeyword.File}),LeftShift:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:Nu.Operator.LeftShift}),RightShift:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:Nu.Operator.RightShift}),UnsignedRightShift:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:Nu.Operator.UnsignedRightShift}),BitwiseOr:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:Nu.Operator.BitwiseOr}),BitwiseAnd:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:Nu.Operator.BitwiseAnd}),Escape:(0,ze.createSelector)({type:ze.TokenType.Punctuator,value:ze.Operator.Escape})});var yi;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(yi=_t.SelectorGroupType||(_t.SelectorGroupType={}));_t.SelectorGroups=Object.assign(Object.assign({},ze.SelectorGroups),{[yi.MapSeparator]:(0,ze.createSelectorGroup)(yi.MapSeparator,[_t.Selectors.MapSeperator,_t.Selectors.CRBracket]),[yi.ListSeparator]:(0,ze.createSelectorGroup)(yi.ListSeparator,[_t.Selectors.MapSeperator,_t.Selectors.SRBracket]),[yi.PathSegmentEnd]:(0,ze.createSelectorGroup)(yi.PathSegmentEnd,[_t.Selectors.EndOfLine,_t.Selectors.Comment,_t.Selectors.EndOfFile]),[yi.BitwiseOperators]:(0,ze.createSelectorGroup)(yi.BitwiseOperators,[_t.Selectors.LeftShift,_t.Selectors.RightShift,_t.Selectors.UnsignedRightShift])})});var F1=m(qu=>{"use strict";var zj=qu&&qu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qu,"__esModule",{value:!0});var Cn=Ee(),Kj=Ga(),q1=Ja(),Vj=zj(Ev()),Xj=qv(),$s=Ko(),j1=Vo(),$e=jv(),Fv=class extends Cn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new Vj.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new Xj.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(){let e=this,n=0;for(;;){if($e.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
|
108
|
+
`)!==-1,start:e.token.start,end:e.token.end,range:e.token.range,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if($e.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!$e.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(),$e.Selectors.CRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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($e.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 l=r.requireTokenOfAny($e.SelectorGroups.MapSeparator,s.start);if($e.Selectors.CRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!$e.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(),$e.Selectors.SRBracket(r.token))r.next();else for(;!$e.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),$e.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 l=r.requireTokenOfAny($e.SelectorGroups.ListSeparator,s.start);if($e.Selectors.SRBracket(l))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Cn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!$e.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany($e.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(Cn.ASTIdentifierKind.Variable);if(!n.consume($e.Selectors.From))return n.raise("expected from keyword",new q1.Range(r.start,new Kj.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});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(Cn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,range:i.range,scope:n.currentScope}),start:i.start,end:i.end,range:i.range,scope:n.currentScope});return n.currentScope.assignments.push(a),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($e.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Cn.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(;$e.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:j1.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(;$e.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:j1.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(;$e.Selectors.Plus(r.token)||$e.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(;$e.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 $e.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):$e.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):$e.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Cn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Cn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):$e.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Cn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Cn.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(Cn.TokenType.Keyword))switch(e.token.value){case $s.GreybelKeyword.Include:case $s.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Import:case $s.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Cn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Cn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunkAdvanced({start:n.start,end:null,range:[n.range[0],null]}),i=new Cn.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!$e.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!$e.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Cn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new q1.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.scopes=e.scopes,r.lines=e.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};qu.default=Fv});var Yr=m(qt=>{"use strict";var Yj=qt&&qt.__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]}),ju=qt&&qt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Yj(e,t,n)},$v=qt&&qt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qt,"__esModule",{value:!0});qt.Parser=qt.LexerValidator=qt.Lexer=void 0;var Jj=Ev();Object.defineProperty(qt,"Lexer",{enumerable:!0,get:function(){return $v(Jj).default}});var Qj=kv();Object.defineProperty(qt,"LexerValidator",{enumerable:!0,get:function(){return $v(Qj).default}});var Zj=F1();Object.defineProperty(qt,"Parser",{enumerable:!0,get:function(){return $v(Zj).default}});ju(qv(),qt);ju(wv(),qt);ju(Ko(),qt);ju(Vo(),qt);ju(jv(),qt)});var Bv=m(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.merge=void 0;function eF(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))}Tf.merge=eF});var $1=m(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.parseMapDescription=void 0;var tF=mb();function nF(t){return{path:t.name,type:t.type}}function rF(t){let e=t.tags.find(r=>r.tag==="type");if(!e)return null;let n=t.tags.filter(r=>r.tag==="property");return{type:e.name,properties:n.map(nF)}}function iF(t){let e=(0,tF.parse)(`/**
|
109
109
|
${t}
|
110
|
-
*/`),[n]=e;return n.tags.length>0?
|
111
|
-
`)}else if(r instanceof Re.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,
|
110
|
+
*/`),[n]=e;return n.tags.length>0?rF(n):null}Sf.parseMapDescription=iF});var Wv=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Aggregator=Xo.ASTChainIterator=void 0;var kf=Yr(),Be=sr(),Re=Ee(),sF=cv(),Pe=Ns(),Bs=hv(),B1=Zy(),U1=sv(),oF=iv(),H1=su(),W1=Bv(),aF=gv(),uF=$1(),lF=zo(),wf=class{constructor(e,n,r=!1,i=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assume=i,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(this.index===0?Pe.CompletionItemKind.Variable:Pe.CompletionItemKind.Property);return typeof n=="string"&&r.setLabel(n),this.assume?(r.addType(Be.SignatureDefinitionBaseType.Map),e.setProperty(n,r),e.resolveProperty(n,!0)):(r.addType(Be.SignatureDefinitionBaseType.Any),r)}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,i=this.chain[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Bs.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")e=n.globals;else if(i.getter.name==="outer")e=n.outer;else if(i.getter.name==="locals")e=n.locals;else if(i.getter.name==="super"){let o=r.getScopeContext(i.ref.scope)?.scope.context?.getIsa();o==null?e=this.aggregator.factory(Pe.CompletionItemKind.Constant).addType("null").setLabel("super"):e=o.copy({kind:Pe.CompletionItemKind.Constant,label:"super",values:o.values})}else if(i.getter.name==="self"){let o=r.getScopeContext(i.ref.scope)?.scope.context;o==null?e=this.aggregator.factory(Pe.CompletionItemKind.Constant).addType("null").setLabel("self"):e=o.copy({kind:Pe.CompletionItemKind.Constant,label:"self",values:o.values})}else{let o=n.resolveNamespace(i.getter.name,s);o==null&&(o=this.defineAssumedProperty(n.globals,i.getter.name)),e=o}else if((0,Bs.isResolveChainItemWithValue)(i))e=this.aggregator.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Re.Keyword.New&&e!==null){let o=this.aggregator.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(i.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index],r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Bs.isResolveChainItemWithMember)(n)){let i=e.resolveProperty(n.getter.name,r);i==null&&(i=this.defineAssumedProperty(e,n.getter.name)),e=i}else if((0,Bs.isResolveChainItemWithIndex)(n))if((0,H1.isValidIdentifierLiteral)(n.getter)){let i=n.getter.value.toString(),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else{let i=this.aggregator.resolveTypeWithDefault(n.getter),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else if(n.ref.type===Re.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Re.Keyword.New&&this.current!==null){let i=this.aggregator.factory(Pe.CompletionItemKind.Property).addType(Be.SignatureDefinitionBaseType.Map).setLabel(e.label);i.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,i),e=i}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};Xo.ASTChainIterator=wf;var Uv=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new lF.Entity({source:this._document.source,kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Re.ASTType.Comment);if(n instanceof Re.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Re.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
|
111
|
+
`)}else if(r instanceof Re.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,uF.parseMapDescription)(r);i!=null&&(i.properties.forEach(s=>{if(s.path==="__isa")return;let o=s.path.split("."),a=this.factory(Pe.CompletionItemKind.Property).addType(s.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(i.type,n))}createFunctionDescription(e,n=sF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Re.ASTType.Comment);if(r instanceof Re.ASTComment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!s.has(u))if(u instanceof Re.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
|
112
112
|
|
113
|
-
`)}else if(i instanceof Re.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Ke.SignatureDefinitionFunction.parse({type:Ke.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Re.ASTType.Identifier)return{label:r.name??"unknown",type:Ke.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(Pe.CompletionItemKind.Function).addType(Ke.SignatureDefinitionBaseType.Function).addSignatureType((0,sF.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Pe.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),i=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(i),n}resolveLogicalExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Ke.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Ke.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Ke.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Pe.CompletionItemKind.MapConstructor).addType(Ke.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Re.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`i:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Pe.CompletionItemKind.ListConstructor).addType(Ke.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Number).setLine(i.start.line),o=this.resolveTypeWithDefault(i.value).setLine(i.start.line);n.setProperty(s,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(e.start.line):n.setLine(e.start.line)}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Property).addType(Ke.SignatureDefinitionBaseType.Any).setLabel(e.identifier.name).setLine(e.start.line):r}resolveIdentifier(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Property).addType(Ke.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Re.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Re.ASTType.CallStatement:return this.resolveCallStatement(e);case Re.ASTType.CallExpression:return this.resolveCallExpression(e);case Re.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Re.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Re.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Re.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Re.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Re.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Re.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Re.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Re.ASTType.Identifier:return this.resolveIdentifier(e,n);case Re.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Re.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Re.ASTType.NegationExpression:case Re.ASTType.BinaryNegatedExpression:case Re.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Re.ASTType.NilLiteral:return this.factory(Pe.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Re.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Pe.CompletionItemKind.Literal).addType(Ke.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Re.ASTType.NumericLiteral:case Re.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Pe.CompletionItemKind.Literal).addType(Ke.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case kf.ASTType.FeatureFileExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Ke.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case kf.ASTType.FeatureLineExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Ke.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case kf.ASTType.FeatureEnvarExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Ke.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case kf.ASTType.FeatureInjectExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Ke.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e=null,n=!1){let r=this.resolveType(e,n);if(r==null){let i=this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let i=new wf(this,e,n,r),s=null,o=i.next();for(;!o.done;)s=o.value,o=i.next();return s}setEntityInPath(e,n,r){let i=e;for(let s=0;s<n.length-1;s++){let o=n[s],a=i.resolveProperty(o);if(a==null){let u=this.factory(Pe.CompletionItemKind.Property).addType(Ke.SignatureDefinitionBaseType.Map).setLabel(o);i.setProperty(o,u),a=u}i=a}return i.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let i=0;i<n.length;i++){let s=n[i],o=r.resolveProperty(s);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,W1.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let i=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),i}defineNamespace(e,n){let r=(0,W1.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,Bs.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,Bs.isResolveChainItemWithIndex)(i)){if((0,G1.isValidIdentifierLiteral)(i.getter))return this.defineProperty(o,i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return this.defineProperty(o,a,n)}}return!1}let s=this._scope;return(0,Bs.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let n=(0,U1.createExpressionId)(e.variable),r=this._definitions;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator.definitions,n=n.slice(8)):n.startsWith("locals.")?(r=this._definitions,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent.definitions,n=n.slice(6));let i=r.get(n);i?i.push({source:this._document.source,node:e}):r.set(n,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let i of r){let s=i.definitions;for(let o of s.keys())if(o.includes(e)){let a=s.get(o);(0,H1.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,U1.createExpressionId)(e),r=this;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator,n=n.slice(8)):n.startsWith("locals.")?(r=this,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent,n=n.slice(6));let i=[],s=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of s){if(o==null)continue;let a=o.resolveNamespace(e,!0);a!=null&&(0,H1.merge)(i,a.definitions)}return i}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy({source:this._document.source}).setLine(n.start.line)??this.factory(Pe.CompletionItemKind.Variable).addType(Ke.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r),this.addDefinition(n)}}extend(e){for(let[n,r]of e.definitions){let i=this.definitions.get(n);i?(0,oF.mergeUnique)(i,r):this.definitions.set(n,r)}}};Xo.Aggregator=Uv});var Gv=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.Document=void 0;var bi=sr(),lF=Ee(),K1=Ns(),cF=Bv(),z1=Wv(),V1=Ko(),X1=_v(),Hv=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(bi.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(bi.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(bi.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(bi.SignatureDefinitionBaseType.String),list:this._container.primitives.get(bi.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(bi.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new V1.Entity({source:this._source,kind:K1.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(bi.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new X1.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new z1.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof lF.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(bi.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let l=a[u],c=r.resolveProperty(l.getLabel(),!0),h=l.getTypes().map(f=>f.type);c===null?r.setProperty(l.getLabel(),new V1.Entity({source:this._source,kind:K1.CompletionItemKind.Variable,container:this._container}).addTypes(h)):(c.types.delete(bi.SignatureDefinitionBaseType.Any),c.addTypes(h))}}}}analyze(){let e=new X1.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new z1.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];return n&&n.length>0?n[n.length-1]:null}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}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,cF.merge)(n,u)}}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};xf.Document=Hv});var Xv=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.ContainerProxy=void 0;var Or=sr(),vi=Ko(),Kv=Ns(),Y1=Eu(),zv=hf(),Vv=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;for(let[n,r]of this._container.getPrimitives()){let i=new vi.Entity({source:"internal",kind:Kv.CompletionItemKind.Internal,container:this,isAPI:n===Or.SignatureDefinitionBaseType.General}).addType(Or.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let i=new vi.Entity({source:"internal",kind:Kv.CompletionItemKind.Internal,container:this}).addType(Or.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){for(let n of e._customTypes){let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))}}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(Or.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;for(let s of r){let o=this.getTypeSignature(s);if(o===null)continue;let a=(0,zv.lookupProperty)(o,n);a!==null&&i.set(s,a)}return i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,zv.lookupProperty)(this._primitives.get(Or.SignatureDefinitionBaseType.Any),n);if(e.includes(Or.SignatureDefinitionBaseType.Any)&&i)return(0,vi.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return(0,vi.resolveEntity)(this,s.values().next().value,r);if(s.has(Or.SignatureDefinitionBaseType.Any))return(0,vi.resolveEntity)(this,s.get(Or.SignatureDefinitionBaseType.Any),r);if(i!==null)return(0,vi.resolveEntity)(this,i,r);let o=new vi.Entity({source:"internal",label:n,kind:Kv.CompletionItemKind.Internal,container:this});for(let a of s.values()){let u=(0,vi.resolveEntity)(this,a,r);o.extend(u,!0,!0)}return o}getGeneralDefinition(e,n=!1){let r=(0,zv.lookupProperty)(this._primitives.get(Or.SignatureDefinitionBaseType.General),e);return r==null?null:(0,vi.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,Y1.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(Or.SignatureDefinitionBaseType.Map);(0,Y1.injectIdentifers)(e,i)}}getAllIdentifier(e){let n=new Map;if(e===Or.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Ef.ContainerProxy=Vv});var J1=m(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.TypeManager=void 0;var hF=Gv(),fF=Xv(),Yv=class{constructor(e){this._container=new fF.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new hF.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Af.TypeManager=Yv});var Yo=m(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.TypeManager=ae.ContainerProxy=ae.Document=ae.Aggregator=ae.Scope=ae.Entity=ae.aggregateEntity=ae.lookupProperty=ae.isEligibleForProperties=ae.injectIdentifers=ae.isSignatureDefinitionFunction=ae.isResolveChainItemWithValue=ae.isResolveChainItemWithMember=ae.isResolveChainItemWithIndex=ae.isResolveChainItemWithIdentifier=ae.CompletionItemKind=ae.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ae.ObjectSetIterator=ae.ObjectSet=ae.rotateBits=ae.getStringHashCode=ae.getHashCode=ae.createResolveChain=ae.enrichWithMetaInformation=ae.createExpressionId=ae.createExpressionHash=ae.isValidIdentifierLiteral=void 0;var dF=su();Object.defineProperty(ae,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return dF.isValidIdentifierLiteral}});var pF=tE();Object.defineProperty(ae,"createExpressionHash",{enumerable:!0,get:function(){return pF.createExpressionHash}});var gF=Zy();Object.defineProperty(ae,"createExpressionId",{enumerable:!0,get:function(){return gF.createExpressionId}});var mF=iv();Object.defineProperty(ae,"enrichWithMetaInformation",{enumerable:!0,get:function(){return mF.enrichWithMetaInformation}});var yF=sv();Object.defineProperty(ae,"createResolveChain",{enumerable:!0,get:function(){return yF.createResolveChain}});var Jv=Qy();Object.defineProperty(ae,"getHashCode",{enumerable:!0,get:function(){return Jv.getHashCode}});Object.defineProperty(ae,"getStringHashCode",{enumerable:!0,get:function(){return Jv.getStringHashCode}});Object.defineProperty(ae,"rotateBits",{enumerable:!0,get:function(){return Jv.rotateBits}});var Q1=lv();Object.defineProperty(ae,"ObjectSet",{enumerable:!0,get:function(){return Q1.ObjectSet}});Object.defineProperty(ae,"ObjectSetIterator",{enumerable:!0,get:function(){return Q1.ObjectSetIterator}});var bF=cv();Object.defineProperty(ae,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return bF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var vF=Ns();Object.defineProperty(ae,"CompletionItemKind",{enumerable:!0,get:function(){return vF.CompletionItemKind}});var Of=hv();Object.defineProperty(ae,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Of.isResolveChainItemWithIdentifier}});Object.defineProperty(ae,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Of.isResolveChainItemWithIndex}});Object.defineProperty(ae,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Of.isResolveChainItemWithMember}});Object.defineProperty(ae,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Of.isResolveChainItemWithValue}});var _F=fv();Object.defineProperty(ae,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return _F.isSignatureDefinitionFunction}});var TF=Eu();Object.defineProperty(ae,"injectIdentifers",{enumerable:!0,get:function(){return TF.injectIdentifers}});var SF=lf();Object.defineProperty(ae,"isEligibleForProperties",{enumerable:!0,get:function(){return SF.isEligibleForProperties}});var kF=hf();Object.defineProperty(ae,"lookupProperty",{enumerable:!0,get:function(){return kF.lookupProperty}});var wF=dv();Object.defineProperty(ae,"aggregateEntity",{enumerable:!0,get:function(){return wF.aggregateEntity}});var xF=Ko();Object.defineProperty(ae,"Entity",{enumerable:!0,get:function(){return xF.Entity}});var EF=_v();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return EF.Scope}});var AF=Wv();Object.defineProperty(ae,"Aggregator",{enumerable:!0,get:function(){return AF.Aggregator}});var OF=Gv();Object.defineProperty(ae,"Document",{enumerable:!0,get:function(){return OF.Document}});var CF=Xv();Object.defineProperty(ae,"ContainerProxy",{enumerable:!0,get:function(){return CF.ContainerProxy}});var RF=J1();Object.defineProperty(ae,"TypeManager",{enumerable:!0,get:function(){return RF.TypeManager}})});var Qv=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getSymbolItemKind=Jo.getCompletionItemKind=void 0;var lt=Yo(),PF={[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},DF=t=>PF[t]??6;Jo.getCompletionItemKind=DF;var IF={[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},MF=t=>IF[t]??13;Jo.getSymbolItemKind=MF});var Z1=m(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.CompletionListBuilder=void 0;var LF=Qv(),Zv=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,LF.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Cf.CompletionListBuilder=Zv});var Pf=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.findEx=Qo.ScraperWalker=void 0;var NF=Ee(),qF=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:()=>{}}},Rf=class{constructor(e,n={}){this.map=Object.assign(qF(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)}};Qo.ScraperWalker=Rf;function jF(t,e){let n=[];return new Rf((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==NF.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Qo.findEx=jF});var e_=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.lookupBase=bn.lookupIdentifier=bn.lookupScopes=bn.lookupRootScope=void 0;var _i=Ee(),FF=t=>{let e=t;for(;e.scope;)e=e.scope;return e};bn.lookupRootScope=FF;var $F=t=>{if(!t.scope)return[t];let e=(0,bn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};bn.lookupScopes=$F;var BF=t=>{switch(t.type){case _i.ASTType.CallStatement:return(0,bn.lookupIdentifier)(t.expression);case _i.ASTType.CallExpression:return(0,bn.lookupIdentifier)(t.base);case _i.ASTType.Identifier:return t;case _i.ASTType.MemberExpression:return(0,bn.lookupIdentifier)(t.identifier);case _i.ASTType.IndexExpression:return(0,bn.lookupIdentifier)(t.index);default:return null}};bn.lookupIdentifier=BF;var UF=(t=null)=>{switch(t?.type){case _i.ASTType.MemberExpression:return t.base;case _i.ASTType.IndexExpression:return t.base;case _i.ASTType.CallExpression:return t.base;case _i.ASTType.SliceExpression:return t.base;default:return null}};bn.lookupBase=UF});var ea=m(Jr=>{"use strict";var WF=Jr&&Jr.__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]}),HF=Jr&&Jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GF=Jr&&Jr.__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)&&WF(e,t,n);return HF(e,t),e};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.LookupHelper=void 0;var KF=sr(),eO=Ee(),Zo=Yo(),zF=GF(Pf()),VF=e_(),t_=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.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAllIdentifier(KF.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:Zo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:Zo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,Zo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,Zo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,Zo.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=zF.findEx((l,c)=>{let h=l.start.line-1,f=l.start.character-1,g=l.end.line-1,v=l.end.character-1;return h>e.line?{exit:!0}:h<g?{valid:e.line>h&&e.line<g||e.line===h&&f<=e.character||e.line===g&&v>=e.character}:{valid:h<=e.line&&f<=e.character&&g>=e.line&&v>=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,VF.lookupBase)(e);return r?n.resolveNamespace(r):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===eO.ASTType.MemberExpression&&e===i.identifier||i?.type===eO.ASTType.IndexExpression&&e===i.index&&(0,Zo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Jr.LookupHelper=t_});var tO=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.AVAILABLE_CONSTANTS=void 0;Df.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var nO=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.AVAILABLE_KEYWORDS=void 0;var ta=Yr(),ln=Ee();If.AVAILABLE_KEYWORDS=[ln.Keyword.If,ln.Keyword.In,ln.Keyword.Or,ln.Keyword.And,ln.Keyword.Isa,ln.Keyword.For,ln.Keyword.New,ln.Keyword.Not,ln.Keyword.End,ln.Keyword.Then,ln.Keyword.Else,ln.Keyword.Break,ln.Keyword.While,ln.Keyword.Return,ln.Keyword.Function,ln.Keyword.Continue,ta.GreybelKeyword.Envar,ta.GreybelKeyword.Import,ta.GreybelKeyword.Include,ta.GreybelKeyword.Debugger,ta.GreybelKeyword.Line,ta.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var rO=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.AVAILABLE_OPERATORS=void 0;var Fu=Vo(),Wt=Ee();Mf.AVAILABLE_OPERATORS=[Wt.Operator.Plus,Wt.Operator.Asterik,Wt.Operator.Minus,Wt.Operator.Slash,Wt.Operator.Power,Wt.Operator.Modulo,Wt.Operator.LessThan,Wt.Operator.GreaterThan,Wt.Operator.LessThanOrEqual,Wt.Operator.GreaterThanOrEqual,Wt.Operator.NotEqual,Wt.Operator.Equal,Wt.Operator.AddShorthand,Wt.Operator.SubtractShorthand,Wt.Operator.MultiplyShorthand,Wt.Operator.DivideShorthand,Fu.Operator.BitwiseAnd,Fu.Operator.BitwiseOr,Fu.Operator.LeftShift,Fu.Operator.RightShift,Fu.Operator.UnsignedRightShift,Wt.Operator.Assign,Wt.Operator.Reference].map(t=>({label:t,kind:24}))});var sO=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.activate=ar.getDefaultCompletionList=ar.getPropertyCompletionList=void 0;var iO=Ee(),XF=Z1(),YF=ea(),JF=tO(),QF=nO(),ZF=rO(),e$=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAllIdentifier()};ar.getPropertyCompletionList=e$;var t$=()=>[...QF.AVAILABLE_KEYWORDS,...ZF.AVAILABLE_OPERATORS,...JF.AVAILABLE_CONSTANTS];ar.getDefaultCompletionList=t$;function n$(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 YF.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=new XF.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof iO.ASTMemberExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):a instanceof iO.ASTIndexExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):(o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}ar.activate=n$});var aO=m((ez,oO)=>{"use strict";oO.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 n_=m((tz,lO)=>{var $u=aO(),uO={};for(let t of Object.keys($u))uO[$u[t]]=t;var se={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"]}};lO.exports=se;for(let t of Object.keys(se)){if(!("channels"in se[t]))throw new Error("missing channels property: "+t);if(!("labels"in se[t]))throw new Error("missing channel labels property: "+t);if(se[t].labels.length!==se[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=se[t];delete se[t].channels,delete se[t].labels,Object.defineProperty(se[t],"channels",{value:e}),Object.defineProperty(se[t],"labels",{value:n})}se.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 l=(i+s)/2;return s===i?u=0:l<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,l*100]};se.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(o,a,u),c=l-Math.min(o,a,u),h=function(f){return(l-f)/6/c+1/2};return c===0?(i=0,s=0):(s=c/l,e=h(o),n=h(a),r=h(u),o===l?i=r-n:a===l?i=1/3+e-r:u===l&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,l*100]};se.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=se.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]};se.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 r$(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}se.rgb.keyword=function(t){let e=uO[t];if(e)return e;let n=1/0,r;for(let i of Object.keys($u)){let s=$u[i],o=r$(t,s);o<n&&(n=o,r=i)}return r};se.keyword.rgb=function(t){return $u[t]};se.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]};se.rgb.lab=function(t){let e=se.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]};se.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 l=0;l<3;l++)s=e+1/3*-(l-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[l]=o*255;return u};se.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]};se.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]}};se.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]};se.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),l,c,h;switch(o){default:case 6:case 0:l=a,c=u,h=n;break;case 1:l=u,c=a,h=n;break;case 2:l=n,c=a,h=u;break;case 3:l=n,c=u,h=a;break;case 4:l=u,c=n,h=a;break;case 5:l=a,c=n,h=u;break}return[l*255,c*255,h*255]};se.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]};se.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]};se.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]};se.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,l=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};se.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]};se.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]};se.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?se.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};se.hsv.ansi16=function(t){return se.rgb.ansi16(se.hsv.rgb(t),t[2])};se.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)};se.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]};se.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]};se.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};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};se.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};se.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};se.gray.hsl=function(t){return[0,0,t[0]]};se.gray.hsv=se.gray.hsl;se.gray.hwb=function(t){return[0,100,t[0]]};se.gray.cmyk=function(t){return[0,0,0,t[0]]};se.gray.lab=function(t){return[t[0],0,0]};se.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};se.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var hO=m((nz,cO)=>{var Lf=n_();function i$(){let t={},e=Object.keys(Lf);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function s$(t){let e=i$(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Lf[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 o$(t,e){return function(n){return e(t(n))}}function a$(t,e){let n=[e[t].parent,t],r=Lf[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=o$(Lf[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}cO.exports=function(t){let e=s$(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]=a$(o,e))}return n}});var dO=m((rz,fO)=>{var r_=n_(),u$=hO(),na={},l$=Object.keys(r_);function c$(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 h$(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}l$.forEach(t=>{na[t]={},Object.defineProperty(na[t],"channels",{value:r_[t].channels}),Object.defineProperty(na[t],"labels",{value:r_[t].labels});let e=u$(t);Object.keys(e).forEach(r=>{let i=e[r];na[t][r]=h$(i),na[t][r].raw=c$(i)})});fO.exports=na});var gO=m(ra=>{"use strict";var f$=ra&&ra.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ra,"__esModule",{value:!0});ra.activate=void 0;var i_=f$(dO()),d$=Ee(),pO;(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"})(pO||(pO={}));var s_={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},p$=()=>new RegExp(`(?:mark|color)=(${Object.keys(s_).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),g$=Object.prototype.hasOwnProperty;function m$(t){t.connection.onColorPresentation(e=>[{label:`#${i_.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)).document.literals.filter(u=>u.type===d$.ASTType.StringLiteral),o=[],a=({match:u,markup:l,value:c,astPosition:h,lineIndex:f})=>{let g=u.index+l.indexOf("=")+1,v=g+c.length,b=h.line-1+f,O=g,A=v;return f===0&&(O+=h.character,A+=h.character),{start:{line:b,character:O},end:{line:b,character:A}}};for(let u=0;u<s.length;u++){let l=s[u];if(!l.start)continue;let c=l.start,h=l.value.toString().split(`
|
114
|
-
`);for(let f=0;f<h.length;f++){let g=h[f],v=
|
113
|
+
`)}else if(i instanceof Re.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Be.SignatureDefinitionFunction.parse({type:Be.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Re.ASTType.Identifier)return{label:r.name??"unknown",type:Be.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(Pe.CompletionItemKind.Function).addType(Be.SignatureDefinitionBaseType.Function).addSignatureType((0,oF.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Pe.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),i=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(i),n}resolveLogicalExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Be.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Be.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Pe.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Be.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Pe.CompletionItemKind.MapConstructor).addType(Be.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Re.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`i:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Pe.CompletionItemKind.ListConstructor).addType(Be.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Number).setLine(i.start.line),o=this.resolveTypeWithDefault(i.value).setLine(i.start.line);n.setProperty(s,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(e.start.line):n.setLine(e.start.line)}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Property).addType(Be.SignatureDefinitionBaseType.Any).setLabel(e.identifier.name).setLine(e.start.line):r}resolveIdentifier(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Pe.CompletionItemKind.Property).addType(Be.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Re.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Re.ASTType.CallStatement:return this.resolveCallStatement(e);case Re.ASTType.CallExpression:return this.resolveCallExpression(e);case Re.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Re.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Re.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Re.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Re.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Re.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Re.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Re.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Re.ASTType.Identifier:return this.resolveIdentifier(e,n);case Re.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Re.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Re.ASTType.NegationExpression:case Re.ASTType.BinaryNegatedExpression:case Re.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Re.ASTType.NilLiteral:return this.factory(Pe.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Re.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Pe.CompletionItemKind.Literal).addType(Be.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Re.ASTType.NumericLiteral:case Re.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Pe.CompletionItemKind.Literal).addType(Be.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case kf.ASTType.FeatureFileExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Be.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case kf.ASTType.FeatureLineExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Be.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case kf.ASTType.FeatureEnvarExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Be.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case kf.ASTType.FeatureInjectExpression:return this.factory(Pe.CompletionItemKind.Expression).addType(Be.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e=null,n=!1){let r=this.resolveType(e,n);if(r==null){let i=this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let i=new wf(this,e,n,r),s=null,o=i.next();for(;!o.done;)s=o.value,o=i.next();return s}setEntityInPath(e,n,r){let i=e;for(let s=0;s<n.length-1;s++){let o=n[s],a=i.resolveProperty(o);if(a==null){let u=this.factory(Pe.CompletionItemKind.Property).addType(Be.SignatureDefinitionBaseType.Map).setLabel(o);i.setProperty(o,u),a=u}i=a}return i.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let i=0;i<n.length;i++){let s=n[i],o=r.resolveProperty(s);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,U1.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let i=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),i}defineNamespace(e,n){let r=(0,U1.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,Bs.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,Bs.isResolveChainItemWithIndex)(i)){if((0,H1.isValidIdentifierLiteral)(i.getter))return this.defineProperty(o,i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return this.defineProperty(o,a,n)}}return!1}let s=this._scope;return(0,Bs.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let n=(0,B1.createExpressionId)(e.variable),r=this._definitions;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator.definitions,n=n.slice(8)):n.startsWith("locals.")?(r=this._definitions,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent.definitions,n=n.slice(6));let i=r.get(n);i?i.push({source:this._document.source,node:e}):r.set(n,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let i of r){let s=i.definitions;for(let o of s.keys())if(o.includes(e)){let a=s.get(o);(0,W1.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,B1.createExpressionId)(e),r=this;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator,n=n.slice(8)):n.startsWith("locals.")?(r=this,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent,n=n.slice(6));let i=[],s=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of s){if(o==null)continue;let a=o.resolveNamespace(e,!0);a!=null&&(0,W1.merge)(i,a.definitions)}return i}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy({source:this._document.source}).setLine(n.start.line)??this.factory(Pe.CompletionItemKind.Variable).addType(Be.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r),this.addDefinition(n)}}extend(e){for(let[n,r]of e.definitions){let i=this.definitions.get(n);i?(0,aF.mergeUnique)(i,r):this.definitions.set(n,r)}}};Xo.Aggregator=Uv});var Gv=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.Document=void 0;var bi=sr(),cF=Ee(),G1=Ns(),hF=Bv(),z1=Wv(),K1=zo(),V1=_v(),Hv=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(bi.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(bi.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(bi.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(bi.SignatureDefinitionBaseType.String),list:this._container.primitives.get(bi.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(bi.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new K1.Entity({source:this._source,kind:G1.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(bi.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new V1.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new z1.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof cF.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(bi.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let l=a[u],c=r.resolveProperty(l.getLabel(),!0),h=l.getTypes().map(f=>f.type);c===null?r.setProperty(l.getLabel(),new K1.Entity({source:this._source,kind:G1.CompletionItemKind.Variable,container:this._container}).addTypes(h)):(c.types.delete(bi.SignatureDefinitionBaseType.Any),c.addTypes(h))}}}}analyze(){let e=new V1.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new z1.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];return n&&n.length>0?n[n.length-1]:null}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}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,hF.merge)(n,u)}}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};xf.Document=Hv});var Vv=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.ContainerProxy=void 0;var Or=sr(),vi=zo(),X1=Ns(),Y1=Eu(),zv=hf(),Kv=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;for(let[n,r]of this._container.getPrimitives()){let i=new vi.Entity({source:"internal",kind:X1.CompletionItemKind.Internal,container:this,isAPI:n===Or.SignatureDefinitionBaseType.General}).addType(Or.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let i=new vi.Entity({source:"internal",kind:X1.CompletionItemKind.Internal,container:this}).addType(Or.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){for(let n of e._customTypes){let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))}}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(Or.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;for(let s of r){let o=this.getTypeSignature(s);if(o===null)continue;let a=(0,zv.lookupProperty)(o,n);a!==null&&i.set(s,a)}return i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,zv.lookupProperty)(this._primitives.get(Or.SignatureDefinitionBaseType.Any),n);if(e.includes(Or.SignatureDefinitionBaseType.Any)&&i)return(0,vi.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return(0,vi.resolveEntity)(this,s.values().next().value,r);if(s.has(Or.SignatureDefinitionBaseType.Any))return(0,vi.resolveEntity)(this,s.get(Or.SignatureDefinitionBaseType.Any),r);if(i!==null)return(0,vi.resolveEntity)(this,i,r);let o=s.values().next().value,a=new vi.Entity({source:"internal",label:n,kind:o.kind,container:this});for(let u of s.values()){let l=(0,vi.resolveEntity)(this,u,r);a.extend(l,!0,!0)}return a}getGeneralDefinition(e,n=!1){let r=(0,zv.lookupProperty)(this._primitives.get(Or.SignatureDefinitionBaseType.General),e);return r==null?null:(0,vi.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,Y1.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(Or.SignatureDefinitionBaseType.Map);(0,Y1.injectIdentifers)(e,i)}}getAllIdentifier(e){let n=new Map;if(e===Or.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Ef.ContainerProxy=Kv});var J1=m(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.TypeManager=void 0;var fF=Gv(),dF=Vv(),Xv=class{constructor(e){this._container=new dF.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new fF.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Af.TypeManager=Xv});var Yo=m(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.TypeManager=ae.ContainerProxy=ae.Document=ae.Aggregator=ae.Scope=ae.Entity=ae.aggregateEntity=ae.lookupProperty=ae.isEligibleForProperties=ae.injectIdentifers=ae.isSignatureDefinitionFunction=ae.isResolveChainItemWithValue=ae.isResolveChainItemWithMember=ae.isResolveChainItemWithIndex=ae.isResolveChainItemWithIdentifier=ae.CompletionItemKind=ae.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ae.ObjectSetIterator=ae.ObjectSet=ae.rotateBits=ae.getStringHashCode=ae.getHashCode=ae.createResolveChain=ae.enrichWithMetaInformation=ae.createExpressionId=ae.createExpressionHash=ae.isValidIdentifierLiteral=void 0;var pF=su();Object.defineProperty(ae,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return pF.isValidIdentifierLiteral}});var gF=eE();Object.defineProperty(ae,"createExpressionHash",{enumerable:!0,get:function(){return gF.createExpressionHash}});var mF=Zy();Object.defineProperty(ae,"createExpressionId",{enumerable:!0,get:function(){return mF.createExpressionId}});var yF=iv();Object.defineProperty(ae,"enrichWithMetaInformation",{enumerable:!0,get:function(){return yF.enrichWithMetaInformation}});var bF=sv();Object.defineProperty(ae,"createResolveChain",{enumerable:!0,get:function(){return bF.createResolveChain}});var Yv=Qy();Object.defineProperty(ae,"getHashCode",{enumerable:!0,get:function(){return Yv.getHashCode}});Object.defineProperty(ae,"getStringHashCode",{enumerable:!0,get:function(){return Yv.getStringHashCode}});Object.defineProperty(ae,"rotateBits",{enumerable:!0,get:function(){return Yv.rotateBits}});var Q1=lv();Object.defineProperty(ae,"ObjectSet",{enumerable:!0,get:function(){return Q1.ObjectSet}});Object.defineProperty(ae,"ObjectSetIterator",{enumerable:!0,get:function(){return Q1.ObjectSetIterator}});var vF=cv();Object.defineProperty(ae,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return vF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var _F=Ns();Object.defineProperty(ae,"CompletionItemKind",{enumerable:!0,get:function(){return _F.CompletionItemKind}});var Of=hv();Object.defineProperty(ae,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Of.isResolveChainItemWithIdentifier}});Object.defineProperty(ae,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Of.isResolveChainItemWithIndex}});Object.defineProperty(ae,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Of.isResolveChainItemWithMember}});Object.defineProperty(ae,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Of.isResolveChainItemWithValue}});var TF=fv();Object.defineProperty(ae,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return TF.isSignatureDefinitionFunction}});var SF=Eu();Object.defineProperty(ae,"injectIdentifers",{enumerable:!0,get:function(){return SF.injectIdentifers}});var kF=lf();Object.defineProperty(ae,"isEligibleForProperties",{enumerable:!0,get:function(){return kF.isEligibleForProperties}});var wF=hf();Object.defineProperty(ae,"lookupProperty",{enumerable:!0,get:function(){return wF.lookupProperty}});var xF=dv();Object.defineProperty(ae,"aggregateEntity",{enumerable:!0,get:function(){return xF.aggregateEntity}});var EF=zo();Object.defineProperty(ae,"Entity",{enumerable:!0,get:function(){return EF.Entity}});var AF=_v();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return AF.Scope}});var OF=Wv();Object.defineProperty(ae,"Aggregator",{enumerable:!0,get:function(){return OF.Aggregator}});var CF=Gv();Object.defineProperty(ae,"Document",{enumerable:!0,get:function(){return CF.Document}});var RF=Vv();Object.defineProperty(ae,"ContainerProxy",{enumerable:!0,get:function(){return RF.ContainerProxy}});var PF=J1();Object.defineProperty(ae,"TypeManager",{enumerable:!0,get:function(){return PF.TypeManager}})});var Jv=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getSymbolItemKind=Jo.getCompletionItemKind=void 0;var lt=Yo(),DF={[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},IF=t=>DF[t]??6;Jo.getCompletionItemKind=IF;var MF={[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},LF=t=>MF[t]??13;Jo.getSymbolItemKind=LF});var Z1=m(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.CompletionListBuilder=void 0;var NF=Jv(),Qv=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,NF.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Cf.CompletionListBuilder=Qv});var Pf=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.findEx=Qo.ScraperWalker=void 0;var qF=Ee(),jF=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:()=>{}}},Rf=class{constructor(e,n={}){this.map=Object.assign(jF(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)}};Qo.ScraperWalker=Rf;function FF(t,e){let n=[];return new Rf((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==qF.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Qo.findEx=FF});var Zv=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.lookupBase=bn.lookupIdentifier=bn.lookupScopes=bn.lookupRootScope=void 0;var _i=Ee(),$F=t=>{let e=t;for(;e.scope;)e=e.scope;return e};bn.lookupRootScope=$F;var BF=t=>{if(!t.scope)return[t];let e=(0,bn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};bn.lookupScopes=BF;var UF=t=>{switch(t.type){case _i.ASTType.CallStatement:return(0,bn.lookupIdentifier)(t.expression);case _i.ASTType.CallExpression:return(0,bn.lookupIdentifier)(t.base);case _i.ASTType.Identifier:return t;case _i.ASTType.MemberExpression:return(0,bn.lookupIdentifier)(t.identifier);case _i.ASTType.IndexExpression:return(0,bn.lookupIdentifier)(t.index);default:return null}};bn.lookupIdentifier=UF;var WF=(t=null)=>{switch(t?.type){case _i.ASTType.MemberExpression:return t.base;case _i.ASTType.IndexExpression:return t.base;case _i.ASTType.CallExpression:return t.base;case _i.ASTType.SliceExpression:return t.base;default:return null}};bn.lookupBase=WF});var ea=m(Jr=>{"use strict";var HF=Jr&&Jr.__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]}),GF=Jr&&Jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zF=Jr&&Jr.__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)&&HF(e,t,n);return GF(e,t),e};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.LookupHelper=void 0;var KF=sr(),eO=Ee(),Zo=Yo(),VF=zF(Pf()),XF=Zv(),e_=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.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAllIdentifier(KF.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:Zo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:Zo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,Zo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,Zo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,Zo.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=VF.findEx((l,c)=>{let h=l.start.line-1,f=l.start.character-1,g=l.end.line-1,v=l.end.character-1;return h>e.line?{exit:!0}:h<g?{valid:e.line>h&&e.line<g||e.line===h&&f<=e.character||e.line===g&&v>=e.character}:{valid:h<=e.line&&f<=e.character&&g>=e.line&&v>=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,XF.lookupBase)(e);return r?n.resolveNamespace(r):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===eO.ASTType.MemberExpression&&e===i.identifier||i?.type===eO.ASTType.IndexExpression&&e===i.index&&(0,Zo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Jr.LookupHelper=e_});var tO=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.AVAILABLE_CONSTANTS=void 0;Df.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var nO=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.AVAILABLE_KEYWORDS=void 0;var ta=Yr(),ln=Ee();If.AVAILABLE_KEYWORDS=[ln.Keyword.If,ln.Keyword.In,ln.Keyword.Or,ln.Keyword.And,ln.Keyword.Isa,ln.Keyword.For,ln.Keyword.New,ln.Keyword.Not,ln.Keyword.End,ln.Keyword.Then,ln.Keyword.Else,ln.Keyword.Break,ln.Keyword.While,ln.Keyword.Return,ln.Keyword.Function,ln.Keyword.Continue,ta.GreybelKeyword.Envar,ta.GreybelKeyword.Import,ta.GreybelKeyword.Include,ta.GreybelKeyword.Debugger,ta.GreybelKeyword.Line,ta.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var rO=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.AVAILABLE_OPERATORS=void 0;var Fu=Vo(),Wt=Ee();Mf.AVAILABLE_OPERATORS=[Wt.Operator.Plus,Wt.Operator.Asterik,Wt.Operator.Minus,Wt.Operator.Slash,Wt.Operator.Power,Wt.Operator.Modulo,Wt.Operator.LessThan,Wt.Operator.GreaterThan,Wt.Operator.LessThanOrEqual,Wt.Operator.GreaterThanOrEqual,Wt.Operator.NotEqual,Wt.Operator.Equal,Wt.Operator.AddShorthand,Wt.Operator.SubtractShorthand,Wt.Operator.MultiplyShorthand,Wt.Operator.DivideShorthand,Fu.Operator.BitwiseAnd,Fu.Operator.BitwiseOr,Fu.Operator.LeftShift,Fu.Operator.RightShift,Fu.Operator.UnsignedRightShift,Wt.Operator.Assign,Wt.Operator.Reference].map(t=>({label:t,kind:24}))});var sO=m(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.activate=ur.getDefaultCompletionList=ur.getPropertyCompletionList=void 0;var iO=Ee(),YF=Z1(),JF=ea(),QF=tO(),ZF=nO(),e$=rO(),t$=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAllIdentifier()};ur.getPropertyCompletionList=t$;var n$=()=>[...ZF.AVAILABLE_KEYWORDS,...e$.AVAILABLE_OPERATORS,...QF.AVAILABLE_CONSTANTS];ur.getDefaultCompletionList=n$;function r$(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 JF.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=new YF.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof iO.ASTMemberExpression?o.addCollection(await(0,ur.getPropertyCompletionList)(i,a)):a instanceof iO.ASTIndexExpression?o.addCollection(await(0,ur.getPropertyCompletionList)(i,a)):(o.setDefault((0,ur.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,ur.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}ur.activate=r$});var aO=m((tK,oO)=>{"use strict";oO.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 t_=m((nK,lO)=>{var $u=aO(),uO={};for(let t of Object.keys($u))uO[$u[t]]=t;var se={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"]}};lO.exports=se;for(let t of Object.keys(se)){if(!("channels"in se[t]))throw new Error("missing channels property: "+t);if(!("labels"in se[t]))throw new Error("missing channel labels property: "+t);if(se[t].labels.length!==se[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=se[t];delete se[t].channels,delete se[t].labels,Object.defineProperty(se[t],"channels",{value:e}),Object.defineProperty(se[t],"labels",{value:n})}se.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 l=(i+s)/2;return s===i?u=0:l<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,l*100]};se.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(o,a,u),c=l-Math.min(o,a,u),h=function(f){return(l-f)/6/c+1/2};return c===0?(i=0,s=0):(s=c/l,e=h(o),n=h(a),r=h(u),o===l?i=r-n:a===l?i=1/3+e-r:u===l&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,l*100]};se.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=se.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]};se.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 i$(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}se.rgb.keyword=function(t){let e=uO[t];if(e)return e;let n=1/0,r;for(let i of Object.keys($u)){let s=$u[i],o=i$(t,s);o<n&&(n=o,r=i)}return r};se.keyword.rgb=function(t){return $u[t]};se.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]};se.rgb.lab=function(t){let e=se.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]};se.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 l=0;l<3;l++)s=e+1/3*-(l-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[l]=o*255;return u};se.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]};se.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]}};se.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]};se.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),l,c,h;switch(o){default:case 6:case 0:l=a,c=u,h=n;break;case 1:l=u,c=a,h=n;break;case 2:l=n,c=a,h=u;break;case 3:l=n,c=u,h=a;break;case 4:l=u,c=n,h=a;break;case 5:l=a,c=n,h=u;break}return[l*255,c*255,h*255]};se.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]};se.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]};se.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]};se.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,l=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};se.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]};se.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]};se.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?se.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};se.hsv.ansi16=function(t){return se.rgb.ansi16(se.hsv.rgb(t),t[2])};se.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)};se.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]};se.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]};se.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};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.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]};se.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};se.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};se.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};se.gray.hsl=function(t){return[0,0,t[0]]};se.gray.hsv=se.gray.hsl;se.gray.hwb=function(t){return[0,100,t[0]]};se.gray.cmyk=function(t){return[0,0,0,t[0]]};se.gray.lab=function(t){return[t[0],0,0]};se.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};se.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var hO=m((rK,cO)=>{var Lf=t_();function s$(){let t={},e=Object.keys(Lf);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function o$(t){let e=s$(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Lf[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 a$(t,e){return function(n){return e(t(n))}}function u$(t,e){let n=[e[t].parent,t],r=Lf[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=a$(Lf[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}cO.exports=function(t){let e=o$(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]=u$(o,e))}return n}});var dO=m((iK,fO)=>{var n_=t_(),l$=hO(),na={},c$=Object.keys(n_);function h$(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 f$(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}c$.forEach(t=>{na[t]={},Object.defineProperty(na[t],"channels",{value:n_[t].channels}),Object.defineProperty(na[t],"labels",{value:n_[t].labels});let e=l$(t);Object.keys(e).forEach(r=>{let i=e[r];na[t][r]=f$(i),na[t][r].raw=h$(i)})});fO.exports=na});var gO=m(ra=>{"use strict";var d$=ra&&ra.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ra,"__esModule",{value:!0});ra.activate=void 0;var r_=d$(dO()),p$=Ee(),pO;(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"})(pO||(pO={}));var i_={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},g$=()=>new RegExp(`(?:mark|color)=(${Object.keys(i_).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),m$=Object.prototype.hasOwnProperty;function y$(t){t.connection.onColorPresentation(e=>[{label:`#${r_.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)).document.literals.filter(u=>u.type===p$.ASTType.StringLiteral),o=[],a=({match:u,markup:l,value:c,astPosition:h,lineIndex:f})=>{let g=u.index+l.indexOf("=")+1,v=g+c.length,b=h.line-1+f,O=g,A=v;return f===0&&(O+=h.character,A+=h.character),{start:{line:b,character:O},end:{line:b,character:A}}};for(let u=0;u<s.length;u++){let l=s[u];if(!l.start)continue;let c=l.start,h=l.value.toString().split(`
|
114
|
+
`);for(let f=0;f<h.length;f++){let g=h[f],v=g$(),b;for(;b=v.exec(g);){let[O,A]=b,k=a({match:b,markup:O,value:A,astPosition:c,lineIndex:f});if(A.startsWith("#")){let[S,_,N]=r_.default.hex.rgb(A.slice(1));o.push({range:k,color:{red:S/255,green:_/255,blue:N/255,alpha:1}})}else if(m$.call(i_,A)){let[S,_,N]=r_.default.hex.rgb(i_[A].slice(1));o.push({range:k,color:{red:S/255,green:_/255,blue:N/255,alpha:1}})}else o.push({range:k,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}ra.activate=y$});var mO=m(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.activate=void 0;var b$=Ee(),v$=ea(),_$=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,T$=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u={line:a.start.line-1,character:a.start.character-1},l={line:a.end.line-1,character:a.end.character-1},c={targetUri:o.source,targetRange:{start:u,end:l},targetSelectionRange:{start:u,end:l}},h=_$(c);s.has(h)||(s.add(h),i.push(c))}return i};function S$(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new v$.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{outer:s,closest:o}=i,a=s.length>0?s[s.length-1]:void 0,u=o;return a&&a instanceof b$.ASTMemberExpression&&a.identifier===o&&(u=a),await T$(r,u,u.scope)})}Nf.activate=S$});var yO=m(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.activate=void 0;async function k$(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.document.start,end:n.document.end},message:r.message,severity:1}})}function w$(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 k$(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}qf.activate=w$});var bO=m(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.getStringHashCode=void 0;jf.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 s_=m(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.createExpressionHash=void 0;var Ff=Ee(),vO=bO(),$f=(t,e)=>t.$$hash=e,x$=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function ia(t){let e=x$(t);if(e!==null)return e;let n=(0,vO.getStringHashCode)(t.type);switch(t.type){case Ff.ASTType.ParenthesisExpression:return ia(t.expression);case Ff.ASTType.MemberExpression:{let r=t;return n^=ia(r.base),n^=ia(r.identifier),$f(t,n)}case Ff.ASTType.IndexExpression:{let r=t;return n^=ia(r.base),n^=ia(r.index),$f(t,n)}case Ff.ASTType.Identifier:{let r=t;return n^=(0,vO.getStringHashCode)(r.name),$f(t,n)}}return $f(t,n)}function E$(t){return ia(t)}Bf.createExpressionHash=E$});var aa=m(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.getLiteralValue=oa.getLiteralRawValue=void 0;var sa=Ee(),A$=t=>{switch(t.type){case sa.ASTType.NilLiteral:return"null";case sa.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case sa.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};oa.getLiteralRawValue=A$;var O$=t=>{switch(t.type){case sa.ASTType.NilLiteral:return"null";case sa.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case sa.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};oa.getLiteralValue=O$});var a_=m(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.Stack=void 0;var o_=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}};Uf.Stack=o_});var ua=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.Factory=Us.TokenType=void 0;var C$=a_(),R$;(function(t){t[t.Text=0]="Text",t[t.EndOfLine=1]="EndOfLine",t[t.Comment=2]="Comment"})(R$=Us.TokenType||(Us.TokenType={}));var u_=class{get tokens(){return this._tokens}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._tokens=[],this._currentDependency=null,this._currentStack=new C$.Stack}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()}};Us.Factory=u_});var c_=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.BeautifyContext=Ws.IndentationType=void 0;var Bu=Ee(),Wf=ua(),_O;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(_O=Ws.IndentationType||(Ws.IndentationType={}));var l_=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}get usedComments(){return this._usedComments}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this._usedComments=new Set,this.getIndent=n.indentation===_O.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Bu.ASTIfClause||e instanceof Bu.ASTWhileStatement?e.condition.end.line:e instanceof Bu.ASTForGenericStatement?e.iterator.end.line:e instanceof Bu.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Bu.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}containsNewLineInRange(e,n=this.factory.tokens.length){let r=Math.min(n,this.factory.tokens.length);for(let i=e;i<r;i++)if(this.factory.tokens[i].type===Wf.TokenType.EndOfLine)return!0;return!1}buildBlock(e){if(e.body.length===0)return;e.body.sort((s,o)=>s.range[0]-o.range[0]);let n=null;for(let s=0;s<e.body.length;s++){let o=e.body[s],a=n?this.getPreviousEndLine(n):this.getBlockOpenerEndLine(e),u=Math.max(o.start.line-a-1,0);if(u>0)for(let c=0;c<u;c++){let h={line:a+c+1,character:0};this.factory.tokens.push({type:Wf.TokenType.EndOfLine,value:`
|
115
115
|
`,ref:{start:h,end:h}})}let l=this.factory.tokens.length;this.factory.process(o,{isCommand:!0}),l<this.factory.tokens.length&&(this.factory.tokens[l].value=this.getIndent()+this.factory.tokens[l].value,this.factory.tokens.push({type:Wf.TokenType.EndOfLine,value:`
|
116
116
|
`,ref:{start:o.end,end:o.end}})),n=o}let r=e.body[e.body.length-1],i=Math.max(e.end.line-this.getPreviousEndLine(r)-1,0);if(i>0)for(let s=0;s<i;s++){let o={line:r.end.line+s+1,character:0};this.factory.tokens.push({type:Wf.TokenType.EndOfLine,value:`
|
117
|
-
`,ref:{start:o,end:o}})}}};Ws.BeautifyContext=
|
117
|
+
`,ref:{start:o,end:o}})}}};Ws.BeautifyContext=l_});var h_=m(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.hasEmptyBody=Qt.containsMultilineItemInShortcutClauses=Qt.getLastComment=Qt.unwrap=Qt.countRightBinaryExpressions=Qt.SHORTHAND_OPERATORS=void 0;var Rn=Ee();Qt.SHORTHAND_OPERATORS=[Rn.Operator.Plus,Rn.Operator.Minus,Rn.Operator.Asterik,Rn.Operator.Slash,Rn.Operator.Modulo,Rn.Operator.Power];var P$=t=>{if(t=(0,Qt.unwrap)(t),t instanceof Rn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof Rn.ASTBinaryExpression&&n++,(r instanceof Rn.ASTBinaryExpression||r instanceof Rn.ASTLogicalExpression||r instanceof Rn.ASTIsaExpression)&&(e.push((0,Qt.unwrap)(r.left)),e.push((0,Qt.unwrap)(r.right)))}return n};Qt.countRightBinaryExpressions=P$;var D$=t=>{for(;t instanceof Rn.ASTParenthesisExpression;)t=t.expression;return t};Qt.unwrap=D$;var I$=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===Rn.ASTType.Comment)return n}return null};Qt.getLastComment=I$;var M$=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Qt.containsMultilineItemInShortcutClauses=M$;var L$=t=>!t.some(e=>!(e instanceof Rn.ASTComment));Qt.hasEmptyBody=L$});var d_=m(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.BeautifyFactory=void 0;var Uu=Ee(),N$=require("path"),TO=s_(),Hf=aa(),SO=c_(),Ti=h_(),q=ua(),f_=class extends q.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"(",ref:o}),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:")",ref:o})},Comment:function(o,a){if(this.context.usedComments.add(o),o.isMultiline){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Comment,value:`/*${o.value}*/`,ref:o,isMultiline:!0});return}this.tokens.push({type:q.TokenType.Comment,value:o.value.split(`
|
118
118
|
`).map(u=>`//${u}`).join(`
|
119
119
|
`),ref:o,isMultiline:!0});return}this.tokens.push({type:q.TokenType.Comment,value:"// "+o.value.trimStart(),ref:o,isMultiline:!1})},AssignmentStatement:function(o,a){let u=o.variable,l=o.init;if(this.process(u),(u instanceof Uu.ASTIdentifier||u instanceof Uu.ASTMemberExpression)&&l instanceof Uu.ASTBinaryExpression&&(l.left instanceof Uu.ASTIdentifier||l.left instanceof Uu.ASTMemberExpression)&&Ti.SHORTHAND_OPERATORS.includes(l.operator)&&(0,TO.createExpressionHash)(u)===(0,TO.createExpressionHash)(l.left)){this.tokens.push({type:q.TokenType.Text,value:" "+l.operator+"= ",ref:o}),this.process((0,Ti.unwrap)(l.right));return}this.tokens.push({type:q.TokenType.Text,value:" = ",ref:o}),this.process(l)},MemberExpression:function(o,a){this.process(o.base),this.tokens.push({type:q.TokenType.Text,value:o.indexer,ref:o}),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.tokens.push({type:q.TokenType.Text,value:"function",ref:{start:o.start,end:o.start}});else{this.context.disableMultiline(),this.tokens.push({type:q.TokenType.Text,value:"function(",ref:{start:o.start,end:o.start}});for(let u=0;u<o.parameters.length;u++){let l=o.parameters[u];this.process(l),u!==o.parameters.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:l})}this.tokens.push({type:q.TokenType.Text,value:")",ref:{start:o.start,end:o.start}}),this.context.enableMultiline()}this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
120
120
|
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end function",ref:{start:o.end,end:o.end}})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:q.TokenType.Text,value:"{}",ref:o});return}if(o.fields.length===1){this.tokens.push({type:q.TokenType.Text,value:"{ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:q.TokenType.Text,value:" }",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:q.TokenType.Text,value:"{",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
@@ -128,17 +128,17 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
128
128
|
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end for",ref:{start:o.end,end:o.end}})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"end if",ref:{start:o.end,end:o.end}})},IfClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"if ",ref:{start:o.start,end:o.start}}),this.process((0,Ti.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
129
129
|
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"else if ",ref:{start:o.start,end:o.start}}),this.process((0,Ti.unwrap)(o.condition)),this.tokens.push({type:q.TokenType.Text,value:" then",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
130
130
|
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"else",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
131
|
-
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"continue",ref:o})},BreakStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"break",ref:o})},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}if(this.currentDependency===null){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.tokens.push({type:q.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${u.replace(/"/g,'""')}"`,ref:o})},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:' = __REQUIRE("'+o.namespace+'")',ref:o})},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"debugger",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:"//debugger",ref:o})},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#line",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`${o.start.line}`,ref:o})},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#filename",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${(0,
|
131
|
+
`,ref:{start:o.start,end:o.start}}),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"continue",ref:o})},BreakStatement:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"break",ref:o})},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}if(this.currentDependency===null){this.tokens.push({type:q.TokenType.Text,value:`#inject "${o.path}";`,ref:o});return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.tokens.push({type:q.TokenType.Text,value:"null",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${u.replace(/"/g,()=>'""')}"`,ref:o})},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:"#import ",ref:o}),this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:` from "${o.path}";`,ref:o});return}this.process(o.name),this.tokens.push({type:q.TokenType.Text,value:' = __REQUIRE("'+o.namespace+'")',ref:o})},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}if(!o.chunk){this.tokens.push({type:q.TokenType.Text,value:`#include "${o.path}";`,ref:o});return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"debugger",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:"//debugger",ref:o})},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#line",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`${o.start.line}`,ref:o})},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:q.TokenType.Text,value:"#filename",ref:o});return}this.tokens.push({type:q.TokenType.Text,value:`"${(0,N$.basename)(o.filename).replace(/"/g,()=>'"')}"`,ref:o})},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.tokens.push({type:q.TokenType.Text,value:"[]",ref:o});return}if(o.fields.length===1){this.tokens.push({type:q.TokenType.Text,value:"[ ",ref:o}),this.process(o.fields[0]),this.tokens.push({type:q.TokenType.Text,value:" ]",ref:o});return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.tokens.push({type:q.TokenType.Text,value:"[",ref:{start:o.start,end:o.start}}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
132
132
|
`,ref:{start:o.start,end:o.start}});for(let u=0;u<o.fields.length;u++){let l=o.fields[u];this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:l}),this.process(l),this.tokens.push({type:q.TokenType.Text,value:",",ref:l}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
133
133
|
`,ref:l})}this.context.decIndent(),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent()+"]",ref:{start:o.end,end:o.end}});return}this.tokens.push({type:q.TokenType.Text,value:"[ ",ref:o});for(let u=0;u<o.fields.length;u++){let l=o.fields[u];this.process(l),u!==o.fields.length-1&&this.tokens.push({type:q.TokenType.Text,value:", ",ref:l})}this.tokens.push({type:q.TokenType.Text,value:" ]",ref:o})},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.tokens.push({type:q.TokenType.Text,value:(0,Hf.getLiteralRawValue)(o),ref:o})},EmptyExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:"",ref:o})},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Ti.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.tokens.push({type:q.TokenType.EndOfLine,value:`
|
134
134
|
`,ref:o}),this.tokens.push({type:q.TokenType.Text,value:this.context.getIndent(),ref:o}),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.tokens.push({type:q.TokenType.Text,value:"bitOr(",ref:o}),this.process(o.left),this.tokens.push({type:q.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:q.TokenType.Text,value:")",ref:o});return}else if(o.operator==="&"){this.tokens.push({type:q.TokenType.Text,value:"bitAnd(",ref:o}),this.process(o.left),this.tokens.push({type:q.TokenType.Text,value:", ",ref:o}),this.process(o.right),this.tokens.push({type:q.TokenType.Text,value:")",ref: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.tokens.push({type:q.TokenType.Text,value:" "+o.operator+" ",ref:o}),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.tokens.push({type:q.TokenType.Text,value:o.operator,ref:o}),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.tokens.push({type:q.TokenType.Text,value:" "+o.operators[u]+" ",ref:o}),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.buildBlock(o)}};let{keepParentheses:n=!1,indentation:r=SO.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new SO.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i],o=this.tokens[i+1];if(s.type===q.TokenType.Text)r+=s.value;else if(s.type===q.TokenType.Comment)r+=s.value;else if(s.type===q.TokenType.EndOfLine){if(o?.type===q.TokenType.Comment&&s.ref.end.line===o?.ref.start.line){r+=" "+o.value.trim(),i++;continue}r+=`
|
135
|
-
`}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Gf.BeautifyFactory=
|
135
|
+
`}else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Gf.BeautifyFactory=f_});var g_=m(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.DefaultFactory=void 0;var q$=require("path"),zf=aa(),H=ua(),p_=class extends H.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"(",ref:e}),this.process(e.expression),this.tokens.push({type:H.TokenType.Text,value:")",ref:e})},Comment:function(e,n){if(e.isMultiline){this.tokens.push({type:H.TokenType.Comment,value:e.value.split(`
|
136
136
|
`).map(r=>`//${r}`).join(`
|
137
137
|
`),ref:e});return}this.tokens.push({type:H.TokenType.Comment,value:"//"+e.value,ref:e})},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.tokens.push({type:H.TokenType.Text,value:"=",ref:e}),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:e.indexer,ref:e}),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.tokens.push({type:H.TokenType.Text,value:"function",ref:{start:e.start,end:e.start}});else{this.tokens.push({type:H.TokenType.Text,value:"function(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.start,end:e.start}})}this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
138
138
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
139
|
-
`,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end function",ref:{start:e.end,end:e.end}})},MapConstructorExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"{",ref:{start:e.start,end:e.start}});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:"}",ref:{start:e.end,end:e.end}})},MapKeyString:function(e,n){this.process(e.key),this.tokens.push({type:H.TokenType.Text,value:":",ref:e}),this.process(e.value)},Identifier:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.name,ref:e})},ReturnStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"return ",ref:e}),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,
|
139
|
+
`,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end function",ref:{start:e.end,end:e.end}})},MapConstructorExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"{",ref:{start:e.start,end:e.start}});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:"}",ref:{start:e.end,end:e.end}})},MapKeyString:function(e,n){this.process(e.key),this.tokens.push({type:H.TokenType.Text,value:":",ref:e}),this.process(e.value)},Identifier:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.name,ref:e})},ReturnStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"return ",ref:e}),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,zf.getLiteralValue)(e),ref:e})},WhileStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"while ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
140
140
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
141
|
-
`,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end while",ref:{start:e.end,end:e.end}})},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.tokens.push({type:H.TokenType.Text,value:"(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.end,end:e.end}})}},StringLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,
|
141
|
+
`,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end while",ref:{start:e.end,end:e.end}})},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.tokens.push({type:H.TokenType.Text,value:"(",ref:{start:e.start,end:e.start}});for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:")",ref:{start:e.end,end:e.end}})}},StringLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,zf.getLiteralRawValue)(e),ref:e})},SliceExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:"[",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:":",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},IndexExpression:function(e,n){this.process(e.base),this.tokens.push({type:H.TokenType.Text,value:"[",ref:e}),this.process(e.index),this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},UnaryExpression:function(e,n){e.operator==="new"?this.tokens.push({type:H.TokenType.Text,value:e.operator+" ",ref:e}):this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},NegationExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"not ",ref:e}),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#envar ${e.name}`,ref:e});return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${r}"`,ref:e})},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.tokens.push({type:H.TokenType.Text,value:" ",ref:e})}},IfShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"if ",ref:e}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else if ",ref:e}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then ",ref:e}),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else ",ref:e}),this.process(e.body[0])},NilLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,zf.getLiteralRawValue)(e),ref:e})},ForGenericStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"for ",ref:{start:e.start,end:e.start}}),this.process(e.variable),this.tokens.push({type:H.TokenType.Text,value:" in ",ref:{start:e.start,end:e.start}}),this.process(e.iterator),this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
142
142
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
143
143
|
`,ref:{start:r.end,end:r.end}})}this.tokens.push({type:H.TokenType.Text,value:"end for",ref:{start:e.end,end:e.end}})},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.tokens.push({type:H.TokenType.Text,value:"end if",ref:{start:e.end,end:e.end}})},IfClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"if ",ref:{start:e.start,end:e.start}}),this.process(e.condition),this.tokens.push({type:H.TokenType.Text,value:" then",ref:{start:e.start,end:e.start}}),this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
144
144
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
@@ -146,13 +146,13 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
146
146
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
147
147
|
`,ref:{start:r.end,end:r.end}})}},ElseClause:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"else",ref:{start:e.start,end:e.start}}),this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
148
148
|
`,ref:{start:e.start,end:e.start}});for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
149
|
-
`,ref:{start:r.end,end:r.end}})}},ContinueStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"continue",ref:e})},BreakStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"break",ref:e})},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}if(this.currentDependency===null){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${r.replace(/"/g,'""')}"`,ref:e})},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:' = __REQUIRE("'+e.namespace+'")',ref:e})},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"debugger",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:"//debugger",ref:e})},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#line",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`${e.start.line}`,ref:e})},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#filename",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${(0,
|
149
|
+
`,ref:{start:r.end,end:r.end}})}},ContinueStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"continue",ref:e})},BreakStatement:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"break",ref:e})},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}if(this.currentDependency===null){this.tokens.push({type:H.TokenType.Text,value:`#inject "${e.path}";`,ref:e});return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.tokens.push({type:H.TokenType.Text,value:"null",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${r.replace(/"/g,()=>'""')}"`,ref:e})},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:"#import ",ref:e}),this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:` from "${e.path}";`,ref:e});return}this.process(e.name),this.tokens.push({type:H.TokenType.Text,value:' = __REQUIRE("'+e.namespace+'")',ref:e})},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}if(!e.chunk){this.tokens.push({type:H.TokenType.Text,value:`#include "${e.path}";`,ref:e});return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"debugger",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:"//debugger",ref:e})},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#line",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`${e.start.line}`,ref:e})},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:H.TokenType.Text,value:"#filename",ref:e});return}this.tokens.push({type:H.TokenType.Text,value:`"${(0,q$.basename)(e.filename).replace(/"/g,()=>'"')}"`,ref:e})},ListConstructorExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"[",ref:e});for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.tokens.push({type:H.TokenType.Text,value:",",ref:i})}this.tokens.push({type:H.TokenType.Text,value:"]",ref:e})},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.tokens.push({type:H.TokenType.Text,value:(0,zf.getLiteralRawValue)(e),ref:e})},EmptyExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:"",ref:e})},IsaExpression:function(e,n){this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:" "+e.operator+" ",ref:e}),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.tokens.push({type:H.TokenType.Text,value:"bitOr(",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:")",ref:e});return}else if(e.operator==="&"){this.tokens.push({type:H.TokenType.Text,value:"bitAnd(",ref:e}),this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:",",ref:e}),this.process(e.right),this.tokens.push({type:H.TokenType.Text,value:")",ref:e});return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.tokens.push({type:H.TokenType.Text,value:e.operator,ref:e}),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.tokens.push({type:H.TokenType.Text,value:e.operators[r],ref:e}),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body){let i=this.tokens.length;this.process(r),i<this.tokens.length&&this.tokens.push({type:H.TokenType.EndOfLine,value:`
|
150
150
|
`,ref:{start:r.end,end:r.end}})}}}}transform(e,n){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===H.TokenType.Text||s.type===H.TokenType.Comment)r+=s.value;else if(s.type===H.TokenType.EndOfLine)r+=`
|
151
|
-
`;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};
|
151
|
+
`;else throw new Error("Unknown token type!")}return r}generateOptimizations(){return[]}};Kf.DefaultFactory=p_});var m_=m(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.createExpressionString=void 0;var Vf=Ee();function Wu(t){switch(t.type){case Vf.ASTType.ParenthesisExpression:return Wu(t.expression);case Vf.ASTType.MemberExpression:{let e=t;return`${Wu(e.base)}.${Wu(e.identifier)}`}case Vf.ASTType.IndexExpression:return`${Wu(t.base)}[]`;case Vf.ASTType.Identifier:return t.name}}function j$(t){return Wu(t)}Xf.createExpressionString=j$});var Hu=m(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.merge=void 0;function F$(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))}Yf.merge=F$});var b_=m(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.UglifyFactory=void 0;var $$=require("path"),kO=m_(),Qr=aa(),B$=Hu(),B=ua(),y_=class extends B.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"(",ref:i}),this.process(i.expression),this.tokens.push({type:B.TokenType.Text,value:")",ref:i})},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.tokens.push({type:B.TokenType.Text,value:"=",ref:i}),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:i.indexer,ref:i});let o=(0,kO.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.tokens.push({type:B.TokenType.Text,value:"function",ref:{start:i.start,end:i.start}});else{this.tokens.push({type:B.TokenType.Text,value:"function(",ref:{start:i.start,end:i.start}}),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.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.isWithinArgument=!1,this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.start,end:i.start}})}this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
152
152
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
153
153
|
`,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end function",ref:{start:i.end,end:i.end}})},MapConstructorExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"{",ref:{start:i.start,end:i.start}});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"}",ref:{start:i.end,end:i.end}})},MapKeyString:function(i,s){this.process(i.key),this.tokens.push({type:B.TokenType.Text,value:":",ref:i}),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:o,ref:i});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.tokens.push({type:B.TokenType.Text,value:o,ref:i})},ReturnStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"return ",ref:i}),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralValue)(i),ref:i})},WhileStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"while ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
154
154
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
155
|
-
`,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end while",ref:{start:i.end,end:i.end}})},CallExpression:function(i,s){let o=(0,kO.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 l=(0,Qr.getLiteralValue)(u),c=this.transformer.context.variables.get(l);this.tokens.push({type:B.TokenType.Text,value:'("'+(c??l)+'")',ref:{start:i.start,end:i.start}});return}this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}}),this.process(u),this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}});return}if(i.arguments.length!==0){this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}});for(let l=0;l<i.arguments.length;l++){let c=i.arguments[l];this.process(c),l!==i.arguments.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:c})}this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}})}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i})},SliceExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:":",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},IndexExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.index),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},UnaryExpression:function(i,s){i.operator==="new"?this.tokens.push({type:B.TokenType.Text,value:i.operator+" ",ref:i}):this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},NegationExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"not ",ref:i}),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#envar ${i.name}`,ref:i});return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o}"`,ref:i})},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"debugger",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:"//debugger",ref:i})},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#line",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`${i.start.line}`,ref:i})},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#filename",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${(0
|
155
|
+
`,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end while",ref:{start:i.end,end:i.end}})},CallExpression:function(i,s){let o=(0,kO.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 l=(0,Qr.getLiteralValue)(u),c=this.transformer.context.variables.get(l);this.tokens.push({type:B.TokenType.Text,value:'("'+(c??l)+'")',ref:{start:i.start,end:i.start}});return}this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}}),this.process(u),this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}});return}if(i.arguments.length!==0){this.tokens.push({type:B.TokenType.Text,value:"(",ref:{start:i.start,end:i.start}});for(let l=0;l<i.arguments.length;l++){let c=i.arguments[l];this.process(c),l!==i.arguments.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:c})}this.tokens.push({type:B.TokenType.Text,value:")",ref:{start:i.end,end:i.end}})}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i})},SliceExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:":",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},IndexExpression:function(i,s){this.process(i.base),this.tokens.push({type:B.TokenType.Text,value:"[",ref:i}),this.process(i.index),this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},UnaryExpression:function(i,s){i.operator==="new"?this.tokens.push({type:B.TokenType.Text,value:i.operator+" ",ref:i}):this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},NegationExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"not ",ref:i}),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#envar ${i.name}`,ref:i});return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o}"`,ref:i})},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"debugger",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:"//debugger",ref:i})},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#line",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`${i.start.line}`,ref:i})},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#filename",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${(0,$$.basename)(i.filename).replace(/"/g,()=>'"')}"`,ref:i})},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.tokens.push({type:B.TokenType.Text,value:" ",ref:i})}},IfShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:i}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else if ",ref:i}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then ",ref:i}),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else ",ref:i}),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i})},ForGenericStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"for ",ref:{start:i.start,end:i.start}}),this.process(i.variable,{isForVariable:!0}),this.tokens.push({type:B.TokenType.Text,value:" in ",ref:{start:i.start,end:i.start}}),this.process(i.iterator),this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
156
156
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
157
157
|
`,ref:{start:o.end,end:o.end}})}this.tokens.push({type:B.TokenType.Text,value:"end for",ref:{start:i.end,end:i.end}})},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.tokens.push({type:B.TokenType.Text,value:"end if",ref:{start:i.end,end:i.end}})},IfClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"if ",ref:{start:i.start,end:i.start}}),this.process(i.condition),this.tokens.push({type:B.TokenType.Text,value:" then",ref:{start:i.start,end:i.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
158
158
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
@@ -160,9 +160,9 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
160
160
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
161
161
|
`,ref:{start:o.end,end:o.end}})}},ElseClause:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"else",ref:{start:i.start,end:i.start}}),this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
162
162
|
`,ref:{start:i.start,end:i.start}});for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
163
|
-
`,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"continue",ref:i})},BreakStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"break",ref:i})},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}if(this.currentDependency===null){this.tokens.push({type:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o.replace(/"/g,'""')}"`,ref:i})},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(this.process(i.name),this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:`=__REQUIRE("${i.namespace}")`,ref:i});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:B.TokenType.Text,value:`=${o}("${i.namespace}")`,ref:i})},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"[",ref:i});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i})},EmptyExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"",ref:i})},IsaExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.tokens.push({type:B.TokenType.Text,value:"bitOr(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:i});return}else if(i.operator==="&"){this.tokens.push({type:B.TokenType.Text,value:"bitAnd(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:i});return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.tokens.push({type:B.TokenType.Text,value:i.operators[o],ref:i}),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
163
|
+
`,ref:{start:o.end,end:o.end}})}},ContinueStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"continue",ref:i})},BreakStatement:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"break",ref:i})},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}if(this.currentDependency===null){this.tokens.push({type:B.TokenType.Text,value:`#inject "${i.path}";`,ref:i});return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.tokens.push({type:B.TokenType.Text,value:"null",ref:i});return}this.tokens.push({type:B.TokenType.Text,value:`"${o.replace(/"/g,()=>'""')}"`,ref:i})},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:"#import ",ref:i}),this.process(i.name),this.tokens.push({type:B.TokenType.Text,value:` from "${i.path}";`,ref:i});return}if(this.process(i.name),this.disableNamespacesOptimization){this.tokens.push({type:B.TokenType.Text,value:`=__REQUIRE("${i.namespace}")`,ref:i});return}let o=this.transformer.context.variables.get("__REQUIRE");this.tokens.push({type:B.TokenType.Text,value:`=${o}("${i.namespace}")`,ref:i})},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}if(!i.chunk){this.tokens.push({type:B.TokenType.Text,value:`#include "${i.path}";`,ref:i});return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"[",ref:i});for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.tokens.push({type:B.TokenType.Text,value:",",ref:a})}this.tokens.push({type:B.TokenType.Text,value:"]",ref:i})},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i});return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.tokens.push({type:B.TokenType.Text,value:o.namespace,ref:i});return}this.tokens.push({type:B.TokenType.Text,value:(0,Qr.getLiteralRawValue)(i),ref:i})},EmptyExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:"",ref:i})},IsaExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:" "+i.operator+" ",ref:i}),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.tokens.push({type:B.TokenType.Text,value:"bitOr(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:i});return}else if(i.operator==="&"){this.tokens.push({type:B.TokenType.Text,value:"bitAnd(",ref:i}),this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:",",ref:i}),this.process(i.right),this.tokens.push({type:B.TokenType.Text,value:")",ref:i});return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.tokens.push({type:B.TokenType.Text,value:i.operator,ref:i}),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.tokens.push({type:B.TokenType.Text,value:i.operators[o],ref:i}),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body){let a=this.tokens.length;this.process(o),a<this.tokens.length&&this.tokens.push({type:B.TokenType.EndOfLine,value:`
|
164
164
|
`,ref:{start:o.end,end:o.end}})}}},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){this._tokens=[],this._currentDependency=n,this.process(e);let r="";for(let i=0;i<this.tokens.length-1;i++){let s=this.tokens[i];if(s.type===B.TokenType.Text||s.type===B.TokenType.Comment)r+=s.value;else if(s.type===B.TokenType.EndOfLine)r+=`
|
165
|
-
`;else throw new Error("Unknown token type!")}return r}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,Qr.getLiteralRawValue)(o.literal)}`);(0,$$.merge)(i,s)}return i}};Jf.UglifyFactory=b_});var Qf=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.getFactory=Hs.BuildType=void 0;var B$=p_(),U$=m_(),W$=v_(),Gu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Gu=Hs.BuildType||(Hs.BuildType={}));var H$={[Gu.DEFAULT]:U$.DefaultFactory,[Gu.UGLIFY]:W$.UglifyFactory,[Gu.BEAUTIFY]:B$.BeautifyFactory};function G$(t=Gu.DEFAULT){let e=H$[t];if(!e)throw new Error("Unknown build type.");return e}Hs.getFactory=G$});var __=m((wO,Zf)=>{(function(t){"use strict";function e(_,N){var R=(_&65535)+(N&65535),G=(_>>16)+(N>>16)+(R>>16);return G<<16|R&65535}function n(_,N){return _<<N|_>>>32-N}function r(_,N,R,G,ie,ue){return e(n(e(e(N,_),e(G,ue)),ie),R)}function i(_,N,R,G,ie,ue,K){return r(N&R|~N&G,_,N,ie,ue,K)}function s(_,N,R,G,ie,ue,K){return r(N&G|R&~G,_,N,ie,ue,K)}function o(_,N,R,G,ie,ue,K){return r(N^R^G,_,N,ie,ue,K)}function a(_,N,R,G,ie,ue,K){return r(R^(N|~G),_,N,ie,ue,K)}function u(_,N){_[N>>5]|=128<<N%32,_[(N+64>>>9<<4)+14]=N;var R,G,ie,ue,K,C=1732584193,M=-271733879,L=-1732584194,F=271733878;for(R=0;R<_.length;R+=16)G=C,ie=M,ue=L,K=F,C=i(C,M,L,F,_[R],7,-680876936),F=i(F,C,M,L,_[R+1],12,-389564586),L=i(L,F,C,M,_[R+2],17,606105819),M=i(M,L,F,C,_[R+3],22,-1044525330),C=i(C,M,L,F,_[R+4],7,-176418897),F=i(F,C,M,L,_[R+5],12,1200080426),L=i(L,F,C,M,_[R+6],17,-1473231341),M=i(M,L,F,C,_[R+7],22,-45705983),C=i(C,M,L,F,_[R+8],7,1770035416),F=i(F,C,M,L,_[R+9],12,-1958414417),L=i(L,F,C,M,_[R+10],17,-42063),M=i(M,L,F,C,_[R+11],22,-1990404162),C=i(C,M,L,F,_[R+12],7,1804603682),F=i(F,C,M,L,_[R+13],12,-40341101),L=i(L,F,C,M,_[R+14],17,-1502002290),M=i(M,L,F,C,_[R+15],22,1236535329),C=s(C,M,L,F,_[R+1],5,-165796510),F=s(F,C,M,L,_[R+6],9,-1069501632),L=s(L,F,C,M,_[R+11],14,643717713),M=s(M,L,F,C,_[R],20,-373897302),C=s(C,M,L,F,_[R+5],5,-701558691),F=s(F,C,M,L,_[R+10],9,38016083),L=s(L,F,C,M,_[R+15],14,-660478335),M=s(M,L,F,C,_[R+4],20,-405537848),C=s(C,M,L,F,_[R+9],5,568446438),F=s(F,C,M,L,_[R+14],9,-1019803690),L=s(L,F,C,M,_[R+3],14,-187363961),M=s(M,L,F,C,_[R+8],20,1163531501),C=s(C,M,L,F,_[R+13],5,-1444681467),F=s(F,C,M,L,_[R+2],9,-51403784),L=s(L,F,C,M,_[R+7],14,1735328473),M=s(M,L,F,C,_[R+12],20,-1926607734),C=o(C,M,L,F,_[R+5],4,-378558),F=o(F,C,M,L,_[R+8],11,-2022574463),L=o(L,F,C,M,_[R+11],16,1839030562),M=o(M,L,F,C,_[R+14],23,-35309556),C=o(C,M,L,F,_[R+1],4,-1530992060),F=o(F,C,M,L,_[R+4],11,1272893353),L=o(L,F,C,M,_[R+7],16,-155497632),M=o(M,L,F,C,_[R+10],23,-1094730640),C=o(C,M,L,F,_[R+13],4,681279174),F=o(F,C,M,L,_[R],11,-358537222),L=o(L,F,C,M,_[R+3],16,-722521979),M=o(M,L,F,C,_[R+6],23,76029189),C=o(C,M,L,F,_[R+9],4,-640364487),F=o(F,C,M,L,_[R+12],11,-421815835),L=o(L,F,C,M,_[R+15],16,530742520),M=o(M,L,F,C,_[R+2],23,-995338651),C=a(C,M,L,F,_[R],6,-198630844),F=a(F,C,M,L,_[R+7],10,1126891415),L=a(L,F,C,M,_[R+14],15,-1416354905),M=a(M,L,F,C,_[R+5],21,-57434055),C=a(C,M,L,F,_[R+12],6,1700485571),F=a(F,C,M,L,_[R+3],10,-1894986606),L=a(L,F,C,M,_[R+10],15,-1051523),M=a(M,L,F,C,_[R+1],21,-2054922799),C=a(C,M,L,F,_[R+8],6,1873313359),F=a(F,C,M,L,_[R+15],10,-30611744),L=a(L,F,C,M,_[R+6],15,-1560198380),M=a(M,L,F,C,_[R+13],21,1309151649),C=a(C,M,L,F,_[R+4],6,-145523070),F=a(F,C,M,L,_[R+11],10,-1120210379),L=a(L,F,C,M,_[R+2],15,718787259),M=a(M,L,F,C,_[R+9],21,-343485551),C=e(C,G),M=e(M,ie),L=e(L,ue),F=e(F,K);return[C,M,L,F]}function l(_){var N,R="",G=_.length*32;for(N=0;N<G;N+=8)R+=String.fromCharCode(_[N>>5]>>>N%32&255);return R}function c(_){var N,R=[];for(R[(_.length>>2)-1]=void 0,N=0;N<R.length;N+=1)R[N]=0;var G=_.length*8;for(N=0;N<G;N+=8)R[N>>5]|=(_.charCodeAt(N/8)&255)<<N%32;return R}function h(_){return l(u(c(_),_.length*8))}function f(_,N){var R,G=c(_),ie=[],ue=[],K;for(ie[15]=ue[15]=void 0,G.length>16&&(G=u(G,_.length*8)),R=0;R<16;R+=1)ie[R]=G[R]^909522486,ue[R]=G[R]^1549556828;return K=u(ie.concat(c(N)),512+N.length*8),l(u(ue.concat(K),640))}function g(_){var N="0123456789abcdef",R="",G,ie;for(ie=0;ie<_.length;ie+=1)G=_.charCodeAt(ie),R+=N.charAt(G>>>4&15)+N.charAt(G&15);return R}function v(_){return unescape(encodeURIComponent(_))}function b(_){return h(v(_))}function O(_){return g(b(_))}function A(_,N){return f(v(_),v(N))}function k(_,N){return g(A(_,N))}function S(_,N,R){return N?R?A(N,_):k(N,_):R?b(_):O(_)}typeof define=="function"&&define.amd?define(function(){return S}):typeof Zf=="object"&&Zf.exports?Zf.exports=S:t.md5=S})(wO)});var S_=m(la=>{"use strict";var K$=la&&la.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(la,"__esModule",{value:!0});la.LiteralsMapper=void 0;var z$=K$(__()),xO=aa(),T_=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,xO.getLiteralRawValue)(e);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,z$.default)(r)))}return n}get(e){let n=this,r=(0,xO.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};la.LiteralsMapper=T_});var w_=m(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.NamespaceGenerator=void 0;var k_=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}};ed.NamespaceGenerator=k_});var Ku=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.Context=Gs.ContextDataProperty=void 0;var V$=Ee(),X$=S_(),EO=w_(),Y$;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(Y$=Gs.ContextDataProperty||(Gs.ContextDataProperty={}));var x_=class{constructor(e){let n=this;n.modules=new EO.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new EO.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(V$.Keyword),...e.variablesExcluded||[]]}),n.literals=new X$.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)}};Gs.Context=x_});var E_=m(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.DependencyType=void 0;var J$;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(J$=zu.DependencyType||(zu.DependencyType={}))});var nd=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.BuildError=void 0;var A_=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};td.BuildError=A_});var id=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.fetchNamespaces=void 0;var O_=Ee();function AO(t){if(t.type===O_.ASTType.MemberExpression){let e=t;return e.identifier.type===O_.ASTType.Identifier?e.identifier.name:null}else if(t.type===O_.ASTType.Identifier)return t.name;return null}function Q$(t){let e=new Set(t.namespaces.map(AO).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(AO).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}rd.fetchNamespaces=Q$});var D_=m(Zi=>{"use strict";var C_=Zi&&Zi.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},DO=Zi&&Zi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Dependency=void 0;var OO=DO(__()),Z$=DO(require("events")),CO=Yr(),sd=Ku(),R_=E_(),RO=nd(),eB=id(),PO=Hu(),P_=class t extends Z$.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,OO.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||R_.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(sd.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(sd.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return C_(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(sd.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,l=yield u.getTargetRelativeTo(i.target,e),c=(0,OO.default)(l),h=o.get(c);if(a.has(h))return a.get(h);if(!(yield u.has(l)))throw new Error("Dependency "+l+" does not exist...");let f=yield u.get(l);i.emit("parse-before",l);try{let v=new CO.Parser(f,{filename:l}).parseChunk(),b=new t({target:l,resourceHandler:u,chunk:v,type:n,context:s,ref:r});return i.emit("parse-after",b),b}catch(g){throw g instanceof RO.BuildError?g:new RO.BuildError(g.message,{target:l,range:g.range})}})}findInjections(){return C_(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return C_(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(sd.ContextDataProperty.DependencyCallStack),o=[...(0,eB.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let l=[...n,...r];for(let h of l){let f=h instanceof CO.ASTFeatureIncludeExpression?R_.DependencyType.Include:R_.DependencyType.Import,g=yield e.resolve(h.path,f,h),v=g.getNamespace();if(s.includes(v))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let b=g.chunk;h.chunk=b,h.namespace=v;let O=yield g.findDependencies();(0,PO.merge)(o,O.namespaces),(0,PO.merge)(a,O.literals),u.push(g)}yield this.findInjections();let c=new Set(u);return e.dependencies=c,s.pop(),{dependencies:c,namespaces:o,literals:a}})}};Zi.Dependency=P_});var ad=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.Transformer=void 0;var I_=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)}};od.Transformer=I_});var cd=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.generateCharsetMap=void 0;function ud(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function tB(t=!1){let e=ud(65,90),n=ud(97,122),r=ud(48,57),i="_";return t&&(i=i+ud(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}ld.generateCharsetMap=tB});var L_=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MAIN_BOILERPLATE=es.MODULE_BOILERPLATE=es.HEADER_BOILERPLATE=void 0;var M_=Yr();es.HEADER_BOILERPLATE=new M_.Parser(`MODULES={}
|
165
|
+
`;else throw new Error("Unknown token type!")}return r}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,Qr.getLiteralRawValue)(o.literal)}`);(0,B$.merge)(i,s)}return i}};Jf.UglifyFactory=y_});var Qf=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.getFactory=Hs.BuildType=void 0;var U$=d_(),W$=g_(),H$=b_(),Gu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Gu=Hs.BuildType||(Hs.BuildType={}));var G$={[Gu.DEFAULT]:W$.DefaultFactory,[Gu.UGLIFY]:H$.UglifyFactory,[Gu.BEAUTIFY]:U$.BeautifyFactory};function z$(t=Gu.DEFAULT){let e=G$[t];if(!e)throw new Error("Unknown build type.");return e}Hs.getFactory=z$});var v_=m((wO,Zf)=>{(function(t){"use strict";function e(_,N){var R=(_&65535)+(N&65535),G=(_>>16)+(N>>16)+(R>>16);return G<<16|R&65535}function n(_,N){return _<<N|_>>>32-N}function r(_,N,R,G,ie,ue){return e(n(e(e(N,_),e(G,ue)),ie),R)}function i(_,N,R,G,ie,ue,z){return r(N&R|~N&G,_,N,ie,ue,z)}function s(_,N,R,G,ie,ue,z){return r(N&G|R&~G,_,N,ie,ue,z)}function o(_,N,R,G,ie,ue,z){return r(N^R^G,_,N,ie,ue,z)}function a(_,N,R,G,ie,ue,z){return r(R^(N|~G),_,N,ie,ue,z)}function u(_,N){_[N>>5]|=128<<N%32,_[(N+64>>>9<<4)+14]=N;var R,G,ie,ue,z,C=1732584193,M=-271733879,L=-1732584194,F=271733878;for(R=0;R<_.length;R+=16)G=C,ie=M,ue=L,z=F,C=i(C,M,L,F,_[R],7,-680876936),F=i(F,C,M,L,_[R+1],12,-389564586),L=i(L,F,C,M,_[R+2],17,606105819),M=i(M,L,F,C,_[R+3],22,-1044525330),C=i(C,M,L,F,_[R+4],7,-176418897),F=i(F,C,M,L,_[R+5],12,1200080426),L=i(L,F,C,M,_[R+6],17,-1473231341),M=i(M,L,F,C,_[R+7],22,-45705983),C=i(C,M,L,F,_[R+8],7,1770035416),F=i(F,C,M,L,_[R+9],12,-1958414417),L=i(L,F,C,M,_[R+10],17,-42063),M=i(M,L,F,C,_[R+11],22,-1990404162),C=i(C,M,L,F,_[R+12],7,1804603682),F=i(F,C,M,L,_[R+13],12,-40341101),L=i(L,F,C,M,_[R+14],17,-1502002290),M=i(M,L,F,C,_[R+15],22,1236535329),C=s(C,M,L,F,_[R+1],5,-165796510),F=s(F,C,M,L,_[R+6],9,-1069501632),L=s(L,F,C,M,_[R+11],14,643717713),M=s(M,L,F,C,_[R],20,-373897302),C=s(C,M,L,F,_[R+5],5,-701558691),F=s(F,C,M,L,_[R+10],9,38016083),L=s(L,F,C,M,_[R+15],14,-660478335),M=s(M,L,F,C,_[R+4],20,-405537848),C=s(C,M,L,F,_[R+9],5,568446438),F=s(F,C,M,L,_[R+14],9,-1019803690),L=s(L,F,C,M,_[R+3],14,-187363961),M=s(M,L,F,C,_[R+8],20,1163531501),C=s(C,M,L,F,_[R+13],5,-1444681467),F=s(F,C,M,L,_[R+2],9,-51403784),L=s(L,F,C,M,_[R+7],14,1735328473),M=s(M,L,F,C,_[R+12],20,-1926607734),C=o(C,M,L,F,_[R+5],4,-378558),F=o(F,C,M,L,_[R+8],11,-2022574463),L=o(L,F,C,M,_[R+11],16,1839030562),M=o(M,L,F,C,_[R+14],23,-35309556),C=o(C,M,L,F,_[R+1],4,-1530992060),F=o(F,C,M,L,_[R+4],11,1272893353),L=o(L,F,C,M,_[R+7],16,-155497632),M=o(M,L,F,C,_[R+10],23,-1094730640),C=o(C,M,L,F,_[R+13],4,681279174),F=o(F,C,M,L,_[R],11,-358537222),L=o(L,F,C,M,_[R+3],16,-722521979),M=o(M,L,F,C,_[R+6],23,76029189),C=o(C,M,L,F,_[R+9],4,-640364487),F=o(F,C,M,L,_[R+12],11,-421815835),L=o(L,F,C,M,_[R+15],16,530742520),M=o(M,L,F,C,_[R+2],23,-995338651),C=a(C,M,L,F,_[R],6,-198630844),F=a(F,C,M,L,_[R+7],10,1126891415),L=a(L,F,C,M,_[R+14],15,-1416354905),M=a(M,L,F,C,_[R+5],21,-57434055),C=a(C,M,L,F,_[R+12],6,1700485571),F=a(F,C,M,L,_[R+3],10,-1894986606),L=a(L,F,C,M,_[R+10],15,-1051523),M=a(M,L,F,C,_[R+1],21,-2054922799),C=a(C,M,L,F,_[R+8],6,1873313359),F=a(F,C,M,L,_[R+15],10,-30611744),L=a(L,F,C,M,_[R+6],15,-1560198380),M=a(M,L,F,C,_[R+13],21,1309151649),C=a(C,M,L,F,_[R+4],6,-145523070),F=a(F,C,M,L,_[R+11],10,-1120210379),L=a(L,F,C,M,_[R+2],15,718787259),M=a(M,L,F,C,_[R+9],21,-343485551),C=e(C,G),M=e(M,ie),L=e(L,ue),F=e(F,z);return[C,M,L,F]}function l(_){var N,R="",G=_.length*32;for(N=0;N<G;N+=8)R+=String.fromCharCode(_[N>>5]>>>N%32&255);return R}function c(_){var N,R=[];for(R[(_.length>>2)-1]=void 0,N=0;N<R.length;N+=1)R[N]=0;var G=_.length*8;for(N=0;N<G;N+=8)R[N>>5]|=(_.charCodeAt(N/8)&255)<<N%32;return R}function h(_){return l(u(c(_),_.length*8))}function f(_,N){var R,G=c(_),ie=[],ue=[],z;for(ie[15]=ue[15]=void 0,G.length>16&&(G=u(G,_.length*8)),R=0;R<16;R+=1)ie[R]=G[R]^909522486,ue[R]=G[R]^1549556828;return z=u(ie.concat(c(N)),512+N.length*8),l(u(ue.concat(z),640))}function g(_){var N="0123456789abcdef",R="",G,ie;for(ie=0;ie<_.length;ie+=1)G=_.charCodeAt(ie),R+=N.charAt(G>>>4&15)+N.charAt(G&15);return R}function v(_){return unescape(encodeURIComponent(_))}function b(_){return h(v(_))}function O(_){return g(b(_))}function A(_,N){return f(v(_),v(N))}function k(_,N){return g(A(_,N))}function S(_,N,R){return N?R?A(N,_):k(N,_):R?b(_):O(_)}typeof define=="function"&&define.amd?define(function(){return S}):typeof Zf=="object"&&Zf.exports?Zf.exports=S:t.md5=S})(wO)});var T_=m(la=>{"use strict";var K$=la&&la.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(la,"__esModule",{value:!0});la.LiteralsMapper=void 0;var V$=K$(v_()),xO=aa(),__=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,xO.getLiteralRawValue)(e);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,V$.default)(r)))}return n}get(e){let n=this,r=(0,xO.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};la.LiteralsMapper=__});var k_=m(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.NamespaceGenerator=void 0;var S_=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}};ed.NamespaceGenerator=S_});var zu=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.Context=Gs.ContextDataProperty=void 0;var X$=Ee(),Y$=T_(),EO=k_(),J$;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(J$=Gs.ContextDataProperty||(Gs.ContextDataProperty={}));var w_=class{constructor(e){let n=this;n.modules=new EO.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new EO.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(X$.Keyword),...e.variablesExcluded||[]]}),n.literals=new Y$.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)}};Gs.Context=w_});var x_=m(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.DependencyType=void 0;var Q$;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(Q$=Ku.DependencyType||(Ku.DependencyType={}))});var nd=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.BuildError=void 0;var E_=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};td.BuildError=E_});var id=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.fetchNamespaces=void 0;var A_=Ee();function AO(t){if(t.type===A_.ASTType.MemberExpression){let e=t;return e.identifier.type===A_.ASTType.Identifier?e.identifier.name:null}else if(t.type===A_.ASTType.Identifier)return t.name;return null}function Z$(t){let e=new Set(t.namespaces.map(AO).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(AO).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}rd.fetchNamespaces=Z$});var P_=m(Zi=>{"use strict";var O_=Zi&&Zi.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},DO=Zi&&Zi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Dependency=void 0;var OO=DO(v_()),eB=DO(require("events")),CO=Yr(),sd=zu(),C_=x_(),RO=nd(),tB=id(),PO=Hu(),R_=class t extends eB.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,OO.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||C_.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(sd.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(sd.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return O_(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(sd.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,l=yield u.getTargetRelativeTo(i.target,e),c=(0,OO.default)(l),h=o.get(c);if(a.has(h))return a.get(h);if(!(yield u.has(l)))throw new Error("Dependency "+l+" does not exist...");let f=yield u.get(l);i.emit("parse-before",l);try{let v=new CO.Parser(f,{filename:l}).parseChunk(),b=new t({target:l,resourceHandler:u,chunk:v,type:n,context:s,ref:r});return i.emit("parse-after",b),b}catch(g){throw g instanceof RO.BuildError?g:new RO.BuildError(g.message,{target:l,range:g.range})}})}findInjections(){return O_(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return O_(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(sd.ContextDataProperty.DependencyCallStack),o=[...(0,tB.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let l=[...n,...r];for(let h of l){let f=h instanceof CO.ASTFeatureIncludeExpression?C_.DependencyType.Include:C_.DependencyType.Import,g=yield e.resolve(h.path,f,h),v=g.getNamespace();if(s.includes(v))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let b=g.chunk;h.chunk=b,h.namespace=v;let O=yield g.findDependencies();(0,PO.merge)(o,O.namespaces),(0,PO.merge)(a,O.literals),u.push(g)}yield this.findInjections();let c=new Set(u);return e.dependencies=c,s.pop(),{dependencies:c,namespaces:o,literals:a}})}};Zi.Dependency=R_});var ad=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.Transformer=void 0;var D_=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)}};od.Transformer=D_});var cd=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.generateCharsetMap=void 0;function ud(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function nB(t=!1){let e=ud(65,90),n=ud(97,122),r=ud(48,57),i="_";return t&&(i=i+ud(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}ld.generateCharsetMap=nB});var M_=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MAIN_BOILERPLATE=es.MODULE_BOILERPLATE=es.HEADER_BOILERPLATE=void 0;var I_=Yr();es.HEADER_BOILERPLATE=new I_.Parser(`MODULES={}
|
166
166
|
EXPORTED={}
|
167
167
|
__REQUIRE=function(r)
|
168
168
|
if (not MODULES.hasIndex(r)) then
|
@@ -171,7 +171,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
171
171
|
end if
|
172
172
|
module=@MODULES[r]
|
173
173
|
return @module(r).exports
|
174
|
-
end function`).parseChunk();es.MODULE_BOILERPLATE=new
|
174
|
+
end function`).parseChunk();es.MODULE_BOILERPLATE=new I_.Parser(`MODULES["$0"]=function(r)
|
175
175
|
module={}
|
176
176
|
if (EXPORTED.hasIndex(r)) then
|
177
177
|
module=EXPORTED[r]
|
@@ -181,18 +181,18 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
181
181
|
end if
|
182
182
|
EXPORTED[r]=module
|
183
183
|
return EXPORTED[r]
|
184
|
-
end function`).parseChunk();es.MAIN_BOILERPLATE=new
|
185
|
-
`)}};hd.OutputProcessor=N_});var LO=m(ca=>{"use strict";var rB=ca&&ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ca,"__esModule",{value:!0});ca.DirectTranspiler=void 0;var iB=rB(require("events")),sB=Yr(),MO=Qf(),oB=Ku(),aB=ad(),uB=cd(),lB=id(),cB=fd(),hB=Object.prototype.hasOwnProperty,q_=class extends iB.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=hB.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||MO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,MO.getFactory)(e.buildType),i=new sB.Parser(e.code).parseChunk(),s=(0,lB.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,uB.generateCharsetMap)(e.obfuscation),u=new oB.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let c=new aB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new cB.OutputProcessor(u,c);h.addOptimizations();let f=c.transform(i);return h.addCode(f),h.build()}};ca.DirectTranspiler=q_});var F_=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ResourceProvider=void 0;var j_=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))}}};dd.ResourceProvider=j_});var B_=m(ts=>{"use strict";var fB=ts&&ts.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},dB=ts&&ts.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ts,"__esModule",{value:!0});ts.Target=void 0;var pB=dB(require("events")),gB=Yr(),mB=D_(),NO=nd(),$_=class extends pB.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return fB(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new gB.Parser(s,{filename:r}).parseChunk(),u=new mB.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:l,literals:c}=yield u.findDependencies(),h=new Set(l);for(let f of h)i.variables.createNamespace(f);for(let f of c)i.literals.add(f);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof NO.BuildError?o:new NO.BuildError(o.message,{target:this.target,range:o.range})}})}};ts.Target=$_});var jO=m(ha=>{"use strict";var yB=ha&&ha.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})};Object.defineProperty(ha,"__esModule",{value:!0});ha.Transpiler=void 0;var bB=W_(),vB=L_(),qO=Qf(),_B=Ku(),TB=F_(),SB=B_(),kB=ad(),wB=cd(),xB=fd(),EB=Object.prototype.hasOwnProperty,U_=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new TB.ResourceProvider().getHandler(),n.obfuscation=EB.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,wB.generateCharsetMap)(n.obfuscation);n.context=new _B.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||qO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return yB(this,void 0,void 0,function*(){let e=this,n=(0,qO.getFactory)(e.buildType),r=e.context,s=yield new SB.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new kB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(vB.MODULE_BOILERPLATE),l=c=>{let h=r.modules.get(c.getId()),f={},g=0,v=function(A){let k=A.getNamespace();if(!(k in f)){if(k!==h&&A.type===bB.DependencyType.Import){let S=o.transform(A.chunk,A);f[k]=u.replace('"$0"','"'+k+'"').replace('"$1"',S),g++}for(let S of A.dependencies)v(S)}};v(c);let b=new xB.OutputProcessor(r,o);b.addOptimizations(),g>0&&b.addHeader(),Object.keys(f).forEach(A=>b.addCode(f[A]));let O=o.transform(c.chunk,c);return b.addCode(O,!0),b.build()};return{[e.target]:l(a.dependency)}})}};ha.Transpiler=U_});var FO=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.unwrap=void 0;var AB=Ee();function OB(t){for(;t instanceof AB.ASTParenthesisExpression;)t=t.expression;return t}pd.unwrap=OB});var W_=m(ee=>{"use strict";var $O=ee&&ee.__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]}),CB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RB=ee&&ee.__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)&&$O(e,t,n);return CB(e,t),e},PB=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&$O(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.unwrap=ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.merge=ee.LiteralsMapper=ee.getLiteralValue=ee.getLiteralRawValue=ee.fetchNamespaces=ee.BuildError=ee.createExpressionString=ee.createExpressionHash=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.UglifyFactory=ee.TokenType=ee.Factory=ee.DefaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.BeautifyFactory=ee.getFactory=ee.BuildType=void 0;var BO=Qf();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return BO.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return BO.getFactory}});var DB=p_();Object.defineProperty(ee,"BeautifyFactory",{enumerable:!0,get:function(){return DB.BeautifyFactory}});var IB=h_();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return IB.BeautifyContext}});ee.BeautifyUtils=RB(f_());var MB=m_();Object.defineProperty(ee,"DefaultFactory",{enumerable:!0,get:function(){return MB.DefaultFactory}});var UO=ua();Object.defineProperty(ee,"Factory",{enumerable:!0,get:function(){return UO.Factory}});Object.defineProperty(ee,"TokenType",{enumerable:!0,get:function(){return UO.TokenType}});var LB=v_();Object.defineProperty(ee,"UglifyFactory",{enumerable:!0,get:function(){return LB.UglifyFactory}});var WO=Ku();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return WO.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return WO.ContextDataProperty}});var NB=D_();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return NB.Dependency}});var qB=LO();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return qB.DirectTranspiler}});PB(F_(),ee);var jB=B_();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return jB.Target}});var FB=ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return FB.Transformer}});var $B=jO();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return $B.Transpiler}});var BB=E_();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return BB.DependencyType}});var UB=cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return UB.generateCharsetMap}});var WB=o_();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return WB.createExpressionHash}});var HB=y_();Object.defineProperty(ee,"createExpressionString",{enumerable:!0,get:function(){return HB.createExpressionString}});var GB=nd();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return GB.BuildError}});var KB=id();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return KB.fetchNamespaces}});var HO=aa();Object.defineProperty(ee,"getLiteralRawValue",{enumerable:!0,get:function(){return HO.getLiteralRawValue}});Object.defineProperty(ee,"getLiteralValue",{enumerable:!0,get:function(){return HO.getLiteralValue}});var zB=S_();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return zB.LiteralsMapper}});var VB=Hu();Object.defineProperty(ee,"merge",{enumerable:!0,get:function(){return VB.merge}});var XB=w_();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return XB.NamespaceGenerator}});var YB=fd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return YB.OutputProcessor}});var JB=u_();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return JB.Stack}});var QB=FO();Object.defineProperty(ee,"unwrap",{enumerable:!0,get:function(){return QB.unwrap}})});var KO=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.activate=void 0;var GO=W_();function ZB(t){async function e(n){try{let r=t.getConfiguration();return new GO.DirectTranspiler({code:n,buildType:GO.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.document.end},newText:s}]})}gd.activate=ZB});var md=m((Vu,H_)=>{(function(t,e){if(typeof Vu=="object"&&typeof H_=="object")H_.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Vu=="object"?Vu:t)[r]=n[r]}})(Vu,()=>(()=>{"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,l){for(var c,h="",f=0,g=-1,v=0,b=0;b<=u.length;++b){if(b<u.length)c=u.charCodeAt(b);else{if(c===47)break;c=47}if(c===47){if(!(g===b-1||v===1))if(g!==b-1&&v===2){if(h.length<2||f!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var O=h.lastIndexOf("/");if(O!==h.length-1){O===-1?(h="",f=0):f=(h=h.slice(0,O)).length-1-h.lastIndexOf("/"),g=b,v=0;continue}}else if(h.length===2||h.length===1){h="",f=0,g=b,v=0;continue}}l&&(h.length>0?h+="/..":h="..",f=2)}else h.length>0?h+="/"+u.slice(g+1,b):h=u.slice(g+1,b),f=b-g-1;g=b,v=0}else c===46&&v!==-1?++v:v=-1}return h}var a={resolve:function(){for(var u,l="",c=!1,h=arguments.length-1;h>=-1&&!c;h--){var f;h>=0?f=arguments[h]:(u===void 0&&(u=process.cwd()),f=u),s(f),f.length!==0&&(l=f+"/"+l,c=f.charCodeAt(0)===47)}return l=o(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(s(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=o(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+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,l=0;l<arguments.length;++l){var c=arguments[l];s(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":a.normalize(u)},relative:function(u,l){if(s(u),s(l),u===l||(u=a.resolve(u))===(l=a.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var h=u.length,f=h-c,g=1;g<l.length&&l.charCodeAt(g)===47;++g);for(var v=l.length-g,b=f<v?f:v,O=-1,A=0;A<=b;++A){if(A===b){if(v>b){if(l.charCodeAt(g+A)===47)return l.slice(g+A+1);if(A===0)return l.slice(g+A)}else f>b&&(u.charCodeAt(c+A)===47?O=A:A===0&&(O=0));break}var k=u.charCodeAt(c+A);if(k!==l.charCodeAt(g+A))break;k===47&&(O=A)}var S="";for(A=c+O+1;A<=h;++A)A!==h&&u.charCodeAt(A)!==47||(S.length===0?S+="..":S+="/..");return S.length>0?S+l.slice(g+O):(g+=O,l.charCodeAt(g)===47&&++g,l.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,h=-1,f=!0,g=u.length-1;g>=1;--g)if((l=u.charCodeAt(g))===47){if(!f){h=g;break}}else f=!1;return h===-1?c?"/":".":c&&h===1?"//":u.slice(0,h)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');s(u);var c,h=0,f=-1,g=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var v=l.length-1,b=-1;for(c=u.length-1;c>=0;--c){var O=u.charCodeAt(c);if(O===47){if(!g){h=c+1;break}}else b===-1&&(g=!1,b=c+1),v>=0&&(O===l.charCodeAt(v)?--v==-1&&(f=c):(v=-1,f=b))}return h===f?f=b:f===-1&&(f=u.length),u.slice(h,f)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!g){h=c+1;break}}else f===-1&&(g=!1,f=c+1);return f===-1?"":u.slice(h,f)},extname:function(u){s(u);for(var l=-1,c=0,h=-1,f=!0,g=0,v=u.length-1;v>=0;--v){var b=u.charCodeAt(v);if(b!==47)h===-1&&(f=!1,h=v+1),b===46?l===-1?l=v:g!==1&&(g=1):l!==-1&&(g=-1);else if(!f){c=v+1;break}}return l===-1||h===-1||g===0||g===1&&l===h-1&&l===c+1?"":u.slice(l,h)},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(l,c){var h=c.dir||c.root,f=c.base||(c.name||"")+(c.ext||"");return h?h===c.root?h+f:h+"/"+f:f}(0,u)},parse:function(u){s(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,h=u.charCodeAt(0),f=h===47;f?(l.root="/",c=1):c=0;for(var g=-1,v=0,b=-1,O=!0,A=u.length-1,k=0;A>=c;--A)if((h=u.charCodeAt(A))!==47)b===-1&&(O=!1,b=A+1),h===46?g===-1?g=A:k!==1&&(k=1):g!==-1&&(k=-1);else if(!O){v=A+1;break}return g===-1||b===-1||k===0||k===1&&g===b-1&&g===v+1?b!==-1&&(l.base=l.name=v===0&&f?u.slice(1,b):u.slice(v,b)):(v===0&&f?(l.name=u.slice(1,g),l.base=u.slice(1,b)):(l.name=u.slice(v,g),l.base=u.slice(v,b)),l.ext=u.slice(g,b)),v>0?l.dir=u.slice(0,v-1):f&&(l.dir="/"),l},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+.-]*$/,l=/^\//,c=/^\/\//;function h(K,C){if(!K.scheme&&C)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(!l.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(c.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 f="",g="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class b{static isUri(C){return C instanceof b||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,M,L,F,me,pe=!1){typeof C=="object"?(this.scheme=C.scheme||f,this.authority=C.authority||f,this.path=C.path||f,this.query=C.query||f,this.fragment=C.fragment||f):(this.scheme=function(qt,Tt){return qt||Tt?qt:"file"}(C,pe),this.authority=M||f,this.path=function(qt,Tt){switch(qt){case"https":case"http":case"file":Tt?Tt[0]!==g&&(Tt=g+Tt):Tt=g}return Tt}(this.scheme,L||f),this.query=F||f,this.fragment=me||f,h(this,pe))}get fsPath(){return N(this,!1)}with(C){if(!C)return this;let{scheme:M,authority:L,path:F,query:me,fragment:pe}=C;return M===void 0?M=this.scheme:M===null&&(M=f),L===void 0?L=this.authority:L===null&&(L=f),F===void 0?F=this.path:F===null&&(F=f),me===void 0?me=this.query:me===null&&(me=f),pe===void 0?pe=this.fragment:pe===null&&(pe=f),M===this.scheme&&L===this.authority&&F===this.path&&me===this.query&&pe===this.fragment?this:new A(M,L,F,me,pe)}static parse(C,M=!1){let L=v.exec(C);return L?new A(L[2]||f,ue(L[4]||f),ue(L[5]||f),ue(L[7]||f),ue(L[9]||f),M):new A(f,f,f,f,f)}static file(C){let M=f;if(a.isWindows&&(C=C.replace(/\\/g,g)),C[0]===g&&C[1]===g){let L=C.indexOf(g,2);L===-1?(M=C.substring(2),C=g):(M=C.substring(2,L),C=C.substring(L)||g)}return new A("file",M,C,f,f)}static from(C){let M=new A(C.scheme,C.authority,C.path,C.query,C.fragment);return h(M,!0),M}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof b)return C;{let M=new A(C);return M._formatted=C.external,M._fsPath=C._sep===O?C.fsPath:null,M}}return C}}s.URI=b;let O=a.isWindows?1:void 0;class A extends b{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=O),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}let k={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 S(K,C,M){let L,F=-1;for(let me=0;me<K.length;me++){let pe=K.charCodeAt(me);if(pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===45||pe===46||pe===95||pe===126||C&&pe===47||M&&pe===91||M&&pe===93||M&&pe===58)F!==-1&&(L+=encodeURIComponent(K.substring(F,me)),F=-1),L!==void 0&&(L+=K.charAt(me));else{L===void 0&&(L=K.substr(0,me));let qt=k[pe];qt!==void 0?(F!==-1&&(L+=encodeURIComponent(K.substring(F,me)),F=-1),L+=qt):F===-1&&(F=me)}}return F!==-1&&(L+=encodeURIComponent(K.substring(F))),L!==void 0?L:K}function _(K){let C;for(let M=0;M<K.length;M++){let L=K.charCodeAt(M);L===35||L===63?(C===void 0&&(C=K.substr(0,M)),C+=k[L]):C!==void 0&&(C+=K[M])}return C!==void 0?C:K}function N(K,C){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?C?K.path.substr(1):K.path[1].toLowerCase()+K.path.substr(2):K.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(K,C){let M=C?_:S,L="",{scheme:F,authority:me,path:pe,query:qt,fragment:Tt}=K;if(F&&(L+=F,L+=":"),(me||F==="file")&&(L+=g,L+=g),me){let Ue=me.indexOf("@");if(Ue!==-1){let Tn=me.substr(0,Ue);me=me.substr(Ue+1),Ue=Tn.lastIndexOf(":"),Ue===-1?L+=M(Tn,!1,!1):(L+=M(Tn.substr(0,Ue),!1,!1),L+=":",L+=M(Tn.substr(Ue+1),!1,!0)),L+="@"}me=me.toLowerCase(),Ue=me.lastIndexOf(":"),Ue===-1?L+=M(me,!1,!0):(L+=M(me.substr(0,Ue),!1,!0),L+=me.substr(Ue))}if(pe){if(pe.length>=3&&pe.charCodeAt(0)===47&&pe.charCodeAt(2)===58){let Ue=pe.charCodeAt(1);Ue>=65&&Ue<=90&&(pe=`/${String.fromCharCode(Ue+32)}:${pe.substr(3)}`)}else if(pe.length>=2&&pe.charCodeAt(1)===58){let Ue=pe.charCodeAt(0);Ue>=65&&Ue<=90&&(pe=`${String.fromCharCode(Ue+32)}:${pe.substr(2)}`)}L+=M(pe,!0,!1)}return qt&&(L+="?",L+=M(qt,!1,!1)),Tt&&(L+="#",L+=C?Tt:S(Tt,!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 ie=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ue(K){return K.match(ie)?K.replace(ie,C=>G(C)):K}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,b,O,A){A===void 0&&(A=O);var k=Object.getOwnPropertyDescriptor(b,O);k&&!("get"in k?!b.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return b[O]}}),Object.defineProperty(v,A,k)}:function(v,b,O,A){A===void 0&&(A=O),v[A]=b[O]}),u=this&&this.__setModuleDefault||(Object.create?function(v,b){Object.defineProperty(v,"default",{enumerable:!0,value:b})}:function(v,b){v.default=b}),l=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var b={};if(v!=null)for(var O in v)O!=="default"&&Object.prototype.hasOwnProperty.call(v,O)&&a(b,v,O);return u(b,v),b};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let c=l(o(470)),h=c.posix||c,f="/";var g;(function(v){v.joinPath=function(b,...O){return b.with({path:h.join(b.path,...O)})},v.resolvePath=function(b,...O){let A=b.path,k=!1;A[0]!==f&&(A=f+A,k=!0);let S=h.resolve(A,...O);return k&&S[0]===f&&!b.authority&&(S=S.substring(1)),b.with({path:S})},v.dirname=function(b){if(b.path.length===0||b.path===f)return b;let O=h.dirname(b.path);return O.length===1&&O.charCodeAt(0)===46&&(O=""),b.with({path:O})},v.basename=function(b){return h.basename(b.path)},v.extname=function(b){return h.extname(b.path)}})(g||(s.Utils=g={}))}},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 bd=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.MarkdownString=void 0;var G_=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+=`
|
186
|
-
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};yd.MarkdownString=
|
187
|
-
`)};ft.appendTooltipHeader=
|
184
|
+
end function`).parseChunk();es.MAIN_BOILERPLATE=new I_.Parser('"$0"').parseChunk()});var fd=m(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.OutputProcessor=void 0;var IO=M_(),rB=Hu(),L_=class{constructor(e,n,{header:r=IO.HEADER_BOILERPLATE,main:i=IO.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,rB.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(`
|
185
|
+
`)}};hd.OutputProcessor=L_});var LO=m(ca=>{"use strict";var iB=ca&&ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ca,"__esModule",{value:!0});ca.DirectTranspiler=void 0;var sB=iB(require("events")),oB=Yr(),MO=Qf(),aB=zu(),uB=ad(),lB=cd(),cB=id(),hB=fd(),fB=Object.prototype.hasOwnProperty,N_=class extends sB.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=fB.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||MO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,MO.getFactory)(e.buildType),i=new oB.Parser(e.code).parseChunk(),s=(0,cB.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,lB.generateCharsetMap)(e.obfuscation),u=new aB.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let c=new uB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new hB.OutputProcessor(u,c);h.addOptimizations();let f=c.transform(i);return h.addCode(f),h.build()}};ca.DirectTranspiler=N_});var j_=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ResourceProvider=void 0;var q_=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))}}};dd.ResourceProvider=q_});var $_=m(ts=>{"use strict";var dB=ts&&ts.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})},pB=ts&&ts.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ts,"__esModule",{value:!0});ts.Target=void 0;var gB=pB(require("events")),mB=Yr(),yB=P_(),NO=nd(),F_=class extends gB.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return dB(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new mB.Parser(s,{filename:r}).parseChunk(),u=new yB.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:l,literals:c}=yield u.findDependencies(),h=new Set(l);for(let f of h)i.variables.createNamespace(f);for(let f of c)i.literals.add(f);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof NO.BuildError?o:new NO.BuildError(o.message,{target:this.target,range:o.range})}})}};ts.Target=F_});var jO=m(ha=>{"use strict";var bB=ha&&ha.__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(c){try{l(r.next(c))}catch(h){o(h)}}function u(c){try{l(r.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(t,e||[])).next())})};Object.defineProperty(ha,"__esModule",{value:!0});ha.Transpiler=void 0;var vB=U_(),_B=M_(),qO=Qf(),TB=zu(),SB=j_(),kB=$_(),wB=ad(),xB=cd(),EB=fd(),AB=Object.prototype.hasOwnProperty,B_=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new SB.ResourceProvider().getHandler(),n.obfuscation=AB.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,xB.generateCharsetMap)(n.obfuscation);n.context=new TB.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||qO.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return bB(this,void 0,void 0,function*(){let e=this,n=(0,qO.getFactory)(e.buildType),r=e.context,s=yield new kB.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new wB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(_B.MODULE_BOILERPLATE),l=c=>{let h=r.modules.get(c.getId()),f={},g=0,v=function(A){let k=A.getNamespace();if(!(k in f)){if(k!==h&&A.type===vB.DependencyType.Import){let S=o.transform(A.chunk,A);f[k]=u.replace('"$0"',()=>'"'+k+'"').replace('"$1"',()=>S),g++}for(let S of A.dependencies)v(S)}};v(c);let b=new EB.OutputProcessor(r,o);b.addOptimizations(),g>0&&b.addHeader(),Object.keys(f).forEach(A=>b.addCode(f[A]));let O=o.transform(c.chunk,c);return b.addCode(O,!0),b.build()};return{[e.target]:l(a.dependency)}})}};ha.Transpiler=B_});var FO=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.unwrap=void 0;var OB=Ee();function CB(t){for(;t instanceof OB.ASTParenthesisExpression;)t=t.expression;return t}pd.unwrap=CB});var U_=m(ee=>{"use strict";var $O=ee&&ee.__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]}),RB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PB=ee&&ee.__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)&&$O(e,t,n);return RB(e,t),e},DB=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&$O(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.unwrap=ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.merge=ee.LiteralsMapper=ee.getLiteralValue=ee.getLiteralRawValue=ee.fetchNamespaces=ee.BuildError=ee.createExpressionString=ee.createExpressionHash=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.UglifyFactory=ee.TokenType=ee.Factory=ee.DefaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.BeautifyFactory=ee.getFactory=ee.BuildType=void 0;var BO=Qf();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return BO.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return BO.getFactory}});var IB=d_();Object.defineProperty(ee,"BeautifyFactory",{enumerable:!0,get:function(){return IB.BeautifyFactory}});var MB=c_();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return MB.BeautifyContext}});ee.BeautifyUtils=PB(h_());var LB=g_();Object.defineProperty(ee,"DefaultFactory",{enumerable:!0,get:function(){return LB.DefaultFactory}});var UO=ua();Object.defineProperty(ee,"Factory",{enumerable:!0,get:function(){return UO.Factory}});Object.defineProperty(ee,"TokenType",{enumerable:!0,get:function(){return UO.TokenType}});var NB=b_();Object.defineProperty(ee,"UglifyFactory",{enumerable:!0,get:function(){return NB.UglifyFactory}});var WO=zu();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return WO.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return WO.ContextDataProperty}});var qB=P_();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return qB.Dependency}});var jB=LO();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return jB.DirectTranspiler}});DB(j_(),ee);var FB=$_();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return FB.Target}});var $B=ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return $B.Transformer}});var BB=jO();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return BB.Transpiler}});var UB=x_();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return UB.DependencyType}});var WB=cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return WB.generateCharsetMap}});var HB=s_();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return HB.createExpressionHash}});var GB=m_();Object.defineProperty(ee,"createExpressionString",{enumerable:!0,get:function(){return GB.createExpressionString}});var zB=nd();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return zB.BuildError}});var KB=id();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return KB.fetchNamespaces}});var HO=aa();Object.defineProperty(ee,"getLiteralRawValue",{enumerable:!0,get:function(){return HO.getLiteralRawValue}});Object.defineProperty(ee,"getLiteralValue",{enumerable:!0,get:function(){return HO.getLiteralValue}});var VB=T_();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return VB.LiteralsMapper}});var XB=Hu();Object.defineProperty(ee,"merge",{enumerable:!0,get:function(){return XB.merge}});var YB=k_();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return YB.NamespaceGenerator}});var JB=fd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return JB.OutputProcessor}});var QB=a_();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return QB.Stack}});var ZB=FO();Object.defineProperty(ee,"unwrap",{enumerable:!0,get:function(){return ZB.unwrap}})});var zO=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.activate=void 0;var GO=U_();function e2(t){async function e(n){try{let r=t.getConfiguration();return new GO.DirectTranspiler({code:n,buildType:GO.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.document.end},newText:s}]})}gd.activate=e2});var md=m((Vu,W_)=>{(function(t,e){if(typeof Vu=="object"&&typeof W_=="object")W_.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Vu=="object"?Vu:t)[r]=n[r]}})(Vu,()=>(()=>{"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,l){for(var c,h="",f=0,g=-1,v=0,b=0;b<=u.length;++b){if(b<u.length)c=u.charCodeAt(b);else{if(c===47)break;c=47}if(c===47){if(!(g===b-1||v===1))if(g!==b-1&&v===2){if(h.length<2||f!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var O=h.lastIndexOf("/");if(O!==h.length-1){O===-1?(h="",f=0):f=(h=h.slice(0,O)).length-1-h.lastIndexOf("/"),g=b,v=0;continue}}else if(h.length===2||h.length===1){h="",f=0,g=b,v=0;continue}}l&&(h.length>0?h+="/..":h="..",f=2)}else h.length>0?h+="/"+u.slice(g+1,b):h=u.slice(g+1,b),f=b-g-1;g=b,v=0}else c===46&&v!==-1?++v:v=-1}return h}var a={resolve:function(){for(var u,l="",c=!1,h=arguments.length-1;h>=-1&&!c;h--){var f;h>=0?f=arguments[h]:(u===void 0&&(u=process.cwd()),f=u),s(f),f.length!==0&&(l=f+"/"+l,c=f.charCodeAt(0)===47)}return l=o(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(s(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=o(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+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,l=0;l<arguments.length;++l){var c=arguments[l];s(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":a.normalize(u)},relative:function(u,l){if(s(u),s(l),u===l||(u=a.resolve(u))===(l=a.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var h=u.length,f=h-c,g=1;g<l.length&&l.charCodeAt(g)===47;++g);for(var v=l.length-g,b=f<v?f:v,O=-1,A=0;A<=b;++A){if(A===b){if(v>b){if(l.charCodeAt(g+A)===47)return l.slice(g+A+1);if(A===0)return l.slice(g+A)}else f>b&&(u.charCodeAt(c+A)===47?O=A:A===0&&(O=0));break}var k=u.charCodeAt(c+A);if(k!==l.charCodeAt(g+A))break;k===47&&(O=A)}var S="";for(A=c+O+1;A<=h;++A)A!==h&&u.charCodeAt(A)!==47||(S.length===0?S+="..":S+="/..");return S.length>0?S+l.slice(g+O):(g+=O,l.charCodeAt(g)===47&&++g,l.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,h=-1,f=!0,g=u.length-1;g>=1;--g)if((l=u.charCodeAt(g))===47){if(!f){h=g;break}}else f=!1;return h===-1?c?"/":".":c&&h===1?"//":u.slice(0,h)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');s(u);var c,h=0,f=-1,g=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var v=l.length-1,b=-1;for(c=u.length-1;c>=0;--c){var O=u.charCodeAt(c);if(O===47){if(!g){h=c+1;break}}else b===-1&&(g=!1,b=c+1),v>=0&&(O===l.charCodeAt(v)?--v==-1&&(f=c):(v=-1,f=b))}return h===f?f=b:f===-1&&(f=u.length),u.slice(h,f)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!g){h=c+1;break}}else f===-1&&(g=!1,f=c+1);return f===-1?"":u.slice(h,f)},extname:function(u){s(u);for(var l=-1,c=0,h=-1,f=!0,g=0,v=u.length-1;v>=0;--v){var b=u.charCodeAt(v);if(b!==47)h===-1&&(f=!1,h=v+1),b===46?l===-1?l=v:g!==1&&(g=1):l!==-1&&(g=-1);else if(!f){c=v+1;break}}return l===-1||h===-1||g===0||g===1&&l===h-1&&l===c+1?"":u.slice(l,h)},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(l,c){var h=c.dir||c.root,f=c.base||(c.name||"")+(c.ext||"");return h?h===c.root?h+f:h+"/"+f:f}(0,u)},parse:function(u){s(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,h=u.charCodeAt(0),f=h===47;f?(l.root="/",c=1):c=0;for(var g=-1,v=0,b=-1,O=!0,A=u.length-1,k=0;A>=c;--A)if((h=u.charCodeAt(A))!==47)b===-1&&(O=!1,b=A+1),h===46?g===-1?g=A:k!==1&&(k=1):g!==-1&&(k=-1);else if(!O){v=A+1;break}return g===-1||b===-1||k===0||k===1&&g===b-1&&g===v+1?b!==-1&&(l.base=l.name=v===0&&f?u.slice(1,b):u.slice(v,b)):(v===0&&f?(l.name=u.slice(1,g),l.base=u.slice(1,b)):(l.name=u.slice(v,g),l.base=u.slice(v,b)),l.ext=u.slice(g,b)),v>0?l.dir=u.slice(0,v-1):f&&(l.dir="/"),l},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+.-]*$/,l=/^\//,c=/^\/\//;function h(z,C){if(!z.scheme&&C)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${z.authority}", path: "${z.path}", query: "${z.query}", fragment: "${z.fragment}"}`);if(z.scheme&&!u.test(z.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(z.path){if(z.authority){if(!l.test(z.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(c.test(z.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let f="",g="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class b{static isUri(C){return C instanceof b||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,M,L,F,me,pe=!1){typeof C=="object"?(this.scheme=C.scheme||f,this.authority=C.authority||f,this.path=C.path||f,this.query=C.query||f,this.fragment=C.fragment||f):(this.scheme=function(jt,Tt){return jt||Tt?jt:"file"}(C,pe),this.authority=M||f,this.path=function(jt,Tt){switch(jt){case"https":case"http":case"file":Tt?Tt[0]!==g&&(Tt=g+Tt):Tt=g}return Tt}(this.scheme,L||f),this.query=F||f,this.fragment=me||f,h(this,pe))}get fsPath(){return N(this,!1)}with(C){if(!C)return this;let{scheme:M,authority:L,path:F,query:me,fragment:pe}=C;return M===void 0?M=this.scheme:M===null&&(M=f),L===void 0?L=this.authority:L===null&&(L=f),F===void 0?F=this.path:F===null&&(F=f),me===void 0?me=this.query:me===null&&(me=f),pe===void 0?pe=this.fragment:pe===null&&(pe=f),M===this.scheme&&L===this.authority&&F===this.path&&me===this.query&&pe===this.fragment?this:new A(M,L,F,me,pe)}static parse(C,M=!1){let L=v.exec(C);return L?new A(L[2]||f,ue(L[4]||f),ue(L[5]||f),ue(L[7]||f),ue(L[9]||f),M):new A(f,f,f,f,f)}static file(C){let M=f;if(a.isWindows&&(C=C.replace(/\\/g,g)),C[0]===g&&C[1]===g){let L=C.indexOf(g,2);L===-1?(M=C.substring(2),C=g):(M=C.substring(2,L),C=C.substring(L)||g)}return new A("file",M,C,f,f)}static from(C){let M=new A(C.scheme,C.authority,C.path,C.query,C.fragment);return h(M,!0),M}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof b)return C;{let M=new A(C);return M._formatted=C.external,M._fsPath=C._sep===O?C.fsPath:null,M}}return C}}s.URI=b;let O=a.isWindows?1:void 0;class A extends b{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=O),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}let k={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 S(z,C,M){let L,F=-1;for(let me=0;me<z.length;me++){let pe=z.charCodeAt(me);if(pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===45||pe===46||pe===95||pe===126||C&&pe===47||M&&pe===91||M&&pe===93||M&&pe===58)F!==-1&&(L+=encodeURIComponent(z.substring(F,me)),F=-1),L!==void 0&&(L+=z.charAt(me));else{L===void 0&&(L=z.substr(0,me));let jt=k[pe];jt!==void 0?(F!==-1&&(L+=encodeURIComponent(z.substring(F,me)),F=-1),L+=jt):F===-1&&(F=me)}}return F!==-1&&(L+=encodeURIComponent(z.substring(F))),L!==void 0?L:z}function _(z){let C;for(let M=0;M<z.length;M++){let L=z.charCodeAt(M);L===35||L===63?(C===void 0&&(C=z.substr(0,M)),C+=k[L]):C!==void 0&&(C+=z[M])}return C!==void 0?C:z}function N(z,C){let M;return M=z.authority&&z.path.length>1&&z.scheme==="file"?`//${z.authority}${z.path}`:z.path.charCodeAt(0)===47&&(z.path.charCodeAt(1)>=65&&z.path.charCodeAt(1)<=90||z.path.charCodeAt(1)>=97&&z.path.charCodeAt(1)<=122)&&z.path.charCodeAt(2)===58?C?z.path.substr(1):z.path[1].toLowerCase()+z.path.substr(2):z.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(z,C){let M=C?_:S,L="",{scheme:F,authority:me,path:pe,query:jt,fragment:Tt}=z;if(F&&(L+=F,L+=":"),(me||F==="file")&&(L+=g,L+=g),me){let We=me.indexOf("@");if(We!==-1){let Tn=me.substr(0,We);me=me.substr(We+1),We=Tn.lastIndexOf(":"),We===-1?L+=M(Tn,!1,!1):(L+=M(Tn.substr(0,We),!1,!1),L+=":",L+=M(Tn.substr(We+1),!1,!0)),L+="@"}me=me.toLowerCase(),We=me.lastIndexOf(":"),We===-1?L+=M(me,!1,!0):(L+=M(me.substr(0,We),!1,!0),L+=me.substr(We))}if(pe){if(pe.length>=3&&pe.charCodeAt(0)===47&&pe.charCodeAt(2)===58){let We=pe.charCodeAt(1);We>=65&&We<=90&&(pe=`/${String.fromCharCode(We+32)}:${pe.substr(3)}`)}else if(pe.length>=2&&pe.charCodeAt(1)===58){let We=pe.charCodeAt(0);We>=65&&We<=90&&(pe=`${String.fromCharCode(We+32)}:${pe.substr(2)}`)}L+=M(pe,!0,!1)}return jt&&(L+="?",L+=M(jt,!1,!1)),Tt&&(L+="#",L+=C?Tt:S(Tt,!1,!1)),L}function G(z){try{return decodeURIComponent(z)}catch{return z.length>3?z.substr(0,3)+G(z.substr(3)):z}}s.uriToFsPath=N;let ie=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ue(z){return z.match(ie)?z.replace(ie,C=>G(C)):z}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,b,O,A){A===void 0&&(A=O);var k=Object.getOwnPropertyDescriptor(b,O);k&&!("get"in k?!b.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return b[O]}}),Object.defineProperty(v,A,k)}:function(v,b,O,A){A===void 0&&(A=O),v[A]=b[O]}),u=this&&this.__setModuleDefault||(Object.create?function(v,b){Object.defineProperty(v,"default",{enumerable:!0,value:b})}:function(v,b){v.default=b}),l=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var b={};if(v!=null)for(var O in v)O!=="default"&&Object.prototype.hasOwnProperty.call(v,O)&&a(b,v,O);return u(b,v),b};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let c=l(o(470)),h=c.posix||c,f="/";var g;(function(v){v.joinPath=function(b,...O){return b.with({path:h.join(b.path,...O)})},v.resolvePath=function(b,...O){let A=b.path,k=!1;A[0]!==f&&(A=f+A,k=!0);let S=h.resolve(A,...O);return k&&S[0]===f&&!b.authority&&(S=S.substring(1)),b.with({path:S})},v.dirname=function(b){if(b.path.length===0||b.path===f)return b;let O=h.dirname(b.path);return O.length===1&&O.charCodeAt(0)===46&&(O=""),b.with({path:O})},v.basename=function(b){return h.basename(b.path)},v.extname=function(b){return h.extname(b.path)}})(g||(s.Utils=g={}))}},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 bd=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.MarkdownString=void 0;var H_=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+=`
|
186
|
+
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};yd.MarkdownString=H_});var vd=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.createHover=ft.createSignatureInfo=ft.appendTooltipBody=ft.appendTooltipHeader=ft.createTooltipHeader=ft.formatDefaultValue=ft.formatTypes=ft.formatKind=void 0;var lr=Yo(),KO=bs(),VO=bd(),t2={[lr.CompletionItemKind.Constant]:"constant",[lr.CompletionItemKind.Expression]:"expr",[lr.CompletionItemKind.Function]:"function",[lr.CompletionItemKind.Internal]:"internal",[lr.CompletionItemKind.InternalFunction]:"function",[lr.CompletionItemKind.InternalProperty]:"var",[lr.CompletionItemKind.ListConstructor]:"list",[lr.CompletionItemKind.Literal]:"literal",[lr.CompletionItemKind.MapConstructor]:"map",[lr.CompletionItemKind.Property]:"var",[lr.CompletionItemKind.Unknown]:"unknown",[lr.CompletionItemKind.Variable]:"var"};function G_(t){return t2[t]||"unknown"}ft.formatKind=G_;function z_(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}ft.formatTypes=z_;function XO(t){return typeof t=="string"?`"${t}"`:t.toString()}ft.formatDefaultValue=XO;var n2=(t,e)=>{let n=e.getArguments()||[],r=z_(e.getReturns())||"null";if(n.length===0)return`(${G_(t.kind)}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${z_(s.getTypes())}${s.getDefault()?` = ${XO(s.getDefault().value)}`:""}`).join(", ");return`(${G_(t.kind)}) ${t.label} (${i}): ${r}`};ft.createTooltipHeader=n2;var r2=(t,e,n)=>{t.appendCodeblock(KO.LanguageId,(0,ft.createTooltipHeader)(e,n)),t.appendMarkdown(`***
|
187
|
+
`)};ft.appendTooltipHeader=r2;var i2=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
|
188
188
|
`),n.length>0&&(t.appendMarkdown(`#### Examples:
|
189
|
-
`),t.appendCodeblock(
|
190
|
-
`)))};ft.appendTooltipBody=
|
191
|
-
`)),{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=new u2.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===YO.ASTType.FeatureImportExpression||s.closest.type===YO.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,_d.createHover)(o);let a=new JO.MarkdownString(""),u=Array.from(o.types).map(V_.SignatureDefinitionTypeMeta.parse),l=`(${(0,_d.formatKind)(o.kind)}) ${o.label}: ${(0,_d.formatTypes)(u)}`;if(o.types.has(V_.SignatureDefinitionBaseType.Map)){let c={};for(let[h,f]of o.values){let g=Array.from(f.types).map(V_.SignatureDefinitionTypeMeta.parse);c[h.slice(2)]=(0,_d.formatTypes)(g)}l+=" "+JSON.stringify(c,null,2)}return a.appendCodeblock(l2.LanguageId,l),{contents:a.toString()}})}fa.activate=h2});var eC=m(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.activate=void 0;var ZO=Ee(),f2=ea(),d2=vd(),p2=t=>{if(t.closest.type===ZO.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===ZO.ASTType.CallExpression)return n}return null};function g2(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new f2.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=p2(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let l=o.arguments.findIndex(h=>{let f=h.start.character-1,g=h.end.character;return f<=e.position.character&&g>=e.position.character}),c={activeParameter:l===-1?0:l,signatures:[],activeSignature:0};return c.signatures.push(...(0,d2.createSignatureInfo)(a)),c})}Td.activate=g2});var nC=m(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.activate=void 0;var tC=bs();function m2(t){let e=r=>r.languageId!==tC.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===tC.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)}Sd.activate=m2});var rC=m((Wz,y2)=>{y2.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 iC=m((Hz,b2)=>{b2.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:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. 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:
|
189
|
+
`),t.appendCodeblock(KO.LanguageId,n.join(`
|
190
|
+
`)))};ft.appendTooltipBody=i2;var s2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,ft.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new VO.MarkdownString("");(0,ft.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};ft.createSignatureInfo=s2;var o2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new VO.MarkdownString(""),i=n;(0,ft.appendTooltipHeader)(r,t,i),(0,ft.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};ft.createHover=o2});var QO=m(fa=>{"use strict";var a2=fa&&fa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fa,"__esModule",{value:!0});fa.activate=void 0;var YO=Yr(),K_=sr(),u2=a2(require("path")),Xu=md(),l2=ea(),JO=bd(),_d=vd(),c2=bs(),h2=async(t,e,n)=>{let r=Xu.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?Xu.Utils.joinPath(r,".."):n.startsWith("/")?i:Xu.Utils.joinPath(r,"..")};function f2(t){async function e(n,r){let i=new JO.MarkdownString(""),o=r.closest.path,a=await h2(t,n,o),u=Xu.Utils.joinPath(a,o),l=Xu.Utils.joinPath(a,`${o}`),c=await t.fs.findExistingPath(u.toString(),l.toString()),h=c==null?["Cannot open file."]:[`[Inserts file "${u2.default.basename(c)}" inside this code when building](${c.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(h.join(`
|
191
|
+
`)),{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=new l2.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===YO.ASTType.FeatureImportExpression||s.closest.type===YO.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,_d.createHover)(o);let a=new JO.MarkdownString(""),u=Array.from(o.types).map(K_.SignatureDefinitionTypeMeta.parse),l=`(${(0,_d.formatKind)(o.kind)}) ${o.label}: ${(0,_d.formatTypes)(u)}`;if(o.types.has(K_.SignatureDefinitionBaseType.Map)){let c={};for(let[h,f]of o.values){let g=Array.from(f.types).map(K_.SignatureDefinitionTypeMeta.parse);c[h.slice(2)]=(0,_d.formatTypes)(g)}l+=" "+JSON.stringify(c,null,2)}return a.appendCodeblock(c2.LanguageId,l),{contents:a.toString()}})}fa.activate=f2});var eC=m(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.activate=void 0;var ZO=Ee(),d2=ea(),p2=vd(),g2=t=>{if(t.closest.type===ZO.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===ZO.ASTType.CallExpression)return n}return null};function m2(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new d2.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=g2(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let l=o.arguments.findIndex(h=>{let f=h.start.character-1,g=h.end.character;return f<=e.position.character&&g>=e.position.character}),c={activeParameter:l===-1?0:l,signatures:[],activeSignature:0};return c.signatures.push(...(0,p2.createSignatureInfo)(a)),c})}Td.activate=m2});var nC=m(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.activate=void 0;var tC=bs();function y2(t){let e=r=>r.languageId!==tC.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===tC.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)}Sd.activate=y2});var rC=m((HK,b2)=>{b2.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 iC=m((GK,v2)=>{v2.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:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. 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:
|
192
192
|
miniscript: a string such as "1.5"
|
193
193
|
buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
|
194
194
|
host: a number for the host major and minor version, like 0.9
|
195
195
|
hostName: name of the host application, e.g. "Mini Micro"
|
196
|
-
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var sC=m((Gz,v2)=>{v2.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 oC=m((Kz,_2)=>{_2.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 aC=m((zz,T2)=>{T2.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 uC=m((Vz,S2)=>{S2.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 lC=m(Yu=>{"use strict";var da=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var k2=da(rC()),w2=da(iC()),x2=da(sC()),E2=da(oC()),A2=da(aC()),O2=da(uC()),C2={any:k2.default,general:w2.default,list:x2.default,map:E2.default,string:O2.default,number:A2.default};Yu.default=C2});var cC=m((Yz,R2)=>{R2.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var hC=m((Jz,P2)=>{P2.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"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:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"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:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"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:{type:"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:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var fC=m((Qz,D2)=>{D2.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var dC=m((Zz,I2)=>{I2.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var pC=m((eV,M2)=>{M2.exports={type:"number",definitions:{}}});var gC=m((tV,L2)=>{L2.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var mC=m((nV,N2)=>{N2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var X_=m(Pn=>{"use strict";var ns=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.miniscriptMeta=void 0;var q2=sr(),j2=ns(lC()),F2=ns(cC()),$2=ns(hC()),B2=ns(fC()),U2=ns(dC()),W2=ns(pC()),H2=ns(gC()),G2=ns(mC());Pn.miniscriptMeta=new q2.Container;Pn.miniscriptMeta.addTypeSignatureFromPayload(F2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload($2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(B2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(U2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(W2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(H2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(G2.default);Pn.miniscriptMeta.addMetaFromPayload("en",j2.default)});var Ju=m(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var K2=X_(),z2=Yo();Y_.default=new z2.TypeManager({container:K2.miniscriptMeta})});var bC=m(pa=>{"use strict";var V2=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});pa.activate=void 0;var X2=Ee(),Y2=Yo(),J2=Qv(),Q2=V2(Ju()),yC=(t,e)=>{let n=Q2.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==X2.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=(0,Y2.createExpressionId)(o.variable),l=a?.kind?(0,J2.getSymbolItemKind)(a.kind):13,c={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,kind:l,location:{uri:t.uri,range:{start:c,end:h}}})}return i};function Z2(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?yC(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...yC(r,e.query));return n})}pa.activate=Z2});var kd=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.buildTokens=lr.semanticTokensLegend=lr.SemanticTokenModifier=lr.SemanticTokenType=void 0;var Ht=Yr(),W=Ee(),eU=X_(),vC=(t,e)=>!!eU.miniscriptMeta.getDefinition(t,e),Z;(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"})(Z=lr.SemanticTokenType||(lr.SemanticTokenType={}));var J_;(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"})(J_=lr.SemanticTokenModifier||(lr.SemanticTokenModifier={}));lr.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 _C=t=>1<<t,Q_=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new W.ParserValidatorm}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){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(W.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Z.Comment,0);else if(!W.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(W.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Parameter,0);else if(e){let o=vC(["any"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Property,o)}else{let o=vC(["general"],i.value)?_C(J_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case W.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.String,0);break}case W.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Number,0);break}case W.TokenType.BooleanLiteral:case W.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ht.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ht.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ht.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(Ht.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(W.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!W.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(W.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!W.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}if(r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!W.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(W.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0),r.skipNewlines(),r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(W.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next(),W.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next();else for(;!W.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(W.SelectorGroups.CallArgsEnd);if(!n)return;if(W.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Punctuator,0);break}else if(!W.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!W.Selectors.EndOfFile(r.token);)if(W.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(W.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()):(r.processExpr(),W.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()));let i=r.requireToken(W.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}else if(W.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),W.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!W.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!W.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!W.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);W.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ht.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);W.Selectors.Plus(r.token)||W.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!W.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(W.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ht.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ht.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),W.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(W.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);W.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);W.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!W.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),!W.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(W.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0);!W.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(W.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Z.Operator,0),r.processExpr()),!W.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);let o=r.requireToken(W.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Z.Punctuator,0),W.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);break}}let s=r.requireToken(W.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(W.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),W.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!W.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),W.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case W.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(W.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Z.Keyword,0);break}case W.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(W.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),W.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;W.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),W.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(W.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}else if(W.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!W.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(W.SelectorGroups.BlockEndOfLine(e.token)||W.Selectors.Else(e.token)));){if(W.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(W.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(W.Selectors.EndOfLine(i)||W.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:e.next(),e.processReturnStatement();case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===W.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Z.String,0),this.next();return}let n="";for(;!Ht.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ht.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ht.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(W.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),W.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}else return;if(e.consume(W.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),!e.isType(W.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}e.consume(W.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:{e.next(),e.processReturnStatement();return}case W.Keyword.If:{e.next(),e.processIfStatement();return}case W.Keyword.ElseIf:{e.next(),e.processNextIfClause(W.ASTType.ElseifClause);return}case W.Keyword.Else:{e.next(),e.processNextIfClause(W.ASTType.ElseClause);return}case W.Keyword.While:{e.next(),e.processWhileStatement();return}case W.Keyword.For:{e.next(),e.processForStatement();return}case W.Keyword.EndFunction:{e.next();return}case W.Keyword.EndFor:{e.next();return}case W.Keyword.EndWhile:{e.next();return}case W.Keyword.EndIf:{e.next();return}case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}case Ht.GreybelKeyword.Include:case Ht.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ht.GreybelKeyword.Import:case Ht.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ht.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ht.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ht.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!W.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!W.Selectors.EndOfFile(e.token));)e.processStatement()}};function tU(t,e){let n=new Ht.Lexer(e.content,{unsafe:!0});return new Q_(n,t).process(),t}lr.buildTokens=tU});var TC=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.activate=void 0;var nU=kd();function rU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,nU.buildTokens)(i,r),i.build()})}wd.activate=rU});var SC=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.buildFoldingRanges=void 0;var Zr=Ee(),Z_=bm(),iU=Pf();function sU(t){let e=[];return new iU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Z_.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Z_.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}xd.buildFoldingRanges=sU});var kC=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.activate=void 0;var oU=SC();function aU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,oU.buildFoldingRanges)(r)})}Ed.activate=aU});var Cd=m((fV,AC)=>{var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,uU=typeof AbortController=="function",Ad=uU?AbortController:class{constructor(){this.signal=new wC}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},lU=typeof AbortSignal=="function",cU=typeof Ad.AbortSignal=="function",wC=lU?AbortSignal:cU?Ad.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},rT=new Set,eT=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Od(n)&&iT(n,`${t} option`,`options.${e}`,ma)},tT=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} method`,`cache.${e}()`,i)}},hU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);iT(n,`${t} property`,`cache.${e}`,i)}},xC=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Od=t=>!rT.has(t),iT=(t,e,n,r)=>{rT.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;xC(i,"DeprecationWarning",t,r)},rs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),EC=t=>rs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ga:null:null,ga=class extends Array{constructor(e){super(e),this.fill(0)}},nT=class{constructor(e){if(e===0)return[];let n=EC(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ma=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,fetchContext:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e,{length:G,maxAge:ie,stale:ue}=e instanceof t?{}:e;if(n!==0&&!rs(n))throw new TypeError("max option must be a nonnegative integer");let K=n?EC(n):Array;if(!K)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=b||G,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new K(n),this.prev=new K(n),this.head=0,this.tail=0,this.free=new nT(n),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!rs(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ue,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ie||0,this.ttl){if(!rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let C="LRU_CACHE_UNBOUNDED";Od(C)&&(rT.add(C),xC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}ue&&eT("stale","allowStale"),ie&&eT("maxAge","ttl"),G&&eT("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ga(this.max),this.starts=new ga(this.max),this.setItemTTL=(r,i,s=Qu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Qu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Qu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ga(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!rs(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!rs(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return tT("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Qu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[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=Qu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=n,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,o,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);let h=this.valList[c];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(c),this.valList[c]=n,this.addItemSize(c,o,l),l){l.set="replace";let f=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,r,i),this.statusTTL(l,c),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ad;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,v=!1)=>{let{aborted:b}=o.signal,O=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,O&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!O&&!v?c(o.signal.reason):(this.valList[n]===f&&(g===void 0?f.__staleWhileFetching?this.valList[n]=f.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),c(g)),c=g=>{let{aborted:v}=o.signal,b=v&&r.allowStaleOnFetchAbort,O=b||r.allowStaleOnFetchRejection,A=O||r.noDeleteOnFetchRejection;if(this.valList[n]===f&&(!A||f.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=f.__staleWhileFetching)),O)return r.status&&f.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw g},h=(g,v)=>{this.fetchMethod(e,s,a).then(b=>g(b),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let f=new Promise(h).then(u,l);return f.__abortController=o,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(e,f,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=f,f}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:b=!1,status:O,signal:A}={}){if(!this.fetchMethod)return O&&(O.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:O});let k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:f,status:O,signal:A},S=this.keyMap.get(e);if(S===void 0){O&&(O.fetch="miss");let _=this.backgroundFetch(e,S,k,v);return _.__returned=_}else{let _=this.valList[S];if(this.isBackgroundFetch(_)){let ue=n&&_.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",ue&&(O.returnedStale=!0)),ue?_.__staleWhileFetching:_.__returned=_}let N=this.isStale(S);if(!b&&!N)return O&&(O.fetch="hit"),this.moveToTail(S),r&&this.updateItemAge(S),this.statusTTL(O,S),_;let R=this.backgroundFetch(e,S,k,v),G=R.__staleWhileFetching!==void 0,ie=G&&n;return O&&(O.fetch=G&&N?"stale":"refresh",ie&&N&&(O.returnedStale=!0)),ie?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return tT("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return tT("reset","clear"),this.clear}get length(){return hU("length","size"),this.size}static get AbortController(){return Ad}static get AbortSignal(){return wC}};AC.exports=ma});var MC=m((dV,IC)=>{var uT=Object.defineProperty,fU=Object.getOwnPropertyDescriptor,dU=Object.getOwnPropertyNames,pU=Object.prototype.hasOwnProperty,gU=(t,e)=>{for(var n in e)uT(t,n,{get:e[n],enumerable:!0})},mU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dU(e))!pU.call(t,i)&&i!==n&&uT(t,i,{get:()=>e[i],enumerable:!(r=fU(e,i))||r.enumerable});return t},yU=t=>mU(uT({},"__esModule",{value:!0}),t),OC={};gU(OC,{ScheduleIntervalHelper:()=>sT,SchedulePostMessageHelper:()=>oT,ScheduleSetImmmediateHelper:()=>aT,schedule:()=>_U,scheduleProvider:()=>DC});IC.exports=yU(OC);var bU=Promise.prototype.then.bind(Promise.resolve()),lT=class Rd{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,Rd.QUEUE_LIMIT);this.queue=this.queue.slice(Rd.QUEUE_LIMIT);for(let r=0;r<n;bU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},sT=class CC extends lT{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new CC;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}},vU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},oT=class RC extends lT{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!vU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new RC;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}},aT=class PC extends lT{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new PC;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 DC(){if(aT.isApplicable())return aT.createCallback();if(oT.isApplicable())return oT.createCallback();if(sT.isApplicable())return sT.createCallback();throw new Error("No schedule helper fulfills requirements!")}var _U=DC()});var LC=m(Bn=>{"use strict";var fT=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.DocumentManager=Bn.PROCESSING_TIMEOUT=Bn.ActiveDocument=Bn.DocumentURIBuilder=void 0;var TU=fT(require("events")),SU=Yr(),kU=fT(Cd()),cT=MC(),ya=md(),wU=fT(Ju()),Pd=class{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."),ya.Utils.joinPath(this.rootPath,e).toString()):ya.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ya.Utils.joinPath(this.rootPath,e).toString()}};Bn.DocumentURIBuilder=Pd;var Dd=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ya.Utils.joinPath(ya.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Pd(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ya.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};Bn.ActiveDocument=Dd;Bn.PROCESSING_TIMEOUT=100;var hT=class extends TU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=Bn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new kU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,cT.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,cT.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new SU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),wU.default.analyze(e.uri,i),new Dd({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,cT.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};Bn.DocumentManager=hT});var qC=m((gV,dT)=>{dT.exports=function(t){return NC(xU(t),t)};dT.exports.array=NC;function NC(t,e){var n=t.length,r=new Array(n),i={},s=n,o=EU(e),a=AU(t);for(e.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(l,c,h){if(h.has(l)){var f;try{f=", node was:"+JSON.stringify(l)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),c=g.length){h.add(l);do{var v=g[--c];u(v,a.get(v),h)}while(c);h.delete(l)}r[--n]=l}}}function xU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function EU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function AU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var jC=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.hash=void 0;function OU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Id.hash=OU});var $C=m(ba=>{"use strict";var gT=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.DocumentMerger=void 0;var CU=gT(Cd()),RU=gT(qC()),PU=bs(),FC=jC(),Md=gT(Ju()),pT=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new CU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,FC.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,FC.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.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Md.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,r);b!==null&&o.push(b)}));let c=s.merge(...o);return r.set(i,c),this.results.set(u,c),c}async buildByDependencies(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),l=new Map([[r,null]]);await Promise.all(u.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,l);b!==null&&s.push(b)}));let c=i.merge(...s);return this.results.set(a,c),c}async buildByWorkspace(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let l=a.map(g=>g.textDocument.uri),c=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b]))),h=RU.default.array(l,c.flat());for(let g=h.length-1;g>=0;g--){let v=h[g];if(v===r)continue;let b=Md.default.get(v);if(b===null)return;s.push(b)}let f=i.merge(...s);return this.results.set(u,f),f}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===PU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ba.DocumentMerger=pT});var WC=m(va=>{"use strict";var DU=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.CoreContext=void 0;var IU=DU(require("events")),Zu=bs(),BC=kd();function UC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Zu.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??Zu.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Zu.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var mT=class extends IU.default{constructor(){super(),this._configuration=UC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Zu.ConfigurationNamespace),n=UC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.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:Zu.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:BC.semanticTokensLegend.tokenTypes,tokenModifiers:BC.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()}};va.CoreContext=mT});var Ld=m(X=>{"use strict";var MU=X&&X.__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]}),LU=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NU=X&&X.__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)&&MU(e,t,n);return LU(e,t),e},qU=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.CoreContext=X.buildTokens=X.semanticTokensLegend=X.lookupBase=X.lookupIdentifier=X.typeAnalyzer=X.appendTooltipHeader=X.appendTooltipBody=X.formatTypes=X.formatDefaultValue=X.createTooltipHeader=X.createSignatureInfo=X.createHover=X.MarkdownString=X.LookupHelper=X.DocumentMerger=X.DocumentManager=X.ActiveDocument=X.ASTScraper=X.activateFoldingRange=X.activateSemantic=X.activateSymbol=X.activateSubscriptions=X.activateSignature=X.activateHover=X.activateFormatter=X.activateDiagnostic=X.activateDefinition=X.activateColor=X.activateAutocomplete=X.DefaultFileExtensions=X.TypeAnalyzerStrategy=X.ConfigurationNamespace=X.LanguageId=X.IndentationType=void 0;var el=bs();Object.defineProperty(X,"IndentationType",{enumerable:!0,get:function(){return el.IndentationType}});Object.defineProperty(X,"LanguageId",{enumerable:!0,get:function(){return el.LanguageId}});Object.defineProperty(X,"ConfigurationNamespace",{enumerable:!0,get:function(){return el.ConfigurationNamespace}});Object.defineProperty(X,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return el.TypeAnalyzerStrategy}});Object.defineProperty(X,"DefaultFileExtensions",{enumerable:!0,get:function(){return el.DefaultFileExtensions}});var jU=sO();Object.defineProperty(X,"activateAutocomplete",{enumerable:!0,get:function(){return jU.activate}});var FU=gO();Object.defineProperty(X,"activateColor",{enumerable:!0,get:function(){return FU.activate}});var $U=mO();Object.defineProperty(X,"activateDefinition",{enumerable:!0,get:function(){return $U.activate}});var BU=yO();Object.defineProperty(X,"activateDiagnostic",{enumerable:!0,get:function(){return BU.activate}});var UU=KO();Object.defineProperty(X,"activateFormatter",{enumerable:!0,get:function(){return UU.activate}});var WU=QO();Object.defineProperty(X,"activateHover",{enumerable:!0,get:function(){return WU.activate}});var HU=eC();Object.defineProperty(X,"activateSignature",{enumerable:!0,get:function(){return HU.activate}});var GU=nC();Object.defineProperty(X,"activateSubscriptions",{enumerable:!0,get:function(){return GU.activate}});var KU=bC();Object.defineProperty(X,"activateSymbol",{enumerable:!0,get:function(){return KU.activate}});var zU=TC();Object.defineProperty(X,"activateSemantic",{enumerable:!0,get:function(){return zU.activate}});var VU=kC();Object.defineProperty(X,"activateFoldingRange",{enumerable:!0,get:function(){return VU.activate}});X.ASTScraper=NU(Pf());var HC=LC();Object.defineProperty(X,"ActiveDocument",{enumerable:!0,get:function(){return HC.ActiveDocument}});Object.defineProperty(X,"DocumentManager",{enumerable:!0,get:function(){return HC.DocumentManager}});var XU=$C();Object.defineProperty(X,"DocumentMerger",{enumerable:!0,get:function(){return XU.DocumentMerger}});var YU=ea();Object.defineProperty(X,"LookupHelper",{enumerable:!0,get:function(){return YU.LookupHelper}});var JU=bd();Object.defineProperty(X,"MarkdownString",{enumerable:!0,get:function(){return JU.MarkdownString}});var Ks=vd();Object.defineProperty(X,"createHover",{enumerable:!0,get:function(){return Ks.createHover}});Object.defineProperty(X,"createSignatureInfo",{enumerable:!0,get:function(){return Ks.createSignatureInfo}});Object.defineProperty(X,"createTooltipHeader",{enumerable:!0,get:function(){return Ks.createTooltipHeader}});Object.defineProperty(X,"formatDefaultValue",{enumerable:!0,get:function(){return Ks.formatDefaultValue}});Object.defineProperty(X,"formatTypes",{enumerable:!0,get:function(){return Ks.formatTypes}});Object.defineProperty(X,"appendTooltipBody",{enumerable:!0,get:function(){return Ks.appendTooltipBody}});Object.defineProperty(X,"appendTooltipHeader",{enumerable:!0,get:function(){return Ks.appendTooltipHeader}});var QU=Ju();Object.defineProperty(X,"typeAnalyzer",{enumerable:!0,get:function(){return qU(QU).default}});var GC=e_();Object.defineProperty(X,"lookupIdentifier",{enumerable:!0,get:function(){return GC.lookupIdentifier}});Object.defineProperty(X,"lookupBase",{enumerable:!0,get:function(){return GC.lookupBase}});var KC=kd();Object.defineProperty(X,"semanticTokensLegend",{enumerable:!0,get:function(){return KC.semanticTokensLegend}});Object.defineProperty(X,"buildTokens",{enumerable:!0,get:function(){return KC.buildTokens}});var ZU=WC();Object.defineProperty(X,"CoreContext",{enumerable:!0,get:function(){return ZU.CoreContext}})});var YC={};dP(YC,{TextDocument:()=>yT});function bT(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);bT(r,e),bT(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 zC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);VC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function VC(t){return t===13||t===10}function XC(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 eW(t){let e=XC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nd,yT,JC=fP(()=>{"use strict";Nd=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=XC(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),l=this._lineOffsets,c=zC(r.text,!1,s);if(u-a===c.length)for(let f=0,g=c.length;f<g;f++)l[f+a+1]=c[f];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let f=a+1+c.length,g=l.length;f<g;f++)l[f]=l[f]+h}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=zC(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&&VC(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 Nd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Nd)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=bT(s.map(eW),(c,h)=>{let f=c.range.start.line-h.range.start.line;return f===0?c.range.start.character-h.range.start.character:f}),u=0,l=[];for(let c of a){let h=i.offsetAt(c.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&l.push(o.substring(u,h)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}t.applyEdits=r})(yT||(yT={}))});var nR=m((_V,tR)=>{"use strict";tR.exports=ZC;function ZC(t,e,n){t instanceof RegExp&&(t=QC(t,n)),e instanceof RegExp&&(e=QC(e,n));var r=eR(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 QC(t,e){var n=e.match(t);return n?n[0]:null}ZC.range=eR;function eR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),l=n.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(r=[],s=n.length;c>=0&&!a;)c==u?(r.push(c),u=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,c+1)),c=u<l&&u>=0?u:l;r.length&&(a=[s,o])}return a}});var cR=m((TV,lR)=>{var rR=nR();lR.exports=rW;var iR="\0SLASH"+Math.random()+"\0",sR="\0OPEN"+Math.random()+"\0",_T="\0CLOSE"+Math.random()+"\0",oR="\0COMMA"+Math.random()+"\0",aR="\0PERIOD"+Math.random()+"\0";function vT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function tW(t){return t.split("\\\\").join(iR).split("\\{").join(sR).split("\\}").join(_T).split("\\,").join(oR).split("\\.").join(aR)}function nW(t){return t.split(iR).join("\\").split(sR).join("{").split(_T).join("}").split(oR).join(",").split(aR).join(".")}function uR(t){if(!t)return[""];var e=[],n=rR("{","}",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=uR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function rW(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),tl(tW(t),!0).map(nW)):[]}function iW(t){return"{"+t+"}"}function sW(t){return/^-?0\d/.test(t)}function oW(t,e){return t<=e}function aW(t,e){return t>=e}function tl(t,e){var n=[],r=rR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?tl(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),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),c=u||l,h=r.body.indexOf(",")>=0;if(!c&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+_T+r.post,tl(t)):[t];var f;if(c)f=r.body.split(/\.\./);else if(f=uR(r.body),f.length===1&&(f=tl(f[0],!1).map(iW),f.length===1))return s.map(function(K){return r.pre+f[0]+K});var g;if(c){var v=vT(f[0]),b=vT(f[1]),O=Math.max(f[0].length,f[1].length),A=f.length==3?Math.abs(vT(f[2])):1,k=oW,S=b<v;S&&(A*=-1,k=aW);var _=f.some(sW);g=[];for(var N=v;k(N,b);N+=A){var R;if(l)R=String.fromCharCode(N),R==="\\"&&(R="");else if(R=String(N),_){var G=O-R.length;if(G>0){var ie=new Array(G+1).join("0");N<0?R="-"+ie+R.slice(1):R=ie+R}}g.push(R)}}else{g=[];for(var ue=0;ue<f.length;ue++)g.push.apply(g,tl(f[ue],!1))}for(var ue=0;ue<g.length;ue++)for(var o=0;o<s.length;o++){var a=i+g[ue]+s[o];(!e||c||a)&&n.push(a)}}return n}});var hR=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.assertValidPattern=void 0;var uW=1024*64,lW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>uW)throw new TypeError("pattern is too long")};qd.assertValidPattern=lW});var dR=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.parseClass=void 0;var cW={"[: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]},nl=t=>t.replace(/[[\]\\-]/g,"\\$&"),hW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fR=t=>t.join(""),fW=(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,l=!1,c=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){l=!0,s++;continue}if(b==="]"&&o&&!u){c=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[O,[A,k,S]]of Object.entries(cW))if(t.startsWith(O,s)){if(h)return["$.",!1,t.length-n,!0];s+=O.length,S?i.push(A):r.push(A),a=a||k;continue e}}if(u=!1,h){b>h?r.push(nl(h)+"-"+nl(b)):b===h&&r.push(nl(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(nl(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(nl(b)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let b=r[0].length===2?r[0].slice(-1):r[0];return[hW(b),!1,c-n,!1]}let f="["+(l?"^":"")+fR(r)+"]",g="["+(l?"":"^")+fR(i)+"]";return[r.length&&i.length?"("+f+"|"+g+")":r.length?f:g,a,c-n,!0]};jd.parseClass=fW});var $d=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.unescape=void 0;var dW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Fd.unescape=dW});var kT=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.AST=void 0;var pW=dR(),Bd=$d(),gW=new Set(["!","?","+","*","@"]),pR=t=>gW.has(t),mW="(?!(?:^|/)\\.\\.?(?:$|/))",Ud="(?!\\.)",yW=new Set(["[","."]),bW=new Set(["..","."]),vW=new Set("().*{}+?[]^$\\!"),_W=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ST="[^/]",gR=ST+"*?",mR=ST+"+?",TT=class t{type;#e;#t;#s=!1;#r=[];#o;#_;#l;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#h&&this.#l.push(this),this.#_=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#_+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[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.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#_===0)return!0;let e=this.#o;for(let n=0;n<this.#_;n++){let r=e.#r[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.#r.length:0;return this.#_===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.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,v="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,v+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),v+=b;continue}else if(b==="["){o=!0,a=g,u=!1,v+=b;continue}if(!i.noext&&pR(b)&&e.charAt(g)==="("){n.push(v),v="";let O=new t(b,n);g=t.#y(e,O,g,i),n.push(O);continue}v+=b}return n.push(v),g}let l=r+1,c=new t(null,n),h=[],f="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,f+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),f+=g;continue}else if(g==="["){o=!0,a=l,u=!1,f+=g;continue}if(pR(g)&&e.charAt(l)==="("){c.push(f),f="";let v=new t(g,c);c.push(v),l=t.#y(e,v,l,i);continue}if(g==="|"){c.push(f),f="",h.push(c),c=new t(null,n);continue}if(g===")")return f===""&&n.#r.length===0&&(n.#i=!0),c.push(f),f="",n.push(...h,c),l;f+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(g=>{let[v,b,O,A]=typeof g=="string"?t.#f(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||O,this.#s=this.#s||A,v}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&bW.has(this.#r[0]))){let v=yW,b=n&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),O=!n&&!e&&v.has(l.charAt(0));c=b?mW:O?Ud:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[c+l+h,(0,Bd.unescape)(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#d(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Bd.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Ud?"":this.#d(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Ud:"")+mR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Ud:"")+gR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Bd.unescape)(s),this.#t=!!this.#t,this.#s]}#d(e){return this.#r.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+=(vW.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[l,c,h,f]=(0,pW.parseClass)(e,a);if(h){s+=l,o=o||c,a+=h-1,n=n||f;continue}}if(u==="*"){r&&e==="*"?s+=mR:s+=gR,n=!0;continue}if(u==="?"){s+=ST,n=!0;continue}s+=_W(u)}return[s,(0,Bd.unescape)(e),!!n,o]}};Wd.AST=TT});var wT=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.escape=void 0;var TW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Hd.escape=TW});var is=m(re=>{"use strict";var SW=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.unescape=re.escape=re.AST=re.Minimatch=re.match=re.makeRe=re.braceExpand=re.defaults=re.filter=re.GLOBSTAR=re.sep=re.minimatch=void 0;var kW=SW(cR()),Gd=hR(),vR=kT(),wW=wT(),xW=$d(),EW=(t,e,n={})=>((0,Gd.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new zs(e,n).match(t));re.minimatch=EW;var AW=/^\*+([^+@!?\*\[\(]*)$/,OW=t=>e=>!e.startsWith(".")&&e.endsWith(t),CW=t=>e=>e.endsWith(t),RW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),PW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),DW=/^\*+\.\*+$/,IW=t=>!t.startsWith(".")&&t.includes("."),MW=t=>t!=="."&&t!==".."&&t.includes("."),LW=/^\.\*+$/,NW=t=>t!=="."&&t!==".."&&t.startsWith("."),qW=/^\*+$/,jW=t=>t.length!==0&&!t.startsWith("."),FW=t=>t.length!==0&&t!=="."&&t!=="..",$W=/^\?+([^+@!?\*\[\(]*)?$/,BW=([t,e=""])=>{let n=_R([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},UW=([t,e=""])=>{let n=TR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},WW=([t,e=""])=>{let n=TR([t]);return e?r=>n(r)&&r.endsWith(e):n},HW=([t,e=""])=>{let n=_R([t]);return e?r=>n(r)&&r.endsWith(e):n},_R=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},TR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},SR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yR={win32:{sep:"\\"},posix:{sep:"/"}};re.sep=SR==="win32"?yR.win32.sep:yR.posix.sep;re.minimatch.sep=re.sep;re.GLOBSTAR=Symbol("globstar **");re.minimatch.GLOBSTAR=re.GLOBSTAR;var GW="[^/]",KW=GW+"*?",zW="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VW="(?:(?!(?:\\/|^)\\.).)*?",XW=(t,e={})=>n=>(0,re.minimatch)(n,t,e);re.filter=XW;re.minimatch.filter=re.filter;var cr=(t,e={})=>Object.assign({},t,e),YW=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return re.minimatch;let e=re.minimatch;return Object.assign((r,i,s={})=>e(r,i,cr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,cr(t,s))}static defaults(i){return e.defaults(cr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,cr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,cr(t,s))}},unescape:(r,i={})=>e.unescape(r,cr(t,i)),escape:(r,i={})=>e.escape(r,cr(t,i)),filter:(r,i={})=>e.filter(r,cr(t,i)),defaults:r=>e.defaults(cr(t,r)),makeRe:(r,i={})=>e.makeRe(r,cr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,cr(t,i)),match:(r,i,s={})=>e.match(r,i,cr(t,s)),sep:e.sep,GLOBSTAR:re.GLOBSTAR})};re.defaults=YW;re.minimatch.defaults=re.defaults;var JW=(t,e={})=>((0,Gd.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,kW.default)(t));re.braceExpand=JW;re.minimatch.braceExpand=re.braceExpand;var QW=(t,e={})=>new zs(t,e).makeRe();re.makeRe=QW;re.minimatch.makeRe=re.makeRe;var ZW=(t,e,n={})=>{let r=new zs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};re.match=ZW;re.minimatch.match=re.match;var bR=/[?*]|[+@!]\(.*?\)|\[|\]/,e5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Gd.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||SR,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]==="?"||!bR.test(s[2]))&&!bR.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}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],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let c=r.slice(0);c[i]="**",e.push(c),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 b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=O?3:b?0:void 0,_=k?3:A?0:void 0;if(typeof S=="number"&&typeof _=="number"){let[N,R]=[e[S],n[_]];N.toLowerCase()===R.toLowerCase()&&(n[_]=N,_>S?n=n.slice(_):S>_&&(e=e.slice(S)))}}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,l=n.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=n[a],h=e[o];if(this.debug(n,c,h),c===!1)return!1;if(c===re.GLOBSTAR){this.debug("GLOBSTAR",[n,c,h]);var f=o,g=a+1;if(g===l){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(;f<u;){var v=e[f];if(this.debug(`
|
196
|
+
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var sC=m((zK,_2)=>{_2.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 oC=m((KK,T2)=>{T2.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 aC=m((VK,S2)=>{S2.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 uC=m((XK,k2)=>{k2.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 lC=m(Yu=>{"use strict";var da=Yu&&Yu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yu,"__esModule",{value:!0});var w2=da(rC()),x2=da(iC()),E2=da(sC()),A2=da(oC()),O2=da(aC()),C2=da(uC()),R2={any:w2.default,general:x2.default,list:E2.default,map:A2.default,string:C2.default,number:O2.default};Yu.default=R2});var cC=m((JK,P2)=>{P2.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var hC=m((QK,D2)=>{D2.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"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:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"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:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"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:{type:"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:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var fC=m((ZK,I2)=>{I2.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var dC=m((eV,M2)=>{M2.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var pC=m((tV,L2)=>{L2.exports={type:"number",definitions:{}}});var gC=m((nV,N2)=>{N2.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var mC=m((rV,q2)=>{q2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var V_=m(Pn=>{"use strict";var ns=Pn&&Pn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.miniscriptMeta=void 0;var j2=sr(),F2=ns(lC()),$2=ns(cC()),B2=ns(hC()),U2=ns(fC()),W2=ns(dC()),H2=ns(pC()),G2=ns(gC()),z2=ns(mC());Pn.miniscriptMeta=new j2.Container;Pn.miniscriptMeta.addTypeSignatureFromPayload($2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(B2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(U2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(W2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(H2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(G2.default);Pn.miniscriptMeta.addTypeSignatureFromPayload(z2.default);Pn.miniscriptMeta.addMetaFromPayload("en",F2.default)});var Ju=m(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var K2=V_(),V2=Yo();X_.default=new V2.TypeManager({container:K2.miniscriptMeta})});var bC=m(pa=>{"use strict";var X2=pa&&pa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pa,"__esModule",{value:!0});pa.activate=void 0;var Y2=Ee(),J2=Yo(),Q2=Jv(),Z2=X2(Ju()),yC=(t,e)=>{let n=Z2.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==Y2.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=(0,J2.createExpressionId)(o.variable),l=a?.kind?(0,Q2.getSymbolItemKind)(a.kind):13,c={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,kind:l,location:{uri:t.uri,range:{start:c,end:h}}})}return i};function eU(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?yC(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...yC(r,e.query));return n})}pa.activate=eU});var kd=m(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.buildTokens=cr.semanticTokensLegend=cr.SemanticTokenModifier=cr.SemanticTokenType=void 0;var Ht=Yr(),W=Ee(),tU=V_(),vC=(t,e)=>!!tU.miniscriptMeta.getDefinition(t,e),Z;(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"})(Z=cr.SemanticTokenType||(cr.SemanticTokenType={}));var Y_;(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"})(Y_=cr.SemanticTokenModifier||(cr.SemanticTokenModifier={}));cr.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 _C=t=>1<<t,J_=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new W.ParserValidatorm}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){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(W.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Z.Comment,0);else if(!W.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(W.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Parameter,0);else if(e){let o=vC(["any"],i.value)?_C(Y_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Property,o)}else{let o=vC(["general"],i.value)?_C(Y_.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case W.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.String,0);break}case W.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Number,0);break}case W.TokenType.BooleanLiteral:case W.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Z.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ht.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ht.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ht.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}else if(Ht.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(W.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!W.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(W.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!W.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}if(r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!W.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),W.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();else for(r.skipNewlines();!W.Selectors.EndOfFile(r.token);){if(W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(W.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0),r.skipNewlines(),r.processExpr(),W.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines()),W.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(W.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next(),W.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Punctuator,0),e.next();else for(;!W.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(W.SelectorGroups.CallArgsEnd);if(!n)return;if(W.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Punctuator,0);break}else if(!W.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!W.Selectors.EndOfFile(r.token);)if(W.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(W.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()):(r.processExpr(),W.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),W.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0):r.processExpr()));let i=r.requireToken(W.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0)}else if(W.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),W.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!W.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!W.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!W.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);W.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ht.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);W.Selectors.Plus(r.token)||W.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!W.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(W.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ht.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ht.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),W.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(W.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);W.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);W.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!W.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Keyword,0),r.next(),!W.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(W.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Z.Punctuator,0);!W.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(W.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Z.Operator,0),r.processExpr()),!W.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);let o=r.requireToken(W.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Z.Punctuator,0),W.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Z.Punctuator,0);break}}let s=r.requireToken(W.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Z.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(W.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),e.processExpr(),W.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!W.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),W.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case W.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(W.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Z.Keyword,0);break}case W.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(W.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Z.Keyword,0),W.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;W.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),W.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(W.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}else if(W.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!W.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(W.SelectorGroups.BlockEndOfLine(e.token)||W.Selectors.Else(e.token)));){if(W.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(W.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(W.Selectors.EndOfLine(i)||W.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:e.next(),e.processReturnStatement();case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===W.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Z.String,0),this.next();return}let n="";for(;!Ht.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ht.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ht.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(W.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),W.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}else return;if(e.consume(W.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0),!e.isType(W.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Z.String,0),e.next()}e.consume(W.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Z.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Z.Keyword,0),n){case W.Keyword.Return:{e.next(),e.processReturnStatement();return}case W.Keyword.If:{e.next(),e.processIfStatement();return}case W.Keyword.ElseIf:{e.next(),e.processNextIfClause(W.ASTType.ElseifClause);return}case W.Keyword.Else:{e.next(),e.processNextIfClause(W.ASTType.ElseClause);return}case W.Keyword.While:{e.next(),e.processWhileStatement();return}case W.Keyword.For:{e.next(),e.processForStatement();return}case W.Keyword.EndFunction:{e.next();return}case W.Keyword.EndFor:{e.next();return}case W.Keyword.EndWhile:{e.next();return}case W.Keyword.EndIf:{e.next();return}case W.Keyword.Continue:{e.next();return}case W.Keyword.Break:{e.next();return}case Ht.GreybelKeyword.Include:case Ht.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ht.GreybelKeyword.Import:case Ht.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ht.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ht.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ht.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(W.TokenType.Keyword===e.token.type&&W.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!W.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!W.Selectors.EndOfFile(e.token));)e.processStatement()}};function nU(t,e){let n=new Ht.Lexer(e.content,{unsafe:!0});return new J_(n,t).process(),t}cr.buildTokens=nU});var TC=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.activate=void 0;var rU=kd();function iU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,rU.buildTokens)(i,r),i.build()})}wd.activate=iU});var SC=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.buildFoldingRanges=void 0;var Zr=Ee(),Q_=bm(),sU=Pf();function oU(t){let e=[];return new sU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Q_.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:Q_.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:Q_.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}xd.buildFoldingRanges=oU});var kC=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.activate=void 0;var aU=SC();function uU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,aU.buildFoldingRanges)(r)})}Ed.activate=uU});var Cd=m((dV,AC)=>{var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lU=typeof AbortController=="function",Ad=lU?AbortController:class{constructor(){this.signal=new wC}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},cU=typeof AbortSignal=="function",hU=typeof Ad.AbortSignal=="function",wC=cU?AbortSignal:hU?Ad.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},nT=new Set,Z_=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Od(n)&&rT(n,`${t} option`,`options.${e}`,ma)},eT=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);rT(n,`${t} method`,`cache.${e}()`,i)}},fU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Od(n)){let{prototype:r}=ma,{get:i}=Object.getOwnPropertyDescriptor(r,t);rT(n,`${t} property`,`cache.${e}`,i)}},xC=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Od=t=>!nT.has(t),rT=(t,e,n,r)=>{nT.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;xC(i,"DeprecationWarning",t,r)},rs=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),EC=t=>rs(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ga:null:null,ga=class extends Array{constructor(e){super(e),this.fill(0)}},tT=class{constructor(e){if(e===0)return[];let n=EC(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ma=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,fetchContext:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e,{length:G,maxAge:ie,stale:ue}=e instanceof t?{}:e;if(n!==0&&!rs(n))throw new TypeError("max option must be a nonnegative integer");let z=n?EC(n):Array;if(!z)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=b||G,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=O||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=A,!this.fetchMethod&&A!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new z(n),this.prev=new z(n),this.head=0,this.tail=0,this.free=new tT(n),this.initialFill=1,this.size=0,typeof l=="function"&&(this.dispose=l),typeof c=="function"?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!rs(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!rs(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!ue,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=rs(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ie||0,this.ttl){if(!rs(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let C="LRU_CACHE_UNBOUNDED";Od(C)&&(nT.add(C),xC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,t))}ue&&Z_("stale","allowStale"),ie&&Z_("maxAge","ttl"),G&&Z_("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ga(this.max),this.starts=new ga(this.max),this.setItemTTL=(r,i,s=Qu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Qu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Qu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ga(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!rs(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!rs(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return eT("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Qu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[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=Qu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:l}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let c=this.size===0?void 0:this.keyMap.get(e);if(c===void 0)c=this.newIndex(),this.keyList[c]=e,this.valList[c]=n,this.keyMap.set(e,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,o,l),l&&(l.set="add"),u=!1;else{this.moveToTail(c);let h=this.valList[c];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(c),this.valList[c]=n,this.addItemSize(c,o,l),l){l.set="replace";let f=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(c,r,i),this.statusTTL(l,c),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ad;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,v=!1)=>{let{aborted:b}=o.signal,O=r.ignoreFetchAbort&&g!==void 0;return r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,O&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!O&&!v?c(o.signal.reason):(this.valList[n]===f&&(g===void 0?f.__staleWhileFetching?this.valList[n]=f.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},l=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),c(g)),c=g=>{let{aborted:v}=o.signal,b=v&&r.allowStaleOnFetchAbort,O=b||r.allowStaleOnFetchRejection,A=O||r.noDeleteOnFetchRejection;if(this.valList[n]===f&&(!A||f.__staleWhileFetching===void 0?this.delete(e):b||(this.valList[n]=f.__staleWhileFetching)),O)return r.status&&f.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw g},h=(g,v)=>{this.fetchMethod(e,s,a).then(b=>g(b),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=b=>u(b,!0)))})};r.status&&(r.status.fetchDispatched=!0);let f=new Promise(h).then(u,l);return f.__abortController=o,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(e,f,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=f,f}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:b=!1,status:O,signal:A}={}){if(!this.fetchMethod)return O&&(O.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:O});let k={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:f,status:O,signal:A},S=this.keyMap.get(e);if(S===void 0){O&&(O.fetch="miss");let _=this.backgroundFetch(e,S,k,v);return _.__returned=_}else{let _=this.valList[S];if(this.isBackgroundFetch(_)){let ue=n&&_.__staleWhileFetching!==void 0;return O&&(O.fetch="inflight",ue&&(O.returnedStale=!0)),ue?_.__staleWhileFetching:_.__returned=_}let N=this.isStale(S);if(!b&&!N)return O&&(O.fetch="hit"),this.moveToTail(S),r&&this.updateItemAge(S),this.statusTTL(O,S),_;let R=this.backgroundFetch(e,S,k,v),G=R.__staleWhileFetching!==void 0,ie=G&&n;return O&&(O.fetch=G&&N?"stale":"refresh",ie&&N&&(O.returnedStale=!0)),ie?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return eT("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return eT("reset","clear"),this.clear}get length(){return fU("length","size"),this.size}static get AbortController(){return Ad}static get AbortSignal(){return wC}};AC.exports=ma});var MC=m((pV,IC)=>{var aT=Object.defineProperty,dU=Object.getOwnPropertyDescriptor,pU=Object.getOwnPropertyNames,gU=Object.prototype.hasOwnProperty,mU=(t,e)=>{for(var n in e)aT(t,n,{get:e[n],enumerable:!0})},yU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pU(e))!gU.call(t,i)&&i!==n&&aT(t,i,{get:()=>e[i],enumerable:!(r=dU(e,i))||r.enumerable});return t},bU=t=>yU(aT({},"__esModule",{value:!0}),t),OC={};mU(OC,{ScheduleIntervalHelper:()=>iT,SchedulePostMessageHelper:()=>sT,ScheduleSetImmmediateHelper:()=>oT,schedule:()=>TU,scheduleProvider:()=>DC});IC.exports=bU(OC);var vU=Promise.prototype.then.bind(Promise.resolve()),uT=class Rd{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,Rd.QUEUE_LIMIT);this.queue=this.queue.slice(Rd.QUEUE_LIMIT);for(let r=0;r<n;vU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},iT=class CC extends uT{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new CC;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}},_U=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},sT=class RC extends uT{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!_U()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new RC;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}},oT=class PC extends uT{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new PC;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 DC(){if(oT.isApplicable())return oT.createCallback();if(sT.isApplicable())return sT.createCallback();if(iT.isApplicable())return iT.createCallback();throw new Error("No schedule helper fulfills requirements!")}var TU=DC()});var LC=m(Bn=>{"use strict";var hT=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.DocumentManager=Bn.PROCESSING_TIMEOUT=Bn.ActiveDocument=Bn.DocumentURIBuilder=void 0;var SU=hT(require("events")),kU=Yr(),wU=hT(Cd()),lT=MC(),ya=md(),xU=hT(Ju()),Pd=class{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."),ya.Utils.joinPath(this.rootPath,e).toString()):ya.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ya.Utils.joinPath(this.rootPath,e).toString()}};Bn.DocumentURIBuilder=Pd;var Dd=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ya.Utils.joinPath(ya.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Pd(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ya.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};Bn.ActiveDocument=Dd;Bn.PROCESSING_TIMEOUT=100;var cT=class extends SU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=Bn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new wU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,lT.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,lT.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new kU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),xU.default.analyze(e.uri,i),new Dd({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,lT.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};Bn.DocumentManager=cT});var qC=m((mV,fT)=>{fT.exports=function(t){return NC(EU(t),t)};fT.exports.array=NC;function NC(t,e){var n=t.length,r=new Array(n),i={},s=n,o=AU(e),a=OU(t);for(e.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(l,c,h){if(h.has(l)){var f;try{f=", node was:"+JSON.stringify(l)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),c=g.length){h.add(l);do{var v=g[--c];u(v,a.get(v),h)}while(c);h.delete(l)}r[--n]=l}}}function EU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function AU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function OU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var jC=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.hash=void 0;function CU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Id.hash=CU});var $C=m(ba=>{"use strict";var pT=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.DocumentMerger=void 0;var RU=pT(Cd()),PU=pT(qC()),DU=bs(),FC=jC(),Md=pT(Ju()),dT=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new RU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,FC.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,FC.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.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Md.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let l=await n.documentManager.get(e).getDependencies();await Promise.all(l.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,r);b!==null&&o.push(b)}));let c=s.merge(...o);return r.set(i,c),this.results.set(u,c),c}async buildByDependencies(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),l=new Map([[r,null]]);await Promise.all(u.map(async h=>{let f=n.documentManager.results.get(h);if(!f)return;let{document:g,textDocument:v}=f;if(!g)return;let b=await this.processByDependencies(v,n,l);b!==null&&s.push(b)}));let c=i.merge(...s);return this.results.set(a,c),c}async buildByWorkspace(e,n){let r=e.uri,i=Md.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let l=a.map(g=>g.textDocument.uri),c=await Promise.all(a.map(async g=>(await g.getDependencies()).map(b=>[g.textDocument.uri,b]))),h=PU.default.array(l,c.flat());for(let g=h.length-1;g>=0;g--){let v=h[g];if(v===r)continue;let b=Md.default.get(v);if(b===null)return;s.push(b)}let f=i.merge(...s);return this.results.set(u,f),f}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===DU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ba.DocumentMerger=dT});var WC=m(va=>{"use strict";var IU=va&&va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(va,"__esModule",{value:!0});va.CoreContext=void 0;var MU=IU(require("events")),Zu=bs(),BC=kd();function UC(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Zu.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??Zu.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Zu.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var gT=class extends MU.default{constructor(){super(),this._configuration=UC(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Zu.ConfigurationNamespace),n=UC(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.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:Zu.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:BC.semanticTokensLegend.tokenTypes,tokenModifiers:BC.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()}};va.CoreContext=gT});var Ld=m(X=>{"use strict";var LU=X&&X.__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]}),NU=X&&X.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qU=X&&X.__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)&&LU(e,t,n);return NU(e,t),e},jU=X&&X.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X,"__esModule",{value:!0});X.CoreContext=X.buildTokens=X.semanticTokensLegend=X.lookupBase=X.lookupIdentifier=X.typeAnalyzer=X.appendTooltipHeader=X.appendTooltipBody=X.formatTypes=X.formatDefaultValue=X.createTooltipHeader=X.createSignatureInfo=X.createHover=X.MarkdownString=X.LookupHelper=X.DocumentMerger=X.DocumentManager=X.ActiveDocument=X.ASTScraper=X.activateFoldingRange=X.activateSemantic=X.activateSymbol=X.activateSubscriptions=X.activateSignature=X.activateHover=X.activateFormatter=X.activateDiagnostic=X.activateDefinition=X.activateColor=X.activateAutocomplete=X.DefaultFileExtensions=X.TypeAnalyzerStrategy=X.ConfigurationNamespace=X.LanguageId=X.IndentationType=void 0;var el=bs();Object.defineProperty(X,"IndentationType",{enumerable:!0,get:function(){return el.IndentationType}});Object.defineProperty(X,"LanguageId",{enumerable:!0,get:function(){return el.LanguageId}});Object.defineProperty(X,"ConfigurationNamespace",{enumerable:!0,get:function(){return el.ConfigurationNamespace}});Object.defineProperty(X,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return el.TypeAnalyzerStrategy}});Object.defineProperty(X,"DefaultFileExtensions",{enumerable:!0,get:function(){return el.DefaultFileExtensions}});var FU=sO();Object.defineProperty(X,"activateAutocomplete",{enumerable:!0,get:function(){return FU.activate}});var $U=gO();Object.defineProperty(X,"activateColor",{enumerable:!0,get:function(){return $U.activate}});var BU=mO();Object.defineProperty(X,"activateDefinition",{enumerable:!0,get:function(){return BU.activate}});var UU=yO();Object.defineProperty(X,"activateDiagnostic",{enumerable:!0,get:function(){return UU.activate}});var WU=zO();Object.defineProperty(X,"activateFormatter",{enumerable:!0,get:function(){return WU.activate}});var HU=QO();Object.defineProperty(X,"activateHover",{enumerable:!0,get:function(){return HU.activate}});var GU=eC();Object.defineProperty(X,"activateSignature",{enumerable:!0,get:function(){return GU.activate}});var zU=nC();Object.defineProperty(X,"activateSubscriptions",{enumerable:!0,get:function(){return zU.activate}});var KU=bC();Object.defineProperty(X,"activateSymbol",{enumerable:!0,get:function(){return KU.activate}});var VU=TC();Object.defineProperty(X,"activateSemantic",{enumerable:!0,get:function(){return VU.activate}});var XU=kC();Object.defineProperty(X,"activateFoldingRange",{enumerable:!0,get:function(){return XU.activate}});X.ASTScraper=qU(Pf());var HC=LC();Object.defineProperty(X,"ActiveDocument",{enumerable:!0,get:function(){return HC.ActiveDocument}});Object.defineProperty(X,"DocumentManager",{enumerable:!0,get:function(){return HC.DocumentManager}});var YU=$C();Object.defineProperty(X,"DocumentMerger",{enumerable:!0,get:function(){return YU.DocumentMerger}});var JU=ea();Object.defineProperty(X,"LookupHelper",{enumerable:!0,get:function(){return JU.LookupHelper}});var QU=bd();Object.defineProperty(X,"MarkdownString",{enumerable:!0,get:function(){return QU.MarkdownString}});var zs=vd();Object.defineProperty(X,"createHover",{enumerable:!0,get:function(){return zs.createHover}});Object.defineProperty(X,"createSignatureInfo",{enumerable:!0,get:function(){return zs.createSignatureInfo}});Object.defineProperty(X,"createTooltipHeader",{enumerable:!0,get:function(){return zs.createTooltipHeader}});Object.defineProperty(X,"formatDefaultValue",{enumerable:!0,get:function(){return zs.formatDefaultValue}});Object.defineProperty(X,"formatTypes",{enumerable:!0,get:function(){return zs.formatTypes}});Object.defineProperty(X,"appendTooltipBody",{enumerable:!0,get:function(){return zs.appendTooltipBody}});Object.defineProperty(X,"appendTooltipHeader",{enumerable:!0,get:function(){return zs.appendTooltipHeader}});var ZU=Ju();Object.defineProperty(X,"typeAnalyzer",{enumerable:!0,get:function(){return jU(ZU).default}});var GC=Zv();Object.defineProperty(X,"lookupIdentifier",{enumerable:!0,get:function(){return GC.lookupIdentifier}});Object.defineProperty(X,"lookupBase",{enumerable:!0,get:function(){return GC.lookupBase}});var zC=kd();Object.defineProperty(X,"semanticTokensLegend",{enumerable:!0,get:function(){return zC.semanticTokensLegend}});Object.defineProperty(X,"buildTokens",{enumerable:!0,get:function(){return zC.buildTokens}});var eW=WC();Object.defineProperty(X,"CoreContext",{enumerable:!0,get:function(){return eW.CoreContext}})});var YC={};dP(YC,{TextDocument:()=>mT});function yT(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);yT(r,e),yT(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 KC(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);VC(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function VC(t){return t===13||t===10}function XC(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 tW(t){let e=XC(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nd,mT,JC=fP(()=>{"use strict";Nd=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=XC(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),l=this._lineOffsets,c=KC(r.text,!1,s);if(u-a===c.length)for(let f=0,g=c.length;f<g;f++)l[f+a+1]=c[f];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let f=a+1+c.length,g=l.length;f<g;f++)l[f]=l[f]+h}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=KC(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&&VC(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 Nd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Nd)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=yT(s.map(tW),(c,h)=>{let f=c.range.start.line-h.range.start.line;return f===0?c.range.start.character-h.range.start.character:f}),u=0,l=[];for(let c of a){let h=i.offsetAt(c.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&l.push(o.substring(u,h)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}t.applyEdits=r})(mT||(mT={}))});var nR=m((TV,tR)=>{"use strict";tR.exports=ZC;function ZC(t,e,n){t instanceof RegExp&&(t=QC(t,n)),e instanceof RegExp&&(e=QC(e,n));var r=eR(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 QC(t,e){var n=e.match(t);return n?n[0]:null}ZC.range=eR;function eR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),l=n.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(r=[],s=n.length;c>=0&&!a;)c==u?(r.push(c),u=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),l]:(i=r.pop(),i<s&&(s=i,o=l),l=n.indexOf(e,c+1)),c=u<l&&u>=0?u:l;r.length&&(a=[s,o])}return a}});var cR=m((SV,lR)=>{var rR=nR();lR.exports=iW;var iR="\0SLASH"+Math.random()+"\0",sR="\0OPEN"+Math.random()+"\0",vT="\0CLOSE"+Math.random()+"\0",oR="\0COMMA"+Math.random()+"\0",aR="\0PERIOD"+Math.random()+"\0";function bT(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function nW(t){return t.split("\\\\").join(iR).split("\\{").join(sR).split("\\}").join(vT).split("\\,").join(oR).split("\\.").join(aR)}function rW(t){return t.split(iR).join("\\").split(sR).join("{").split(vT).join("}").split(oR).join(",").split(aR).join(".")}function uR(t){if(!t)return[""];var e=[],n=rR("{","}",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=uR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function iW(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),tl(nW(t),!0).map(rW)):[]}function sW(t){return"{"+t+"}"}function oW(t){return/^-?0\d/.test(t)}function aW(t,e){return t<=e}function uW(t,e){return t>=e}function tl(t,e){var n=[],r=rR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?tl(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),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),c=u||l,h=r.body.indexOf(",")>=0;if(!c&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+vT+r.post,tl(t)):[t];var f;if(c)f=r.body.split(/\.\./);else if(f=uR(r.body),f.length===1&&(f=tl(f[0],!1).map(sW),f.length===1))return s.map(function(z){return r.pre+f[0]+z});var g;if(c){var v=bT(f[0]),b=bT(f[1]),O=Math.max(f[0].length,f[1].length),A=f.length==3?Math.abs(bT(f[2])):1,k=aW,S=b<v;S&&(A*=-1,k=uW);var _=f.some(oW);g=[];for(var N=v;k(N,b);N+=A){var R;if(l)R=String.fromCharCode(N),R==="\\"&&(R="");else if(R=String(N),_){var G=O-R.length;if(G>0){var ie=new Array(G+1).join("0");N<0?R="-"+ie+R.slice(1):R=ie+R}}g.push(R)}}else{g=[];for(var ue=0;ue<f.length;ue++)g.push.apply(g,tl(f[ue],!1))}for(var ue=0;ue<g.length;ue++)for(var o=0;o<s.length;o++){var a=i+g[ue]+s[o];(!e||c||a)&&n.push(a)}}return n}});var hR=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.assertValidPattern=void 0;var lW=1024*64,cW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>lW)throw new TypeError("pattern is too long")};qd.assertValidPattern=cW});var dR=m(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.parseClass=void 0;var hW={"[: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]},nl=t=>t.replace(/[[\]\\-]/g,"\\$&"),fW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fR=t=>t.join(""),dW=(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,l=!1,c=n,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===n+1){l=!0,s++;continue}if(b==="]"&&o&&!u){c=s+1;break}if(o=!0,b==="\\"&&!u){u=!0,s++;continue}if(b==="["&&!u){for(let[O,[A,k,S]]of Object.entries(hW))if(t.startsWith(O,s)){if(h)return["$.",!1,t.length-n,!0];s+=O.length,S?i.push(A):r.push(A),a=a||k;continue e}}if(u=!1,h){b>h?r.push(nl(h)+"-"+nl(b)):b===h&&r.push(nl(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(nl(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}r.push(nl(b)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let b=r[0].length===2?r[0].slice(-1):r[0];return[fW(b),!1,c-n,!1]}let f="["+(l?"^":"")+fR(r)+"]",g="["+(l?"":"^")+fR(i)+"]";return[r.length&&i.length?"("+f+"|"+g+")":r.length?f:g,a,c-n,!0]};jd.parseClass=dW});var $d=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.unescape=void 0;var pW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Fd.unescape=pW});var ST=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.AST=void 0;var gW=dR(),Bd=$d(),mW=new Set(["!","?","+","*","@"]),pR=t=>mW.has(t),yW="(?!(?:^|/)\\.\\.?(?:$|/))",Ud="(?!\\.)",bW=new Set(["[","."]),vW=new Set(["..","."]),_W=new Set("().*{}+?[]^$\\!"),TW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),TT="[^/]",gR=TT+"*?",mR=TT+"+?",_T=class t{type;#e;#t;#s=!1;#r=[];#o;#_;#l;#h=!1;#a;#u;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#h&&this.#l.push(this),this.#_=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#_+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[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.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#_===0)return!0;let e=this.#o;for(let n=0;n<this.#_;n++){let r=e.#r[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.#r.length:0;return this.#_===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.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,v="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,v+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(u=!0):b==="]"&&!(g===a+2&&u)&&(o=!1),v+=b;continue}else if(b==="["){o=!0,a=g,u=!1,v+=b;continue}if(!i.noext&&pR(b)&&e.charAt(g)==="("){n.push(v),v="";let O=new t(b,n);g=t.#y(e,O,g,i),n.push(O);continue}v+=b}return n.push(v),g}let l=r+1,c=new t(null,n),h=[],f="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,f+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),f+=g;continue}else if(g==="["){o=!0,a=l,u=!1,f+=g;continue}if(pR(g)&&e.charAt(l)==="("){c.push(f),f="";let v=new t(g,c);c.push(v),l=t.#y(e,v,l,i);continue}if(g==="|"){c.push(f),f="",h.push(c),c=new t(null,n);continue}if(g===")")return f===""&&n.#r.length===0&&(n.#i=!0),c.push(f),f="",n.push(...h,c),l;f+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#m(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(g=>{let[v,b,O,A]=typeof g=="string"?t.#f(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||O,this.#s=this.#s||A,v}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&vW.has(this.#r[0]))){let v=bW,b=n&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),O=!n&&!e&&v.has(l.charAt(0));c=b?yW:O?Ud:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[c+l+h,(0,Bd.unescape)(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#d(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Bd.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Ud?"":this.#d(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Ud:"")+mR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Ud:"")+gR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Bd.unescape)(s),this.#t=!!this.#t,this.#s]}#d(e){return this.#r.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+=(_W.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[l,c,h,f]=(0,gW.parseClass)(e,a);if(h){s+=l,o=o||c,a+=h-1,n=n||f;continue}}if(u==="*"){r&&e==="*"?s+=mR:s+=gR,n=!0;continue}if(u==="?"){s+=TT,n=!0;continue}s+=TW(u)}return[s,(0,Bd.unescape)(e),!!n,o]}};Wd.AST=_T});var kT=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.escape=void 0;var SW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Hd.escape=SW});var is=m(re=>{"use strict";var kW=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.unescape=re.escape=re.AST=re.Minimatch=re.match=re.makeRe=re.braceExpand=re.defaults=re.filter=re.GLOBSTAR=re.sep=re.minimatch=void 0;var wW=kW(cR()),Gd=hR(),vR=ST(),xW=kT(),EW=$d(),AW=(t,e,n={})=>((0,Gd.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Ks(e,n).match(t));re.minimatch=AW;var OW=/^\*+([^+@!?\*\[\(]*)$/,CW=t=>e=>!e.startsWith(".")&&e.endsWith(t),RW=t=>e=>e.endsWith(t),PW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),DW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),IW=/^\*+\.\*+$/,MW=t=>!t.startsWith(".")&&t.includes("."),LW=t=>t!=="."&&t!==".."&&t.includes("."),NW=/^\.\*+$/,qW=t=>t!=="."&&t!==".."&&t.startsWith("."),jW=/^\*+$/,FW=t=>t.length!==0&&!t.startsWith("."),$W=t=>t.length!==0&&t!=="."&&t!=="..",BW=/^\?+([^+@!?\*\[\(]*)?$/,UW=([t,e=""])=>{let n=_R([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},WW=([t,e=""])=>{let n=TR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},HW=([t,e=""])=>{let n=TR([t]);return e?r=>n(r)&&r.endsWith(e):n},GW=([t,e=""])=>{let n=_R([t]);return e?r=>n(r)&&r.endsWith(e):n},_R=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},TR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},SR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yR={win32:{sep:"\\"},posix:{sep:"/"}};re.sep=SR==="win32"?yR.win32.sep:yR.posix.sep;re.minimatch.sep=re.sep;re.GLOBSTAR=Symbol("globstar **");re.minimatch.GLOBSTAR=re.GLOBSTAR;var zW="[^/]",KW=zW+"*?",VW="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",XW="(?:(?!(?:\\/|^)\\.).)*?",YW=(t,e={})=>n=>(0,re.minimatch)(n,t,e);re.filter=YW;re.minimatch.filter=re.filter;var hr=(t,e={})=>Object.assign({},t,e),JW=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return re.minimatch;let e=re.minimatch;return Object.assign((r,i,s={})=>e(r,i,hr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,hr(t,s))}static defaults(i){return e.defaults(hr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,hr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,hr(t,s))}},unescape:(r,i={})=>e.unescape(r,hr(t,i)),escape:(r,i={})=>e.escape(r,hr(t,i)),filter:(r,i={})=>e.filter(r,hr(t,i)),defaults:r=>e.defaults(hr(t,r)),makeRe:(r,i={})=>e.makeRe(r,hr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,hr(t,i)),match:(r,i,s={})=>e.match(r,i,hr(t,s)),sep:e.sep,GLOBSTAR:re.GLOBSTAR})};re.defaults=JW;re.minimatch.defaults=re.defaults;var QW=(t,e={})=>((0,Gd.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,wW.default)(t));re.braceExpand=QW;re.minimatch.braceExpand=re.braceExpand;var ZW=(t,e={})=>new Ks(t,e).makeRe();re.makeRe=ZW;re.minimatch.makeRe=re.makeRe;var e5=(t,e,n={})=>{let r=new Ks(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};re.match=e5;re.minimatch.match=re.match;var bR=/[?*]|[+@!]\(.*?\)|\[|\]/,t5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ks=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Gd.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||SR,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]==="?"||!bR.test(s[2]))&&!bR.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}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],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(i,1);let c=r.slice(0);c[i]="**",e.push(c),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 b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=O?3:b?0:void 0,_=k?3:A?0:void 0;if(typeof S=="number"&&typeof _=="number"){let[N,R]=[e[S],n[_]];N.toLowerCase()===R.toLowerCase()&&(n[_]=N,_>S?n=n.slice(_):S>_&&(e=e.slice(S)))}}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,l=n.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=n[a],h=e[o];if(this.debug(n,c,h),c===!1)return!1;if(c===re.GLOBSTAR){this.debug("GLOBSTAR",[n,c,h]);var f=o,g=a+1;if(g===l){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(;f<u;){var v=e[f];if(this.debug(`
|
197
197
|
globstar while`,e,f,n,g,v),this.matchOne(e.slice(f),n.slice(g),r))return this.debug("globstar found match!",f,u,v),!0;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,f,n,g);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
|
198
|
-
>>> no match, partial?`,e,f,n,g),f===u))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,re.braceExpand)(this.pattern,this.options)}parse(e){(0,Gd.assertValidPattern)(e);let n=this.options;if(e==="**")return re.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(qW))?i=n.dot?FW:jW:(r=e.match(AW))?i=(n.nocase?n.dot?PW:RW:n.dot?CW:OW)(r[1]):(r=e.match($W))?i=(n.nocase?n.dot?UW:BW:n.dot?WW:HW)(r):(r=e.match(DW))?i=n.dot?MW:IW:(r=e.match(LW))&&(i=NW);let s=vR.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?KW:n.dot?zW:VW,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let l=u.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))i.add(h);return typeof c=="string"?e5(c):c===re.GLOBSTAR?re.GLOBSTAR:c._src});return l.forEach((c,h)=>{let f=l[h+1],g=l[h-1];c!==re.GLOBSTAR||g===re.GLOBSTAR||(g===void 0?f!==void 0&&f!==re.GLOBSTAR?l[h+1]="(?:\\/|"+r+"\\/)?"+f:l[h]=r:f===void 0?l[h-1]=g+"(?:\\/|"+r+")?":f!==re.GLOBSTAR&&(l[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,l[h+1]=re.GLOBSTAR))}),l.filter(c=>c!==re.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],l=i;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return re.minimatch.defaults(e).Minimatch}};re.Minimatch=zs;var t5=kT();Object.defineProperty(re,"AST",{enumerable:!0,get:function(){return t5.AST}});var n5=wT();Object.defineProperty(re,"escape",{enumerable:!0,get:function(){return n5.escape}});var r5=$d();Object.defineProperty(re,"unescape",{enumerable:!0,get:function(){return r5.unescape}});re.minimatch.AST=vR.AST;re.minimatch.Minimatch=zs;re.minimatch.escape=wW.escape;re.minimatch.unescape=xW.unescape});var AR=m(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.LRUCache=void 0;var _a=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,wR=new Set,xT=typeof process=="object"&&process?process:{},xR=(t,e,n,r)=>{typeof xT.emitWarning=="function"?xT.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},Kd=globalThis.AbortController,kR=globalThis.AbortSignal;if(typeof Kd>"u"){kR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Kd=class{constructor(){e()}signal=new kR;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=xT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,xR("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 i5=t=>!wR.has(t),DV=Symbol("type"),ss=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ER=t=>ss(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ta:null:null,Ta=class extends Array{constructor(e){super(e),this.fill(0)}},ET=class t{heap;length;static#e=!1;static create(e){let n=ER(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]}},AT=class t{#e;#t;#s;#r;#o;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#a;#u;#i;#m;#y;#d;#f;#k;#g;#w;#x;#v;#T;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#v,sizes:e.#w,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#f},free:e.#k,isBackgroundFetch:n=>e.#c(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#O(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#_}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,memoMethod:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e;if(n!==0&&!ss(n))throw new TypeError("max option must be a nonnegative integer");let G=n?ER(n):Array;if(!G)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=v||this.#t,this.sizeCalculation=b,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(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=A,O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=O,this.#S=!!O,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new G(n),this.#y=new G(n),this.#d=0,this.#f=0,this.#k=ET.create(n),this.#l=0,this.#h=0,typeof l=="function"&&(this.#s=l),typeof c=="function"?(this.#r=c,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!ss(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ss(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ss(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!ss(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ie="LRU_CACHE_UNBOUNDED";i5(ie)&&(wR.add(ie),xR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ie,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new Ta(this.#e),n=new Ta(this.#e);this.#v=e,this.#x=n,this.#D=(s,o,a=_a.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#E=s=>{n[s]=e[s]!==0?_a.now():0},this.#n=(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 l=s.now-u;s.remainingTTL=a-l}};let r=0,i=()=>{let s=_a.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let l=(r||i())-u;return a-l},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#E=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new Ta(this.#e);this.#h=0,this.#w=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#c(r))return 0;if(!ss(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!ss(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#y[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#O())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#O())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#c(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#v&&this.#x){let o=this.#v[n],a=this.#x[n];if(o&&a){let u=o-(_a.now()-a);s.ttl=u,s.start=Date.now()}}return this.#w&&(s.size=this.#w[n]),s}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#c(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#v&&this.#x){o.ttl=this.#v[n];let a=_a.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=_a.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:l=this.noUpdateTTL}=r,c=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#l===0?void 0:this.#a.get(e);if(h===void 0)h=this.#l===0?this.#f:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#f]=h,this.#y[h]=this.#f,this.#f=h,this.#l++,this.#M(h,c,u),u&&(u.set="add"),l=!1;else{this.#$(h);let f=this.#i[h];if(n!==f){if(this.#S&&this.#c(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=f;g!==void 0&&!o&&(this.#T&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#T&&this.#s?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]));if(this.#I(h),this.#M(h,c,u),this.#i[h]=n,u){u.set="replace";let g=f&&this.#c(f)?f.__staleWhileFetching:f;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#v&&this.#C(),this.#v&&(l||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let f=this.#g,g;for(;g=f?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#i[this.#d];if(this.#q(!0),this.#c(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#d,r=this.#u[n],i=this.#i[n];return this.#S&&this.#c(i)?i.__abortController.abort(new Error("evicted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#k.push(n)),this.#l===1?(this.#d=this.#f=0,this.#k.length=0):this.#d=this.#m[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#E(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#c(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#c(s))return s;let o=new Kd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},l=(b,O=!1)=>{let{aborted:A}=o.signal,k=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!O?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,k&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!k&&!O)return h(o.signal.reason);let S=g;return this.#i[n]===g&&(b===void 0?S.__staleWhileFetching?this.#i[n]=S.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},c=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:O}=o.signal,A=O&&r.allowStaleOnFetchAbort,k=A||r.allowStaleOnFetchRejection,S=k||r.noDeleteOnFetchRejection,_=g;if(this.#i[n]===g&&(!S||_.__staleWhileFetching===void 0?this.#P(e,"fetch"):A||(this.#i[n]=_.__staleWhileFetching)),k)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw b},f=(b,O)=>{let A=this.#o?.(e,s,u);A&&A instanceof Promise&&A.then(k=>b(k===void 0?void 0:k),O),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=k=>l(k,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(f).then(l,c),v=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,v,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=v,v}#c(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Kd}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:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:O=!1,status:A,signal:k}=n;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let S={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:g,status:A,signal:k},_=this.#a.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#j(e,_,S,b);return N.__returned=N}else{let N=this.#i[_];if(this.#c(N)){let K=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",K&&(A.returnedStale=!0)),K?N.__staleWhileFetching:N.__returned=N}let R=this.#b(_);if(!O&&!R)return A&&(A.fetch="hit"),this.#$(_),i&&this.#E(_),A&&this.#n(A,_),N;let G=this.#j(e,_,S,b),ue=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",ue&&R&&(A.returnedStale=!0)),ue?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.#_;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.#a.get(e);if(a!==void 0){let u=this.#i[a],l=this.#c(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#$(a),i&&this.#E(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#f&&(e===this.#d?this.#d=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#c(s)?s.__abortController.abort(new Error("deleted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#f)this.#f=this.#y[i];else if(i===this.#d)this.#d=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#l--,this.#k.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#O({allowStale:!0})){let r=this.#i[n];if(this.#c(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#T&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#v&&this.#x&&(this.#v.fill(0),this.#x.fill(0)),this.#w&&this.#w.fill(0),this.#d=0,this.#f=0,this.#k.length=0,this.#h=0,this.#l=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};zd.LRUCache=AT});var LT=m(_n=>{"use strict";var s5=_n&&_n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_n,"__esModule",{value:!0});_n.Minipass=_n.isWritable=_n.isReadable=_n.isStream=void 0;var OR=typeof process=="object"&&process?process:{stdout:null,stderr:null},MT=require("node:events"),DR=s5(require("node:stream")),o5=require("node:string_decoder"),a5=t=>!!t&&typeof t=="object"&&(t instanceof ep||t instanceof DR.default||(0,_n.isReadable)(t)||(0,_n.isWritable)(t));_n.isStream=a5;var u5=t=>!!t&&typeof t=="object"&&t instanceof MT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==DR.default.Writable.prototype.pipe;_n.isReadable=u5;var l5=t=>!!t&&typeof t=="object"&&t instanceof MT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";_n.isWritable=l5;var Si=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),os=Symbol("emittedEnd"),Vd=Symbol("emittingEnd"),rl=Symbol("emittedError"),Xd=Symbol("closed"),CR=Symbol("read"),Yd=Symbol("flush"),RR=Symbol("flushChunk"),Cr=Symbol("encoding"),Sa=Symbol("decoder"),Gt=Symbol("flowing"),il=Symbol("paused"),ka=Symbol("resume"),Kt=Symbol("buffer"),vn=Symbol("pipes"),zt=Symbol("bufferLength"),OT=Symbol("bufferPush"),Jd=Symbol("bufferShift"),cn=Symbol("objectMode"),Et=Symbol("destroyed"),CT=Symbol("error"),RT=Symbol("emitData"),PR=Symbol("emitEnd"),PT=Symbol("emitEnd2"),ei=Symbol("async"),DT=Symbol("abort"),Qd=Symbol("aborted"),sl=Symbol("signal"),Vs=Symbol("dataListeners"),Un=Symbol("discarded"),ol=t=>Promise.resolve().then(t),c5=t=>t(),h5=t=>t==="end"||t==="finish"||t==="prefinish",f5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,d5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Zd=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ka](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},IT=class extends Zd{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)}},p5=t=>!!t.objectMode,g5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ep=class extends MT.EventEmitter{[Gt]=!1;[il]=!1;[vn]=[];[Kt]=[];[cn];[Cr];[ei];[Sa];[Si]=!1;[os]=!1;[Vd]=!1;[Xd]=!1;[rl]=null;[zt]=0;[Et]=!1;[sl];[Qd]=!1;[Vs]=0;[Un]=!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");p5(n)?(this[cn]=!0,this[Cr]=null):g5(n)?(this[Cr]=n.encoding,this[cn]=!1):(this[cn]=!1,this[Cr]=null),this[ei]=!!n.async,this[Sa]=this[Cr]?new o5.StringDecoder(this[Cr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Kt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[vn]});let{signal:r}=n;r&&(this[sl]=r,r.aborted?this[DT]():r.addEventListener("abort",()=>this[DT]()))}get bufferLength(){return this[zt]}get encoding(){return this[Cr]}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[cn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ei]}set async(e){this[ei]=this[ei]||!!e}[DT](){this[Qd]=!0,this.emit("abort",this[sl]?.reason),this.destroy(this[sl]?.reason)}get aborted(){return this[Qd]}set aborted(e){}write(e,n,r){if(this[Qd])return!1;if(this[Si])throw new Error("write after end");if(this[Et])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let i=this[ei]?ol:c5;if(!this[cn]&&!Buffer.isBuffer(e)){if(d5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(f5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[cn]?(this[Gt]&&this[zt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[OT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):e.length?(typeof e=="string"&&!(n===this[Cr]&&!this[Sa]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Cr]&&(e=this[Sa].write(e)),this[Gt]&&this[zt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[OT](e),this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):(this[zt]!==0&&this.emit("readable"),r&&i(r),this[Gt])}read(e){if(this[Et])return null;if(this[Un]=!1,this[zt]===0||e===0||e&&e>this[zt])return this[ki](),null;this[cn]&&(e=null),this[Kt].length>1&&!this[cn]&&(this[Kt]=[this[Cr]?this[Kt].join(""):Buffer.concat(this[Kt],this[zt])]);let n=this[CR](e||null,this[Kt][0]);return this[ki](),n}[CR](e,n){if(this[cn])this[Jd]();else{let r=n;e===r.length||e===null?this[Jd]():typeof r=="string"?(this[Kt][0]=r.slice(e),n=r.slice(0,e),this[zt]-=e):(this[Kt][0]=r.subarray(e),n=r.subarray(0,e),this[zt]-=e)}return this.emit("data",n),!this[Kt].length&&!this[Si]&&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[Si]=!0,this.writable=!1,(this[Gt]||!this[il])&&this[ki](),this}[ka](){this[Et]||(!this[Vs]&&!this[vn].length&&(this[Un]=!0),this[il]=!1,this[Gt]=!0,this.emit("resume"),this[Kt].length?this[Yd]():this[Si]?this[ki]():this.emit("drain"))}resume(){return this[ka]()}pause(){this[Gt]=!1,this[il]=!0,this[Un]=!1}get destroyed(){return this[Et]}get flowing(){return this[Gt]}get paused(){return this[il]}[OT](e){this[cn]?this[zt]+=1:this[zt]+=e.length,this[Kt].push(e)}[Jd](){return this[cn]?this[zt]-=1:this[zt]-=this[Kt][0].length,this[Kt].shift()}[Yd](e=!1){do;while(this[RR](this[Jd]())&&this[Kt].length);!e&&!this[Kt].length&&!this[Si]&&this.emit("drain")}[RR](e){return this.emit("data",e),this[Gt]}pipe(e,n){if(this[Et])return e;this[Un]=!1;let r=this[os];return n=n||{},e===OR.stdout||e===OR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[vn].push(n.proxyErrors?new IT(this,e,n):new Zd(this,e,n)),this[ei]?ol(()=>this[ka]()):this[ka]()),e}unpipe(e){let n=this[vn].find(r=>r.dest===e);n&&(this[vn].length===1?(this[Gt]&&this[Vs]===0&&(this[Gt]=!1),this[vn]=[]):this[vn].splice(this[vn].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[Un]=!1,this[Vs]++,!this[vn].length&&!this[Gt]&&this[ka]();else if(e==="readable"&&this[zt]!==0)super.emit("readable");else if(h5(e)&&this[os])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[rl]){let i=n;this[ei]?ol(()=>i.call(this,this[rl])):i.call(this,this[rl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Vs]=this.listeners("data").length,this[Vs]===0&&!this[Un]&&!this[vn].length&&(this[Gt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vs]=0,!this[Un]&&!this[vn].length&&(this[Gt]=!1)),n}get emittedEnd(){return this[os]}[ki](){!this[Vd]&&!this[os]&&!this[Et]&&this[Kt].length===0&&this[Si]&&(this[Vd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xd]&&this.emit("close"),this[Vd]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Et&&this[Et])return!1;if(e==="data")return!this[cn]&&!r?!1:this[ei]?(ol(()=>this[RT](r)),!0):this[RT](r);if(e==="end")return this[PR]();if(e==="close"){if(this[Xd]=!0,!this[os]&&!this[Et])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[rl]=r,super.emit(CT,r);let s=!this[sl]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),s}else if(e==="resume"){let s=super.emit("resume");return this[ki](),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[ki](),i}[RT](e){for(let r of this[vn])r.dest.write(e)===!1&&this.pause();let n=this[Un]?!1:super.emit("data",e);return this[ki](),n}[PR](){return this[os]?!1:(this[os]=!0,this.readable=!1,this[ei]?(ol(()=>this[PT]()),!0):this[PT]())}[PT](){if(this[Sa]){let n=this[Sa].end();if(n){for(let r of this[vn])r.dest.write(n);this[Un]||super.emit("data",n)}}for(let n of this[vn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[cn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[cn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[cn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Cr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(Et,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Un]=!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[Si])return n();let s,o,a=h=>{this.off("data",u),this.off("end",l),this.off(Et,c),n(),o(h)},u=h=>{this.off("error",a),this.off("end",l),this.off(Et,c),this.pause(),s({value:h,done:!!this[Si]})},l=()=>{this.off("error",a),this.off("data",u),this.off(Et,c),n(),s({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((h,f)=>{o=f,s=h,this.once(Et,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Un]=!1;let e=!1,n=()=>(this.pause(),this.off(CT,n),this.off(Et,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(CT,n),this.once(Et,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Et])return e?this.emit("error",e):this.emit(Et),this;this[Et]=!0,this[Un]=!0,this[Kt].length=0,this[zt]=0;let n=this;return typeof n.close=="function"&&!this[Xd]&&n.close(),e?this.emit("error",e):this.emit(Et),this}static get isStream(){return _n.isStream}};_n.Minipass=ep});var zR=m(Be=>{"use strict";var m5=Be&&Be.__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]}),y5=Be&&Be.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b5=Be&&Be.__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)&&m5(e,t,n);return y5(e,t),e};Object.defineProperty(Be,"__esModule",{value:!0});Be.PathScurry=Be.Path=Be.PathScurryDarwin=Be.PathScurryPosix=Be.PathScurryWin32=Be.PathScurryBase=Be.PathPosix=Be.PathWin32=Be.PathBase=Be.ChildrenCache=Be.ResolveCache=void 0;var jR=AR(),sp=require("node:path"),v5=require("node:url"),ul=require("fs"),_5=b5(require("node:fs")),T5=ul.realpathSync.native,tp=require("node:fs/promises"),IR=LT(),ll={lstatSync:ul.lstatSync,readdir:ul.readdir,readdirSync:ul.readdirSync,readlinkSync:ul.readlinkSync,realpathSync:T5,promises:{lstat:tp.lstat,readdir:tp.readdir,readlink:tp.readlink,realpath:tp.realpath}},FR=t=>!t||t===ll||t===_5?ll:{...ll,...t,promises:{...ll.promises,...t.promises||{}}},$R=/^\\\\\?\\([a-z]:)\\?$/i,S5=t=>t.replace(/\//g,"\\").replace($R,"$1\\"),k5=/[\\\/]/,fr=0,BR=1,UR=2,ti=4,WR=6,HR=8,Xs=10,GR=12,hr=15,al=~hr,NT=16,MR=32,cl=64,Rr=128,np=256,ip=512,LR=cl|Rr|ip,w5=1023,qT=t=>t.isFile()?HR:t.isDirectory()?ti:t.isSymbolicLink()?Xs:t.isCharacterDevice()?UR:t.isBlockDevice()?WR:t.isSocket()?GR:t.isFIFO()?BR:fr,NR=new Map,hl=t=>{let e=NR.get(t);if(e)return e;let n=t.normalize("NFKD");return NR.set(t,n),n},qR=new Map,rp=t=>{let e=qR.get(t);if(e)return e;let n=hl(t.toLowerCase());return qR.set(t,n),n},fl=class extends jR.LRUCache{constructor(){super({max:256})}};Be.ResolveCache=fl;var op=class extends jR.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Be.ChildrenCache=op;var KR=Symbol("PathScurry setAsCwd"),Zt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#_;get gid(){return this.#_}#l;get rdev(){return this.#l}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#f;get birthtimeMs(){return this.#f}#k;get atime(){return this.#k}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#T;#S;#p;#C;#E;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=fr,r,i,s,o,a){this.name=e,this.#v=s?rp(e):hl(e),this.#n=n&w5,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#S=a.fullpath,this.#C=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=FR(a.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~NT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?rp(e):hl(e);for(let u of r)if(u.#v===i)return u;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,fr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Rr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&hr)===fr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&hr)===HR}isDirectory(){return(this.#n&hr)===ti}isCharacterDevice(){return(this.#n&hr)===UR}isBlockDevice(){return(this.#n&hr)===WR}isFIFO(){return(this.#n&hr)===BR}isSocket(){return(this.#n&hr)===GR}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&MR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&hr;return!(e!==fr&&e!==Xs||this.#n&np||this.#n&Rr)}calledReaddir(){return!!(this.#n&NT)}isENOENT(){return!!(this.#n&Rr)}isNamed(e){return this.nocase?this.#v===rp(e):this.#v===hl(e)}async readlink(){let e=this.#b;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.#b=r}catch(n){this.#c(n.code);return}}readlinkSync(){let e=this.#b;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.#b=r}catch(n){this.#c(n.code);return}}#M(e){this.#n|=NT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Rr||(this.#n=(this.#n|Rr)&al,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#O(){this.#n|=ip,this.#N()}#N(){if(this.#n&cl)return;let e=this.#n;(e&hr)===ti&&(e&=al),this.#n=e|cl,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#c(e=""){let n=this.#n;n|=np,e==="ENOENT"&&(n|=Rr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=al),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=qT(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&hr;return s!==ti&&s!==Xs&&s!==fr&&(i.#n|=cl),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?rp(e.name):hl(e.name))===i.#v)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&al|qT(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.#n&Rr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Rr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:h,ino:f,mode:g,mtime:v,mtimeMs:b,nlink:O,rdev:A,size:k,uid:S}=e;this.#k=n,this.#m=r,this.#x=i,this.#f=s,this.#h=o,this.#i=a,this.#w=u,this.#d=l,this.#t=c,this.#_=h,this.#a=f,this.#s=g,this.#g=v,this.#y=b,this.#r=O,this.#l=A,this.#u=k,this.#o=S;let _=qT(e);this.#n=this.#n&al|_|MR,_!==fr&&_!==ti&&_!==Xs&&(this.#n|=cl)}#W=[];#H=!1;#K(e){this.#H=!1;let n=this.#W.slice();this.#W.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.#W.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#K(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&LR)return!1;let e=hr&this.#n;return e===fr||e===ti||e===Xs}shouldWalk(e,n){return(this.#n&ti)===ti&&!(this.#n&LR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}[KR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#E=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#E=void 0,i=i.parent}};Be.PathBase=Zt;var dl=class t extends Zt{sep="\\";splitSep=k5;constructor(e,n=fr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=fr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return sp.win32.parse(e).root}getRoot(e){if(e=S5(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 ml(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($R,"$1\\"),e===n}};Be.PathWin32=dl;var pl=class t extends Zt{splitSep="/";sep="/";constructor(e,n=fr,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=fr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Be.PathPosix=pl;var gl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ll}={}){this.#r=FR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,v5.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new fl,this.#t=new fl,this.#s=new op(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.#r),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,h=n.sep,f=this.rootPath,g=!1;for(let v of u){let b=c--;l=l.child(v,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:f+=(g?"":h)+v}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let 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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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,l=(h,f)=>{u.add(h),h.readdirCB((g,v)=>{if(g)return f(g);let b=v.length;if(!b)return f();let O=()=>{--b===0&&f()};for(let A of v)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(k=>k?.isUnknown()?k.lstat():k).then(k=>k?.shouldWalk(u,o)?l(k,O):O()):A.shouldWalk(u,o)?l(A,O):O()},!0)},c=e;return new Promise((h,f)=>{l(c,g=>{if(g)return f(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(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 l of u){let c=l.readdirSync();for(let h of c){(!s||s(h))&&a.push(r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(i&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(u,o)&&u.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(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 Zt||(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 l=u.readdirSync();for(let c of l){(!s||s(c))&&(yield r?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(i&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=(O,A,k=!1)=>{if(O)return a.emit("error",O);if(i&&!k){let S=[];for(let _ of A)_.isSymbolicLink()&&S.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(S.length){Promise.all(S).then(()=>v(null,A,!0));return}}for(let S of A)S&&(!s||s(S))&&(a.write(r?S:S.fullpath())||(f=!0));c--;for(let S of A){let _=S.realpathCached()||S;_.shouldWalk(u,o)&&l.push(_)}f&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(v,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=g.readdirSync();for(let b of v)(!s||s(b))&&(a.write(r?b:b.fullpath())||(f=!0));c--;for(let b of v){let O=b;if(b.isSymbolicLink()){if(!(i&&(O=b.realpathSync())))continue;O.isUnknown()&&O.lstatSync()}O.shouldWalk(u,o)&&l.push(O)}}f&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[KR](n)}};Be.PathScurryBase=gl;var ml=class extends gl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,sp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sp.win32.parse(e).root.toUpperCase()}newRoot(e){return new dl(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)}};Be.PathScurryWin32=ml;var yl=class extends gl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,sp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new pl(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Be.PathScurryPosix=yl;var ap=class extends yl{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Be.PathScurryDarwin=ap;Be.Path=process.platform==="win32"?dl:pl;Be.PathScurry=process.platform==="win32"?ml:process.platform==="darwin"?ap:yl});var FT=m(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.Pattern=void 0;var x5=is(),E5=t=>t.length>=1,A5=t=>t.length>=1,jT=class t{#e;#t;#s;length;#r;#o;#_;#l;#h;#a;#u=!0;constructor(e,n,r,i){if(!E5(e))throw new TypeError("empty pattern list");if(!A5(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.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...l]=this.#e,[c,h,f,g,...v]=this.#t;l[0]===""&&(l.shift(),v.shift());let b=[s,o,a,u,""].join("/"),O=[c,h,f,g,""].join("/");this.#e=[b,...l],this.#t=[O,...v],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 l=s+"/",c=a+"/";this.#e=[l,...o],this.#t=[c,...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]===x5.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#_=this.#_||(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.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};up.Pattern=jT});var BT=m(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.Ignore=void 0;var VR=is(),O5=FT(),C5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$T=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=C5}){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 VR.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 O5.Pattern(i,s,0,this.platform),a=new VR.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};lp.Ignore=$T});var YR=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var XR=is(),cp=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()]))}};ni.HasWalkedCache=cp;var hp=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)])}};ni.MatchRecord=hp;var fp=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())}};ni.SubWalks=fp;var UT=class t{hasWalkedCache;matches=new hp;subwalks=new fp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new cp}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 h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,c=!1;for(;typeof(u=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(u),s=l,c=!0;if(u=s.pattern(),l=s.rest(),c){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===XR.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=l?.pattern(),f=l?.rest();if(!l||(h===""||h===".")&&!f)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;f?this.hasWalkedCache.hasWalked(g,f)||this.subwalks.add(g,f):this.matches.add(g,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(),l=o.rest();u===XR.GLOBSTAR?i.testGlobstar(s,o,l,a):u instanceof RegExp?i.testRegExp(s,u,l,a):i.testString(s,u,l,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ni.Processor=UT});var ZR=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.GlobStream=as.GlobWalker=as.GlobUtil=void 0;var R5=LT(),JR=BT(),QR=YR(),P5=(t,e)=>typeof t=="string"?new JR.Ignore([t],e):Array.isArray(t)?new JR.Ignore(t,e):t,bl=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=P5(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}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,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.#r(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.#r(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 QR.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,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).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((l,c)=>this.walkCB3(a,c,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,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).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 QR.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,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);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,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};as.GlobUtil=bl;var WT=class extends bl{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}};as.GlobWalker=WT;var HT=class extends bl{results;constructor(e,n,r){super(e,n,r),this.results=new R5.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}};as.GlobStream=HT});var KT=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Glob=void 0;var D5=is(),I5=require("node:url"),dp=zR(),M5=FT(),pp=ZR(),L5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",GT=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,I5.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||L5,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"?dp.PathScurryWin32:n.platform==="darwin"?dp.PathScurryDarwin:n.platform?dp.PathScurryPosix:dp.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 D5.Minimatch(u,i)),[o,a]=s.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new M5.Pattern(u,c,0,this.platform)})}async walk(){return[...await new pp.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 pp.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 pp.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 pp.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()}};gp.Glob=GT});var zT=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.hasMagic=void 0;var N5=is(),q5=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new N5.Minimatch(n,e).hasMagic())return!0;return!1};mp.hasMagic=q5});var rP=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.glob=Ae.sync=Ae.iterate=Ae.iterateSync=Ae.stream=Ae.streamSync=Ae.Ignore=Ae.hasMagic=Ae.Glob=Ae.unescape=Ae.escape=void 0;Ae.globStreamSync=vl;Ae.globStream=VT;Ae.globSync=XT;Ae.globIterateSync=_l;Ae.globIterate=YT;var eP=is(),Ys=KT(),j5=zT(),nP=is();Object.defineProperty(Ae,"escape",{enumerable:!0,get:function(){return nP.escape}});Object.defineProperty(Ae,"unescape",{enumerable:!0,get:function(){return nP.unescape}});var F5=KT();Object.defineProperty(Ae,"Glob",{enumerable:!0,get:function(){return F5.Glob}});var $5=zT();Object.defineProperty(Ae,"hasMagic",{enumerable:!0,get:function(){return $5.hasMagic}});var B5=BT();Object.defineProperty(Ae,"Ignore",{enumerable:!0,get:function(){return B5.Ignore}});function vl(t,e={}){return new Ys.Glob(t,e).streamSync()}function VT(t,e={}){return new Ys.Glob(t,e).stream()}function XT(t,e={}){return new Ys.Glob(t,e).walkSync()}async function tP(t,e={}){return new Ys.Glob(t,e).walk()}function _l(t,e={}){return new Ys.Glob(t,e).iterateSync()}function YT(t,e={}){return new Ys.Glob(t,e).iterate()}Ae.streamSync=vl;Ae.stream=Object.assign(VT,{sync:vl});Ae.iterateSync=_l;Ae.iterate=Object.assign(YT,{sync:_l});Ae.sync=Object.assign(XT,{stream:vl,iterate:_l});Ae.glob=Object.assign(tP,{glob:tP,globSync:XT,sync:Ae.sync,globStream:VT,stream:Ae.stream,globStreamSync:vl,streamSync:Ae.streamSync,globIterate:YT,iterate:Ae.iterate,globIterateSync:_l,iterateSync:Ae.iterateSync,Glob:Ys.Glob,hasMagic:j5.hasMagic,escape:eP.escape,unescape:eP.unescape});Ae.glob.glob=Ae.glob});var sP=m(wa=>{"use strict";var QT=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.FileSystem=void 0;var U5=vm(),iP=(JC(),gP(YC)),W5=QT(require("events")),yp=md(),H5=QT(require("fs")),G5=Ld(),K5=QT(Cd()),z5=rP(),JT=class extends W5.default{constructor(e){super(),this._context=e,this._textDocumentManager=new U5.TextDocuments(iP.TextDocument),this._tempTextDocumentCache=new K5.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>yp.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,z5.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>yp.URI.file(o))}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=yp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await H5.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=iP.TextDocument.create(e,G5.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(yp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,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)})}};wa.FileSystem=JT});var oP=m(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.NodeContext=void 0;var ZT=vm(),eS=Ld(),V5=sP(),tS=class extends eS.CoreContext{constructor(){super(),this.documentManager=new eS.DocumentManager().setContext(this),this.documentMerger=new eS.DocumentMerger,this.connection=(0,ZT.createConnection)(ZT.ProposedFeatures.all),this.fs=new V5.FileSystem(this)}createSemanticTokensBuilder(){return new ZT.SemanticTokensBuilder}};bp.NodeContext=tS});Object.defineProperty(exports,"__esModule",{value:!0});var X5=oP(),Pr=Ld(),aP=new X5.NodeContext;aP.on("ready",t=>{(0,Pr.activateAutocomplete)(t),(0,Pr.activateColor)(t),(0,Pr.activateDefinition)(t),(0,Pr.activateDiagnostic)(t),(0,Pr.activateFormatter)(t),(0,Pr.activateHover)(t),(0,Pr.activateSignature)(t),(0,Pr.activateSubscriptions)(t),(0,Pr.activateSymbol)(t),(0,Pr.activateSemantic)(t),(0,Pr.activateFoldingRange)(t)});aP.listen();
|
198
|
+
>>> no match, partial?`,e,f,n,g),f===u))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,re.braceExpand)(this.pattern,this.options)}parse(e){(0,Gd.assertValidPattern)(e);let n=this.options;if(e==="**")return re.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(jW))?i=n.dot?$W:FW:(r=e.match(OW))?i=(n.nocase?n.dot?DW:PW:n.dot?RW:CW)(r[1]):(r=e.match(BW))?i=(n.nocase?n.dot?WW:UW:n.dot?HW:GW)(r):(r=e.match(IW))?i=n.dot?LW:MW:(r=e.match(NW))&&(i=qW);let s=vR.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?KW:n.dot?VW:XW,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let l=u.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))i.add(h);return typeof c=="string"?t5(c):c===re.GLOBSTAR?re.GLOBSTAR:c._src});return l.forEach((c,h)=>{let f=l[h+1],g=l[h-1];c!==re.GLOBSTAR||g===re.GLOBSTAR||(g===void 0?f!==void 0&&f!==re.GLOBSTAR?l[h+1]="(?:\\/|"+r+"\\/)?"+f:l[h]=r:f===void 0?l[h-1]=g+"(?:\\/|"+r+")?":f!==re.GLOBSTAR&&(l[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,l[h+1]=re.GLOBSTAR))}),l.filter(c=>c!==re.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],l=i;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return re.minimatch.defaults(e).Minimatch}};re.Minimatch=Ks;var n5=ST();Object.defineProperty(re,"AST",{enumerable:!0,get:function(){return n5.AST}});var r5=kT();Object.defineProperty(re,"escape",{enumerable:!0,get:function(){return r5.escape}});var i5=$d();Object.defineProperty(re,"unescape",{enumerable:!0,get:function(){return i5.unescape}});re.minimatch.AST=vR.AST;re.minimatch.Minimatch=Ks;re.minimatch.escape=xW.escape;re.minimatch.unescape=EW.unescape});var AR=m(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.LRUCache=void 0;var _a=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,wR=new Set,wT=typeof process=="object"&&process?process:{},xR=(t,e,n,r)=>{typeof wT.emitWarning=="function"?wT.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},zd=globalThis.AbortController,kR=globalThis.AbortSignal;if(typeof zd>"u"){kR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},zd=class{constructor(){e()}signal=new kR;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=wT.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,xR("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 s5=t=>!wR.has(t),IV=Symbol("type"),ss=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ER=t=>ss(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ta:null:null,Ta=class extends Array{constructor(e){super(e),this.fill(0)}},xT=class t{heap;length;static#e=!1;static create(e){let n=ER(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]}},ET=class t{#e;#t;#s;#r;#o;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#a;#u;#i;#m;#y;#d;#f;#k;#g;#w;#x;#v;#T;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#v,sizes:e.#w,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#f},free:e.#k,isBackgroundFetch:n=>e.#c(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#O(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#_}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:f,maxSize:g=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:O,memoMethod:A,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:N,ignoreFetchAbort:R}=e;if(n!==0&&!ss(n))throw new TypeError("max option must be a nonnegative integer");let G=n?ER(n):Array;if(!G)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=v||this.#t,this.sizeCalculation=b,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(A!==void 0&&typeof A!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=A,O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=O,this.#S=!!O,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new G(n),this.#y=new G(n),this.#d=0,this.#f=0,this.#k=xT.create(n),this.#l=0,this.#h=0,typeof l=="function"&&(this.#s=l),typeof c=="function"?(this.#r=c,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!ss(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ss(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ss(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!ss(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ie="LRU_CACHE_UNBOUNDED";s5(ie)&&(wR.add(ie),xR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ie,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new Ta(this.#e),n=new Ta(this.#e);this.#v=e,this.#x=n,this.#D=(s,o,a=_a.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#E=s=>{n[s]=e[s]!==0?_a.now():0},this.#n=(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 l=s.now-u;s.remainingTTL=a-l}};let r=0,i=()=>{let s=_a.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let l=(r||i())-u;return a-l},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#E=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new Ta(this.#e);this.#h=0,this.#w=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#c(r))return 0;if(!ss(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!ss(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#y[n]}*#O({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#O())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#c(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#O()){let n=this.#u[e];n!==void 0&&!this.#c(this.#i[e])&&(yield n)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#O())this.#i[e]!==void 0&&!this.#c(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#O()){let i=this.#i[r],s=this.#c(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#O({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#c(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#v&&this.#x){let o=this.#v[n],a=this.#x[n];if(o&&a){let u=o-(_a.now()-a);s.ttl=u,s.start=Date.now()}}return this.#w&&(s.size=this.#w[n]),s}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#c(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#v&&this.#x){o.ttl=this.#v[n];let a=_a.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=_a.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:l=this.noUpdateTTL}=r,c=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#l===0?void 0:this.#a.get(e);if(h===void 0)h=this.#l===0?this.#f:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#f]=h,this.#y[h]=this.#f,this.#f=h,this.#l++,this.#M(h,c,u),u&&(u.set="add"),l=!1;else{this.#$(h);let f=this.#i[h];if(n!==f){if(this.#S&&this.#c(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=f;g!==void 0&&!o&&(this.#T&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#T&&this.#s?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]));if(this.#I(h),this.#M(h,c,u),this.#i[h]=n,u){u.set="replace";let g=f&&this.#c(f)?f.__staleWhileFetching:f;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#v&&this.#C(),this.#v&&(l||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let f=this.#g,g;for(;g=f?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#i[this.#d];if(this.#q(!0),this.#c(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#d,r=this.#u[n],i=this.#i[n];return this.#S&&this.#c(i)?i.__abortController.abort(new Error("evicted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#k.push(n)),this.#l===1?(this.#d=this.#f=0,this.#k.length=0):this.#d=this.#m[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#E(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#c(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#c(s))return s;let o=new zd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},l=(b,O=!1)=>{let{aborted:A}=o.signal,k=r.ignoreFetchAbort&&b!==void 0;if(r.status&&(A&&!O?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,k&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),A&&!k&&!O)return h(o.signal.reason);let S=g;return this.#i[n]===g&&(b===void 0?S.__staleWhileFetching?this.#i[n]=S.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,b,u.options))),b},c=b=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=b),h(b)),h=b=>{let{aborted:O}=o.signal,A=O&&r.allowStaleOnFetchAbort,k=A||r.allowStaleOnFetchRejection,S=k||r.noDeleteOnFetchRejection,_=g;if(this.#i[n]===g&&(!S||_.__staleWhileFetching===void 0?this.#P(e,"fetch"):A||(this.#i[n]=_.__staleWhileFetching)),k)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw b},f=(b,O)=>{let A=this.#o?.(e,s,u);A&&A instanceof Promise&&A.then(k=>b(k===void 0?void 0:k),O),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(b(void 0),r.allowStaleOnFetchAbort&&(b=k=>l(k,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(f).then(l,c),v=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,v,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=v,v}#c(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof zd}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:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:O=!1,status:A,signal:k}=n;if(!this.#S)return A&&(A.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:A});let S={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:g,status:A,signal:k},_=this.#a.get(e);if(_===void 0){A&&(A.fetch="miss");let N=this.#j(e,_,S,b);return N.__returned=N}else{let N=this.#i[_];if(this.#c(N)){let z=r&&N.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",z&&(A.returnedStale=!0)),z?N.__staleWhileFetching:N.__returned=N}let R=this.#b(_);if(!O&&!R)return A&&(A.fetch="hit"),this.#$(_),i&&this.#E(_),A&&this.#n(A,_),N;let G=this.#j(e,_,S,b),ue=G.__staleWhileFetching!==void 0&&r;return A&&(A.fetch=R?"stale":"refresh",ue&&R&&(A.returnedStale=!0)),ue?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.#_;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.#a.get(e);if(a!==void 0){let u=this.#i[a],l=this.#c(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#$(a),i&&this.#E(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#f&&(e===this.#d?this.#d=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#c(s)?s.__abortController.abort(new Error("deleted")):(this.#T||this.#p)&&(this.#T&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#f)this.#f=this.#y[i];else if(i===this.#d)this.#d=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#l--,this.#k.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#O({allowStale:!0})){let r=this.#i[n];if(this.#c(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#T&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#v&&this.#x&&(this.#v.fill(0),this.#x.fill(0)),this.#w&&this.#w.fill(0),this.#d=0,this.#f=0,this.#k.length=0,this.#h=0,this.#l=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};Kd.LRUCache=ET});var MT=m(_n=>{"use strict";var o5=_n&&_n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_n,"__esModule",{value:!0});_n.Minipass=_n.isWritable=_n.isReadable=_n.isStream=void 0;var OR=typeof process=="object"&&process?process:{stdout:null,stderr:null},IT=require("node:events"),DR=o5(require("node:stream")),a5=require("node:string_decoder"),u5=t=>!!t&&typeof t=="object"&&(t instanceof ep||t instanceof DR.default||(0,_n.isReadable)(t)||(0,_n.isWritable)(t));_n.isStream=u5;var l5=t=>!!t&&typeof t=="object"&&t instanceof IT.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==DR.default.Writable.prototype.pipe;_n.isReadable=l5;var c5=t=>!!t&&typeof t=="object"&&t instanceof IT.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";_n.isWritable=c5;var Si=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),os=Symbol("emittedEnd"),Vd=Symbol("emittingEnd"),rl=Symbol("emittedError"),Xd=Symbol("closed"),CR=Symbol("read"),Yd=Symbol("flush"),RR=Symbol("flushChunk"),Cr=Symbol("encoding"),Sa=Symbol("decoder"),Gt=Symbol("flowing"),il=Symbol("paused"),ka=Symbol("resume"),zt=Symbol("buffer"),vn=Symbol("pipes"),Kt=Symbol("bufferLength"),AT=Symbol("bufferPush"),Jd=Symbol("bufferShift"),cn=Symbol("objectMode"),At=Symbol("destroyed"),OT=Symbol("error"),CT=Symbol("emitData"),PR=Symbol("emitEnd"),RT=Symbol("emitEnd2"),ei=Symbol("async"),PT=Symbol("abort"),Qd=Symbol("aborted"),sl=Symbol("signal"),Vs=Symbol("dataListeners"),Un=Symbol("discarded"),ol=t=>Promise.resolve().then(t),h5=t=>t(),f5=t=>t==="end"||t==="finish"||t==="prefinish",d5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,p5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Zd=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ka](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},DT=class extends Zd{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)}},g5=t=>!!t.objectMode,m5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ep=class extends IT.EventEmitter{[Gt]=!1;[il]=!1;[vn]=[];[zt]=[];[cn];[Cr];[ei];[Sa];[Si]=!1;[os]=!1;[Vd]=!1;[Xd]=!1;[rl]=null;[Kt]=0;[At]=!1;[sl];[Qd]=!1;[Vs]=0;[Un]=!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");g5(n)?(this[cn]=!0,this[Cr]=null):m5(n)?(this[Cr]=n.encoding,this[cn]=!1):(this[cn]=!1,this[Cr]=null),this[ei]=!!n.async,this[Sa]=this[Cr]?new a5.StringDecoder(this[Cr]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[zt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[vn]});let{signal:r}=n;r&&(this[sl]=r,r.aborted?this[PT]():r.addEventListener("abort",()=>this[PT]()))}get bufferLength(){return this[Kt]}get encoding(){return this[Cr]}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[cn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ei]}set async(e){this[ei]=this[ei]||!!e}[PT](){this[Qd]=!0,this.emit("abort",this[sl]?.reason),this.destroy(this[sl]?.reason)}get aborted(){return this[Qd]}set aborted(e){}write(e,n,r){if(this[Qd])return!1;if(this[Si])throw new Error("write after end");if(this[At])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[ei]?ol:h5;if(!this[cn]&&!Buffer.isBuffer(e)){if(p5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(d5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[cn]?(this[Gt]&&this[Kt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[AT](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):e.length?(typeof e=="string"&&!(n===this[Cr]&&!this[Sa]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Cr]&&(e=this[Sa].write(e)),this[Gt]&&this[Kt]!==0&&this[Yd](!0),this[Gt]?this.emit("data",e):this[AT](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):(this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt])}read(e){if(this[At])return null;if(this[Un]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[ki](),null;this[cn]&&(e=null),this[zt].length>1&&!this[cn]&&(this[zt]=[this[Cr]?this[zt].join(""):Buffer.concat(this[zt],this[Kt])]);let n=this[CR](e||null,this[zt][0]);return this[ki](),n}[CR](e,n){if(this[cn])this[Jd]();else{let r=n;e===r.length||e===null?this[Jd]():typeof r=="string"?(this[zt][0]=r.slice(e),n=r.slice(0,e),this[Kt]-=e):(this[zt][0]=r.subarray(e),n=r.subarray(0,e),this[Kt]-=e)}return this.emit("data",n),!this[zt].length&&!this[Si]&&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[Si]=!0,this.writable=!1,(this[Gt]||!this[il])&&this[ki](),this}[ka](){this[At]||(!this[Vs]&&!this[vn].length&&(this[Un]=!0),this[il]=!1,this[Gt]=!0,this.emit("resume"),this[zt].length?this[Yd]():this[Si]?this[ki]():this.emit("drain"))}resume(){return this[ka]()}pause(){this[Gt]=!1,this[il]=!0,this[Un]=!1}get destroyed(){return this[At]}get flowing(){return this[Gt]}get paused(){return this[il]}[AT](e){this[cn]?this[Kt]+=1:this[Kt]+=e.length,this[zt].push(e)}[Jd](){return this[cn]?this[Kt]-=1:this[Kt]-=this[zt][0].length,this[zt].shift()}[Yd](e=!1){do;while(this[RR](this[Jd]())&&this[zt].length);!e&&!this[zt].length&&!this[Si]&&this.emit("drain")}[RR](e){return this.emit("data",e),this[Gt]}pipe(e,n){if(this[At])return e;this[Un]=!1;let r=this[os];return n=n||{},e===OR.stdout||e===OR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[vn].push(n.proxyErrors?new DT(this,e,n):new Zd(this,e,n)),this[ei]?ol(()=>this[ka]()):this[ka]()),e}unpipe(e){let n=this[vn].find(r=>r.dest===e);n&&(this[vn].length===1?(this[Gt]&&this[Vs]===0&&(this[Gt]=!1),this[vn]=[]):this[vn].splice(this[vn].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[Un]=!1,this[Vs]++,!this[vn].length&&!this[Gt]&&this[ka]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(f5(e)&&this[os])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[rl]){let i=n;this[ei]?ol(()=>i.call(this,this[rl])):i.call(this,this[rl])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Vs]=this.listeners("data").length,this[Vs]===0&&!this[Un]&&!this[vn].length&&(this[Gt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vs]=0,!this[Un]&&!this[vn].length&&(this[Gt]=!1)),n}get emittedEnd(){return this[os]}[ki](){!this[Vd]&&!this[os]&&!this[At]&&this[zt].length===0&&this[Si]&&(this[Vd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xd]&&this.emit("close"),this[Vd]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==At&&this[At])return!1;if(e==="data")return!this[cn]&&!r?!1:this[ei]?(ol(()=>this[CT](r)),!0):this[CT](r);if(e==="end")return this[PR]();if(e==="close"){if(this[Xd]=!0,!this[os]&&!this[At])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[rl]=r,super.emit(OT,r);let s=!this[sl]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),s}else if(e==="resume"){let s=super.emit("resume");return this[ki](),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[ki](),i}[CT](e){for(let r of this[vn])r.dest.write(e)===!1&&this.pause();let n=this[Un]?!1:super.emit("data",e);return this[ki](),n}[PR](){return this[os]?!1:(this[os]=!0,this.readable=!1,this[ei]?(ol(()=>this[RT]()),!0):this[RT]())}[RT](){if(this[Sa]){let n=this[Sa].end();if(n){for(let r of this[vn])r.dest.write(n);this[Un]||super.emit("data",n)}}for(let n of this[vn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[cn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[cn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[cn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Cr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(At,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Un]=!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[Si])return n();let s,o,a=h=>{this.off("data",u),this.off("end",l),this.off(At,c),n(),o(h)},u=h=>{this.off("error",a),this.off("end",l),this.off(At,c),this.pause(),s({value:h,done:!!this[Si]})},l=()=>{this.off("error",a),this.off("data",u),this.off(At,c),n(),s({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((h,f)=>{o=f,s=h,this.once(At,c),this.once("error",a),this.once("end",l),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Un]=!1;let e=!1,n=()=>(this.pause(),this.off(OT,n),this.off(At,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(OT,n),this.once(At,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[At])return e?this.emit("error",e):this.emit(At),this;this[At]=!0,this[Un]=!0,this[zt].length=0,this[Kt]=0;let n=this;return typeof n.close=="function"&&!this[Xd]&&n.close(),e?this.emit("error",e):this.emit(At),this}static get isStream(){return _n.isStream}};_n.Minipass=ep});var KR=m(Ue=>{"use strict";var y5=Ue&&Ue.__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]}),b5=Ue&&Ue.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v5=Ue&&Ue.__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)&&y5(e,t,n);return b5(e,t),e};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.PathScurry=Ue.Path=Ue.PathScurryDarwin=Ue.PathScurryPosix=Ue.PathScurryWin32=Ue.PathScurryBase=Ue.PathPosix=Ue.PathWin32=Ue.PathBase=Ue.ChildrenCache=Ue.ResolveCache=void 0;var jR=AR(),sp=require("node:path"),_5=require("node:url"),ul=require("fs"),T5=v5(require("node:fs")),S5=ul.realpathSync.native,tp=require("node:fs/promises"),IR=MT(),ll={lstatSync:ul.lstatSync,readdir:ul.readdir,readdirSync:ul.readdirSync,readlinkSync:ul.readlinkSync,realpathSync:S5,promises:{lstat:tp.lstat,readdir:tp.readdir,readlink:tp.readlink,realpath:tp.realpath}},FR=t=>!t||t===ll||t===T5?ll:{...ll,...t,promises:{...ll.promises,...t.promises||{}}},$R=/^\\\\\?\\([a-z]:)\\?$/i,k5=t=>t.replace(/\//g,"\\").replace($R,"$1\\"),w5=/[\\\/]/,dr=0,BR=1,UR=2,ti=4,WR=6,HR=8,Xs=10,GR=12,fr=15,al=~fr,LT=16,MR=32,cl=64,Rr=128,np=256,ip=512,LR=cl|Rr|ip,x5=1023,NT=t=>t.isFile()?HR:t.isDirectory()?ti:t.isSymbolicLink()?Xs:t.isCharacterDevice()?UR:t.isBlockDevice()?WR:t.isSocket()?GR:t.isFIFO()?BR:dr,NR=new Map,hl=t=>{let e=NR.get(t);if(e)return e;let n=t.normalize("NFKD");return NR.set(t,n),n},qR=new Map,rp=t=>{let e=qR.get(t);if(e)return e;let n=hl(t.toLowerCase());return qR.set(t,n),n},fl=class extends jR.LRUCache{constructor(){super({max:256})}};Ue.ResolveCache=fl;var op=class extends jR.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Ue.ChildrenCache=op;var zR=Symbol("PathScurry setAsCwd"),Zt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#_;get gid(){return this.#_}#l;get rdev(){return this.#l}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#f;get birthtimeMs(){return this.#f}#k;get atime(){return this.#k}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#T;#S;#p;#C;#E;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=dr,r,i,s,o,a){this.name=e,this.#v=s?rp(e):hl(e),this.#n=n&x5,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#S=a.fullpath,this.#C=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=FR(a.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~LT,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?rp(e):hl(e);for(let u of r)if(u.#v===i)return u;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,dr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Rr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,n=this.parent;if(!n)return this.#C=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&fr)===dr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&fr)===HR}isDirectory(){return(this.#n&fr)===ti}isCharacterDevice(){return(this.#n&fr)===UR}isBlockDevice(){return(this.#n&fr)===WR}isFIFO(){return(this.#n&fr)===BR}isSocket(){return(this.#n&fr)===GR}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&MR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&fr;return!(e!==dr&&e!==Xs||this.#n&np||this.#n&Rr)}calledReaddir(){return!!(this.#n<)}isENOENT(){return!!(this.#n&Rr)}isNamed(e){return this.nocase?this.#v===rp(e):this.#v===hl(e)}async readlink(){let e=this.#b;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.#b=r}catch(n){this.#c(n.code);return}}readlinkSync(){let e=this.#b;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.#b=r}catch(n){this.#c(n.code);return}}#M(e){this.#n|=LT;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Rr||(this.#n=(this.#n|Rr)&al,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#O(){this.#n|=ip,this.#N()}#N(){if(this.#n&cl)return;let e=this.#n;(e&fr)===ti&&(e&=al),this.#n=e|cl,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#c(e=""){let n=this.#n;n|=np,e==="ENOENT"&&(n|=Rr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=al),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=NT(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&fr;return s!==ti&&s!==Xs&&s!==dr&&(i.#n|=cl),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?rp(e.name):hl(e.name))===i.#v)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&al|NT(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.#n&Rr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Rr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:l,dev:c,gid:h,ino:f,mode:g,mtime:v,mtimeMs:b,nlink:O,rdev:A,size:k,uid:S}=e;this.#k=n,this.#m=r,this.#x=i,this.#f=s,this.#h=o,this.#i=a,this.#w=u,this.#d=l,this.#t=c,this.#_=h,this.#a=f,this.#s=g,this.#g=v,this.#y=b,this.#r=O,this.#l=A,this.#u=k,this.#o=S;let _=NT(e);this.#n=this.#n&al|_|MR,_!==dr&&_!==ti&&_!==Xs&&(this.#n|=cl)}#W=[];#H=!1;#z(e){this.#H=!1;let n=this.#W.slice();this.#W.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.#W.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&LR)return!1;let e=fr&this.#n;return e===dr||e===ti||e===Xs}shouldWalk(e,n){return(this.#n&ti)===ti&&!(this.#n&LR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#R)return this.#R;if(!((ip|np|Rr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#O()}}[zR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#C=r.join(this.sep),i.#E=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#C=void 0,i.#E=void 0,i=i.parent}};Ue.PathBase=Zt;var dl=class t extends Zt{sep="\\";splitSep=w5;constructor(e,n=dr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return sp.win32.parse(e).root}getRoot(e){if(e=k5(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 ml(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($R,"$1\\"),e===n}};Ue.PathWin32=dl;var pl=class t extends Zt{splitSep="/";sep="/";constructor(e,n=dr,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=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Ue.PathPosix=pl;var gl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ll}={}){this.#r=FR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,_5.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new fl,this.#t=new fl,this.#s=new op(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.#r),this.roots[this.rootPath]=this.root;let l=this.root,c=u.length-1,h=n.sep,f=this.rootPath,g=!1;for(let v of u){let b=c--;l=l.child(v,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:f+=(g?"":h)+v}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let 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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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 Zt||(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,l=(h,f)=>{u.add(h),h.readdirCB((g,v)=>{if(g)return f(g);let b=v.length;if(!b)return f();let O=()=>{--b===0&&f()};for(let A of v)(!s||s(A))&&a.push(r?A:A.fullpath()),i&&A.isSymbolicLink()?A.realpath().then(k=>k?.isUnknown()?k.lstat():k).then(k=>k?.shouldWalk(u,o)?l(k,O):O()):A.shouldWalk(u,o)?l(A,O):O()},!0)},c=e;return new Promise((h,f)=>{l(c,g=>{if(g)return f(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(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 l of u){let c=l.readdirSync();for(let h of c){(!s||s(h))&&a.push(r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(i&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(u,o)&&u.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(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 Zt||(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 l=u.readdirSync();for(let c of l){(!s||s(c))&&(yield r?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(i&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=(O,A,k=!1)=>{if(O)return a.emit("error",O);if(i&&!k){let S=[];for(let _ of A)_.isSymbolicLink()&&S.push(_.realpath().then(N=>N?.isUnknown()?N.lstat():N));if(S.length){Promise.all(S).then(()=>v(null,A,!0));return}}for(let S of A)S&&(!s||s(S))&&(a.write(r?S:S.fullpath())||(f=!0));c--;for(let S of A){let _=S.realpathCached()||S;_.shouldWalk(u,o)&&l.push(_)}f&&!a.flowing?a.once("drain",h):b||h()},b=!0;g.readdirCB(v,!0),b=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Zt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new IR.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let l=[e],c=0,h=()=>{let f=!1;for(;!f;){let g=l.shift();if(!g){c===0&&a.end();return}c++,u.add(g);let v=g.readdirSync();for(let b of v)(!s||s(b))&&(a.write(r?b:b.fullpath())||(f=!0));c--;for(let b of v){let O=b;if(b.isSymbolicLink()){if(!(i&&(O=b.realpathSync())))continue;O.isUnknown()&&O.lstatSync()}O.shouldWalk(u,o)&&l.push(O)}}f&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[zR](n)}};Ue.PathScurryBase=gl;var ml=class extends gl{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,sp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sp.win32.parse(e).root.toUpperCase()}newRoot(e){return new dl(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)}};Ue.PathScurryWin32=ml;var yl=class extends gl{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,sp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new pl(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Ue.PathScurryPosix=yl;var ap=class extends yl{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Ue.PathScurryDarwin=ap;Ue.Path=process.platform==="win32"?dl:pl;Ue.PathScurry=process.platform==="win32"?ml:process.platform==="darwin"?ap:yl});var jT=m(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.Pattern=void 0;var E5=is(),A5=t=>t.length>=1,O5=t=>t.length>=1,qT=class t{#e;#t;#s;length;#r;#o;#_;#l;#h;#a;#u=!0;constructor(e,n,r,i){if(!A5(e))throw new TypeError("empty pattern list");if(!O5(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.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...l]=this.#e,[c,h,f,g,...v]=this.#t;l[0]===""&&(l.shift(),v.shift());let b=[s,o,a,u,""].join("/"),O=[c,h,f,g,""].join("/");this.#e=[b,...l],this.#t=[O,...v],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 l=s+"/",c=a+"/";this.#e=[l,...o],this.#t=[c,...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]===E5.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#_=this.#_||(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.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};up.Pattern=qT});var $T=m(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.Ignore=void 0;var VR=is(),C5=jT(),R5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",FT=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=R5}){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 VR.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 C5.Pattern(i,s,0,this.platform),a=new VR.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),u&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};lp.Ignore=FT});var YR=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var XR=is(),cp=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()]))}};ni.HasWalkedCache=cp;var hp=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)])}};ni.MatchRecord=hp;var fp=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())}};ni.SubWalks=fp;var BT=class t{hasWalkedCache;matches=new hp;subwalks=new fp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new cp}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 h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,c=!1;for(;typeof(u=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(u),s=l,c=!0;if(u=s.pattern(),l=s.rest(),c){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===XR.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=l?.pattern(),f=l?.rest();if(!l||(h===""||h===".")&&!f)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;f?this.hasWalkedCache.hasWalked(g,f)||this.subwalks.add(g,f):this.matches.add(g,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(),l=o.rest();u===XR.GLOBSTAR?i.testGlobstar(s,o,l,a):u instanceof RegExp?i.testRegExp(s,u,l,a):i.testString(s,u,l,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ni.Processor=BT});var ZR=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.GlobStream=as.GlobWalker=as.GlobUtil=void 0;var P5=MT(),JR=$T(),QR=YR(),D5=(t,e)=>typeof t=="string"?new JR.Ignore([t],e):Array.isArray(t)?new JR.Ignore(t,e):t,bl=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=D5(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}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,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.#r(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.#r(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 QR.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,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).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((l,c)=>this.walkCB3(a,c,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,l]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,l).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 QR.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,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);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,l]of r.matches.entries())this.#r(a)||this.matchSync(a,u,l);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};as.GlobUtil=bl;var UT=class extends bl{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}};as.GlobWalker=UT;var WT=class extends bl{results;constructor(e,n,r){super(e,n,r),this.results=new P5.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}};as.GlobStream=WT});var GT=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Glob=void 0;var I5=is(),M5=require("node:url"),dp=KR(),L5=jT(),pp=ZR(),N5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",HT=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,M5.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||N5,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"?dp.PathScurryWin32:n.platform==="darwin"?dp.PathScurryDarwin:n.platform?dp.PathScurryPosix:dp.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 I5.Minimatch(u,i)),[o,a]=s.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=o.map((u,l)=>{let c=a[l];if(!c)throw new Error("invalid pattern object");return new L5.Pattern(u,c,0,this.platform)})}async walk(){return[...await new pp.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 pp.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 pp.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 pp.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()}};gp.Glob=HT});var zT=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.hasMagic=void 0;var q5=is(),j5=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new q5.Minimatch(n,e).hasMagic())return!0;return!1};mp.hasMagic=j5});var rP=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.glob=Ae.sync=Ae.iterate=Ae.iterateSync=Ae.stream=Ae.streamSync=Ae.Ignore=Ae.hasMagic=Ae.Glob=Ae.unescape=Ae.escape=void 0;Ae.globStreamSync=vl;Ae.globStream=KT;Ae.globSync=VT;Ae.globIterateSync=_l;Ae.globIterate=XT;var eP=is(),Ys=GT(),F5=zT(),nP=is();Object.defineProperty(Ae,"escape",{enumerable:!0,get:function(){return nP.escape}});Object.defineProperty(Ae,"unescape",{enumerable:!0,get:function(){return nP.unescape}});var $5=GT();Object.defineProperty(Ae,"Glob",{enumerable:!0,get:function(){return $5.Glob}});var B5=zT();Object.defineProperty(Ae,"hasMagic",{enumerable:!0,get:function(){return B5.hasMagic}});var U5=$T();Object.defineProperty(Ae,"Ignore",{enumerable:!0,get:function(){return U5.Ignore}});function vl(t,e={}){return new Ys.Glob(t,e).streamSync()}function KT(t,e={}){return new Ys.Glob(t,e).stream()}function VT(t,e={}){return new Ys.Glob(t,e).walkSync()}async function tP(t,e={}){return new Ys.Glob(t,e).walk()}function _l(t,e={}){return new Ys.Glob(t,e).iterateSync()}function XT(t,e={}){return new Ys.Glob(t,e).iterate()}Ae.streamSync=vl;Ae.stream=Object.assign(KT,{sync:vl});Ae.iterateSync=_l;Ae.iterate=Object.assign(XT,{sync:_l});Ae.sync=Object.assign(VT,{stream:vl,iterate:_l});Ae.glob=Object.assign(tP,{glob:tP,globSync:VT,sync:Ae.sync,globStream:KT,stream:Ae.stream,globStreamSync:vl,streamSync:Ae.streamSync,globIterate:XT,iterate:Ae.iterate,globIterateSync:_l,iterateSync:Ae.iterateSync,Glob:Ys.Glob,hasMagic:F5.hasMagic,escape:eP.escape,unescape:eP.unescape});Ae.glob.glob=Ae.glob});var sP=m(wa=>{"use strict";var JT=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.FileSystem=void 0;var W5=vm(),iP=(JC(),gP(YC)),H5=JT(require("events")),yp=md(),G5=JT(require("fs")),z5=Ld(),K5=JT(Cd()),V5=rP(),YT=class extends H5.default{constructor(e){super(),this._context=e,this._textDocumentManager=new W5.TextDocuments(iP.TextDocument),this._tempTextDocumentCache=new K5.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>yp.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,V5.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>yp.URI.file(o))}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=yp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await G5.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=iP.TextDocument.create(e,z5.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(yp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,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)})}};wa.FileSystem=YT});var oP=m(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.NodeContext=void 0;var QT=vm(),ZT=Ld(),X5=sP(),eS=class extends ZT.CoreContext{constructor(){super(),this.documentManager=new ZT.DocumentManager().setContext(this),this.documentMerger=new ZT.DocumentMerger,this.connection=(0,QT.createConnection)(QT.ProposedFeatures.all),this.fs=new X5.FileSystem(this)}createSemanticTokensBuilder(){return new QT.SemanticTokensBuilder}};bp.NodeContext=eS});Object.defineProperty(exports,"__esModule",{value:!0});var Y5=oP(),Pr=Ld(),aP=new Y5.NodeContext;aP.on("ready",t=>{(0,Pr.activateAutocomplete)(t),(0,Pr.activateColor)(t),(0,Pr.activateDefinition)(t),(0,Pr.activateDiagnostic)(t),(0,Pr.activateFormatter)(t),(0,Pr.activateHover)(t),(0,Pr.activateSignature)(t),(0,Pr.activateSubscriptions)(t),(0,Pr.activateSymbol)(t),(0,Pr.activateSemantic)(t),(0,Pr.activateFoldingRange)(t)});aP.listen();
|