sveld 0.36.2 → 0.36.4
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/lib/browser.d.ts +10 -0
- package/lib/browser.js +173 -173
- package/lib/{chunk-denfbw92.js → chunk-02g49ekt.js} +1 -1
- package/lib/{chunk-t9d5k3p7.js → chunk-0q7qnmx3.js} +1 -1
- package/lib/chunk-4ggahk6z.js +17 -0
- package/lib/chunk-6magvxxe.js +7 -0
- package/lib/chunk-86gqt5ax.js +230 -0
- package/lib/chunk-9ep3ybg5.js +1 -0
- package/lib/chunk-fk94b2eb.js +6 -0
- package/lib/chunk-jehp1k7m.js +1 -0
- package/lib/chunk-jvqe4bt1.js +3 -0
- package/lib/{chunk-gc8z6pa7.js → chunk-mab8x3d6.js} +2 -2
- package/lib/{chunk-dcbq3977.js → chunk-tjthqdyw.js} +2 -2
- package/lib/cli-entry.js +1 -1
- package/lib/index.d.ts +14 -4
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-290pdrzm.js +0 -20
- package/lib/chunk-4mbjcdex.js +0 -230
- package/lib/chunk-8myyzjb1.js +0 -4
- package/lib/chunk-f7112d82.js +0 -1
- package/lib/chunk-h1r040pg.js +0 -6
- package/lib/chunk-w5kk4gd1.js +0 -1
- package/lib/chunk-xryt7ad2.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ea as qU,fa as e,ha as p0}from"./chunk-t9d5k3p7.js";var H$=e((MY)=>{Object.defineProperty(MY,"__esModule",{value:!0});MY.boolean=oJ;MY.string=PY;MY.number=aJ;MY.error=tJ;MY.func=nJ;MY.array=DY;MY.stringArray=eJ;function oJ($){return $===!0||$===!1}function PY($){return typeof $==="string"||$ instanceof String}function aJ($){return typeof $==="number"||$ instanceof Number}function tJ($){return $ instanceof Error}function nJ($){return typeof $==="function"}function DY($){return Array.isArray($)}function eJ($){return DY($)&&$.every((Z)=>PY(Z))}});var Z6=e((j)=>{var U3=j&&j.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),W3=j&&j.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),V3=j&&j.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")U3(Y,Z,Q[G])}return W3(Y,Z),Y}}();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var n0=V3(H$()),eZ;(function($){$.ParseError=-32700,$.InvalidRequest=-32600,$.MethodNotFound=-32601,$.InvalidParams=-32602,$.InternalError=-32603,$.jsonrpcReservedErrorRangeStart=-32099,$.serverErrorStart=-32099,$.MessageWriteError=-32099,$.MessageReadError=-32098,$.PendingResponseRejected=-32097,$.ConnectionInactive=-32096,$.ServerNotInitialized=-32002,$.UnknownErrorCode=-32001,$.jsonrpcReservedErrorRangeEnd=-32000,$.serverErrorEnd=-32000})(eZ||(j.ErrorCodes=eZ={}));class $6 extends Error{code;data;constructor($,Z,Y){super(Z);this.code=n0.number($)?$:eZ.UnknownErrorCode,this.data=Y,Object.setPrototypeOf(this,$6.prototype)}toJson(){let $={code:this.code,message:this.message};if(this.data!==void 0)$.data=this.data;return $}}j.ResponseError=$6;class V0{kind;static auto=new V0("auto");static byPosition=new V0("byPosition");static byName=new V0("byName");constructor($){this.kind=$}static is($){return $===V0.auto||$===V0.byName||$===V0.byPosition}toString(){return this.kind}}j.ParameterStructures=V0;class p{method;numberOfParams;constructor($,Z){this.method=$,this.numberOfParams=Z}get parameterStructures(){return V0.auto}}j.AbstractMessageSignature=p;class EY extends p{_;constructor($){super($,0)}}j.RequestType0=EY;class OY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType=OY;class _Y extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType1=_Y;class TY extends p{_;constructor($){super($,2)}}j.RequestType2=TY;class vY extends p{_;constructor($){super($,3)}}j.RequestType3=vY;class fY extends p{_;constructor($){super($,4)}}j.RequestType4=fY;class kY extends p{_;constructor($){super($,5)}}j.RequestType5=kY;class CY extends p{_;constructor($){super($,6)}}j.RequestType6=CY;class FY extends p{_;constructor($){super($,7)}}j.RequestType7=FY;class hY extends p{_;constructor($){super($,8)}}j.RequestType8=hY;class NY extends p{_;constructor($){super($,9)}}j.RequestType9=NY;class uY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType=uY;class KY extends p{_;constructor($){super($,0)}}j.NotificationType0=KY;class bY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType1=bY;class SY extends p{_;constructor($){super($,2)}}j.NotificationType2=SY;class xY extends p{_;constructor($){super($,3)}}j.NotificationType3=xY;class gY extends p{_;constructor($){super($,4)}}j.NotificationType4=gY;class pY extends p{_;constructor($){super($,5)}}j.NotificationType5=pY;class yY extends p{_;constructor($){super($,6)}}j.NotificationType6=yY;class mY extends p{_;constructor($){super($,7)}}j.NotificationType7=mY;class cY extends p{_;constructor($){super($,8)}}j.NotificationType8=cY;class lY extends p{_;constructor($){super($,9)}}j.NotificationType9=lY;var jY;(function($){function Z(G){let J=G;return J&&n0.string(J.method)&&(n0.string(J.id)||n0.number(J.id))}$.isRequest=Z;function Y(G){let J=G;return J&&n0.string(J.method)&&G.id===void 0}$.isNotification=Y;function Q(G){let J=G;return J&&(J.result!==void 0||!!J.error)&&(n0.string(J.id)||n0.number(J.id)||J.id===null)}$.isResponse=Q})(jY||(j.Message=jY={}))});var X6=e((sY)=>{Object.defineProperty(sY,"__esModule",{value:!0});sY.LRUCache=sY.LinkedMap=sY.Touch=void 0;var $0;(function($){$.None=0,$.First=1,$.AsOld=$.First,$.Last=2,$.AsNew=$.Last})($0||(sY.Touch=$0={}));class Y6{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){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}before($){let Z=this._map.get($);return Z?Z.previous?.value:void 0}after($){let Z=this._map.get($);return Z?Z.next?.value:void 0}has($){return this._map.has($)}get($,Z=$0.None){let Y=this._map.get($);if(!Y)return;if(Z!==$0.None)this.touch(Y,Z);return Y.value}set($,Z,Y=$0.None){let Q=this._map.get($);if(Q){if(Q.value=Z,Y!==$0.None)this.touch(Q,Y)}else{switch(Q={key:$,value:Z,next:void 0,previous:void 0},Y){case $0.None:this.addItemLast(Q);break;case $0.First:this.addItemFirst(Q);break;case $0.Last:this.addItemLast(Q);break;default:this.addItemLast(Q);break}this._map.set($,Q),this._size++}return this}delete($){return!!this.remove($)}remove($){let Z=this._map.get($);if(!Z)return;return this._map.delete($),this.removeItem(Z),this._size--,Z.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let $=this._head;return this._map.delete($.key),this.removeItem($),this._size--,$.value}forEach($,Z){let Y=this._state,Q=this._head;while(Q){if(Z)$.bind(Z)(Q.value,Q.key,this);else $(Q.value,Q.key,this);if(this._state!==Y)throw Error("LinkedMap got modified during iteration.");Q=Q.next}}keys(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.key,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}values(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.value,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}entries(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:[Z.key,Z.value],done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}[Symbol.iterator](){return this.entries()}trimOld($){if($>=this.size)return;if($===0){this.clear();return}let Z=this._head,Y=this.size;while(Z&&Y>$)this._map.delete(Z.key),Z=Z.next,Y--;if(this._head=Z,this._size=Y,Z)Z.previous=void 0;this._state++}addItemFirst($){if(!this._head&&!this._tail)this._tail=$;else if(!this._head)throw Error("Invalid list");else $.next=this._head,this._head.previous=$;this._head=$,this._state++}addItemLast($){if(!this._head&&!this._tail)this._head=$;else if(!this._tail)throw Error("Invalid list");else $.previous=this._tail,this._tail.next=$;this._tail=$,this._state++}removeItem($){if($===this._head&&$===this._tail)this._head=void 0,this._tail=void 0;else if($===this._head){if(!$.next)throw Error("Invalid list");$.next.previous=void 0,this._head=$.next}else if($===this._tail){if(!$.previous)throw Error("Invalid list");$.previous.next=void 0,this._tail=$.previous}else{let{next:Z,previous:Y}=$;if(!Z||!Y)throw Error("Invalid list");Z.previous=Y,Y.next=Z}$.next=void 0,$.previous=void 0,this._state++}touch($,Z){if(!this._head||!this._tail)throw Error("Invalid list");if(Z!==$0.First&&Z!==$0.Last)return;if(Z===$0.First){if($===this._head)return;let{next:Y,previous:Q}=$;if($===this._tail)Q.next=void 0,this._tail=Q;else Y.previous=Q,Q.next=Y;$.previous=void 0,$.next=this._head,this._head.previous=$,this._head=$,this._state++}else if(Z===$0.Last){if($===this._tail)return;let{next:Y,previous:Q}=$;if($===this._head)Y.previous=void 0,this._head=Y;else Y.previous=Q,Q.next=Y;$.next=void 0,$.previous=this._tail,this._tail.next=$,this._tail=$,this._state++}}toJSON(){let $=[];return this.forEach((Z,Y)=>{$.push([Y,Z])}),$}fromJSON($){this.clear();for(let[Z,Y]of $)this.set(Z,Y)}}sY.LinkedMap=Y6;class rY extends Y6{_limit;_ratio;constructor($,Z=1){super();this._limit=$,this._ratio=Math.min(Math.max(0,Z),1)}get limit(){return this._limit}set limit($){this._limit=$,this.checkTrim()}get ratio(){return this._ratio}set ratio($){this._ratio=Math.min(Math.max(0,$),1),this.checkTrim()}get($,Z=$0.AsNew){return super.get($,Z)}peek($){return super.get($,$0.None)}set($,Z){return super.set($,Z,$0.Last),this.checkTrim(),this}checkTrim(){if(this.size>this._limit)this.trimOld(Math.round(this._limit*this._ratio))}}sY.LRUCache=rY});var tY=e((oY)=>{Object.defineProperty(oY,"__esModule",{value:!0});oY.Disposable=void 0;var dY;(function($){function Z(Y){return{dispose:Y}}$.create=Z})(dY||(oY.Disposable=dY={}))});var x0=e((nY)=>{Object.defineProperty(nY,"__esModule",{value:!0});var Q6;function G6(){if(Q6===void 0)throw Error("No runtime abstraction layer installed");return Q6}(function($){function Z(Y){if(Y===void 0)throw Error("No runtime abstraction layer provided");Q6=Y}$.install=Z})(G6||(G6={}));nY.default=G6});var z$=e((g0)=>{var q3=g0&&g0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(g0,"__esModule",{value:!0});g0.Emitter=g0.Event=void 0;var B3=q3(x0()),eY;(function($){let Z={dispose(){}};$.None=function(){return Z}})(eY||(g0.Event=eY={}));class $X{_callbacks;_contexts;add($,Z=null,Y){if(!this._callbacks)this._callbacks=[],this._contexts=[];if(this._callbacks.push($),this._contexts.push(Z),Array.isArray(Y))Y.push({dispose:()=>this.remove($,Z)})}remove($,Z=null){if(!this._callbacks)return;let Y=!1;for(let Q=0,G=this._callbacks.length;Q<G;Q++)if(this._callbacks[Q]===$)if(this._contexts[Q]===Z){this._callbacks.splice(Q,1),this._contexts.splice(Q,1);return}else Y=!0;if(Y)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...$){if(!this._callbacks)return[];let Z=[],Y=this._callbacks.slice(0),Q=this._contexts.slice(0);for(let G=0,J=Y.length;G<J;G++)try{Z.push(Y[G].apply(Q[G],$))}catch(V){(0,B3.default)().console.error(V)}return Z}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class J6{_options;static _noop=function(){};_event;_callbacks;constructor($){this._options=$}get event(){if(!this._event)this._event=($,Z,Y)=>{if(!this._callbacks)this._callbacks=new $X;if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty())this._options.onFirstListenerAdd(this);this._callbacks.add($,Z);let Q={dispose:()=>{if(!this._callbacks)return;if(this._callbacks.remove($,Z),Q.dispose=J6._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty())this._options.onLastListenerRemove(this)}};if(Array.isArray(Y))Y.push(Q);return Q};return this._event}fire($){if(this._callbacks)this._callbacks.invoke.call(this._callbacks,$)}dispose(){if(this._callbacks)this._callbacks.dispose(),this._callbacks=void 0}}g0.Emitter=J6});var HZ=e((J0)=>{var L3=J0&&J0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),A3=J0&&J0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),R3=J0&&J0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")L3(Y,Z,Q[G])}return A3(Y,Z),Y}}(),I3=J0&&J0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(J0,"__esModule",{value:!0});J0.CancellationTokenSource=J0.CancellationToken=void 0;var P3=I3(x0()),D3=R3(H$()),U6=z$(),VZ;(function($){$.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U6.Event.None}),$.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U6.Event.None});function Z(Y){let Q=Y;return Q&&(Q===$.None||Q===$.Cancelled||D3.boolean(Q.isCancellationRequested)&&!!Q.onCancellationRequested)}$.is=Z})(VZ||(J0.CancellationToken=VZ={}));var M3=Object.freeze(function($,Z){let Y=(0,P3.default)().timer.setTimeout($.bind(Z),0);return{dispose(){Y.dispose()}}});class W6{_isCancelled=!1;_emitter;cancel(){if(!this._isCancelled){if(this._isCancelled=!0,this._emitter)this._emitter.fire(void 0),this.dispose()}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled)return M3;if(!this._emitter)this._emitter=new U6.Emitter;return this._emitter.event}dispose(){if(this._emitter)this._emitter.dispose(),this._emitter=void 0}}class ZX{_token;get token(){if(!this._token)this._token=new W6;return this._token}cancel(){if(!this._token)this._token=VZ.Cancelled;else this._token.cancel()}dispose(){if(!this._token)this._token=VZ.None;else if(this._token instanceof W6)this._token.dispose()}}J0.CancellationTokenSource=ZX});var WX=e((JX)=>{Object.defineProperty(JX,"__esModule",{value:!0});JX.SharedArrayReceiverStrategy=JX.SharedArraySenderStrategy=void 0;var j3=HZ(),h$;(function($){$.Continue=0,$.Cancelled=1})(h$||(h$={}));class YX{buffers;constructor(){this.buffers=new Map}enableCancellation($){if($.id===null)return;let Z=new SharedArrayBuffer(4),Y=new Int32Array(Z,0,1);Y[0]=h$.Continue,this.buffers.set($.id,Z),$.$cancellationData=Z}async sendCancellation($,Z){let Y=this.buffers.get(Z);if(Y===void 0)return;let Q=new Int32Array(Y,0,1);Atomics.store(Q,0,h$.Cancelled)}cleanup($){this.buffers.delete($)}dispose(){this.buffers.clear()}}JX.SharedArraySenderStrategy=YX;class XX{data;constructor($){this.data=new Int32Array($,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h$.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class QX{token;constructor($){this.token=new XX($)}cancel(){}dispose(){}}class GX{kind="request";createCancellationTokenSource($){let Z=$.$cancellationData;if(Z===void 0)return new j3.CancellationTokenSource;return new QX(Z)}}JX.SharedArrayReceiverStrategy=GX});var V6=e((w$)=>{var O3=w$&&w$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(w$,"__esModule",{value:!0});w$.Semaphore=void 0;var _3=O3(x0());class VX{_capacity;_active;_waiting;constructor($=1){if($<=0)throw Error("Capacity must be greater than 0");this._capacity=$,this._active=0,this._waiting=[]}lock($){return new Promise((Z,Y)=>{this._waiting.push({thunk:$,resolve:Z,reject:Y}),this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity)return;(0,_3.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let $=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("Too many thunks active");try{let Z=$.thunk();if(Z instanceof Promise)Z.then((Y)=>{this._active--,$.resolve(Y),this.runNext()},(Y)=>{this._active--,$.reject(Y),this.runNext()});else this._active--,$.resolve(Z),this.runNext()}catch(Z){this._active--,$.reject(Z),this.runNext()}}}w$.Semaphore=VX});var wX=e((Z0)=>{var T3=Z0&&Z0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),v3=Z0&&Z0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),f3=Z0&&Z0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")T3(Y,Z,Q[G])}return v3(Y,Z),Y}}(),k3=Z0&&Z0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ReadableStreamMessageReader=Z0.AbstractMessageReader=Z0.MessageReader=void 0;var z6=k3(x0()),q$=f3(H$()),H6=z$(),C3=V6(),HX;(function($){function Z(Y){let Q=Y;return Q&&q$.func(Q.listen)&&q$.func(Q.dispose)&&q$.func(Q.onError)&&q$.func(Q.onClose)&&q$.func(Q.onPartialMessage)}$.is=Z})(HX||(Z0.MessageReader=HX={}));class q6{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new H6.Emitter,this.closeEmitter=new H6.Emitter,this.partialMessageEmitter=new H6.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($){this.errorEmitter.fire(this.asError($))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage($){this.partialMessageEmitter.fire($)}asError($){if($ instanceof Error)return $;else return Error(`Reader received error. Reason: ${q$.string($.message)?$.message:"unknown"}`)}}Z0.AbstractMessageReader=q6;var w6;(function($){function Z(Y){let Q,G,J,V=new Map,L,P=new Map;if(Y===void 0||typeof Y==="string")Q=Y??"utf-8";else{if(Q=Y.charset??"utf-8",Y.contentDecoder!==void 0)J=Y.contentDecoder,V.set(J.name,J);if(Y.contentDecoders!==void 0)for(let _ of Y.contentDecoders)V.set(_.name,_);if(Y.contentTypeDecoder!==void 0)L=Y.contentTypeDecoder,P.set(L.name,L);if(Y.contentTypeDecoders!==void 0)for(let _ of Y.contentTypeDecoders)P.set(_.name,_)}if(L===void 0)L=(0,z6.default)().applicationJson.decoder,P.set(L.name,L);return{charset:Q,contentDecoder:J,contentDecoders:V,contentTypeDecoder:L,contentTypeDecoders:P}}$.fromOptions=Z})(w6||(w6={}));class zX extends q6{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor($,Z){super();this.readable=$,this.options=w6.fromOptions(Z),this.buffer=(0,z6.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new C3.Semaphore(1)}set partialMessageTimeout($){this._partialMessageTimeout=$}get partialMessageTimeout(){return this._partialMessageTimeout}listen($){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=$;let Z=this.readable.onData((Y)=>{this.onData(Y)});return this.readable.onError((Y)=>this.fireError(Y)),this.readable.onClose(()=>this.fireClose()),Z}onData($){try{this.buffer.append($);while(!0){if(this.nextMessageLength===-1){let Y=this.buffer.tryReadHeaders(!0);if(!Y)return;let Q=Y.get("content-length");if(!Q){this.fireError(Error(`Header must provide a Content-Length property.
|
|
1
|
+
import{ta as qU,ua as e,wa as p0}from"./chunk-0q7qnmx3.js";var H$=e((MY)=>{Object.defineProperty(MY,"__esModule",{value:!0});MY.boolean=oJ;MY.string=PY;MY.number=aJ;MY.error=tJ;MY.func=nJ;MY.array=DY;MY.stringArray=eJ;function oJ($){return $===!0||$===!1}function PY($){return typeof $==="string"||$ instanceof String}function aJ($){return typeof $==="number"||$ instanceof Number}function tJ($){return $ instanceof Error}function nJ($){return typeof $==="function"}function DY($){return Array.isArray($)}function eJ($){return DY($)&&$.every((Z)=>PY(Z))}});var Z6=e((j)=>{var U3=j&&j.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),W3=j&&j.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),V3=j&&j.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")U3(Y,Z,Q[G])}return W3(Y,Z),Y}}();Object.defineProperty(j,"__esModule",{value:!0});j.Message=j.NotificationType9=j.NotificationType8=j.NotificationType7=j.NotificationType6=j.NotificationType5=j.NotificationType4=j.NotificationType3=j.NotificationType2=j.NotificationType1=j.NotificationType0=j.NotificationType=j.RequestType9=j.RequestType8=j.RequestType7=j.RequestType6=j.RequestType5=j.RequestType4=j.RequestType3=j.RequestType2=j.RequestType1=j.RequestType=j.RequestType0=j.AbstractMessageSignature=j.ParameterStructures=j.ResponseError=j.ErrorCodes=void 0;var n0=V3(H$()),eZ;(function($){$.ParseError=-32700,$.InvalidRequest=-32600,$.MethodNotFound=-32601,$.InvalidParams=-32602,$.InternalError=-32603,$.jsonrpcReservedErrorRangeStart=-32099,$.serverErrorStart=-32099,$.MessageWriteError=-32099,$.MessageReadError=-32098,$.PendingResponseRejected=-32097,$.ConnectionInactive=-32096,$.ServerNotInitialized=-32002,$.UnknownErrorCode=-32001,$.jsonrpcReservedErrorRangeEnd=-32000,$.serverErrorEnd=-32000})(eZ||(j.ErrorCodes=eZ={}));class $6 extends Error{code;data;constructor($,Z,Y){super(Z);this.code=n0.number($)?$:eZ.UnknownErrorCode,this.data=Y,Object.setPrototypeOf(this,$6.prototype)}toJson(){let $={code:this.code,message:this.message};if(this.data!==void 0)$.data=this.data;return $}}j.ResponseError=$6;class V0{kind;static auto=new V0("auto");static byPosition=new V0("byPosition");static byName=new V0("byName");constructor($){this.kind=$}static is($){return $===V0.auto||$===V0.byName||$===V0.byPosition}toString(){return this.kind}}j.ParameterStructures=V0;class p{method;numberOfParams;constructor($,Z){this.method=$,this.numberOfParams=Z}get parameterStructures(){return V0.auto}}j.AbstractMessageSignature=p;class EY extends p{_;constructor($){super($,0)}}j.RequestType0=EY;class OY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType=OY;class _Y extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.RequestType1=_Y;class TY extends p{_;constructor($){super($,2)}}j.RequestType2=TY;class vY extends p{_;constructor($){super($,3)}}j.RequestType3=vY;class fY extends p{_;constructor($){super($,4)}}j.RequestType4=fY;class kY extends p{_;constructor($){super($,5)}}j.RequestType5=kY;class CY extends p{_;constructor($){super($,6)}}j.RequestType6=CY;class FY extends p{_;constructor($){super($,7)}}j.RequestType7=FY;class hY extends p{_;constructor($){super($,8)}}j.RequestType8=hY;class NY extends p{_;constructor($){super($,9)}}j.RequestType9=NY;class uY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType=uY;class KY extends p{_;constructor($){super($,0)}}j.NotificationType0=KY;class bY extends p{_parameterStructures;_;constructor($,Z=V0.auto){super($,1);this._parameterStructures=Z}get parameterStructures(){return this._parameterStructures}}j.NotificationType1=bY;class SY extends p{_;constructor($){super($,2)}}j.NotificationType2=SY;class xY extends p{_;constructor($){super($,3)}}j.NotificationType3=xY;class gY extends p{_;constructor($){super($,4)}}j.NotificationType4=gY;class pY extends p{_;constructor($){super($,5)}}j.NotificationType5=pY;class yY extends p{_;constructor($){super($,6)}}j.NotificationType6=yY;class mY extends p{_;constructor($){super($,7)}}j.NotificationType7=mY;class cY extends p{_;constructor($){super($,8)}}j.NotificationType8=cY;class lY extends p{_;constructor($){super($,9)}}j.NotificationType9=lY;var jY;(function($){function Z(G){let J=G;return J&&n0.string(J.method)&&(n0.string(J.id)||n0.number(J.id))}$.isRequest=Z;function Y(G){let J=G;return J&&n0.string(J.method)&&G.id===void 0}$.isNotification=Y;function Q(G){let J=G;return J&&(J.result!==void 0||!!J.error)&&(n0.string(J.id)||n0.number(J.id)||J.id===null)}$.isResponse=Q})(jY||(j.Message=jY={}))});var X6=e((sY)=>{Object.defineProperty(sY,"__esModule",{value:!0});sY.LRUCache=sY.LinkedMap=sY.Touch=void 0;var $0;(function($){$.None=0,$.First=1,$.AsOld=$.First,$.Last=2,$.AsNew=$.Last})($0||(sY.Touch=$0={}));class Y6{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){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}before($){let Z=this._map.get($);return Z?Z.previous?.value:void 0}after($){let Z=this._map.get($);return Z?Z.next?.value:void 0}has($){return this._map.has($)}get($,Z=$0.None){let Y=this._map.get($);if(!Y)return;if(Z!==$0.None)this.touch(Y,Z);return Y.value}set($,Z,Y=$0.None){let Q=this._map.get($);if(Q){if(Q.value=Z,Y!==$0.None)this.touch(Q,Y)}else{switch(Q={key:$,value:Z,next:void 0,previous:void 0},Y){case $0.None:this.addItemLast(Q);break;case $0.First:this.addItemFirst(Q);break;case $0.Last:this.addItemLast(Q);break;default:this.addItemLast(Q);break}this._map.set($,Q),this._size++}return this}delete($){return!!this.remove($)}remove($){let Z=this._map.get($);if(!Z)return;return this._map.delete($),this.removeItem(Z),this._size--,Z.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let $=this._head;return this._map.delete($.key),this.removeItem($),this._size--,$.value}forEach($,Z){let Y=this._state,Q=this._head;while(Q){if(Z)$.bind(Z)(Q.value,Q.key,this);else $(Q.value,Q.key,this);if(this._state!==Y)throw Error("LinkedMap got modified during iteration.");Q=Q.next}}keys(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.key,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}values(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:Z.value,done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}entries(){let $=this._state,Z=this._head,Y={[Symbol.iterator]:()=>{return Y},next:()=>{if(this._state!==$)throw Error("LinkedMap got modified during iteration.");if(Z){let Q={value:[Z.key,Z.value],done:!1};return Z=Z.next,Q}else return{value:void 0,done:!0}}};return Y}[Symbol.iterator](){return this.entries()}trimOld($){if($>=this.size)return;if($===0){this.clear();return}let Z=this._head,Y=this.size;while(Z&&Y>$)this._map.delete(Z.key),Z=Z.next,Y--;if(this._head=Z,this._size=Y,Z)Z.previous=void 0;this._state++}addItemFirst($){if(!this._head&&!this._tail)this._tail=$;else if(!this._head)throw Error("Invalid list");else $.next=this._head,this._head.previous=$;this._head=$,this._state++}addItemLast($){if(!this._head&&!this._tail)this._head=$;else if(!this._tail)throw Error("Invalid list");else $.previous=this._tail,this._tail.next=$;this._tail=$,this._state++}removeItem($){if($===this._head&&$===this._tail)this._head=void 0,this._tail=void 0;else if($===this._head){if(!$.next)throw Error("Invalid list");$.next.previous=void 0,this._head=$.next}else if($===this._tail){if(!$.previous)throw Error("Invalid list");$.previous.next=void 0,this._tail=$.previous}else{let{next:Z,previous:Y}=$;if(!Z||!Y)throw Error("Invalid list");Z.previous=Y,Y.next=Z}$.next=void 0,$.previous=void 0,this._state++}touch($,Z){if(!this._head||!this._tail)throw Error("Invalid list");if(Z!==$0.First&&Z!==$0.Last)return;if(Z===$0.First){if($===this._head)return;let{next:Y,previous:Q}=$;if($===this._tail)Q.next=void 0,this._tail=Q;else Y.previous=Q,Q.next=Y;$.previous=void 0,$.next=this._head,this._head.previous=$,this._head=$,this._state++}else if(Z===$0.Last){if($===this._tail)return;let{next:Y,previous:Q}=$;if($===this._head)Y.previous=void 0,this._head=Y;else Y.previous=Q,Q.next=Y;$.next=void 0,$.previous=this._tail,this._tail.next=$,this._tail=$,this._state++}}toJSON(){let $=[];return this.forEach((Z,Y)=>{$.push([Y,Z])}),$}fromJSON($){this.clear();for(let[Z,Y]of $)this.set(Z,Y)}}sY.LinkedMap=Y6;class rY extends Y6{_limit;_ratio;constructor($,Z=1){super();this._limit=$,this._ratio=Math.min(Math.max(0,Z),1)}get limit(){return this._limit}set limit($){this._limit=$,this.checkTrim()}get ratio(){return this._ratio}set ratio($){this._ratio=Math.min(Math.max(0,$),1),this.checkTrim()}get($,Z=$0.AsNew){return super.get($,Z)}peek($){return super.get($,$0.None)}set($,Z){return super.set($,Z,$0.Last),this.checkTrim(),this}checkTrim(){if(this.size>this._limit)this.trimOld(Math.round(this._limit*this._ratio))}}sY.LRUCache=rY});var tY=e((oY)=>{Object.defineProperty(oY,"__esModule",{value:!0});oY.Disposable=void 0;var dY;(function($){function Z(Y){return{dispose:Y}}$.create=Z})(dY||(oY.Disposable=dY={}))});var x0=e((nY)=>{Object.defineProperty(nY,"__esModule",{value:!0});var Q6;function G6(){if(Q6===void 0)throw Error("No runtime abstraction layer installed");return Q6}(function($){function Z(Y){if(Y===void 0)throw Error("No runtime abstraction layer provided");Q6=Y}$.install=Z})(G6||(G6={}));nY.default=G6});var z$=e((g0)=>{var q3=g0&&g0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(g0,"__esModule",{value:!0});g0.Emitter=g0.Event=void 0;var B3=q3(x0()),eY;(function($){let Z={dispose(){}};$.None=function(){return Z}})(eY||(g0.Event=eY={}));class $X{_callbacks;_contexts;add($,Z=null,Y){if(!this._callbacks)this._callbacks=[],this._contexts=[];if(this._callbacks.push($),this._contexts.push(Z),Array.isArray(Y))Y.push({dispose:()=>this.remove($,Z)})}remove($,Z=null){if(!this._callbacks)return;let Y=!1;for(let Q=0,G=this._callbacks.length;Q<G;Q++)if(this._callbacks[Q]===$)if(this._contexts[Q]===Z){this._callbacks.splice(Q,1),this._contexts.splice(Q,1);return}else Y=!0;if(Y)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...$){if(!this._callbacks)return[];let Z=[],Y=this._callbacks.slice(0),Q=this._contexts.slice(0);for(let G=0,J=Y.length;G<J;G++)try{Z.push(Y[G].apply(Q[G],$))}catch(V){(0,B3.default)().console.error(V)}return Z}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class J6{_options;static _noop=function(){};_event;_callbacks;constructor($){this._options=$}get event(){if(!this._event)this._event=($,Z,Y)=>{if(!this._callbacks)this._callbacks=new $X;if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty())this._options.onFirstListenerAdd(this);this._callbacks.add($,Z);let Q={dispose:()=>{if(!this._callbacks)return;if(this._callbacks.remove($,Z),Q.dispose=J6._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty())this._options.onLastListenerRemove(this)}};if(Array.isArray(Y))Y.push(Q);return Q};return this._event}fire($){if(this._callbacks)this._callbacks.invoke.call(this._callbacks,$)}dispose(){if(this._callbacks)this._callbacks.dispose(),this._callbacks=void 0}}g0.Emitter=J6});var HZ=e((J0)=>{var L3=J0&&J0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),A3=J0&&J0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),R3=J0&&J0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")L3(Y,Z,Q[G])}return A3(Y,Z),Y}}(),I3=J0&&J0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(J0,"__esModule",{value:!0});J0.CancellationTokenSource=J0.CancellationToken=void 0;var P3=I3(x0()),D3=R3(H$()),U6=z$(),VZ;(function($){$.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U6.Event.None}),$.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U6.Event.None});function Z(Y){let Q=Y;return Q&&(Q===$.None||Q===$.Cancelled||D3.boolean(Q.isCancellationRequested)&&!!Q.onCancellationRequested)}$.is=Z})(VZ||(J0.CancellationToken=VZ={}));var M3=Object.freeze(function($,Z){let Y=(0,P3.default)().timer.setTimeout($.bind(Z),0);return{dispose(){Y.dispose()}}});class W6{_isCancelled=!1;_emitter;cancel(){if(!this._isCancelled){if(this._isCancelled=!0,this._emitter)this._emitter.fire(void 0),this.dispose()}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled)return M3;if(!this._emitter)this._emitter=new U6.Emitter;return this._emitter.event}dispose(){if(this._emitter)this._emitter.dispose(),this._emitter=void 0}}class ZX{_token;get token(){if(!this._token)this._token=new W6;return this._token}cancel(){if(!this._token)this._token=VZ.Cancelled;else this._token.cancel()}dispose(){if(!this._token)this._token=VZ.None;else if(this._token instanceof W6)this._token.dispose()}}J0.CancellationTokenSource=ZX});var WX=e((JX)=>{Object.defineProperty(JX,"__esModule",{value:!0});JX.SharedArrayReceiverStrategy=JX.SharedArraySenderStrategy=void 0;var j3=HZ(),h$;(function($){$.Continue=0,$.Cancelled=1})(h$||(h$={}));class YX{buffers;constructor(){this.buffers=new Map}enableCancellation($){if($.id===null)return;let Z=new SharedArrayBuffer(4),Y=new Int32Array(Z,0,1);Y[0]=h$.Continue,this.buffers.set($.id,Z),$.$cancellationData=Z}async sendCancellation($,Z){let Y=this.buffers.get(Z);if(Y===void 0)return;let Q=new Int32Array(Y,0,1);Atomics.store(Q,0,h$.Cancelled)}cleanup($){this.buffers.delete($)}dispose(){this.buffers.clear()}}JX.SharedArraySenderStrategy=YX;class XX{data;constructor($){this.data=new Int32Array($,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h$.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class QX{token;constructor($){this.token=new XX($)}cancel(){}dispose(){}}class GX{kind="request";createCancellationTokenSource($){let Z=$.$cancellationData;if(Z===void 0)return new j3.CancellationTokenSource;return new QX(Z)}}JX.SharedArrayReceiverStrategy=GX});var V6=e((w$)=>{var O3=w$&&w$.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(w$,"__esModule",{value:!0});w$.Semaphore=void 0;var _3=O3(x0());class VX{_capacity;_active;_waiting;constructor($=1){if($<=0)throw Error("Capacity must be greater than 0");this._capacity=$,this._active=0,this._waiting=[]}lock($){return new Promise((Z,Y)=>{this._waiting.push({thunk:$,resolve:Z,reject:Y}),this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity)return;(0,_3.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let $=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("Too many thunks active");try{let Z=$.thunk();if(Z instanceof Promise)Z.then((Y)=>{this._active--,$.resolve(Y),this.runNext()},(Y)=>{this._active--,$.reject(Y),this.runNext()});else this._active--,$.resolve(Z),this.runNext()}catch(Z){this._active--,$.reject(Z),this.runNext()}}}w$.Semaphore=VX});var wX=e((Z0)=>{var T3=Z0&&Z0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),v3=Z0&&Z0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),f3=Z0&&Z0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")T3(Y,Z,Q[G])}return v3(Y,Z),Y}}(),k3=Z0&&Z0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ReadableStreamMessageReader=Z0.AbstractMessageReader=Z0.MessageReader=void 0;var z6=k3(x0()),q$=f3(H$()),H6=z$(),C3=V6(),HX;(function($){function Z(Y){let Q=Y;return Q&&q$.func(Q.listen)&&q$.func(Q.dispose)&&q$.func(Q.onError)&&q$.func(Q.onClose)&&q$.func(Q.onPartialMessage)}$.is=Z})(HX||(Z0.MessageReader=HX={}));class q6{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new H6.Emitter,this.closeEmitter=new H6.Emitter,this.partialMessageEmitter=new H6.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($){this.errorEmitter.fire(this.asError($))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage($){this.partialMessageEmitter.fire($)}asError($){if($ instanceof Error)return $;else return Error(`Reader received error. Reason: ${q$.string($.message)?$.message:"unknown"}`)}}Z0.AbstractMessageReader=q6;var w6;(function($){function Z(Y){let Q,G,J,V=new Map,L,P=new Map;if(Y===void 0||typeof Y==="string")Q=Y??"utf-8";else{if(Q=Y.charset??"utf-8",Y.contentDecoder!==void 0)J=Y.contentDecoder,V.set(J.name,J);if(Y.contentDecoders!==void 0)for(let _ of Y.contentDecoders)V.set(_.name,_);if(Y.contentTypeDecoder!==void 0)L=Y.contentTypeDecoder,P.set(L.name,L);if(Y.contentTypeDecoders!==void 0)for(let _ of Y.contentTypeDecoders)P.set(_.name,_)}if(L===void 0)L=(0,z6.default)().applicationJson.decoder,P.set(L.name,L);return{charset:Q,contentDecoder:J,contentDecoders:V,contentTypeDecoder:L,contentTypeDecoders:P}}$.fromOptions=Z})(w6||(w6={}));class zX extends q6{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor($,Z){super();this.readable=$,this.options=w6.fromOptions(Z),this.buffer=(0,z6.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new C3.Semaphore(1)}set partialMessageTimeout($){this._partialMessageTimeout=$}get partialMessageTimeout(){return this._partialMessageTimeout}listen($){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=$;let Z=this.readable.onData((Y)=>{this.onData(Y)});return this.readable.onError((Y)=>this.fireError(Y)),this.readable.onClose(()=>this.fireClose()),Z}onData($){try{this.buffer.append($);while(!0){if(this.nextMessageLength===-1){let Y=this.buffer.tryReadHeaders(!0);if(!Y)return;let Q=Y.get("content-length");if(!Q){this.fireError(Error(`Header must provide a Content-Length property.
|
|
2
2
|
${JSON.stringify(Object.fromEntries(Y))}`));return}let G=parseInt(Q);if(isNaN(G)){this.fireError(Error(`Content-Length value must be a number. Got ${Q}`));return}this.nextMessageLength=G}let Z=this.buffer.tryReadBody(this.nextMessageLength);if(Z===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let Y=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(Z):Z,Q=await this.options.contentTypeDecoder.decode(Y,this.options);this.callback(Q)}).catch((Y)=>{this.fireError(Y)})}}catch(Z){this.fireError(Z)}}clearPartialMessageTimer(){if(this.partialMessageTimer)this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0}setPartialMessageTimer(){if(this.clearPartialMessageTimer(),this._partialMessageTimeout<=0)return;this.partialMessageTimer=(0,z6.default)().timer.setTimeout(($,Z)=>{if(this.partialMessageTimer=void 0,$===this.messageToken)this.firePartialMessage({messageToken:$,waitingTime:Z}),this.setPartialMessageTimer()},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout)}}Z0.ReadableStreamMessageReader=zX});var IX=e((Y0)=>{var F3=Y0&&Y0.__createBinding||(Object.create?function($,Z,Y,Q){if(Q===void 0)Q=Y;var G=Object.getOwnPropertyDescriptor(Z,Y);if(!G||("get"in G?!Z.__esModule:G.writable||G.configurable))G={enumerable:!0,get:function(){return Z[Y]}};Object.defineProperty($,Q,G)}:function($,Z,Y,Q){if(Q===void 0)Q=Y;$[Q]=Z[Y]}),h3=Y0&&Y0.__setModuleDefault||(Object.create?function($,Z){Object.defineProperty($,"default",{enumerable:!0,value:Z})}:function($,Z){$.default=Z}),N3=Y0&&Y0.__importStar||function(){var $=function(Z){return $=Object.getOwnPropertyNames||function(Y){var Q=[];for(var G in Y)if(Object.prototype.hasOwnProperty.call(Y,G))Q[Q.length]=G;return Q},$(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var Y={};if(Z!=null){for(var Q=$(Z),G=0;G<Q.length;G++)if(Q[G]!=="default")F3(Y,Z,Q[G])}return h3(Y,Z),Y}}(),u3=Y0&&Y0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Y0,"__esModule",{value:!0});Y0.WriteableStreamMessageWriter=Y0.AbstractMessageWriter=Y0.MessageWriter=void 0;var qX=u3(x0()),N$=N3(H$()),K3=V6(),BX=z$(),b3="Content-Length: ",LX=`\r
|
|
3
3
|
`,AX;(function($){function Z(Y){let Q=Y;return Q&&N$.func(Q.dispose)&&N$.func(Q.onClose)&&N$.func(Q.onError)&&N$.func(Q.write)}$.is=Z})(AX||(Y0.MessageWriter=AX={}));class L6{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new BX.Emitter,this.closeEmitter=new BX.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError($,Z,Y){this.errorEmitter.fire([this.asError($),Z,Y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError($){if($ instanceof Error)return $;else return Error(`Writer received error. Reason: ${N$.string($.message)?$.message:"unknown"}`)}}Y0.AbstractMessageWriter=L6;var B6;(function($){function Z(Y){if(Y===void 0||typeof Y==="string")return{charset:Y??"utf-8",contentTypeEncoder:(0,qX.default)().applicationJson.encoder};else return{charset:Y.charset??"utf-8",contentEncoder:Y.contentEncoder,contentTypeEncoder:Y.contentTypeEncoder??(0,qX.default)().applicationJson.encoder}}$.fromOptions=Z})(B6||(B6={}));class RX extends L6{writable;options;errorCount;writeSemaphore;constructor($,Z){super();this.writable=$,this.options=B6.fromOptions(Z),this.errorCount=0,this.writeSemaphore=new K3.Semaphore(1),this.writable.onError((Y)=>this.fireError(Y)),this.writable.onClose(()=>this.fireClose())}async write($){return this.writeSemaphore.lock(async()=>{return this.options.contentTypeEncoder.encode($,this.options).then((Y)=>{if(this.options.contentEncoder!==void 0)return this.options.contentEncoder.encode(Y);else return Y}).then((Y)=>{let Q=[];return Q.push(b3,Y.byteLength.toString(),LX),Q.push(LX),this.doWrite($,Q,Y)},(Y)=>{throw this.fireError(Y),Y})})}async doWrite($,Z,Y){try{return await this.writable.write(Z.join(""),"ascii"),this.writable.write(Y)}catch(Q){return this.handleError(Q,$),Promise.reject(Q)}}handleError($,Z){this.errorCount++,this.fireError($,Z,this.errorCount)}end(){this.writable.end()}}Y0.WriteableStreamMessageWriter=RX});var jX=e((DX)=>{Object.defineProperty(DX,"__esModule",{value:!0});DX.AbstractMessageBuffer=void 0;var S3=13,x3=10,g3=`\r
|
|
4
4
|
`;class PX{_encoding;_chunks;_totalLength;constructor($="utf-8"){this._encoding=$,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append($){let Z=typeof $==="string"?this.fromString($,this._encoding):$;this._chunks.push(Z),this._totalLength+=Z.byteLength}tryReadHeaders($=!1){if(this._chunks.length===0)return;let Z=0,Y=0,Q=0,G=0;$:while(Y<this._chunks.length){let P=this._chunks[Y];Q=0;while(Q<P.length){switch(P[Q]){case S3:switch(Z){case 0:Z=1;break;case 2:Z=3;break;default:Z=0}break;case x3:switch(Z){case 1:Z=2;break;case 3:Z=4,Q++;break $;default:Z=0}break;default:Z=0}Q++}G+=P.byteLength,Y++}if(Z!==4)return;let J=this._read(G+Q),V=new Map,L=this.toString(J,"ascii").split(g3);if(L.length<2)return V;for(let P=0;P<L.length-2;P++){let _=L[P],k=_.indexOf(":");if(k===-1)throw Error(`Message header must separate key and value using ':'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as s}from"node:module";var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,t=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var u=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var v=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var x=s(import.meta.url);
|
|
2
|
-
export{t as
|
|
2
|
+
export{t as ta,u as ua,v as va,x as wa};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function C(w){return typeof w==="object"&&w!==null}function Sw(w){return C(w)&&w.type==="VariableDeclaration"&&Array.isArray(w.declarations)}function W0(w){return C(w)&&w.type==="Literal"}function h0(w){return C(w)&&w.type==="Identifier"&&typeof w.name==="string"}function fw(w){return C(w)&&w.type==="MemberExpression"}function F0(w){return C(w)&&w.type==="ObjectExpression"&&Array.isArray(w.properties)}function i0(w){return C(w)&&w.type==="CallExpression"}function Dw(w,O){if(!i0(w))return!1;return!!w.callee&&C(w.callee)&&w.callee.type==="Identifier"&&w.callee.name===O}function p0(w){if(C(w)&&(w.type==="TSAsExpression"||w.type==="TSSatisfiesExpression")&&"expression"in w)return p0(w.expression);return w}function Ew(w){if(C(w)&&(w.type==="TSAsExpression"||w.type==="TSSatisfiesExpression")&&"typeAnnotation"in w)return w.typeAnnotation;return}function o0(w){return C(w)&&w.type==="NewExpression"}function K0(w,O){if(!o0(w))return!1;return!!w.callee&&C(w.callee)&&w.callee.type==="Identifier"&&w.callee.name===O}var n0=Symbol("sveld.parsedComponentTypeScriptMetadata");function vw(w){return w[n0]}function Nw(w,O){if(O.length===0)return;let j=new Set(w.props.map((W)=>W.name));for(let W of O){if(j.has(W.name))continue;j.add(W.name),w.props.push({name:W.name,kind:"let",constant:!1,type:W.type,typeSource:"typescript",...W.description?{description:W.description}:{},isFunction:W.type.includes("=>"),isFunctionDeclaration:!1,isRequired:W.isRequired,reactive:!1})}}var r0=/\w/;function c0(w,O){let j=w.trim();if(!j.startsWith("{")||!j.endsWith("}"))return;let W=j.slice(1,-1),K=[],Z=0,$="";for(let Q of W)if(Q==="{"||Q==="<"||Q==="("||Q==="[")Z++,$+=Q;else if(Q==="}"||Q===">"||Q===")"||Q==="]")Z--,$+=Q;else if((Q===";"||Q===",")&&Z===0)K.push($.trim()),$="";else $+=Q;if($.trim())K.push($.trim());for(let Q of K){if(!Q.startsWith(O))continue;let J=Q.slice(O.length);if(J.length>0&&r0.test(J[0]))continue;let M=J.trimStart();if(M.startsWith("?"))M=M.slice(1).trimStart();if(M.startsWith(":"))return M.slice(1).trim()}return}function C0(w,O,j){let W=j;if(W.computed||W.object?.type!=="Identifier"||W.property?.type!=="Identifier")return;let K=W.object.name,Z=W.property.name;if(!K||!Z)return;if(w.wholePropsLocals.has(K))return O.getPropTypeByLocalOrPublic(Z);let $=O.getPropTypeByLocalOrPublic(K)??O.findVariableTypeAndDescription(K)?.type;if(!$)return;return c0($,Z)}var s0=/[\r\n]+/g;function a0(w){if(w.sourceLineStartOffsetsCache)return w.sourceLineStartOffsetsCache;let O=[0];if(w.source){for(let j=0;j<w.source.length;j++)if(w.source[j]===`
|
|
2
|
+
`)O.push(j+1)}return w.sourceLineStartOffsetsCache=O,O}function I0(w,O){if(!w.source||O<0||O>w.source.length)return;let j=a0(w),W=0,K=j.length-1;while(W<=K){let Z=Math.floor((W+K)/2),$=j[Z],Q=j[Z+1]??Number.POSITIVE_INFINITY;if(O<$)K=Z-1;else if(O>=Q)W=Z+1;else return{line:Z+1,column:O-$}}return}function b0(w,O,j){if(O===void 0||j===void 0||j<O)return;let W=I0(w,O),K=I0(w,j);if(!W||!K)return;return{start:W,end:K}}function L0(w,O){if(!O||typeof O!=="object")return;let j="start"in O&&typeof O.start==="number"?O.start:void 0,W="end"in O&&typeof O.end==="number"?O.end:void 0;return b0(w,j,W)}function Z0(w,O,j,W){if(!j||j.length===0||W===void 0)return;let K=[...j];while(K.length>1){let X=K[K.length-1];if(X.tokens.tag||!X.source.trim().endsWith("*/"))break;K.pop()}let Z=W;for(let X=0;X<K[0].number-1;X++)Z+=O[X]?.source.length??0,Z+=1;let $=K[0],Q=$.source.indexOf($.tokens.tag??""),J=Z+Math.max(Q,0),M=W,Y=K[K.length-1],z=Y.number;for(let X=0;X<z-1;X++)M+=O[X]?.source.length??0,M+=1;return M+=Y.source.length,b0(w,J,M)}function l(w,O,j){return w.source?.slice(O,j)}function yw(w,O){if(!O||typeof O!=="object")return;let j="start"in O&&typeof O.start==="number"?O.start:void 0,W="end"in O&&typeof O.end==="number"?O.end:void 0;if(j===void 0||W===void 0)return;return l(w,j,W)?.replace(s0," ")}function N(w){return w===void 0||w===""?void 0:w}function t0(w){return typeof w==="string"?JSON.stringify(w):String(w)}function $0(w,{name:O,detail:j,has_argument:W,description:K,deprecated:Z,tags:$,source:Q}){if(O===void 0)return;let J=!W&&!j?"null":N(j),M=K,Y=w.events.get(O);if(Y?.type==="forwarded")w.events.set(O,{type:"dispatched",name:O,detail:J,description:M||Y.description,deprecated:Z??Y.deprecated,tags:$??Y.tags,source:Q||Y.source});else if(Y){let z=Y.tags??$;w.events.set(O,{...Y,detail:Y.detail===void 0?J:Y.detail,description:Y.description||M,deprecated:Y.deprecated??Z,tags:z,source:Q||Y.source})}else w.events.set(O,{type:"dispatched",name:O,detail:J,description:M,deprecated:Z,tags:$,source:Q})}function iw(w,O){let j=O.arguments[0],W=K0(j,"CustomEvent");if(!W&&!K0(j,"Event"))return;let K=j.arguments[0],Z=W0(K)?K.value:void 0;if(Z==null)return;let $=W?j.arguments[1]:void 0,Q=!1,J;if(F0($)){let M=$.properties.find((Y)=>Y.type==="Property"&&h0(Y.key)&&Y.key.name==="detail");if(M?.type==="Property")Q=!0,J=W0(M.value)?M.value.value:void 0}return $0(w,{name:String(Z),detail:J==null?"":t0(J),has_argument:Q,source:L0(w,O)}),String(Z)}function Q0(w,O,j=!1){if(w.length===0)return"null";let W=w.map(({name:K,type:Z,description:$,optional:Q,default:J})=>{let M=Q?"?":"",Y=$||"";if(J&&Y)Y=`${Y} @default ${J}`;else if(J)Y=`@default ${J}`;if(Y){if(j)return`/** ${Y} */
|
|
3
|
+
${K}${M}: ${Z};`;return`/** ${Y} */ ${K}${M}: ${Z};`}return`${K}${M}: ${Z};`}).join(j?`
|
|
4
|
+
`:" ");return j?`{
|
|
5
|
+
${W}
|
|
6
|
+
}`:`{ ${W} }`}var e0=/[A-Za-z_$][\w$]*/g;function ww(w,O){if(!O)return!1;let j=new Set(O[0].split(",").map((W)=>W.trim()));for(let[W]of w.matchAll(e0))if(j.has(W))return!0;return!1}function Ow(w,O){if(O===void 0)return;return w.runesPropsDeclarationMetadataByDeclaratorStart.get(O)}function nw(w,O,j){return Ow(w,O)?.props.get(j)}function rw(w){if(!w||typeof w!=="object"||!("type"in w))return;if(w.type==="Identifier"&&"name"in w&&typeof w.name==="string")return w.name;if(w.type==="TSQualifiedName"&&"right"in w&&w.right&&typeof w.right==="object"&&"name"in w.right&&typeof w.right.name==="string")return w.right.name;return}function _0(w){if(!w||typeof w!=="object"||!("type"in w))return;if(w.type==="Identifier"&&"name"in w&&typeof w.name==="string")return w.name;if(w.type==="TSQualifiedName"&&"left"in w&&w.left&&typeof w.left==="object")return _0(w.left);return}function cw(w,O){let j=O?.start,W=O?.end;if(j===void 0||W===void 0)return;return l(w,j+1,W)?.trim()}function sw(w,O){let j=O?.start,W=O?.end;if(j===void 0||W===void 0)return;return l(w,j,W)?.trim()}function D(w,O,j,W,K=new Set){if(!O?.type)return;switch(O.type){case"TSInterfaceDeclaration":D(w,{type:"TSTypeLiteral",members:O.body?.body},j,W,K);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":D(w,O.typeAnnotation,j,W,K);return;case"TSIntersectionType":case"TSUnionType":for(let Z of O.types??[])D(w,Z,j,W,K);return;case"TSTypeLiteral":for(let Z of O.members??[]){if(Z?.type!=="TSPropertySignature")continue;D(w,Z.typeAnnotation?.typeAnnotation,j,W,K)}return;case"TSTypeReference":{let Z=_0(O.typeName);if(Z){if(w.typeImportBindingsByLocalName.has(Z))j.add(Z);let $=w.localTypeDeclarationsByName.get(Z);if($&&!K.has(Z))W.add(Z),K.add(Z),D(w,$.node,j,W,K),K.delete(Z)}if("typeParameters"in O&&O.typeParameters&&typeof O.typeParameters==="object"){let $=O.typeParameters;for(let Q of $.params??[])D(w,Q,j,W,K)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let Z of Object.values(O)){if(!Z||typeof Z!=="object")continue;if(Array.isArray(Z)){for(let $ of Z){if(!$||typeof $!=="object"||!("type"in $))continue;D(w,$,j,W,K)}continue}if("type"in Z)D(w,Z,j,W,K)}}function jw(w,O){let j=new Map;for(let W of Array.from(O).sort()){let K=w.typeImportBindingsByLocalName.get(W);if(!K)continue;let Z=j.get(K.source)??{default:[],named:[],namespace:[]};if(K.specifierType==="default")Z.default.push(K.localName);else if(K.specifierType==="namespace")Z.namespace.push(K.localName);else Z.named.push({imported:K.importedName,local:K.localName});j.set(K.source,Z)}return Array.from(j.entries()).sort(([W],[K])=>W.localeCompare(K)).map(([W,K])=>{if(K.namespace.length>0)return K.namespace.map((J)=>`import type * as ${J} from "${W}";`).join(`
|
|
7
|
+
`);let Z=K.named.map(({imported:J,local:M})=>{if(!J||J===M)return M;return`${J} as ${M}`}),$=K.default[0],Q=Z.length>0?`{ ${Z.join(", ")} }`:"";if($&&Q)return`import type ${$}, ${Q} from "${W}";`;if($)return`import type ${$} from "${W}";`;return`import type ${Q} from "${W}";`})}function aw(w){let O=w.pendingCallDefaultCandidates.length>0?w.pendingCallDefaultCandidates.slice():void 0;if(w.typedRunesPropsDeclarations.length!==1)return O?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],pendingCallDefaultCandidates:O}:void 0;let[j]=w.typedRunesPropsDeclarations;if(!j.canonicalType)return O?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],pendingCallDefaultCandidates:O}:void 0;let W=Array.from(j.referencedLocalTypes).map((K)=>w.localTypeDeclarationsByName.get(K)).filter((K)=>K!==void 0).sort((K,Z)=>K.start-Z.start).map((K)=>K.code);return{canonicalPropsType:j.canonicalType,canonicalPropNames:Array.from(j.props.keys()).sort(),localTypeDeclarations:W,typeImportStatements:jw(w,j.referencedImportedTypes),referencesComponentGenerics:ww(j.canonicalType,w.generics),...O?{pendingCallDefaultCandidates:O}:{}}}var Ww=/^[A-Za-z_$][\w$]*/,Kw=/[A-Za-z_$][\w$]*/g,S0=/^(?:const|in|out)\s+/;function Y0(w){let O=[],j=0,W=0;for(let K=0;K<w.length;K++){let Z=w[K];if(Z==="<"||Z==="("||Z==="["||Z==="{")j++;else if(Z===">"||Z===")"||Z==="]"||Z==="}")j=Math.max(j-1,0);else if(Z===","&&j===0)O.push(w.slice(W,K)),W=K+1}return O.push(w.slice(W)),O}function wO(w){let O=Y0(w).map((W)=>W.trim()).filter((W)=>W.length>0);if(O.length===0)return null;return[O.map((W)=>{let K=W;while(S0.test(K))K=K.replace(S0,"");return K.match(Ww)?.[0]??W}).join(", "),O.join(", ")]}function OO(w,O,j){let W=w.scriptGenericsAttribute?.value;if(!W)return;for(let[K]of W.matchAll(Kw)){if(w.typeImportBindingsByLocalName.has(K))O.add(K);if(j.has(K))continue;let Z=w.localTypeDeclarationsByName.get(K);if(!Z)continue;j.add(K),D(w,Z.node,O,j)}}var Zw=null;function $w(w,O,j){let W={value:void 0,replace:!1};if(!j||typeof j!=="object"||!("type"in j))return W;if(j.type==="Identifier")W.value=j.name,W.replace=!0;else if(j.type==="Literal")W.value=String(j.value);else if(j.type==="MemberExpression")W.value=C0(w,O,j);else if((j.type==="ObjectExpression"||j.type==="TemplateLiteral")&&"start"in j&&"end"in j&&typeof j.start==="number"&&typeof j.end==="number")W.value=l(w,j.start,j.end);return W}function $O(w,O,j){let W={};for(let K of j.properties){if(K.type!=="Property"||K.computed)continue;let Z=O.getPropertyName(K.key);if(!Z)continue;W[Z]=$w(w,O,K.value)}return W}function Qw(w,O){if(!O||typeof O!=="object"||!("type"in O))return null;if(O.type==="Identifier"){let Z=O,$=w.propLocalToPublicName.get(Z.name);if(!$)return null;return{publicName:$,trackingName:Z.name}}if(O.type!=="MemberExpression")return null;let j=O,W=j.object&&typeof j.object==="object"&&"type"in j.object&&j.object.type==="Identifier"?j.object.name:void 0;if(!W||!w.wholePropsLocals.has(W))return null;let K;if(!j.computed&&j.property&&typeof j.property==="object"&&"type"in j.property){if(j.property.type==="Identifier")K=j.property.name;else if(j.property.type==="Literal"&&j.property.value!=null)K=String(j.property.value)}else if(j.computed&&j.property&&typeof j.property==="object"&&"type"in j.property&&j.property.type==="Literal"&&"value"in j.property&&j.property.value!=null)K=String(j.property.value);if(!K)return null;return{publicName:K,trackingName:K}}function QO(w,O){let j=O;if(j&&typeof j==="object"&&"type"in j&&j.type==="ChainExpression")j=j.expression;if(!j||typeof j!=="object"||!("type"in j)||j.type!=="CallExpression")return null;let W=j;if(!W.callee||typeof W.callee!=="object"||!("type"in W.callee))return null;let K=Qw(w,W.callee);if(!K)return null;return{...K,arguments:W.arguments}}function f0(w,{slot_name:O,slot_props:j,slot_fallback:W,slot_description:K,slot_deprecated:Z,slot_tags:$,source:Q}){let J=O===void 0||O==="",M=J?Zw:O??"",Y=N(W),z=j===void 0||j===""?void 0:j,X=K?.trim()||void 0;if(w.slots.has(M)){let B=w.slots.get(M);if(B)w.slots.set(M,{...B,default:B.default??J,fallback:Y,slot_props:B.slot_props===void 0?z:B.slot_props,description:B.description||X,deprecated:B.deprecated??Z,tags:B.tags||$,source:Q||B.source})}else w.slots.set(M,{name:M,default:J,fallback:Y,slot_props:j,description:X,deprecated:Z,tags:$,source:Q})}var I;(function(w){w.start="/**",w.nostart="/***",w.delim="*",w.end="*/"})(I||(I={}));function M0(w){return/^\s+$/.test(w)}function D0(w){let O=w.match(/\r+$/);return O==null?["",w]:[w.slice(-O[0].length),w.slice(0,-O[0].length)]}function k(w){let O=w.match(/^\s+/);return O==null?["",w]:[w.slice(0,O[0].length),w.slice(O[0].length)]}function E0(w){return w.split(/\n/)}function k0(w={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},w)}function J0(w={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},w)}var Yw=/^@[^\s/]+(?=\s|$)/;function z0({fence:w="```"}={}){let O=Mw(w),j=(W,K)=>O(W)?!K:K;return function(K){let Z=[[]],$=!1;for(let Q of K){if(Yw.test(Q.tokens.description)&&!$)Z.push([Q]);else Z[Z.length-1].push(Q);$=j(Q.tokens.description,$)}return Z}}function Mw(w){if(typeof w==="string")return(O)=>O.split(w).length%2===0;return w}function H0({startLine:w=0,markers:O=I}={}){let j=null,W=w;return function(Z){let $=Z,Q=J0();if([Q.lineEnd,$]=D0($),[Q.start,$]=k($),j===null&&$.startsWith(O.start)&&!$.startsWith(O.nostart))j=[],Q.delimiter=$.slice(0,O.start.length),$=$.slice(O.start.length),[Q.postDelimiter,$]=k($);if(j===null)return W++,null;let J=$.trimRight().endsWith(O.end);if(Q.delimiter===""&&$.startsWith(O.delim)&&!$.startsWith(O.end))Q.delimiter=O.delim,$=$.slice(O.delim.length),[Q.postDelimiter,$]=k($);if(J){let M=$.trimRight();Q.end=$.slice(M.length-O.end.length),$=M.slice(0,-O.end.length)}if(Q.description=$,j.push({number:W,source:Z,tokens:Q}),W++,J){let M=j.slice();return j=null,M}return null}}function X0({tokenizers:w}){return function(j){var W;let K=k0({source:j});for(let Z of w)if(K=Z(K),(W=K.problems[K.problems.length-1])===null||W===void 0?void 0:W.critical)break;return K}}function n(){return(w)=>{let{tokens:O}=w.source[0],j=O.description.match(/\s*(@(\S+))(\s*)/);if(j===null)return w.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:w.source[0].number,critical:!0}),w;if(j[1].includes("/"))return w;return O.tag=j[1],O.postTag=j[3],O.description=O.description.slice(j[0].length),w.tag=j[2],w}}function r(w="compact"){let O=zw(w);return(j)=>{let W=0,K=[],Z=!1,$=!0;for(let{tokens:M}of j.source.values()){let Y="";if(!Z&&M.description.trim())Z=!0;else if(!Z)continue;if($&&M.description[0]!=="{")return j;$=!1;for(let z of M.description){if(z==="{")W++;if(z==="}")W--;if(Y+=z,W===0)break}if(K.push([M,Y]),W===0)break}if(!Z)return j;if(W!==0)return j.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:j.source[0].number,critical:!0}),j;let Q=[],J=K[0][0].postDelimiter.length;for(let[M,[Y,z]]of K.entries()){if(Y.type=z,M>0)Y.type=Y.postDelimiter.slice(J)+z,Y.postDelimiter=Y.postDelimiter.slice(0,J);[Y.postType,Y.description]=k(Y.description.slice(z.length)),Q.push(Y.type)}return Q[0]=Q[0].slice(1),Q[Q.length-1]=Q[Q.length-1].slice(0,-1),j.type=O(Q),j}}var Jw=(w)=>w.trim();function zw(w){if(w==="compact")return(O)=>O.map(Jw).join("");else if(w==="preserve")return(O)=>O.join(`
|
|
8
|
+
`);else return w}var v0=(w)=>w&&w.startsWith('"')&&w.endsWith('"');function c(){let w=(O,{tokens:j},W)=>j.type===""?O:W;return(O)=>{let j=O.source.reduce(w,0),W;if(O.type)do{if({tokens:W}=O.source[j],W.description.trim())break;j++}while(O.source[j]);else({tokens:W}=O.source[j]);let K=W.description.trimStart(),Z=K.split('"');if(Z.length>1&&Z[0]===""&&Z.length%2===1)return O.name=Z[1],W.name=`"${Z[1]}"`,[W.postName,W.description]=k(K.slice(W.name.length)),O;let $=0,Q="",J=!1,M;for(let z of K){if($===0&&M0(z))break;if(z==="[")$++;if(z==="]")$--;Q+=z}if($!==0)return O.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:O.source[0].number,critical:!0}),O;let Y=Q;if(Q[0]==="["&&Q[Q.length-1]==="]"){J=!0,Q=Q.slice(1,-1);let z=Q.split("=");if(Q=z[0].trim(),z[1]!==void 0)M=z.slice(1).join("=").trim();if(Q==="")return O.problems.push({code:"spec:name:empty-name",message:"empty name",line:O.source[0].number,critical:!0}),O;if(M==="")return O.problems.push({code:"spec:name:empty-default",message:"empty default value",line:O.source[0].number,critical:!0}),O;if(!v0(M)&&/=(?!>)/.test(M))return O.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:O.source[0].number,critical:!0}),O}if(!J){let z=Q.search(/=(?!>)/);if(z!==-1){let X=Q.slice(0,z).trim(),B=Q.slice(z+1).trim();if(X==="")return O.problems.push({code:"spec:name:empty-name",message:"empty name",line:O.source[0].number,critical:!0}),O;if(B==="")return O.problems.push({code:"spec:name:empty-default",message:"empty default value",line:O.source[0].number,critical:!0}),O;if(/^[\p{ID_Start}$_\.][\p{ID_Continue}$_\u200c\u200d\.]*=/u.test(Q)){if(!v0(B)&&/=(?!>)/.test(B))return O.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:O.source[0].number,critical:!0}),O;Q=X,M=B}}}if(O.optional=J,O.name=Q,W.name=Y,M!==void 0)O.default=M;return[W.postName,W.description]=k(K.slice(W.name.length)),O}}function s(w="compact",O=I){let j=q0(w);return(W)=>{return W.description=j(W.source,O),W}}function q0(w){if(w==="compact")return Hw;if(w==="preserve")return Uw;return w}function Hw(w,O=I){return w.map(({tokens:{description:j}})=>j.trim()).filter((j)=>j!=="").join(" ")}var Xw=(w,{tokens:O},j)=>O.type===""?w:j,qw=({tokens:w})=>(w.delimiter===""?w.start:w.postDelimiter.slice(1))+w.description;function Uw(w,O=I){if(w.length===0)return"";if(w[0].tokens.description===""&&w[0].tokens.delimiter===O.start)w=w.slice(1);let j=w[w.length-1];if(j!==void 0&&j.tokens.description===""&&j.tokens.end.endsWith(O.end))w=w.slice(0,-1);return w=w.slice(w.reduce(Xw,0)),w.map(qw).join(`
|
|
9
|
+
`)}function U0({startLine:w=0,fence:O="```",spacing:j="compact",markers:W=I,tokenizers:K=[n(),r(j),c(),s(j)]}={}){if(w<0||w%1>0)throw Error("Invalid startLine");let Z=H0({startLine:w,markers:W}),$=z0({fence:O}),Q=X0({tokenizers:K}),J=q0(j);return function(M){let Y=[];for(let z of E0(M)){let X=Z(z);if(X===null)continue;let B=$(X),b=B.slice(1).map(Q);Y.push({description:J(B[0],W),tags:b,source:X,problems:b.reduce((L,_)=>L.concat(_.problems),[])})}return Y}}function Bw(w){return w.start+w.delimiter+w.postDelimiter+w.tag+w.postTag+w.type+w.postType+w.name+w.postName+w.description+w.end+w.lineEnd}function B0(){return(w)=>w.source.map(({tokens:O})=>Bw(O)).join(`
|
|
10
|
+
`)}var Gw={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};var iO=Object.keys(Gw);function a(w,O={}){return U0(O)(w)}var Jj=B0();var Vw=/\s*=\s*/;function N0(w){let O=w.indexOf("<");if(O===-1||!w.endsWith(">"))return w;let j=w.slice(0,O),W=w.slice(O+1,-1),K=Y0(W).map((Z)=>Z.trim().replace(Vw," = ")).join(", ");return`${j}<${K}>`}var Aw=/^\s*$/,Rw=/;$/,Pw=/^-\s*/;function T(w){if(w===void 0)return;let O=w.replace(Pw,"").trim();return O===""?"":O}function i(w){if(!w||w.length===0)return;return w[0].tokens.description}var x0=new Set(["since","example"]);function T0(w){if(!w||w.length===0)return"";let O=[];for(let j of w){let W=j.tokens;if((W.end??"").trim()==="*/")break;if(W.tag){let K=`${W.name??""}${W.postName??""}${W.description??""}`.trimEnd();if(K)O.push(K)}else O.push(`${W.postDelimiter??""}${W.description??""}`)}return O.join(`
|
|
11
|
+
`)}function hw(w){let O=w.trim();return O===""?!0:O}function y0(w,O){return hw(`${w??""}${O?` ${O}`:""}`)}function Fw(w){let O=w.trim().replace(Rw,"").trimEnd();if(!O.startsWith("{")||!O.endsWith("}"))return!1;let j=0,W=null;for(let K=0;K<O.length;K++){let Z=O[K];if(W!==null){if(Z==="\\"){K++;continue}if(Z===W)W=null;continue}if(Z==='"'||Z==="'"||Z==="`"){W=Z;continue}if(Z==="{"||Z==="["||Z==="(")j++;else if(Z==="}"||Z==="]"||Z===")"){if(j--,j===0&&K<O.length-1)return!1}}return j===0}function u0(w){let O=w;if(!O.startsWith("/*"))O=`/*${O}`;if(!O.endsWith("*/"))O+="*/";return O}function Cw(w){if(w==="*")return"any";return w.trim()}function Rj(w){let O=a(u0(w),{spacing:"preserve"}),{returns:j}=g0(O);return j?Cw(j.type):void 0}function g0(w){let O=w[0]?.tags??[],j=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated"]),W,K=[],Z,$,Q,J=[],M=[];for(let Y of O)if(Y.tag==="type")W=Y;else if(Y.tag==="param")K.push(Y);else if(Y.tag==="returns"||Y.tag==="return")Z=Y;else if(Y.tag==="deprecated")Q??=y0(Y.name,Y.description);else if(x0.has(Y.tag))M.push(Y);else if(Y.tag==="bindable"){if(Y.type)continue;let z=`${Y.name}${Y.description?` ${Y.description}`:""}`.trim();if(z==="readonly"||z==="writable")$??=z}else if(!j.has(Y.tag))J.push(Y);return{type:W,param:K,returns:Z,binding:$,deprecated:Q,additional:J,passthrough:M,description:w[0]?.description}}function Iw(w){if(!w||w.length===0)return;let O=w[w.length-1];return O&&typeof O==="object"&&"value"in O?O:void 0}function bw(w,O,j){if(!O||O.length===0||j===void 0||!w.source)return;for(let W=O.length-1;W>=0;W--){let K=O[W];if(!K||typeof K!=="object"||!("value"in K)||!("end"in K))continue;if(typeof K.end!=="number")continue;let Z=w.source.slice(K.end,j);if(Aw.test(Z))return K}return}function Lw(w,O,j){if(!j?.leadingComments)return;let W=bw(w,j.leadingComments,j.start);if(!W)return;return _w(O,[W])}function Pj(w,O,j){if(!j?.leadingComments)return;return Lw(w,O,j)}function _w(w,O){if(!O)return;let j=Iw(O);if(!j)return;let W=a(u0(j.value),{spacing:"preserve"}),{type:K,param:Z,returns:$,binding:Q,deprecated:J,additional:M,passthrough:Y,description:z}=g0(W),X,B,b,L;if(K)X=w.aliasType(K.type);if(Z.length>0)B=Z.filter((G)=>!G.name.includes(".")).map((G)=>({name:G.name,type:w.aliasType(G.type),description:T(G.description),optional:G.optional||!1}));if($)b=w.aliasType($.type);let _=N(z?.trim());if(_||M.length>0){let G=[];if(_)G.push(_);for(let S of M){let x=`@${S.tag}${S.name?` ${S.name}`:""}${S.description?` ${S.description}`:""}`;G.push(x)}L=G.join(`
|
|
12
|
+
`)}let y=Y.length>0?Y.map((G)=>({name:G.tag,body:T0(G.source)})):void 0;return{type:X,params:B,returnType:b,description:L,binding:Q,deprecated:J,tags:y}}function hj(w,O,j=w.source){if(!j)return;let W=0;for(let{tags:K,description:Z,source:$}of a(j,{spacing:"preserve"})){let Q=$.map((H)=>H.source).join(`
|
|
13
|
+
`),J=j.indexOf(Q,W),M=J===-1?void 0:J;if(J!==-1)W=J+Q.length;let Y,z,X,B,b,L,_=[],y=[],G,S,x,p=[],v,d,t=[],e,f=!1,A=!0,m=[],w0,o=new Map,V0=new Set,O0=new Set;for(let H of K)if(H.source&&H.source.length>0)V0.add(H.source[0].number);for(let H of $)if(!H.tokens.tag&&H.tokens.description&&H.tokens.description.trim()!=="}")o.set(H.number,H.tokens.description);let l0=(H)=>{if(!H||H.length===0)return;let h=H[0].number,U=[],F=[],E=!1;for(let q=h-1;q>=1;q--){if(V0.has(q))break;let V=o.get(q);if(V)U.unshift(V),F.unshift(q),E=!0;else if(E){let R=$.find((P)=>P.number===q);if(!(!R||!R.tokens.tag&&(!R.tokens.description||R.tokens.description.trim()==="")))break}}if(U.length===0)return;for(let q of F)O0.add(q);return U.join(`
|
|
14
|
+
`).trim()},A0=()=>{if(Y!==void 0){let H=z&&z!=="object"&&z!=="Object"?z:void 0,h;if(H)h=H;else if(y.length>0)h=Q0(y,Y,!0);else h=z||"";if(L!==void 0){let U;for(let q of K){let V=q.source?.[0]?.number;if(typeof V!=="number")continue;if(V<=L)continue;if(q.tag==="property"||q.tag==="type")continue;U=V;break}let F=[],E=Array.from(o.keys()).sort((q,V)=>q-V);for(let q of E){if(q<=L)continue;if(U!==void 0&&q>=U)continue;if(O0.has(q))continue;let R=o.get(q)?.trim();if(R)F.push(R),O0.add(q)}if(F.length>0){let q=F.join(`
|
|
15
|
+
`);X=X?`${X}
|
|
16
|
+
${q}`:q}}$0(w,{name:Y,detail:h,has_argument:!1,description:X,deprecated:B,tags:_.length>0?_:void 0,source:b}),w.eventDescriptions.set(Y,X),w.jsDocEventNames.add(Y),w.jsDocEventSources.set(Y,b),y.length=0,Y=void 0,z=void 0,X=void 0,B=void 0,b=void 0,L=void 0,_=[]}},R0=()=>{if(G!==void 0){let H,h;if(p.length>0)H=Q0(p,void 0,!0),h=`type ${G} = ${H};`;else if(S)H=S,h=Fw(H)?`interface ${G} ${H}`:`type ${G} = ${H};`;else H="{}",h=`type ${G} = ${H};`;w.typedefs.set(G,{type:H,name:G,description:N(x),ts:h}),p.length=0,G=void 0,S=void 0,x=void 0}},P0=()=>{if(v!==void 0){let U=`(${t.map(({name:E,type:q,optional:V})=>{return`${E}${V?"?":""}: ${q}`}).join(", ")}) => ${e||"void"}`,F=`type ${v} = ${U};`;w.typedefs.set(v,{type:U,name:v,description:N(d),ts:F}),t.length=0,e=void 0,v=void 0,d=void 0}},d0=K.some((H)=>H.tag==="slot"||H.tag==="snippet"),m0=K.some((H)=>H.tag==="extends"||H.tag==="extendProps");for(let{tag:H,type:h,name:U,description:F,optional:E,default:q,source:V}of K){let R=O.aliasType(h),u=l0(V);switch(H){case"extends":case"extendProps":if(w.extends={interface:U,import:R},A)A=!1;break;case"restProps":{let P=U?F?`${U} ${F}`:U:F,j0=T(P)||u;if(!j0&&A&&!f&&Z)j0=Z,f=!0;if(w.rest_props={type:"Element",name:R,description:j0||void 0},A)A=!1;break}case"slot":case"snippet":{let g=T(i(V));if(!g&&A&&!f&&Z)g=Z,f=!0;if(!g&&m.length===0)g=u;if(A)A=!1;f0(w,{slot_name:U,slot_props:R,slot_description:g||void 0,slot_deprecated:w0,slot_tags:m.length>0?[...m]:void 0,source:Z0(w,$,V,M)}),m.length=0,w0=void 0;break}case"event":{if(A0(),Y=U,z=R,L=V&&V.length>0?V[0].number:void 0,X=T(i(V))||u,!X&&A&&!f&&Z)X=Z,f=!0;if(b=Z0(w,$,V,M),A)A=!1;break}case"type":if(Y!==void 0)z=R;break;case"param":if(v!==void 0)t.push({name:U,type:R,optional:E||!1});break;case"returns":case"return":if(v!==void 0)e=R;break;case"property":{let P={name:U,type:R,description:T(i(V)),optional:E||!1,default:q};if(Y!==void 0)y.push(P);else if(G!==void 0)p.push(P);break}case"typedef":{if(R0(),G=N0(U),S=R,x=T(i(V))||u,!x&&A&&!f&&Z)x=Z,f=!0;if(A)A=!1;break}case"callback":{if(P0(),v=N0(U),d=T(i(V))||u,!d&&A&&!f&&Z)d=Z,f=!0;if(A)A=!1;break}case"generics":if(w.generics=[U,R],A)A=!1;break;case"template":{let P=U;if(R)P=`${U} extends ${R}`;if(q)P+=` = ${q}`;if(d0&&!m0){w.deferredSlotBlockGenerics.push({name:U,constraint:P});break}if(O.accumulateGeneric(U,P),A)A=!1;break}case"deprecated":{let P=y0(U,F);if(Y===void 0)w0??=P;else B??=P;break}case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let P={name:H,body:T0(V)};if(Y!==void 0&&x0.has(H))_.push(P);else m.push(P)}break}}A0(),R0(),P0()}}
|
|
17
|
+
export{C as u,Sw as v,W0 as w,h0 as x,fw as y,F0 as z,Dw as A,p0 as B,Ew as C,n0 as D,vw as E,Nw as F,C0 as G,s0 as H,b0 as I,L0 as J,l as K,yw as L,N as M,t0 as N,$0 as O,iw as P,Ow as Q,nw as R,rw as S,cw as T,sw as U,D as V,aw as W,Y0 as X,wO as Y,OO as Z,a as _,$O as $,QO as aa,f0 as ba,Aw as ca,Rj as da,g0 as ea,Lw as fa,Pj as ga,hj as ha};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{$ as bZ,A as v,B as p,C as XZ,D as TQ,G as EZ,H as yQ,I as hZ,J as h,K as A,L as zQ,M as LQ,N as DZ,O as kZ,P as _Z,Q as UZ,R as qZ,S as YZ,T as jQ,U as WZ,V as KZ,W as SZ,Y as TZ,Z as HZ,_ as MZ,aa as gZ,ba as SQ,ca as jZ,ea as FZ,fa as o,ga as OZ,ha as fZ,v as aQ,w as VQ,x as s,y as PZ,z as iQ}from"./chunk-4ggahk6z.js";import{ja as NZ}from"./chunk-mab8x3d6.js";class OQ{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(Q)=>this.replacement=Q}}replace(Q,Z,$,G){if(Q&&Z)if($!=null)Q[Z][$]=G;else Q[Z]=G}remove(Q,Z,$){if(Q&&Z)if($!==null&&$!==void 0)Q[Z].splice($,1);else delete Q[Z]}}class IQ extends OQ{constructor(Q,Z){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:($)=>this.replacement=$},this.enter=Q,this.leave=Z}visit(Q,Z,$,G){if(Q){if(this.enter){let q=this.should_skip,W=this.should_remove,K=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,Q,Z,$,G),this.replacement)Q=this.replacement,this.replace(Z,$,G,Q);if(this.should_remove)this.remove(Z,$,G);let Y=this.should_skip,O=this.should_remove;if(this.should_skip=q,this.should_remove=W,this.replacement=K,Y)return Q;if(O)return null}let X;for(X in Q){let q=Q[X];if(q&&typeof q==="object"){if(Array.isArray(q)){let W=q;for(let K=0;K<W.length;K+=1){let Y=W[K];if(bQ(Y)){if(!this.visit(Y,Q,X,K))K--}}}else if(bQ(q))this.visit(q,Q,X,null)}}if(this.leave){let q=this.replacement,W=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,Q,Z,$,G),this.replacement)Q=this.replacement,this.replace(Z,$,G,Q);if(this.should_remove)this.remove(Z,$,G);let K=this.should_remove;if(this.replacement=q,this.should_remove=W,K)return null}}return Q}}function bQ(Q){return Q!==null&&typeof Q==="object"&&"type"in Q&&typeof Q.type==="string"}function x(Q,{enter:Z,leave:$}){return new IQ(Z,$).visit(Q,null)}var gQ={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",kbd:"HTMLElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};function vZ(Q){return Q in gQ}function fQ(Q){if(vZ(Q))return gQ[Q];return"HTMLElement"}function AQ(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLineStartOffsetsCache:void 0,rest_props:void 0,extends:void 0,customElementTag:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitPropTypesByName:new Map,explicitVariableTypesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,scopeDeclarations:new WeakMap,activeScopes:[],slots:new Map,snippetPropLocals:new Set,deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,contexts:new Map,typedefs:new Map,variableInfoCache:new Map,variableInfoCacheBuilt:!1}}function m(Q,Z,$,G,X){Q.diagnosticRecords.push({component:Q.componentFilePath,kind:Z,name:$,message:G,...X?{source:X}:{}})}function GQ(Q,Z,$,G){if(LQ($)===void 0)return;if(Q.trackPropLocalName($),Z.props.has($)){let X=Z.props.get($);Z.props.set($,{...X,...G})}else Z.props.set($,G)}function l(Q,Z,$,G=0){let X,q,W=!1;if(!$||typeof $!=="object"||!("type"in $))return{value:X,type:q,isFunction:W};let K=vQ(Q,Z,$);if($.type==="ObjectExpression"||$.type==="BinaryExpression"||$.type==="ArrayExpression"||$.type==="ArrowFunctionExpression"||$.type==="FunctionExpression"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end)?.replace(yQ," ");if(q=X,W=$.type==="ArrowFunctionExpression"||$.type==="FunctionExpression",$.type==="BinaryExpression"){let O=$;if(O.left&&typeof O.left==="object"&&"type"in O.left&&O.left.type==="Literal"&&"value"in O.left&&typeof O.left.value==="string")q="string"}if($.type==="ArrowFunctionExpression"||$.type==="FunctionExpression")q=lQ($),X=NQ(Z,$)}else if($.type==="UnaryExpression"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end);if(Y.argument){if(typeof Y.argument==="object"&&"type"in Y.argument&&Y.argument.type==="UnaryExpression")q=l(Q,Z,Y.argument).type;else if(typeof Y.argument==="object"&&"value"in Y.argument)q=typeof Y.argument.value}}else if($.type==="NewExpression"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end);if(Y.callee&&typeof Y.callee==="object"&&"type"in Y.callee&&Y.callee.type==="Identifier"){let O=Y.callee.name;if(O==="Date")q="Date";else if(O==="Map")q="Map<any, any>";else if(O==="Set")q="Set<any>";else if(O==="WeakMap")q="WeakMap<object, any>";else if(O==="WeakSet")q="WeakSet<object>";else if(O==="Array")q="any[]";else if(O==="RegExp"||O==="Regexp")q="RegExp";else if(O==="Error")q="Error";else q=O}}else if($.type==="CallExpression"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end);let O=Y.callee,L=O&&typeof O==="object"&&"type"in O&&O.type==="Identifier"?O.name:void 0;if((L==="$derived"||L==="$state")&&Y.arguments.length===1&&G<5)return{...l(Q,Z,Y.arguments[0],G+1),value:X,defaultValue:K};if(L){let J=uZ(Q,Z,L);if(J)return{value:X,type:void 0,isFunction:!1,defaultValue:K,resolvedType:J};if(Z.funcDecls.has(L)||xZ(Z,L))return{value:X,type:void 0,isFunction:!1,defaultValue:K,pendingCallDefault:{calleeName:L}};let j=Z.valueImportBindingsByLocalName.get(L);if(j)return{value:X,type:void 0,isFunction:!1,defaultValue:K,pendingCallDefault:{calleeName:L,importSource:j.source,importedName:j.importedName}}}return{value:X,type:void 0,isFunction:!1,defaultValue:K,pendingCallDefault:{calleeName:L??yZ(Z,O)}}}else if($.type==="Identifier"){let Y=$;if(G<5){let O=uQ(Z,Y.name);if(O){let L=l(Q,Z,O,G+1),J=Q.resolveLocalVarJSDoc(Y.name);return{...L,resolvedType:J?.type??L.resolvedType,resolvedDescription:J?.description??L.resolvedDescription,resolvedParams:J?.params??L.resolvedParams,resolvedReturnType:J?.returnType??L.resolvedReturnType}}if(Z.funcDecls.has(Y.name)){let L=Q.resolveLocalVarJSDoc(Y.name),J=Z.funcDecls.get(Y.name);return{value:J?NQ(Z,J):void 0,type:void 0,isFunction:!0,defaultValue:J?vQ(Q,Z,J):void 0,resolvedType:L?.type??dZ(L,J),resolvedDescription:L?.description,resolvedParams:L?.params,resolvedReturnType:L?.returnType}}}if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end)}else if($.type==="MemberExpression"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end);if(Q.isNumericConstant($))q="number"}else if($.type==="TemplateLiteral"){let Y=$;if("start"in Y&&"end"in Y&&typeof Y.start==="number"&&typeof Y.end==="number")X=A(Z,Y.start,Y.end);q="string"}else if("raw"in $&&typeof $.raw==="string"){if(X=$.raw,"value"in $)q=$.value==null?void 0:typeof $.value}return{value:X,type:q,isFunction:W,defaultValue:K}}function uQ(Q,Z){for(let $ of Q.vars)for(let G of $.declarations)if(G.id&&typeof G.id==="object"&&"type"in G.id&&G.id.type==="Identifier"&&"name"in G.id&&G.id.name===Z&&G.init)return G.init;return}function xQ(Q,Z){for(let $ of Q.vars){if($.kind!=="const")continue;for(let G of $.declarations)if(G.id&&typeof G.id==="object"&&"type"in G.id&&G.id.type==="Identifier"&&"name"in G.id&&G.id.name===Z&&G.init)return G.init}return}function yZ(Q,Z){if(Z&&typeof Z==="object"&&"start"in Z&&"end"in Z&&typeof Z.start==="number"&&typeof Z.end==="number")return A(Q,Z.start,Z.end)??"call";return"call"}function uZ(Q,Z,$){let G=Q.resolveLocalVarJSDoc($);if(G?.returnType)return G.returnType;let X=Z.funcDecls.get($)??mQ(Z,$);if(!X)return;let q=sZ(Z,X);if(q)return q;let W=mZ(Z,$);if(W)return W;let K=sQ(X);return K==="any"?void 0:K}function xZ(Q,Z){return mQ(Q,Z)!==void 0}function mQ(Q,Z){let $=uQ(Q,Z);if(!$||typeof $!=="object"||!("type"in $))return;if($.type==="ArrowFunctionExpression"||$.type==="FunctionExpression")return $;return}function mZ(Q,Z){for(let $ of Q.vars)for(let G of $.declarations){let X=G.id;if(!X||typeof X!=="object"||!("type"in X)||X.type!=="Identifier"||!("name"in X)||X.name!==Z)continue;let q=X.typeAnnotation;if(q?.type!=="TSTypeAnnotation")return;let W=q.typeAnnotation;if(!W||typeof W.start!=="number"||typeof W.end!=="number")return;return lZ(A(Q,W.start,W.end))}return}function lZ(Q){if(!Q)return;let Z=Q.lastIndexOf("=>");if(Z===-1)return;return Q.slice(Z+2).trim()||void 0}function sZ(Q,Z){let $=Z.returnType;if($?.type!=="TSTypeAnnotation")return;let G=$.typeAnnotation;if(!G||typeof G.start!=="number"||typeof G.end!=="number")return;return A(Q,G.start,G.end)}function dZ(Q,Z){let $=Q?.returnType??"any",G=Q?.params;if(G&&G.length>0)return`(${G.map((q)=>`${q.name}${q.optional?"?":""}: ${q.type}`).join(", ")}) => ${$}`;if(Q?.returnType)return`() => ${$}`;if(Z)return lQ(Z);return"(...args: any[]) => any"}function lQ(Q){return`(${cZ(Q)}) => ${sQ(Q)}`}function cZ(Q){let Z=Q.params;if(!Array.isArray(Z)||Z.length===0)return"...args: any[]";let $=[];for(let G of Z)if(G&&typeof G==="object"&&"type"in G&&G.type==="Identifier"&&"name"in G&&typeof G.name==="string")$.push(`${G.name}: any`);else return"...args: any[]";return $.join(", ")}function sQ(Q){if(Q.async||Q.generator)return"any";let Z=Q.body,$;if(Z&&typeof Z==="object"&&"type"in Z&&Z.type==="BlockStatement"){if($=iZ(Z),$.length===0)return"any"}else $=[Z];let G=null;for(let X of $){let q=pZ(X);if(!q)return"any";if(G===null)G=q;else if(G!==q)return"any"}return G??"any"}function iZ(Q){let Z=[];return x(Q,{enter($){if($.type==="FunctionDeclaration"||$.type==="FunctionExpression"||$.type==="ArrowFunctionExpression"){this.skip();return}if($.type==="ReturnStatement")Z.push($.argument??null)}}),Z}function pZ(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return null;switch(Q.type){case"Literal":{let Z=Q.value;if(typeof Z==="string")return"string";if(typeof Z==="number")return"number";if(typeof Z==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let Z=Q.callee;if(Z&&typeof Z==="object"&&"type"in Z&&Z.type==="Identifier"){let $=Z.name;if($==="String")return"string";if($==="Number")return"number";if($==="Boolean")return"boolean"}return null}default:return null}}function dQ(Q){if(v(Q,"$bindable"))return{init:Q.arguments[0],bindable:!0};return{init:Q,bindable:!1}}function oZ(Q,Z){let $=Z.params;if(!Array.isArray($)||$.length===0)return"";let G=$[0],X=$[$.length-1];if(typeof G.start!=="number"||typeof X.end!=="number")return"";return A(Q,G.start,X.end)??""}function NQ(Q,Z){if(Z.generator)return;let $=Z.body;if(!$||typeof $!=="object"||!("type"in $))return;let G=oZ(Q,Z),X=Z.async?"async ":"",q=(K,Y)=>K&&typeof K==="object"&&("type"in K)&&K.type==="ObjectExpression"?`(${Y})`:Y;if($.type!=="BlockStatement"){let K=zQ(Q,$);return K===void 0?void 0:`${X}(${G}) => ${q($,K)}`}let W=$.body;if(W.length===0)return`${X}(${G}) => {}`;if(W.length===1){let K=W[0];if(K&&typeof K==="object"&&"type"in K&&K.type==="ReturnStatement"){let Y=K.argument;if(Y){let O=zQ(Q,Y);if(O!==void 0)return`${X}(${G}) => ${q(Y,O)}`}}}return}function vQ(Q,Z,$){let G=zQ(Z,$);if(!G||!$||typeof $!=="object"||!("type"in $))return;let X="expression";if($.type==="Literal"||$.type==="UnaryExpression")X="literal";else if($.type==="TemplateLiteral")X=$.expressions.length===0?"literal":"expression";else if($.type==="ArrayExpression")X="array";else if($.type==="ObjectExpression")X="object";else if($.type==="ArrowFunctionExpression"||$.type==="FunctionExpression"||$.type==="FunctionDeclaration")X="function";let q={raw:G,kind:X};if(X==="literal"||X==="array"||X==="object"){let W=PQ(Q,$);if(W.ok)q.value=W.value}return q}function PQ(Q,Z){if(!Z||typeof Z!=="object"||!("type"in Z))return{ok:!1};if(Z.type==="Literal"){let $=Z.value;return typeof $==="bigint"?{ok:!1}:{ok:!0,value:$}}if(Z.type==="UnaryExpression"){let $=Z,G=$.argument;if(!G||typeof G!=="object"||!("type"in G)||G.type!=="Literal")return{ok:!1};let X=G.value;if(typeof X==="number"){if($.operator==="-")return{ok:!0,value:-X};if($.operator==="+")return{ok:!0,value:X}}if(typeof X==="boolean"&&$.operator==="!")return{ok:!0,value:!X};return{ok:!1}}if(Z.type==="TemplateLiteral"){let $=Z;if($.expressions.length>0||$.quasis.length!==1)return{ok:!1};return{ok:!0,value:$.quasis[0].value.cooked??$.quasis[0].value.raw}}if(Z.type==="ArrayExpression"){let $=Z,G=[];for(let X of $.elements){if(!X)return{ok:!1};let q=PQ(Q,X);if(!q.ok)return{ok:!1};G.push(q.value)}return{ok:!0,value:G}}if(Z.type==="ObjectExpression"){let $=Z,G={};for(let X of $.properties){if(X.type!=="Property"||X.computed)return{ok:!1};let q=Q.getPropertyName(X.key);if(!q)return{ok:!1};let W=PQ(Q,X.value);if(!W.ok)return{ok:!1};G[q]=W.value}return{ok:!0,value:G}}return{ok:!1}}var rZ=/[-_.:/\s]+/;function EQ(Q){return`${Q.split(rZ).map((G)=>G.charAt(0).toUpperCase()+G.slice(1)).join("")}Context`}function aZ(Q,Z,$,G){if(!$||typeof $!=="object"||!("type"in $))return null;if($.type==="ObjectExpression"){let X=[];if(!iQ($))return null;let q=$;for(let W of q.properties){if(W.type!=="Property")continue;let K=Z.getPropertyName(W.key);if(!K)continue;let Y="any",O;if(s(W.value)){let L=W.value.name,J=Z.findVariableTypeAndDescription(L);if(J)Y=J.type,O=J.description;else m(Q,"context-any-type",K,`Context "${G}" property "${K}" has no type annotation; defaulted to "any".`,h(Q,W))}else if(W.value&&typeof W.value==="object"&&"type"in W.value&&(W.value.type==="ArrowFunctionExpression"||W.value.type==="FunctionExpression"))Y=`(${W.value.params?.map((j)=>{if(s(j))return`${j.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(VQ(W.value))Y=W.value.value==null?"null":typeof W.value.value;X.push({name:K,type:Y,description:O,optional:!1})}return{key:G,typeName:EQ(G),properties:X,description:void 0}}else if(s($)){let X=$.name,q=Z.findVariableTypeAndDescription(X);if(q)return{key:G,typeName:EQ(G),properties:[{name:X,type:q.type,description:q.description,optional:!1}]};return m(Q,"context-any-type",X,`Context "${G}" variable "${X}" has no type annotation; defaulted to "any".`,h(Q,$)),{key:G,typeName:EQ(G),properties:[{name:X,type:"any",description:void 0,optional:!1}]}}return null}function cQ(Q){let Z=Q.callee;if(!Z||typeof Z!=="object"||!("type"in Z))return null;let $=Z.type==="Identifier"&&Z.name==="Symbol",G=Z.type==="MemberExpression"&&!Z.computed&&Z.object.type==="Identifier"&&Z.object.name==="Symbol"&&Z.property.type==="Identifier"&&Z.property.name==="for";if(!$&&!G)return null;let X=Q.arguments[0];if(!X||typeof X!=="object"||!("type"in X))return"";if(X.type==="Literal"&&typeof X.value==="string")return X.value;if(X.type==="TemplateLiteral"&&X.quasis?.length===1)return X.quasis[0].value.cooked??"";return""}function pQ(Q,Z,$=0){if(!Z||typeof Z!=="object"||!("type"in Z))return null;let G=Z;if(G.type==="Literal")return typeof G.value==="string"?G.value:G.value==null?null:String(G.value);if(G.type==="TemplateLiteral"){if(G.quasis?.length===1){let X=G.quasis[0].value.cooked;return X==null?null:X}return null}if(G.type==="CallExpression"||G.type==="NewExpression")return cQ(G);if(G.type==="Identifier"){if($>=5)return null;let X=xQ(Q,G.name);if(X&&typeof X==="object"&&"type"in X){let q=X;if((q.type==="CallExpression"||q.type==="NewExpression")&&cQ(q)==="")return G.name;return pQ(Q,q,$+1)}return null}return null}function oQ(Q,Z,$,G){if(!$||typeof $!=="object"||!("type"in $)||$.type!=="CallExpression")return;let X=$,q=X.arguments[0];if(!q)return;let W=pQ(Q,q);if(!W){let O=Q.componentFilePath?` in ${Q.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${O}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let K=X.arguments[1];if(!K)return;let Y=aZ(Q,Z,K,W);if(Y&&!Q.contexts.has(W))Q.contexts.set(W,Y)}function nZ({hasTypeScriptType:Q,hasJSDocType:Z,inferredType:$,finalType:G}){if(Q)return"typescript";if(Z)return"jsdoc";if($!==void 0)return"default";if(G!==void 0)return"inferred";return"unknown"}function XQ(Q){let Z=Q.explicitType??Q.jsdocType??Q.resolvedType??Q.typeSeed,$=Q.jsdocParams??Q.resolvedParams,G=Q.jsdocReturnType??Q.resolvedReturnType;if(Q.isFunctionDeclaration&&Z==="() => any"&&G)Z=$&&$.length>0?`(${$.map((K)=>`${K.name}${K.optional?"?":""}: ${K.type}`).join(", ")}) => ${G}`:`() => ${G}`;let X=Q.jsdocDescription??Q.resolvedDescription;if(X===void 0&&Z!==void 0)X=Q.typedefs?.get(Z)?.description;let q=nZ({hasTypeScriptType:Q.explicitType!==void 0,hasJSDocType:Q.jsdocType!==void 0||Q.jsdocParams!==void 0||Q.jsdocReturnType!==void 0||Q.resolvedType!==void 0,inferredType:Q.inferredTypeForSource,finalType:Z}),W=Q.initializerIsFunction||Q.isFunctionDeclaration||Q.inferIsFunctionFromTypeSignature===!0&&(!!Q.jsdocParams?.length||Q.jsdocReturnType!==void 0||!!Q.jsdocType?.includes("=>")||!!Q.resolvedType?.includes("=>")||!!Q.explicitType?.includes("=>"));return{type:Z,typeSource:q,description:X,params:$,returnType:G,isFunction:W}}function tZ(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return;let Z=String(Q.type);if(Z!=="InlineComponent"&&Z!=="Element")return;let $="name"in Q&&typeof Q.name==="string"?Q.name:void 0;if(!$)return;let G=Z==="InlineComponent"?{type:"InlineComponent",name:$}:{type:"Element",name:$};if(Z==="Element"&&$==="svelte:element"&&"tag"in Q&&typeof Q.tag==="string")G.thisValue=Q.tag;return G}function rQ(Q,Z){if(Q.rest_props!==void 0)return;let $=tZ(Z);if($)Q.rest_props=$}function k(Q,Z,$){if(!Z||Q.has(Z))return;Q.set(Z,$)}function JQ(Q,Z){for(let $=Q.activeScopes.length-1;$>=0;$-=1){let G=Q.activeScopes[$]?.get(Z);if(!G)continue;return G.kind==="prop"?G.publicPropName:void 0}return}function P(Q,Z=new Set){if(!Q||typeof Q!=="object"||!("type"in Q))return Z;switch(Q.type){case"Identifier":Z.add(Q.name);break;case"AssignmentPattern":P(Q.left,Z);break;case"ArrayPattern":for(let $ of Q.elements)P($??void 0,Z);break;case"ObjectPattern":for(let $ of Q.properties)if($.type==="Property")P($.value,Z);else if($.type==="RestElement")P($.argument,Z);break;case"RestElement":P(Q.argument,Z);break}return Z}function DQ(Q,Z){let $=P(Z);if(!$)return;for(let G of $){let X=JQ(Q,G);if(X)Q.reactive_vars.add(X)}}function BQ(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return!1;switch(String(Q.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"ThenBlock":case"CatchBlock":return!0;default:return!1}}function nQ(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return!1;let Z=String(Q.type);return Z==="FunctionDeclaration"||Z==="FunctionExpression"||Z==="ArrowFunctionExpression"}function eZ(Q,Z){let $=Q.scopeDeclarations.get(Z);if(!$)$=new Map,Q.scopeDeclarations.set(Z,$);return $}function Q0(Q,Z,$){let G=[];if($.id.type==="Identifier")return G.push({kind:"local",name:$.id.name}),G;if($.id.type!=="ObjectPattern")return G;for(let X of $.id.properties){if(X.type==="RestElement"){if(X.argument.type==="Identifier")G.push({kind:"local",name:X.argument.name});continue}if(X.computed)continue;let q=Q.getPropertyName(X.key);if(!q)continue;let W;if(X.value.type==="Identifier")W=X.value.name;else if(X.value.type==="AssignmentPattern"&&X.value.left.type==="Identifier")W=X.value.left.name;if(!W)continue;G.push({kind:"prop",name:W,publicPropName:q})}return G}function hQ(Q,Z,$,G,X){if(!aQ(Z))return;let q=X?.allowRunesProps??!1,W=X?.forceProp??!1,K=Z;for(let Y of K.declarations){if(q&&v(p(Y.init),"$props")){for(let J of Q0(Q,K,Y))k(J.kind==="prop"?$:G,J.name,J.kind==="prop"?{kind:"prop",publicPropName:J.publicPropName}:{kind:"local"});continue}let O=K.kind==="var"?G:$,L=W?"prop":"local";for(let J of P(Y.id))k(O,J,L==="prop"?{kind:"prop",publicPropName:J}:{kind:"local"})}}function Z0(Q,Z){if("id"in Q&&Q.id&&typeof Q.id==="object"&&"name"in Q.id&&typeof Q.id.name==="string")k(Z,Q.id.name,{kind:"local"});for(let $ of Q.params)for(let G of P($))k(Z,G,{kind:"local"})}function $0(Q,Z,$,G){if(!Array.isArray(Z))return;for(let X of Z){if(!X||typeof X!=="object"||!("type"in X))continue;switch(X.type){case"VariableDeclaration":hQ(Q,X,$,G);break;case"FunctionDeclaration":if(X.id?.name)k($,X.id.name,{kind:"local"});break;case"ClassDeclaration":if(X.id?.name)k($,X.id.name,{kind:"local"});break}}}function G0(Q,Z,$){if(!$||typeof $!=="object")return;let G="content"in $&&$.content&&typeof $.content==="object"&&"body"in $.content&&Array.isArray($.content.body)?$.content:("body"in $)&&Array.isArray($.body)?$:void 0;if(!G||!("body"in G)||!Array.isArray(G.body))return;for(let X of G.body){if(!X||typeof X!=="object"||!("type"in X))continue;switch(X.type){case"ImportDeclaration":for(let q of X.specifiers??[])if(q.local?.name)k(Z.componentScope,q.local.name,{kind:"local"});break;case"VariableDeclaration":hQ(Q,X,Z.componentScope,Z.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(X.id?.name)k(Z.componentScope,X.id.name,{kind:"local"});break;case"ClassDeclaration":if(X.id?.name)k(Z.componentScope,X.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!X.declaration||typeof X.declaration!=="object"||!("type"in X.declaration))break;if(X.declaration.type==="VariableDeclaration")hQ(Q,X.declaration,Z.componentScope,Z.componentScope,{forceProp:!0});else if(X.declaration.type==="FunctionDeclaration"&&X.declaration.id?.name)k(Z.componentScope,X.declaration.id.name,{kind:"prop",publicPropName:X.declaration.id.name});break}}}function tQ(Q,Z){Z.componentScope.clear(),Z.scopeDeclarations=new WeakMap,Z.activeScopes.length=0,G0(Q,Z,Z.parsed?.instance)}function eQ(Q){return{varScopeStack:[Q.componentScope]}}function QZ(Q,Z,$,G){if(!BQ(G))return;let X=eZ(Z,G),q=$.varScopeStack[$.varScopeStack.length-1]??Z.componentScope;switch(String(G.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Z0(G,X);break;case"BlockStatement":$0(Q,G.body,X,q);break;case"CatchClause":if("param"in G)for(let K of P(G.param))k(X,K,{kind:"local"});break;case"EachBlock":{let K=G;for(let Y of P(K.context))k(X,Y,{kind:"local"});if(typeof K.index==="string")k(X,K.index,{kind:"local"});else if(K.index&&"name"in K.index)k(X,K.index.name,{kind:"local"});break}case"ThenBlock":if("value"in G)for(let K of P(G.value))k(X,K,{kind:"local"});break;case"CatchBlock":if("error"in G)for(let K of P(G.error))k(X,K,{kind:"local"});break}if(nQ(G))$.varScopeStack.push(X)}function ZZ(Q,Z){if(nQ(Z))Q.varScopeStack.pop()}var X0=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function U0(Q,Z){switch(Z?.type){case"MemberExpression":return Z.computed||Q===Z.object;case"MethodDefinition":return!!Z.computed;case"MetaProperty":return Q===Z.meta;case"PropertyDefinition":return Z.computed||Q===Z.value;case"Property":return Z.computed||Q===Z.value;case"ExportSpecifier":case"ImportSpecifier":return Q===Z.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}function q0(Q,Z){for(let $=Z.length-1;$>=0;$-=1)if(Z[$]?.has(Q))return!0;return!1}function Y0(Q){let Z=new Set;if(!Q||typeof Q!=="object"||!("type"in Q))return Z;switch(String(Q.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let $=Q;if($.id?.name)Z.add($.id.name);for(let G of $.params??[])P(G,Z);break}case"BlockStatement":MQ(Q.body,Z);break;case"CatchClause":P(Q.param,Z);break;case"EachBlock":{let $=Q;if(P($.context,Z),typeof $.index==="string")Z.add($.index);else if($.index?.name)Z.add($.index.name);break}case"ThenBlock":P(Q.value,Z);break;case"CatchBlock":P(Q.error,Z);break}return Z}function MQ(Q,Z){if(!Array.isArray(Q))return;for(let $ of Q){if(!$||typeof $!=="object"||!("type"in $))continue;switch(String($.type)){case"ImportDeclaration":for(let G of $.specifiers??[])if(G.local?.name)Z.add(G.local.name);break;case"VariableDeclaration":for(let G of $.declarations??[])P(G.id,Z);break;case"FunctionDeclaration":case"ClassDeclaration":{let G=$.id?.name;if(G)Z.add(G);break}case"ExportNamedDeclaration":{let G=$.declaration;if(G&&typeof G==="object"&&"type"in G)MQ([G],Z);break}}}}function kQ(Q,Z){if(!Q||typeof Q!=="object")return!1;let $=[...Z],G=!1;return x(Q,{enter(X,q){if(G){this.skip();return}if(BQ(X))$.push(Y0(X));if(q&&X.type==="Identifier"&&X0.has(X.name)&&!q.type.startsWith("TS")&&U0(X,q)&&!q0(X.name,$))G=!0,this.skip()},leave(X){if(BQ(X))$.pop()}}),G}function $Z(Q){if(!Q||typeof Q!=="object")return;if("content"in Q){let Z=Q.content,$=Z&&typeof Z==="object"&&"body"in Z?Z.body:void 0;if(Array.isArray($))return $}if("body"in Q&&Array.isArray(Q.body))return Q.body;return}function GZ(Q){if(Q.runesOptionOverride!==void 0)return Q.runesOptionOverride?"runes":"legacy";let Z=Q.parsed;if(!Z)return"legacy";let $=new Set;MQ($Z(Z.module),$);let G=new Set;return MQ($Z(Z.instance),G),kQ(Z.module,[$])||kQ(Z.instance,[$,G])||kQ(Z.html,[$,G])?"runes":"legacy"}var W0=/[A-Za-z_$][\w$]*/g;function K0(Q,Z,$){let G=new Map,X=Z.typeParameters?.params,q=$.typeArguments?.params;if(!X?.length||!q?.length)return G;for(let W=0;W<X.length;W++){let K=X[W]?.name,Y=q[W];if(!K||Y?.start===void 0||Y?.end===void 0)continue;let O=A(Q,Y.start,Y.end)?.trim();if(O)G.set(K,O)}return G}function H0(Q,Z){if(Z.size===0)return Q;return Q.replace(W0,($)=>Z.get($)??$)}function UQ(Q,Z,$,G,X=new Set){let q=new Map;if(!$?.type)return q;let W=(K)=>{for(let Y of K){if(Y?.type!=="TSPropertySignature"||Y.computed)continue;if(!Y.key)continue;let O=Q.getPropertyName(Y.key);if(!O)continue;let L=Y.typeAnnotation?.start,J=Y.typeAnnotation?.end;if(L===void 0||J===void 0)continue;let j=A(Z,L+1,J)?.trim();if(!j)continue;q.set(O,{type:j,optional:Y.optional===!0,source:h(Z,Y)})}};switch($.type){case"TSTypeLiteral":W($.members??[]);break;case"TSInterfaceDeclaration":W($.body?.body??[]);break;case"TSTypeAliasDeclaration":{let K=UQ(Q,Z,$.typeAnnotation,G,X);for(let[Y,O]of K)q.set(Y,O);break}case"TSTypeReference":{let K=YZ($.typeName);if(!K||X.has(K))break;let Y=G.get(K);if(!Y)break;X.add(K);let O=UQ(Q,Z,Y,G,X);X.delete(K);let L=K0(Z,Y,$);for(let[J,j]of O)q.set(J,L.size===0?j:{...j,type:H0(j.type,L)});break}case"TSIntersectionType":for(let K of $.types??[]){let Y=UQ(Q,Z,K,G,X);for(let[O,L]of Y)q.set(O,L)}break;case"TSParenthesizedType":{let K=UQ(Q,Z,$.typeAnnotation,G,X);for(let[Y,O]of K)q.set(Y,O);break}}return q}function zZ(Q,Z,$){if(Z.runesPropsDeclarationMetadataByDeclaratorStart.clear(),Z.explicitPropTypesByName.clear(),Z.explicitVariableTypesByName.clear(),Z.typeImportBindingsByLocalName.clear(),Z.localTypeDeclarationsByName.clear(),Z.typedRunesPropsDeclarations.length=0,!Z.source)return;let G=$;Z.scriptLanguage=Q.resolveScriptLanguage(G),Z.customElementTag=G.options?.customElement?.tag,Z.runesOptionOverride=G.options?.runes,Z.scriptGenericsAttribute=Q.resolveScriptGenericsAttribute(G);let X=G.instance?.content?.body??[];for(let q of X){if(!q?.type)continue;if(q.type==="ImportDeclaration"&&q.source?.value)for(let W of q.specifiers??[]){let K=W.local?.name;if(!K)continue;if(!(q.importKind==="type"||W.importKind==="type"))continue;let O,L;if(W.type==="ImportSpecifier")O="named",L=W.imported?.type==="Identifier"?W.imported.name:typeof W.imported?.value==="string"?W.imported.value:void 0;else if(W.type==="ImportDefaultSpecifier")O="default";else if(W.type==="ImportNamespaceSpecifier")O="namespace";if(!O)continue;Z.typeImportBindingsByLocalName.set(K,{importedName:L,localName:K,source:String(q.source.value),specifierType:O})}if((q.type==="TSInterfaceDeclaration"||q.type==="TSTypeAliasDeclaration")&&q.id?.name&&q.start!==void 0&&q.end!==void 0)Z.localTypeDeclarationsByName.set(q.id.name,{code:A(Z,q.start,q.end)?.trim()??"",node:q,start:q.start});if(q.type==="ExportNamedDeclaration"&&q.declaration?.type==="VariableDeclaration")for(let W of q.declaration.declarations??[]){if(W.id?.type!=="Identifier"||!W.id.name)continue;let K=jQ(Z,W.id.typeAnnotation);if(K)Z.explicitPropTypesByName.set(W.id.name,K)}else if(q.type==="VariableDeclaration")for(let W of q.declarations??[]){if(W.id?.type!=="Identifier"||!W.id.name)continue;let K=jQ(Z,W.id.typeAnnotation);if(K)Z.explicitVariableTypesByName.set(W.id.name,K)}}for(let q of X){if(!q||typeof q!=="object"||!("declarations"in q))continue;for(let W of q.declarations??[]){if(!v(p(W.init),"$props"))continue;let K=W.id?.typeAnnotation?void 0:XZ(W.init),Y=W.id?.typeAnnotation?.typeAnnotation??K,O=W.id?.typeAnnotation?jQ(Z,W.id.typeAnnotation):WZ(Z,K),L=UQ(Q,Z,Y,new Map(Array.from(Z.localTypeDeclarationsByName.entries(),([T,f])=>[T,f.node]))),J=new Set,j=new Set;if(KZ(Z,Y,J,j),HZ(Z,J,j),W.start!==void 0){let T={canonicalType:O,props:L,referencedImportedTypes:J,referencedLocalTypes:j};if(Z.runesPropsDeclarationMetadataByDeclaratorStart.set(W.start,T),O)Z.typedRunesPropsDeclarations.push(T)}}}}function LZ(Q,Z,$){for(let G of $.declarations){if(!v(p(G.init),"$props"))continue;if(G.id.type==="Identifier"){Z.wholePropsLocals.add(G.id.name),Z.restPropLocals.add(G.id.name);let W=UZ(Z,G.start);if(W)for(let[K,Y]of W.props)GQ(Q,Z,K,{name:K,kind:"let",type:Y.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!Y.optional,constant:!1,reactive:!1,source:Y.source});continue}if(G.id.type!=="ObjectPattern")continue;let X=o(Z,Q,$),q=G.id.properties.filter((W)=>{if(W.type!=="Property"||W.computed)return!1;if(!Q.getPropertyName(W.key))return!1;if(W.value.type==="Identifier")return!0;return W.value.type==="AssignmentPattern"&&W.value.left.type==="Identifier"}).length;for(let W of G.id.properties){if(W.type==="RestElement"){if(W.argument.type==="Identifier")Z.restPropLocals.add(W.argument.name);continue}let K=Q.getPropertyName(W.key);if(!K)continue;let Y,O;if(W.value.type==="Identifier")Y=W.value.name;else{let B=W.value;Y=B.left.name,O=B.right}if(!Y)continue;if(Q.trackPropLocalName(K,Y),K==="children")Z.snippetPropLocals.add(Y);let L=OZ(Z,Q,W)??(q===1?X:void 0),J=qZ(Z,G.start,K),{init:j,bindable:T}=dQ(O),f=j==null?{isFunction:!1}:l(Q,Z,j),{value:e,type:QQ,isFunction:qQ,defaultValue:CQ}=f,RQ=J?.type===void 0&&L?.type===void 0?f.resolvedType:void 0;if(f.pendingCallDefault)Z.pendingCallDefaultCandidates.push({propName:K,location:"props",...f.pendingCallDefault});let{type:wQ,typeSource:YQ,description:WQ,params:KQ,returnType:U,isFunction:H}=XQ({explicitType:J?.type,typeSeed:QQ,inferredTypeForSource:QQ,jsdocType:L?.type,jsdocDescription:L?.description,jsdocParams:L?.params,jsdocReturnType:L?.returnType,resolvedType:RQ,resolvedDescription:f.resolvedDescription,resolvedParams:f.resolvedParams,resolvedReturnType:f.resolvedReturnType,initializerIsFunction:qQ,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(T)Z.reactive_vars.add(K);GQ(Q,Z,K,{name:K,...Y===K?{}:{localName:Y},kind:"let",description:WQ,binding:L?.binding,deprecated:L?.deprecated,tags:L?.tags,...T?{bindable:!0}:{},type:wQ,typeSource:YQ,value:e,defaultValue:CQ,params:KQ,returnType:U,isFunction:H,isFunctionDeclaration:!1,isRequired:j==null&&J?.optional!==!0,constant:!1,reactive:T,source:h(Z,W)})}}}function VZ(Q,Z){if(Q.syntaxMode!=="runes")return;for(let[$,G]of Array.from(Q.events.entries())){if(G.type!=="dispatched")continue;if(Z.has($)||Q.forwardedEvents.has($))continue;let X=`on${$}`,q=Q.props.get(X);if(!q)continue;let W=q.type!==void 0||q.params!==void 0||q.returnType!==void 0,K=G.detail===void 0||G.detail==="undefined"||G.detail==="null"?"() => void":`(detail: ${G.detail}) => void`;Q.props.set(X,{...q,description:q.description??G.description,type:W?q.type:K,typeSource:W?q.typeSource:"inferred",isFunction:!0}),Q.events.delete($)}}var JZ=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function FQ(Q){if(!Q||typeof Q!=="object")return;x(Q,{enter(Z){if(!JZ.has(Z.type))return;let $=Z.expression;while($&&JZ.has($.type))$=$.expression;if($)this.replace($)}})}function _Q(Q,Z){let $=Z.source?.value;if(typeof $!=="string"||Z.importKind==="type")return;for(let G of Z.specifiers??[]){if(G.type!=="ImportSpecifier"||G.importKind==="type")continue;let X=G.local?.name;if(!X)continue;let q=G.imported?.name??(typeof G.imported?.value==="string"?G.imported.value:X);Q.valueImportBindingsByLocalName.set(X,{localName:X,importedName:q,source:$})}}function CZ(Q,Z,$){let G=Z+1;while(G<Q.length){if(Q[G]==="\\"){G+=2;continue}if(Q[G]===$)return G+1;G++}return G}function RZ(Q,Z){let $=Z+1,G=0;while($<Q.length){let X=Q[$];if(X==="\\"){$+=2;continue}if(G===0){if(X==="`")return $+1;if(X==="$"&&Q[$+1]==="{"){G=1,$+=2;continue}$++;continue}if(X==="{")G++;else if(X==="}")G--;else if(X==='"'||X==="'"){$=CZ(Q,$,X);continue}else if(X==="`"){$=RZ(Q,$);continue}$++}return $}function O0(Q,Z){let $=[],G=Q.length,X=0;while(X<G){let q=Q[X];if(q==='"'||q==="'"){X=CZ(Q,X,q);continue}if(q==="`"){X=RZ(Q,X);continue}if(q==="/"&&Q[X+1]==="/"){let W=X+2;while(W<G&&Q[W]!==`
|
|
2
|
+
`)W++;X=W;continue}if(q==="/"&&Q[X+1]==="*"){let W=X,K=X+2;while(K<G&&!(Q[K]==="*"&&Q[K+1]==="/"))K++;let Y=Math.min(K+2,G),O=Q.slice(W,Y);$.push({end:Y+Z,isJsDoc:O.startsWith("/**")&&O.length>4,text:O}),X=Y;continue}X++}return $}function BZ(Q,Z,$){if(!Q||typeof Q!=="object"||!("type"in Q))return;let G=Q;if(G.type==="FunctionDeclaration"){if(G.id?.type==="Identifier"&&G.id.name)$.push({name:G.id.name,start:Z});return}if(G.type==="VariableDeclaration"){for(let X of G.declarations??[])if(X?.id?.type==="Identifier"&&X.id.name)$.push({name:X.id.name,start:Z})}}function z0(Q){let Z=[];for(let $ of Q){if(!$||typeof $!=="object"||!("type"in $))continue;let G=$;if(G.start===void 0)continue;if(G.type==="ExportNamedDeclaration"&&G.declaration)BZ(G.declaration,G.start,Z);else BZ(G,G.start,Z)}return Z}function L0(Q,Z,$){let G;for(let X of Q){if(X.end>Z)break;if(!X.isJsDoc)continue;if(!jZ.test($.slice(X.end,Z)))continue;G=X}return G}function wZ(Q,Z){let $=new Map;if(!Q.source)return $;let G=[Q.parsed?.module,Q.parsed?.instance],X=[],q=[];for(let W of G){let K=W?.content;if(!K?.body||K.start===void 0||K.end===void 0)continue;X.push(...O0(Q.source.slice(K.start,K.end),K.start)),q.push(...z0(K.body))}X.sort((W,K)=>W.end-K.end);for(let W of q){let K=L0(X,W.start,Q.source);if(!K)continue;let Y=MZ(K.text,{spacing:"preserve"}),{type:O,description:L}=FZ(Y);if(!O)continue;$.set(W.name,{type:Z.aliasType(O.type),description:L||O.description})}return $}function IZ(Q){if(Q==="var")return"let";if(Q==="using"||Q==="await using")return"const";return Q}var V0=null,AZ=/^@component/,J0=/\r/g,B0=/^\{\s*\}$/;class _{ctx=AQ();static mapToArray(Q){return Array.from(Q,([Z,$])=>$)}static getStaticAttributeValue(Q){if(!Array.isArray(Q.value))return;return Q.value.map((Z)=>Z.data??Z.raw??"").join("").trim()}resolveScriptLanguage(Q){let Z=[Q.instance,Q.module].filter((G)=>G!==void 0),$=!1;for(let G of Z){let X=G.attributes?.find((W)=>W.name==="lang");if(!X){$=!0;continue}if(_.getStaticAttributeValue(X)?.toLowerCase()==="ts")return"ts"}return $?"js":void 0}resolveScriptGenericsAttribute(Q){let Z=Q.instance?.attributes?.find((W)=>W.name==="generics");if(!Z)return;let $=h(this.ctx,Z),G=Q.instance?.attributes?.find((W)=>W.name==="lang");if((G?_.getStaticAttributeValue(G)?.toLowerCase():void 0)!=="ts"){m(this.ctx,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',$);return}let q=_.getStaticAttributeValue(Z);if(!q)return;return{value:q,source:$}}resolvePublicPropName(Q){return this.ctx.propLocalToPublicName.get(Q)??Q}trackPropLocalName(Q,Z=Q){this.ctx.propLocalToPublicName.set(Z,Q)}getPropByLocalOrPublic(Q){return this.ctx.props.get(this.resolvePublicPropName(Q))}getPropTypeByLocalOrPublic(Q){return this.getPropByLocalOrPublic(Q)?.type}getExplicitPropType(Q){return this.ctx.explicitPropTypesByName.get(Q)}getPropertyName(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return;if(s(Q))return Q.name;if(VQ(Q))return Q.value==null?void 0:String(Q.value);return}isNumericConstant(Q){if(!Q||typeof Q!=="object"||!("type"in Q))return!1;if(Q.type!=="MemberExpression")return!1;let Z=Q,$=Z.object&&"name"in Z.object?Z.object.name:void 0,G=Z.property&&"name"in Z.property?Z.property.name:void 0;if(!$||!G)return!1;if($==="Number")return["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"].includes(G);if($==="Math")return["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"].includes(G);return!1}resolveLocalVarJSDoc(Q){for(let $ of this.ctx.vars)if($.declarations.some((X)=>X.id&&typeof X.id==="object"&&("type"in X.id)&&X.id.type==="Identifier"&&("name"in X.id)&&X.id.name===Q))return o(this.ctx,this,$);let Z=this.ctx.funcDecls.get(Q);if(Z)return o(this.ctx,this,Z);return}addModuleExport(Q,Z){if(LQ(Q)===void 0)return;if(this.ctx.moduleExports.has(Q)){let $=this.ctx.moduleExports.get(Q);this.ctx.moduleExports.set(Q,{...$,...Z})}else this.ctx.moduleExports.set(Q,Z)}aliasType(Q){if(Q==="*")return"any";return Q.trim()}findVariableTypeAndDescription(Q){let Z=this.getPropByLocalOrPublic(Q);if(Z?.type)return{type:Z.type,description:Z.description};if(!this.ctx.variableInfoCacheBuilt)this.ctx.variableInfoCache=wZ(this.ctx,this),this.ctx.variableInfoCacheBuilt=!0;let $=this.ctx.variableInfoCache.get(Q),G=this.ctx.explicitVariableTypesByName.get(Q);if(G)return{type:G,description:$?.description};return $??null}accumulateGeneric(Q,Z){if(this.ctx.generics)this.ctx.generics=[`${this.ctx.generics[0]}, ${Q}`,`${this.ctx.generics[1]}, ${Z}`];else this.ctx.generics=[Q,Z]}cleanup(){this.ctx=AQ()}static SCRIPT_BLOCK_REGEX=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi;static TS_DIRECTIVE_REGEX=/\/\/\s*@ts-[^\n\r]*/g;static stripTypeScriptDirectivesFromScripts(Q){return _.SCRIPT_BLOCK_REGEX.lastIndex=0,Q.replace(_.SCRIPT_BLOCK_REGEX,(Z,$,G,X)=>{_.TS_DIRECTIVE_REGEX.lastIndex=0;let q=G.replace(_.TS_DIRECTIVE_REGEX,"");return $+q+X})}parseSvelteComponent(Q,Z){this.cleanup(),this.ctx.componentFilePath=Z.filePath;let $=_.stripTypeScriptDirectivesFromScripts(Q);this.ctx.source=$;let{modern:G,legacy:X}=NZ($);if(zZ(this,this.ctx,G),this.ctx.parsed=X,this.ctx.scriptLanguage==="ts")FQ(this.ctx.parsed.module),FQ(this.ctx.parsed.instance),FQ(this.ctx.parsed.html);this.ctx.syntaxMode=GZ(this.ctx);let q=this.ctx.parsed.css,W=q?.start!==void 0&&q?.end!==void 0?$.slice(0,q.start)+" ".repeat(q.end-q.start)+$.slice(q.end):$;if(fZ(this.ctx,this,W),this.ctx.parsed?.module)x(this.ctx.parsed?.module,{enter:(U)=>{if(U.type==="ImportDeclaration")_Q(this.ctx,U);if(U.type==="FunctionDeclaration"){let H=U;if(H.id?.name)this.ctx.funcDecls.set(H.id.name,H)}if(U.type==="VariableDeclaration")this.ctx.vars.add(U);if(U.type==="ExportNamedDeclaration"){if(U.declaration==null)return;if(!U.declaration||typeof U.declaration!=="object"||!("type"in U.declaration))return;let H,B,F=!1,z,V,C,w=!1,M,D,R;if(U.declaration.type==="FunctionDeclaration"){let N=U.declaration;if(!N.id?.name)return;H=N.id.name,B="function",z=void 0,V="() => any",w=!0,F=!0}else if(U.declaration.type==="VariableDeclaration"){let N=U.declaration,a=N.declarations[0];if(!a||typeof a!=="object"||!("id"in a))return;let{id:n,init:HQ}=a;if(!n||typeof n!=="object"||!("name"in n))return;let ZQ=n.name;H=ZQ,B=IZ(N.kind);let E=HQ==null?{isFunction:!1}:l(this,this.ctx,HQ);if({value:z,type:V,isFunction:w,defaultValue:M}=E,D=V,R=E,C=this.getExplicitPropType(ZQ),R.pendingCallDefault)this.ctx.pendingCallDefaultCandidates.push({propName:ZQ,location:"moduleExports",...R.pendingCallDefault})}else return;let S=o(this.ctx,this,U),{type:y,typeSource:d,description:I,params:b,returnType:g,isFunction:r}=XQ({explicitType:C,typeSeed:V,inferredTypeForSource:D,jsdocType:S?.type,jsdocDescription:S?.description,jsdocParams:S?.params,jsdocReturnType:S?.returnType,resolvedType:R?.resolvedType,resolvedDescription:R?.resolvedDescription,resolvedParams:R?.resolvedParams,resolvedReturnType:R?.resolvedReturnType,initializerIsFunction:w,isFunctionDeclaration:F,typedefs:this.ctx.typedefs});this.addModuleExport(H,{name:H,kind:B,description:I,deprecated:S?.deprecated,tags:S?.tags,type:y,typeSource:d,value:z,defaultValue:M,params:b,returnType:g,isFunction:r,isFunctionDeclaration:F,isRequired:!1,constant:B==="const",reactive:!1,source:h(this.ctx,U)})}}});let K,Y=new Set,O=new Set,L=[],J={type:"ComponentRoot",instance:this.ctx.parsed.instance,html:this.ctx.parsed.html};tQ(this,this.ctx),this.ctx.activeScopes.push(this.ctx.componentScope);let j=eQ(this.ctx);if(x(J,{enter:(U,H,B)=>{QZ(this,this.ctx,j,U);let F=this.ctx.scopeDeclarations.get(U);if(F)this.ctx.activeScopes.push(F);if(U.type==="AssignmentExpression")DQ(this.ctx,U.left);if(U.type==="UpdateExpression")DQ(this.ctx,U.argument);if(U.type==="CallExpression"){let z=U,V=z.callee&&typeof z.callee==="object"&&"name"in z.callee?z.callee.name:void 0;if(V==="createEventDispatcher"){if(H&&typeof H==="object"&&"id"in H&&H.id&&typeof H.id==="object"&&"name"in H.id)K=H.id.name}if(V==="$host"){if(H&&typeof H==="object"&&"id"in H&&H.id&&typeof H.id==="object"&&"name"in H.id)Y.add(H.id.name)}if(V==="setContext")oQ(this.ctx,this,U,H??void 0);if(V)L.push({name:V,arguments:z.arguments,source:h(this.ctx,z)});if(PZ(z.callee)&&s(z.callee.property)&&z.callee.property.name==="dispatchEvent"&&(v(z.callee.object,"$host")||s(z.callee.object)&&Y.has(z.callee.object.name))){let C=_Z(this.ctx,z);if(C)O.add(C)}}if(U&&typeof U==="object"&&"type"in U&&String(U.type)==="Spread"){let z=U;if(z.expression?.name==="$$restProps"||this.ctx.restPropLocals.has(z.expression?.name??""))rQ(this.ctx,H)}if(U.type==="FunctionDeclaration"){let z=U;if(z.id?.name)this.ctx.funcDecls.set(z.id.name,z)}if(U.type==="ImportDeclaration")_Q(this.ctx,U);if(U.type==="VariableDeclaration"){if(this.ctx.vars.add(U),H&&typeof H==="object"&&"type"in H&&H.type==="Program"&&U.declarations.some((z)=>v(p(z.init),"$props")))LZ(this,this.ctx,U)}if(U.type==="ExportNamedDeclaration"){if(U.declaration==null&&U.specifiers.length===0)return;let z;if(U.declaration==null&&U.specifiers[0]?.type==="ExportSpecifier"){let E=U.specifiers[0],c=E.local&&typeof E.local==="object"&&"name"in E.local?E.local.name:void 0,i=E.exported&&typeof E.exported==="object"&&"name"in E.exported?E.exported.name:void 0;if(!c||!i)return;let t;for(let $Q of Array.from(this.ctx.vars))if($Q.declarations.some((u)=>u.id&&typeof u.id==="object"&&("type"in u.id)&&u.id.type==="Identifier"&&u.id.name===c)){t=$Q;break}U.declaration=t,z=i}if(U.declaration==null)return;if(!U.declaration||typeof U.declaration!=="object"||!("type"in U.declaration))return;let V,C=!1,w,M,D,R=!1,S=!1,y,d,I,b;if(U.declaration.type==="FunctionDeclaration"){let E=U.declaration;if(!E.id?.name)return;z??=E.id.name,y=E.id.name,V="function",w=void 0,M="() => any",R=!0,C=!0,S=!1}else if(U.declaration.type==="VariableDeclaration"){let E=U.declaration,c=E.declarations[0];if(!c||typeof c!=="object"||!("id"in c))return;let{id:i,init:t}=c;if(i&&typeof i==="object"&&"name"in i){let u=i.name;y=u,z??=u,D=this.getExplicitPropType(u)}else return;V=IZ(E.kind),S=V==="let"&&t==null;let $Q=t==null?{isFunction:!1}:l(this,this.ctx,t);if({value:w,type:M,isFunction:R,defaultValue:d}=$Q,I=M,b=$Q,b.pendingCallDefault)this.ctx.pendingCallDefaultCandidates.push({propName:z,location:"props",...b.pendingCallDefault})}else return;let g=o(this.ctx,this,U),{type:r,typeSource:N,description:a,params:n,returnType:HQ,isFunction:ZQ}=XQ({explicitType:D,typeSeed:M,inferredTypeForSource:I,jsdocType:g?.type,jsdocDescription:g?.description,jsdocParams:g?.params,jsdocReturnType:g?.returnType,resolvedType:b?.resolvedType,resolvedDescription:b?.resolvedDescription,resolvedParams:b?.resolvedParams,resolvedReturnType:b?.resolvedReturnType,initializerIsFunction:R,isFunctionDeclaration:C,typedefs:this.ctx.typedefs});GQ(this,this.ctx,z,{name:z,...y!==void 0&&y!==z?{localName:y}:{},kind:V,description:a,binding:g?.binding,deprecated:g?.deprecated,tags:g?.tags,type:r,typeSource:N,value:w,defaultValue:d,params:n,returnType:HQ,isFunction:ZQ,isFunctionDeclaration:C,isRequired:S,constant:V==="const",reactive:this.ctx.reactive_vars.has(z),source:h(this.ctx,U)})}if(U&&typeof U==="object"&&"type"in U&&String(U.type)==="Comment"){let V=U?.data?.trim()??"";if(AZ.test(V))this.ctx.componentComment=V.replace(AZ,"").replace(J0,""),this.ctx.componentCommentSource=h(this.ctx,U)}if(U&&typeof U==="object"&&"type"in U&&String(U.type)==="Slot"){let z=U,V=z.attributes?.find((M)=>M.name==="name")?.value?.[0]?.data,C=(z.attributes||[]).filter((M)=>M.name!=="name").reduce((M,D)=>{let R={value:void 0,replace:!1},S=D.value;if(S===void 0)return M;if(S[0]){let y=S[0],{type:d,expression:I,raw:b,start:g,end:r}=y;if(d==="Text"&&b!==void 0)R.value=JSON.stringify(b);else if(d==="AttributeShorthand"&&I&&typeof I==="object"&&"name"in I)R.value=I.name,R.replace=!0;if(I&&typeof I==="object"&&"type"in I){if(I.type==="Literal"&&"value"in I){let N=I.value;R.value=typeof N==="string"?JSON.stringify(N):String(N)}else if(I.type==="MemberExpression")R.value=EZ(this.ctx,this,I);else if(I.type!=="Identifier"){if(g!==void 0&&r!==void 0){if(I.type==="ObjectExpression"||I.type==="TemplateLiteral")R.value=A(this.ctx,g+1,r-1)}}}}if(D.name)M[D.name]=R;return M},{}),w=z.children?.map(({start:M,end:D})=>{if(M===void 0||D===void 0)return"";return A(this.ctx,M,D)??""}).join("").trim();SQ(this.ctx,{slot_name:V,slot_props:C,slot_fallback:w,source:h(this.ctx,U)})}if(U&&typeof U==="object"&&"type"in U&&String(U.type)==="RenderTag"){let z=U,V=gZ(this.ctx,z.expression);if(V){let C;if(V.arguments.length===0)C={};else if(V.arguments.length===1&&typeof V.arguments[0]==="object"&&V.arguments[0]&&"type"in V.arguments[0]&&V.arguments[0].type==="ObjectExpression")C=bZ(this.ctx,this,V.arguments[0]);else if(V.arguments.length===1)m(this.ctx,"syntax-skipped",V.publicName,`{@render ${V.publicName}(...)} argument is not a plain object literal; the render call was not mapped to slot metadata.`,h(this.ctx,U));let w=V.publicName==="children"?void 0:V.publicName,M=w===void 0?V0:w;if(C!==void 0)SQ(this.ctx,{slot_name:w,slot_props:C,source:h(this.ctx,U)});if(C!==void 0||this.ctx.slots.has(M))this.ctx.snippetPropLocals.add(V.trackingName)}}if(U&&typeof U==="object"&&"type"in U&&String(U.type)==="EventHandler"){let z=U;if(z.expression==null&&z.name){if(H!=null&&typeof H==="object"&&"name"in H){let V=typeof H.name==="string"?H.name:void 0,C="type"in H?String(H.type):void 0;if(V&&C){let w=C==="InlineComponent"?{type:"InlineComponent",name:V}:{type:"Element",name:V};this.ctx.forwardedEvents.set(z.name,w);let M=this.ctx.events.get(z.name),D=this.ctx.eventDescriptions.get(z.name),R=M?.deprecated;if(!M)this.ctx.events.set(z.name,{type:"forwarded",name:z.name,element:w,description:D,deprecated:R,source:h(this.ctx,U)});else if(M.type==="forwarded"&&D&&!M.description)this.ctx.events.set(z.name,{...M,description:D,deprecated:M.deprecated??R,source:M.source||h(this.ctx,U)})}}}}if(H&&typeof H==="object"&&"type"in H&&(String(H.type)==="Element"||String(H.type)==="InlineComponent")&&U&&typeof U==="object"&&"type"in U&&String(U.type)==="Binding"){let z=U;if(z.expression?.name){let V=JQ(this.ctx,z.expression.name);if(V)this.ctx.reactive_vars.add(V)}if(String(H.type)==="Element"&&z.name==="this"&&z.expression?.name&&"name"in H&&typeof H.name==="string"){let V=JQ(this.ctx,z.expression.name);if(!V)return;let C=H.name;if(this.ctx.bindings.has(V)){let w=this.ctx.bindings.get(V);if(w&&!w.elements.includes(C))this.ctx.bindings.set(V,{...w,elements:[...w.elements,C]})}else this.ctx.bindings.set(V,{elements:[C]})}}},leave:(U)=>{if(this.ctx.scopeDeclarations.has(U))this.ctx.activeScopes.pop();ZZ(j,U)}}),K!==void 0){for(let U of L)if(U.name===K){let H=U.arguments[0],B=H&&typeof H==="object"&&"value"in H?H.value:void 0,F=U.arguments[1],z=F&&typeof F==="object"&&"value"in F?F.value:void 0;if(B!=null)kZ(this.ctx,{name:String(B),detail:z==null?"":DZ(z),has_argument:Boolean(F),source:U.source})}}let T=new Set(O);if(K!==void 0){for(let U of L)if(U.name===K){let H=U.arguments[0],B=H&&typeof H==="object"&&"value"in H?H.value:void 0;if(B!=null)T.add(String(B))}}this.ctx.forwardedEvents.forEach((U,H)=>{let B=this.ctx.events.get(H);if(B&&B.type==="dispatched"&&!T.has(H)){let F=this.ctx.eventDescriptions.get(H),z={type:"forwarded",name:H,element:U,description:F,deprecated:B.deprecated,tags:B.tags,source:B.source};if(B.detail!==void 0&&B.detail!=="undefined")z.detail=B.detail;this.ctx.events.set(H,z)}}),VZ(this.ctx,T);let f=this.ctx.syntaxMode==="runes"?new Set(Array.from(this.ctx.snippetPropLocals,(U)=>this.resolvePublicPropName(U))):new Set,e=_.mapToArray(this.ctx.props).filter((U)=>!f.has(U.name)).map((U)=>{if(this.ctx.bindings.has(U.name)){let H=this.ctx.bindings.get(U.name)?.elements.sort().map((B)=>fQ(B)).join(" | ");return{...U,type:`null | ${H}`,typeSource:"inferred",reactive:U.reactive||this.ctx.reactive_vars.has(U.name)}}return{...U,reactive:U.reactive||this.ctx.reactive_vars.has(U.name)}});this.ctx.activeScopes.length=0;let QQ=_.mapToArray(this.ctx.slots).map((U)=>{if(!U.slot_props)return U;if(typeof U.slot_props==="string")return B0.test(U.slot_props)?{...U,slot_props:"Record<string, never>"}:U;let H=U.slot_props,B=[];for(let z of Object.keys(H)){if(H[z].replace&&H[z].value!==void 0)H[z].value=this.getPropTypeByLocalOrPublic(H[z].value);if(H[z].value===void 0)H[z].value="any";B.push(`${z}: ${H[z].value}`)}let F=B.length===0?"Record<string, never>":B.length===1?`{ ${B[0]} }`:`{
|
|
3
|
+
${B.join(`;
|
|
4
|
+
`)};
|
|
5
|
+
}`;return{...U,slot_props:F}}).sort((U,H)=>{let B=U.name??"",F=H.name??"";if(B<F)return-1;if(B>F)return 1;return 0});if(this.ctx.deferredSlotBlockGenerics.length>0){let U=[...e.map((H)=>H.type??""),...QQ.map((H)=>H.slot_props??"")].join(`
|
|
6
|
+
`);for(let{name:H,constraint:B}of this.ctx.deferredSlotBlockGenerics){let F=H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${F}\\b`).test(U))continue;this.accumulateGeneric(H,B)}}if(this.ctx.scriptGenericsAttribute){if(this.ctx.generics)m(this.ctx,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',this.ctx.scriptGenericsAttribute.source);this.ctx.generics=TZ(this.ctx.scriptGenericsAttribute.value)}let qQ=_.mapToArray(this.ctx.moduleExports),CQ=_.mapToArray(this.ctx.events).map((U)=>{switch(U.type){case"forwarded":return{...U,element:U.element.name};case"dispatched":return U;default:return U}}).sort((U,H)=>{let B=U.name.localeCompare(H.name);if(B!==0)return B;let F=U.type.localeCompare(H.type);if(F!==0)return F;if(U.type==="forwarded"&&H.type==="forwarded"){let z=U.element.localeCompare(H.element);if(z!==0)return z}return(U.detail??"").localeCompare(H.detail??"")}),RQ=_.mapToArray(this.ctx.typedefs),wQ=_.mapToArray(this.ctx.contexts),YQ={props:new Map(this.ctx.pendingCallDefaultCandidates.filter((U)=>U.location==="props").map((U)=>[U.propName,U])),moduleExports:new Map(this.ctx.pendingCallDefaultCandidates.filter((U)=>U.location==="moduleExports").map((U)=>[U.propName,U]))};for(let U of e)if(U.typeSource==="unknown"){let H=YQ.props.get(U.name);if(H)U.type="any";let B=H?H.importSource?`Prop "${U.name}" default calls "${H.calleeName}()" imported from "${H.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${U.name}" default calls "${H.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${U.name}" type could not be inferred; falling back to "${U.type??"any"}".`;m(this.ctx,"prop-unknown-type",U.name,B,U.source)}for(let U of qQ)if(U.typeSource==="unknown"&&YQ.moduleExports.has(U.name))U.type="any";for(let U of this.ctx.jsDocEventNames){if(T.has(U))continue;if(this.ctx.forwardedEvents.has(U))continue;if(this.ctx.props.has(`on${U}`))continue;m(this.ctx,"event-no-source",U,`@event "${U}" has no matching dispatch or callback prop.`,this.ctx.jsDocEventSources.get(U))}let WQ={source:hZ(this.ctx,0,this.ctx.source?.length),syntaxMode:this.ctx.syntaxMode,...this.ctx.scriptLanguage?{scriptLanguage:this.ctx.scriptLanguage}:{},props:e,moduleExports:qQ,slots:QQ,events:CQ,typedefs:RQ,generics:this.ctx.generics,rest_props:this.ctx.rest_props,extends:this.ctx.extends,componentComment:this.ctx.componentComment,componentCommentSource:this.ctx.componentCommentSource,contexts:wQ,customElementTag:this.ctx.customElementTag,diagnostics:this.ctx.diagnosticRecords.slice()},KQ=SZ(this.ctx);if(KQ)WQ[TQ]=KQ;return WQ}}
|
|
7
|
+
export{_ as t};
|