likec4 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__app__/src/lib/webcomponent.mjs +1275 -1896
- package/dist/__app__/src/{main-DtZ0eEaw.js → main-yVRq2dIl.js} +1281 -1905
- package/dist/__app__/src/main.js +1 -1
- package/dist/__app__/src/{view._viewId.d2.lazy-C8c-Acn5.js → view._viewId.d2.lazy-CaQPy48H.js} +2 -2
- package/dist/__app__/src/{view._viewId.dot.lazy-BpvEbzHq.js → view._viewId.dot.lazy-6H3L1GpV.js} +2 -2
- package/dist/__app__/src/{view._viewId.mmd.lazy-Bq7RWCKh.js → view._viewId.mmd.lazy-By6xPESQ.js} +2 -2
- package/dist/__app__/src/{view._viewId.react-legacy.lazy-D-bQPgIi.js → view._viewId.react-legacy.lazy-Cxs6F284.js} +901 -1299
- package/dist/__app__/src/{view_viewId_.css-BFbcQw78.js → view_viewId_.css-LQsQcFpp.js} +5 -9
- package/dist/cli/index.mjs +11 -11
- package/package.json +22 -16
- package/react/LikeC4Browser.d.ts +0 -1
- package/react/LikeC4ViewElement.d.ts +0 -1
- package/react/index.mjs +164 -295
- package/react/styles.d.ts +1 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -101,11 +101,11 @@ ${JSON.stringify(F,null,4)}`);let z=F;if(Er.string(z.id)||Er.number(z.id)){let r
|
|
|
101
101
|
`,"\r"];var ST;(function(D){function S(O,K,je,Ar){return new OU(O,K,je,Ar)}D.create=S;function T(O){var K=O;return!!(B.defined(K)&&B.string(K.uri)&&(B.undefined(K.languageId)||B.string(K.languageId))&&B.uinteger(K.lineCount)&&B.func(K.getText)&&B.func(K.positionAt)&&B.func(K.offsetAt))}D.is=T;function w(O,K){for(var je=O.getText(),Ar=h(K,function(cc,Wm){var RT=cc.range.start.line-Wm.range.start.line;return RT===0?cc.range.start.character-Wm.range.start.character:RT}),jt=je.length,Xi=Ar.length-1;Xi>=0;Xi--){var Ji=Ar[Xi],Yo=O.offsetAt(Ji.range.start),st=O.offsetAt(Ji.range.end);if(st<=jt)je=je.substring(0,Yo)+Ji.newText+je.substring(st,je.length);else throw new Error("Overlapping edit");jt=Yo}return je}D.applyEdits=w;function h(O,K){if(O.length<=1)return O;var je=O.length/2|0,Ar=O.slice(0,je),jt=O.slice(je);h(Ar,K),h(jt,K);for(var Xi=0,Ji=0,Yo=0;Xi<Ar.length&&Ji<jt.length;){var st=K(Ar[Xi],jt[Ji]);st<=0?O[Yo++]=Ar[Xi++]:O[Yo++]=jt[Ji++]}for(;Xi<Ar.length;)O[Yo++]=Ar[Xi++];for(;Ji<jt.length;)O[Yo++]=jt[Ji++];return O}})(ST||(e.TextDocument=ST={}));var OU=function(){function D(S,T,w,h){this._uri=S,this._languageId=T,this._version=w,this._content=h,this._lineOffsets=void 0}return Object.defineProperty(D.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),D.prototype.getText=function(S){if(S){var T=this.offsetAt(S.start),w=this.offsetAt(S.end);return this._content.substring(T,w)}return this._content},D.prototype.update=function(S,T){this._content=S.text,this._version=T,this._lineOffsets=void 0},D.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var S=[],T=this._content,w=!0,h=0;h<T.length;h++){w&&(S.push(h),w=!1);var O=T.charAt(h);w=O==="\r"||O===`
|
|
102
102
|
`,O==="\r"&&h+1<T.length&&T.charAt(h+1)===`
|
|
103
103
|
`&&h++}w&&T.length>0&&S.push(T.length),this._lineOffsets=S}return this._lineOffsets},D.prototype.positionAt=function(S){S=Math.max(Math.min(S,this._content.length),0);var T=this.getLineOffsets(),w=0,h=T.length;if(h===0)return s.create(0,S);for(;w<h;){var O=Math.floor((w+h)/2);T[O]>S?h=O:w=O+1}var K=w-1;return s.create(K,S-T[K])},D.prototype.offsetAt=function(S){var T=this.getLineOffsets();if(S.line>=T.length)return this._content.length;if(S.line<0)return 0;var w=T[S.line],h=S.line+1<T.length?T[S.line+1]:this._content.length;return Math.max(Math.min(w+S.character,h),w)},Object.defineProperty(D.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),D}(),B;(function(D){var S=Object.prototype.toString;function T(st){return typeof st<"u"}D.defined=T;function w(st){return typeof st>"u"}D.undefined=w;function h(st){return st===!0||st===!1}D.boolean=h;function O(st){return S.call(st)==="[object String]"}D.string=O;function K(st){return S.call(st)==="[object Number]"}D.number=K;function je(st,cc,Wm){return S.call(st)==="[object Number]"&&cc<=st&&st<=Wm}D.numberRange=je;function Ar(st){return S.call(st)==="[object Number]"&&-2147483648<=st&&st<=2147483647}D.integer=Ar;function jt(st){return S.call(st)==="[object Number]"&&0<=st&&st<=2147483647}D.uinteger=jt;function Xi(st){return S.call(st)==="[object Function]"}D.func=Xi;function Ji(st){return st!==null&&typeof st=="object"}D.objectLiteral=Ji;function Yo(st,cc){return Array.isArray(st)&&st.every(cc)}D.typedArray=Yo})(B||(B={}))})});var pr=X(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.ProtocolNotificationType=ri.ProtocolNotificationType0=ri.ProtocolRequestType=ri.ProtocolRequestType0=ri.RegistrationType=ri.MessageDirection=void 0;var Vl=ju(),zB;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(zB||(ri.MessageDirection=zB={}));var j1=class{constructor(e){this.method=e}};ri.RegistrationType=j1;var V1=class extends Vl.RequestType0{constructor(e){super(e)}};ri.ProtocolRequestType0=V1;var q1=class extends Vl.RequestType{constructor(e){super(e,Vl.ParameterStructures.byName)}};ri.ProtocolRequestType=q1;var U1=class extends Vl.NotificationType0{constructor(e){super(e)}};ri.ProtocolNotificationType0=U1;var G1=class extends Vl.NotificationType{constructor(e){super(e,Vl.ParameterStructures.byName)}};ri.ProtocolNotificationType=G1});var ty=X(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.objectLiteral=Hr.typedArray=Hr.stringArray=Hr.array=Hr.func=Hr.error=Hr.number=Hr.string=Hr.boolean=void 0;function qne(t){return t===!0||t===!1}Hr.boolean=qne;function KB(t){return typeof t=="string"||t instanceof String}Hr.string=KB;function Une(t){return typeof t=="number"||t instanceof Number}Hr.number=Une;function Gne(t){return t instanceof Error}Hr.error=Gne;function Wne(t){return typeof t=="function"}Hr.func=Wne;function YB(t){return Array.isArray(t)}Hr.array=YB;function Hne(t){return YB(t)&&t.every(e=>KB(e))}Hr.stringArray=Hne;function zne(t,e){return Array.isArray(t)&&t.every(e)}Hr.typedArray=zne;function Kne(t){return t!==null&&typeof t=="object"}Hr.objectLiteral=Kne});var QB=X(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.ImplementationRequest=void 0;var XB=pr(),JB;(function(t){t.method="textDocument/implementation",t.messageDirection=XB.MessageDirection.clientToServer,t.type=new XB.ProtocolRequestType(t.method)})(JB||(ry.ImplementationRequest=JB={}))});var t3=X(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.TypeDefinitionRequest=void 0;var ZB=pr(),e3;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=ZB.MessageDirection.clientToServer,t.type=new ZB.ProtocolRequestType(t.method)})(e3||(ny.TypeDefinitionRequest=e3={}))});var i3=X(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.DidChangeWorkspaceFoldersNotification=ql.WorkspaceFoldersRequest=void 0;var iy=pr(),r3;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=iy.MessageDirection.serverToClient,t.type=new iy.ProtocolRequestType0(t.method)})(r3||(ql.WorkspaceFoldersRequest=r3={}));var n3;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=iy.MessageDirection.clientToServer,t.type=new iy.ProtocolNotificationType(t.method)})(n3||(ql.DidChangeWorkspaceFoldersNotification=n3={}))});var a3=X(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.ConfigurationRequest=void 0;var o3=pr(),s3;(function(t){t.method="workspace/configuration",t.messageDirection=o3.MessageDirection.serverToClient,t.type=new o3.ProtocolRequestType(t.method)})(s3||(oy.ConfigurationRequest=s3={}))});var l3=X(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ColorPresentationRequest=Ul.DocumentColorRequest=void 0;var sy=pr(),u3;(function(t){t.method="textDocument/documentColor",t.messageDirection=sy.MessageDirection.clientToServer,t.type=new sy.ProtocolRequestType(t.method)})(u3||(Ul.DocumentColorRequest=u3={}));var c3;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=sy.MessageDirection.clientToServer,t.type=new sy.ProtocolRequestType(t.method)})(c3||(Ul.ColorPresentationRequest=c3={}))});var p3=X(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.FoldingRangeRefreshRequest=Gl.FoldingRangeRequest=void 0;var ay=pr(),f3;(function(t){t.method="textDocument/foldingRange",t.messageDirection=ay.MessageDirection.clientToServer,t.type=new ay.ProtocolRequestType(t.method)})(f3||(Gl.FoldingRangeRequest=f3={}));var d3;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=ay.MessageDirection.serverToClient,t.type=new ay.ProtocolRequestType0(t.method)})(d3||(Gl.FoldingRangeRefreshRequest=d3={}))});var g3=X(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.DeclarationRequest=void 0;var m3=pr(),h3;(function(t){t.method="textDocument/declaration",t.messageDirection=m3.MessageDirection.clientToServer,t.type=new m3.ProtocolRequestType(t.method)})(h3||(uy.DeclarationRequest=h3={}))});var E3=X(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.SelectionRangeRequest=void 0;var D3=pr(),y3;(function(t){t.method="textDocument/selectionRange",t.messageDirection=D3.MessageDirection.clientToServer,t.type=new D3.ProtocolRequestType(t.method)})(y3||(cy.SelectionRangeRequest=y3={}))});var v3=X(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.WorkDoneProgressCancelNotification=Aa.WorkDoneProgressCreateRequest=Aa.WorkDoneProgress=void 0;var Yne=ju(),ly=pr(),C3;(function(t){t.type=new Yne.ProgressType;function e(r){return r===t.type}t.is=e})(C3||(Aa.WorkDoneProgress=C3={}));var x3;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ly.MessageDirection.serverToClient,t.type=new ly.ProtocolRequestType(t.method)})(x3||(Aa.WorkDoneProgressCreateRequest=x3={}));var A3;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ly.MessageDirection.clientToServer,t.type=new ly.ProtocolNotificationType(t.method)})(A3||(Aa.WorkDoneProgressCancelNotification=A3={}))});var S3=X(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.CallHierarchyOutgoingCallsRequest=va.CallHierarchyIncomingCallsRequest=va.CallHierarchyPrepareRequest=void 0;var Wl=pr(),w3;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Wl.MessageDirection.clientToServer,t.type=new Wl.ProtocolRequestType(t.method)})(w3||(va.CallHierarchyPrepareRequest=w3={}));var b3;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Wl.MessageDirection.clientToServer,t.type=new Wl.ProtocolRequestType(t.method)})(b3||(va.CallHierarchyIncomingCallsRequest=b3={}));var F3;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Wl.MessageDirection.clientToServer,t.type=new Wl.ProtocolRequestType(t.method)})(F3||(va.CallHierarchyOutgoingCallsRequest=F3={}))});var I3=X(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.SemanticTokensRefreshRequest=ni.SemanticTokensRangeRequest=ni.SemanticTokensDeltaRequest=ni.SemanticTokensRequest=ni.SemanticTokensRegistrationType=ni.TokenFormat=void 0;var xs=pr(),R3;(function(t){t.Relative="relative"})(R3||(ni.TokenFormat=R3={}));var Pp;(function(t){t.method="textDocument/semanticTokens",t.type=new xs.RegistrationType(t.method)})(Pp||(ni.SemanticTokensRegistrationType=Pp={}));var T3;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=xs.MessageDirection.clientToServer,t.type=new xs.ProtocolRequestType(t.method),t.registrationMethod=Pp.method})(T3||(ni.SemanticTokensRequest=T3={}));var _3;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=xs.MessageDirection.clientToServer,t.type=new xs.ProtocolRequestType(t.method),t.registrationMethod=Pp.method})(_3||(ni.SemanticTokensDeltaRequest=_3={}));var k3;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=xs.MessageDirection.clientToServer,t.type=new xs.ProtocolRequestType(t.method),t.registrationMethod=Pp.method})(k3||(ni.SemanticTokensRangeRequest=k3={}));var P3;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=xs.MessageDirection.serverToClient,t.type=new xs.ProtocolRequestType0(t.method)})(P3||(ni.SemanticTokensRefreshRequest=P3={}))});var O3=X(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.ShowDocumentRequest=void 0;var L3=pr(),N3;(function(t){t.method="window/showDocument",t.messageDirection=L3.MessageDirection.serverToClient,t.type=new L3.ProtocolRequestType(t.method)})(N3||(fy.ShowDocumentRequest=N3={}))});var M3=X(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.LinkedEditingRangeRequest=void 0;var B3=pr(),$3;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=B3.MessageDirection.clientToServer,t.type=new B3.ProtocolRequestType(t.method)})($3||(dy.LinkedEditingRangeRequest=$3={}))});var z3=X(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.WillDeleteFilesRequest=Pn.DidDeleteFilesNotification=Pn.DidRenameFilesNotification=Pn.WillRenameFilesRequest=Pn.DidCreateFilesNotification=Pn.WillCreateFilesRequest=Pn.FileOperationPatternKind=void 0;var Mi=pr(),j3;(function(t){t.file="file",t.folder="folder"})(j3||(Pn.FileOperationPatternKind=j3={}));var V3;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolRequestType(t.method)})(V3||(Pn.WillCreateFilesRequest=V3={}));var q3;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolNotificationType(t.method)})(q3||(Pn.DidCreateFilesNotification=q3={}));var U3;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolRequestType(t.method)})(U3||(Pn.WillRenameFilesRequest=U3={}));var G3;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolNotificationType(t.method)})(G3||(Pn.DidRenameFilesNotification=G3={}));var W3;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolNotificationType(t.method)})(W3||(Pn.DidDeleteFilesNotification=W3={}));var H3;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Mi.MessageDirection.clientToServer,t.type=new Mi.ProtocolRequestType(t.method)})(H3||(Pn.WillDeleteFilesRequest=H3={}))});var Q3=X(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.MonikerRequest=wa.MonikerKind=wa.UniquenessLevel=void 0;var K3=pr(),Y3;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Y3||(wa.UniquenessLevel=Y3={}));var X3;(function(t){t.$import="import",t.$export="export",t.local="local"})(X3||(wa.MonikerKind=X3={}));var J3;(function(t){t.method="textDocument/moniker",t.messageDirection=K3.MessageDirection.clientToServer,t.type=new K3.ProtocolRequestType(t.method)})(J3||(wa.MonikerRequest=J3={}))});var r$=X(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.TypeHierarchySubtypesRequest=ba.TypeHierarchySupertypesRequest=ba.TypeHierarchyPrepareRequest=void 0;var Hl=pr(),Z3;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType(t.method)})(Z3||(ba.TypeHierarchyPrepareRequest=Z3={}));var e$;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType(t.method)})(e$||(ba.TypeHierarchySupertypesRequest=e$={}));var t$;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Hl.MessageDirection.clientToServer,t.type=new Hl.ProtocolRequestType(t.method)})(t$||(ba.TypeHierarchySubtypesRequest=t$={}))});var o$=X(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.InlineValueRefreshRequest=zl.InlineValueRequest=void 0;var py=pr(),n$;(function(t){t.method="textDocument/inlineValue",t.messageDirection=py.MessageDirection.clientToServer,t.type=new py.ProtocolRequestType(t.method)})(n$||(zl.InlineValueRequest=n$={}));var i$;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=py.MessageDirection.serverToClient,t.type=new py.ProtocolRequestType0(t.method)})(i$||(zl.InlineValueRefreshRequest=i$={}))});var c$=X(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.InlayHintRefreshRequest=Fa.InlayHintResolveRequest=Fa.InlayHintRequest=void 0;var Kl=pr(),s$;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Kl.MessageDirection.clientToServer,t.type=new Kl.ProtocolRequestType(t.method)})(s$||(Fa.InlayHintRequest=s$={}));var a$;(function(t){t.method="inlayHint/resolve",t.messageDirection=Kl.MessageDirection.clientToServer,t.type=new Kl.ProtocolRequestType(t.method)})(a$||(Fa.InlayHintResolveRequest=a$={}));var u$;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Kl.MessageDirection.serverToClient,t.type=new Kl.ProtocolRequestType0(t.method)})(u$||(Fa.InlayHintRefreshRequest=u$={}))});var g$=X(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.DiagnosticRefreshRequest=ji.WorkspaceDiagnosticRequest=ji.DocumentDiagnosticRequest=ji.DocumentDiagnosticReportKind=ji.DiagnosticServerCancellationData=void 0;var h$=ju(),Xne=ty(),Yl=pr(),l$;(function(t){function e(r){let n=r;return n&&Xne.boolean(n.retriggerRequest)}t.is=e})(l$||(ji.DiagnosticServerCancellationData=l$={}));var f$;(function(t){t.Full="full",t.Unchanged="unchanged"})(f$||(ji.DocumentDiagnosticReportKind=f$={}));var d$;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Yl.MessageDirection.clientToServer,t.type=new Yl.ProtocolRequestType(t.method),t.partialResult=new h$.ProgressType})(d$||(ji.DocumentDiagnosticRequest=d$={}));var p$;(function(t){t.method="workspace/diagnostic",t.messageDirection=Yl.MessageDirection.clientToServer,t.type=new Yl.ProtocolRequestType(t.method),t.partialResult=new h$.ProgressType})(p$||(ji.WorkspaceDiagnosticRequest=p$={}));var m$;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Yl.MessageDirection.serverToClient,t.type=new Yl.ProtocolRequestType0(t.method)})(m$||(ji.DiagnosticRefreshRequest=m$={}))});var v$=X(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.DidCloseNotebookDocumentNotification=Rr.DidSaveNotebookDocumentNotification=Rr.DidChangeNotebookDocumentNotification=Rr.NotebookCellArrayChange=Rr.DidOpenNotebookDocumentNotification=Rr.NotebookDocumentSyncRegistrationType=Rr.NotebookDocument=Rr.NotebookCell=Rr.ExecutionSummary=Rr.NotebookCellKind=void 0;var Ip=ey(),lo=ty(),Vo=pr(),W1;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(W1||(Rr.NotebookCellKind=W1={}));var H1;(function(t){function e(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}t.create=e;function r(i){let o=i;return lo.objectLiteral(o)&&Ip.uinteger.is(o.executionOrder)&&(o.success===void 0||lo.boolean(o.success))}t.is=r;function n(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}t.equals=n})(H1||(Rr.ExecutionSummary=H1={}));var my;(function(t){function e(o,s){return{kind:o,document:s}}t.create=e;function r(o){let s=o;return lo.objectLiteral(s)&&W1.is(s.kind)&&Ip.DocumentUri.is(s.document)&&(s.metadata===void 0||lo.objectLiteral(s.metadata))}t.is=r;function n(o,s){let a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!H1.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let a=Array.isArray(o),u=Array.isArray(s);if(a!==u)return!1;if(a&&u){if(o.length!==s.length)return!1;for(let c=0;c<o.length;c++)if(!i(o[c],s[c]))return!1}if(lo.objectLiteral(o)&&lo.objectLiteral(s)){let c=Object.keys(o),l=Object.keys(s);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let f=0;f<c.length;f++){let d=c[f];if(!i(o[d],s[d]))return!1}}return!0}})(my||(Rr.NotebookCell=my={}));var D$;(function(t){function e(n,i,o,s){return{uri:n,notebookType:i,version:o,cells:s}}t.create=e;function r(n){let i=n;return lo.objectLiteral(i)&&lo.string(i.uri)&&Ip.integer.is(i.version)&&lo.typedArray(i.cells,my.is)}t.is=r})(D$||(Rr.NotebookDocument=D$={}));var Xl;(function(t){t.method="notebookDocument/sync",t.messageDirection=Vo.MessageDirection.clientToServer,t.type=new Vo.RegistrationType(t.method)})(Xl||(Rr.NotebookDocumentSyncRegistrationType=Xl={}));var y$;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Vo.MessageDirection.clientToServer,t.type=new Vo.ProtocolNotificationType(t.method),t.registrationMethod=Xl.method})(y$||(Rr.DidOpenNotebookDocumentNotification=y$={}));var E$;(function(t){function e(n){let i=n;return lo.objectLiteral(i)&&Ip.uinteger.is(i.start)&&Ip.uinteger.is(i.deleteCount)&&(i.cells===void 0||lo.typedArray(i.cells,my.is))}t.is=e;function r(n,i,o){let s={start:n,deleteCount:i};return o!==void 0&&(s.cells=o),s}t.create=r})(E$||(Rr.NotebookCellArrayChange=E$={}));var C$;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Vo.MessageDirection.clientToServer,t.type=new Vo.ProtocolNotificationType(t.method),t.registrationMethod=Xl.method})(C$||(Rr.DidChangeNotebookDocumentNotification=C$={}));var x$;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Vo.MessageDirection.clientToServer,t.type=new Vo.ProtocolNotificationType(t.method),t.registrationMethod=Xl.method})(x$||(Rr.DidSaveNotebookDocumentNotification=x$={}));var A$;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Vo.MessageDirection.clientToServer,t.type=new Vo.ProtocolNotificationType(t.method),t.registrationMethod=Xl.method})(A$||(Rr.DidCloseNotebookDocumentNotification=A$={}))});var F$=X(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.InlineCompletionRequest=void 0;var w$=pr(),b$;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=w$.MessageDirection.clientToServer,t.type=new w$.ProtocolRequestType(t.method)})(b$||(hy.InlineCompletionRequest=b$={}))});var M4=X(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var te=pr(),S$=ey(),hn=ty(),Jne=QB();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return Jne.ImplementationRequest}});var Qne=t3();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return Qne.TypeDefinitionRequest}});var N4=i3();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return N4.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return N4.DidChangeWorkspaceFoldersNotification}});var Zne=a3();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return Zne.ConfigurationRequest}});var O4=l3();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return O4.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return O4.ColorPresentationRequest}});var B4=p3();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return B4.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return B4.FoldingRangeRefreshRequest}});var eie=g3();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return eie.DeclarationRequest}});var tie=E3();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return tie.SelectionRangeRequest}});var J1=v3();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return J1.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return J1.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return J1.WorkDoneProgressCancelNotification}});var Q1=S3();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Q1.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Q1.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Q1.CallHierarchyPrepareRequest}});var Jl=I3();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return Jl.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return Jl.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Jl.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Jl.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Jl.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Jl.SemanticTokensRegistrationType}});var rie=O3();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return rie.ShowDocumentRequest}});var nie=M3();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return nie.LinkedEditingRangeRequest}});var Vu=z3();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return Vu.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Vu.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Vu.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Vu.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Vu.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Vu.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Vu.WillDeleteFilesRequest}});var Z1=Q3();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Z1.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Z1.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Z1.MonikerRequest}});var eb=r$();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return eb.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return eb.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return eb.TypeHierarchySupertypesRequest}});var $4=o$();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return $4.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return $4.InlineValueRefreshRequest}});var tb=c$();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return tb.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return tb.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return tb.InlayHintRefreshRequest}});var Lp=g$();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Lp.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Lp.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Lp.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Lp.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Lp.DiagnosticRefreshRequest}});var qo=v$();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return qo.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return qo.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return qo.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return qo.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return qo.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return qo.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidCloseNotebookDocumentNotification}});var iie=F$();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return iie.InlineCompletionRequest}});var z1;(function(t){function e(r){let n=r;return hn.string(n)||hn.string(n.language)||hn.string(n.scheme)||hn.string(n.pattern)}t.is=e})(z1||(b.TextDocumentFilter=z1={}));var K1;(function(t){function e(r){let n=r;return hn.objectLiteral(n)&&(hn.string(n.notebookType)||hn.string(n.scheme)||hn.string(n.pattern))}t.is=e})(K1||(b.NotebookDocumentFilter=K1={}));var Y1;(function(t){function e(r){let n=r;return hn.objectLiteral(n)&&(hn.string(n.notebook)||K1.is(n.notebook))&&(n.language===void 0||hn.string(n.language))}t.is=e})(Y1||(b.NotebookCellTextDocumentFilter=Y1={}));var X1;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!hn.string(n)&&!z1.is(n)&&!Y1.is(n))return!1;return!0}t.is=e})(X1||(b.DocumentSelector=X1={}));var R$;(function(t){t.method="client/registerCapability",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolRequestType(t.method)})(R$||(b.RegistrationRequest=R$={}));var T$;(function(t){t.method="client/unregisterCapability",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolRequestType(t.method)})(T$||(b.UnregistrationRequest=T$={}));var _$;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(_$||(b.ResourceOperationKind=_$={}));var k$;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(k$||(b.FailureHandlingKind=k$={}));var P$;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(P$||(b.PositionEncodingKind=P$={}));var I$;(function(t){function e(r){let n=r;return n&&hn.string(n.id)&&n.id.length>0}t.hasId=e})(I$||(b.StaticRegistrationOptions=I$={}));var L$;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||X1.is(n.documentSelector))}t.is=e})(L$||(b.TextDocumentRegistrationOptions=L$={}));var N$;(function(t){function e(n){let i=n;return hn.objectLiteral(i)&&(i.workDoneProgress===void 0||hn.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&hn.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(N$||(b.WorkDoneProgressOptions=N$={}));var O$;(function(t){t.method="initialize",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(O$||(b.InitializeRequest=O$={}));var B$;(function(t){t.unknownProtocolVersion=1})(B$||(b.InitializeErrorCodes=B$={}));var $$;(function(t){t.method="initialized",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})($$||(b.InitializedNotification=$$={}));var M$;(function(t){t.method="shutdown",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType0(t.method)})(M$||(b.ShutdownRequest=M$={}));var j$;(function(t){t.method="exit",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType0(t.method)})(j$||(b.ExitNotification=j$={}));var V$;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(V$||(b.DidChangeConfigurationNotification=V$={}));var q$;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(q$||(b.MessageType=q$={}));var U$;(function(t){t.method="window/showMessage",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolNotificationType(t.method)})(U$||(b.ShowMessageNotification=U$={}));var G$;(function(t){t.method="window/showMessageRequest",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolRequestType(t.method)})(G$||(b.ShowMessageRequest=G$={}));var W$;(function(t){t.method="window/logMessage",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolNotificationType(t.method)})(W$||(b.LogMessageNotification=W$={}));var H$;(function(t){t.method="telemetry/event",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolNotificationType(t.method)})(H$||(b.TelemetryEventNotification=H$={}));var z$;(function(t){t.None=0,t.Full=1,t.Incremental=2})(z$||(b.TextDocumentSyncKind=z$={}));var K$;(function(t){t.method="textDocument/didOpen",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(K$||(b.DidOpenTextDocumentNotification=K$={}));var Y$;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Y$||(b.TextDocumentContentChangeEvent=Y$={}));var X$;(function(t){t.method="textDocument/didChange",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(X$||(b.DidChangeTextDocumentNotification=X$={}));var J$;(function(t){t.method="textDocument/didClose",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(J$||(b.DidCloseTextDocumentNotification=J$={}));var Q$;(function(t){t.method="textDocument/didSave",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(Q$||(b.DidSaveTextDocumentNotification=Q$={}));var Z$;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Z$||(b.TextDocumentSaveReason=Z$={}));var e4;(function(t){t.method="textDocument/willSave",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(e4||(b.WillSaveTextDocumentNotification=e4={}));var t4;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(t4||(b.WillSaveTextDocumentWaitUntilRequest=t4={}));var r4;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolNotificationType(t.method)})(r4||(b.DidChangeWatchedFilesNotification=r4={}));var n4;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(n4||(b.FileChangeType=n4={}));var i4;(function(t){function e(r){let n=r;return hn.objectLiteral(n)&&(S$.URI.is(n.baseUri)||S$.WorkspaceFolder.is(n.baseUri))&&hn.string(n.pattern)}t.is=e})(i4||(b.RelativePattern=i4={}));var o4;(function(t){t.Create=1,t.Change=2,t.Delete=4})(o4||(b.WatchKind=o4={}));var s4;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolNotificationType(t.method)})(s4||(b.PublishDiagnosticsNotification=s4={}));var a4;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(a4||(b.CompletionTriggerKind=a4={}));var u4;(function(t){t.method="textDocument/completion",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(u4||(b.CompletionRequest=u4={}));var c4;(function(t){t.method="completionItem/resolve",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(c4||(b.CompletionResolveRequest=c4={}));var l4;(function(t){t.method="textDocument/hover",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(l4||(b.HoverRequest=l4={}));var f4;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(f4||(b.SignatureHelpTriggerKind=f4={}));var d4;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(d4||(b.SignatureHelpRequest=d4={}));var p4;(function(t){t.method="textDocument/definition",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(p4||(b.DefinitionRequest=p4={}));var m4;(function(t){t.method="textDocument/references",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(m4||(b.ReferencesRequest=m4={}));var h4;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(h4||(b.DocumentHighlightRequest=h4={}));var g4;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(g4||(b.DocumentSymbolRequest=g4={}));var D4;(function(t){t.method="textDocument/codeAction",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(D4||(b.CodeActionRequest=D4={}));var y4;(function(t){t.method="codeAction/resolve",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(y4||(b.CodeActionResolveRequest=y4={}));var E4;(function(t){t.method="workspace/symbol",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(E4||(b.WorkspaceSymbolRequest=E4={}));var C4;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(C4||(b.WorkspaceSymbolResolveRequest=C4={}));var x4;(function(t){t.method="textDocument/codeLens",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(x4||(b.CodeLensRequest=x4={}));var A4;(function(t){t.method="codeLens/resolve",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(A4||(b.CodeLensResolveRequest=A4={}));var v4;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolRequestType0(t.method)})(v4||(b.CodeLensRefreshRequest=v4={}));var w4;(function(t){t.method="textDocument/documentLink",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(w4||(b.DocumentLinkRequest=w4={}));var b4;(function(t){t.method="documentLink/resolve",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(b4||(b.DocumentLinkResolveRequest=b4={}));var F4;(function(t){t.method="textDocument/formatting",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(F4||(b.DocumentFormattingRequest=F4={}));var S4;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(S4||(b.DocumentRangeFormattingRequest=S4={}));var R4;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(R4||(b.DocumentRangesFormattingRequest=R4={}));var T4;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(T4||(b.DocumentOnTypeFormattingRequest=T4={}));var _4;(function(t){t.Identifier=1})(_4||(b.PrepareSupportDefaultBehavior=_4={}));var k4;(function(t){t.method="textDocument/rename",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(k4||(b.RenameRequest=k4={}));var P4;(function(t){t.method="textDocument/prepareRename",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(P4||(b.PrepareRenameRequest=P4={}));var I4;(function(t){t.method="workspace/executeCommand",t.messageDirection=te.MessageDirection.clientToServer,t.type=new te.ProtocolRequestType(t.method)})(I4||(b.ExecuteCommandRequest=I4={}));var L4;(function(t){t.method="workspace/applyEdit",t.messageDirection=te.MessageDirection.serverToClient,t.type=new te.ProtocolRequestType("workspace/applyEdit")})(L4||(b.ApplyWorkspaceEditRequest=L4={}))});var V4=X(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});gy.createProtocolConnection=void 0;var j4=ju();function oie(t,e,r,n){return j4.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,j4.createMessageConnection)(t,e,r,n)}gy.createProtocolConnection=oie});var U4=X(ii=>{"use strict";var sie=ii&&ii.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dy=ii&&ii.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sie(e,t,r)};Object.defineProperty(ii,"__esModule",{value:!0});ii.LSPErrorCodes=ii.createProtocolConnection=void 0;Dy(ju(),ii);Dy(ey(),ii);Dy(pr(),ii);Dy(M4(),ii);var aie=V4();Object.defineProperty(ii,"createProtocolConnection",{enumerable:!0,get:function(){return aie.createProtocolConnection}});var q4;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(q4||(ii.LSPErrorCodes=q4={}))});var At=X(Uo=>{"use strict";var uie=Uo&&Uo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G4=Uo&&Uo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uie(e,t,r)};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.createProtocolConnection=void 0;var cie=M1();G4(M1(),Uo);G4(U4(),Uo);function lie(t,e,r,n){return(0,cie.createMessageConnection)(t,e,r,n)}Uo.createProtocolConnection=lie});var rb=X(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.generateUuid=Vi.parse=Vi.isUUID=Vi.v4=Vi.empty=void 0;var Np=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Op=class t extends Np{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Op._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Op._timeHighBits=["8","9","a","b"];Vi.empty=new Np("00000000-0000-0000-0000-000000000000");function W4(){return new Op}Vi.v4=W4;var fie=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function H4(t){return fie.test(t)}Vi.isUUID=H4;function die(t){if(!H4(t))throw new Error("invalid uuid");return new Np(t)}Vi.parse=die;function pie(){return W4().asHex()}Vi.generateUuid=pie});var z4=X(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.attachPartialResult=Ra.ProgressFeature=Ra.attachWorkDone=void 0;var Sa=At(),mie=rb(),qu=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let o={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Sa.WorkDoneProgress.type,this._token,o)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Sa.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Sa.WorkDoneProgress.type,this._token,{kind:"end"})}};qu.Instances=new Map;var yy=class extends qu{constructor(e,r){super(e,r),this._source=new Sa.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Bp=class{constructor(){}begin(){}report(){}done(){}},Ey=class extends Bp{constructor(){super(),this._source=new Sa.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function hie(t,e){if(e===void 0||e.workDoneToken===void 0)return new Bp;let r=e.workDoneToken;return delete e.workDoneToken,new qu(t,r)}Ra.attachWorkDone=hie;var gie=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Sa.WorkDoneProgressCancelNotification.type,r=>{let n=qu.Instances.get(r.token);(n instanceof yy||n instanceof Ey)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Bp:new qu(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,mie.generateUuid)();return this.connection.sendRequest(Sa.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new yy(this.connection,e))}else return Promise.resolve(new Ey)}};Ra.ProgressFeature=gie;var nb;(function(t){t.type=new Sa.ProgressType})(nb||(nb={}));var ib=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(nb.type,this._token,e)}};function Die(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new ib(t,r)}Ra.attachPartialResult=Die});var K4=X(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});Cy.ConfigurationFeature=void 0;var yie=At(),Eie=ND(),Cie=t=>class extends t{getConfiguration(e){return e?Eie.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(yie.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Cy.ConfigurationFeature=Cie});var Y4=X(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.WorkspaceFoldersFeature=void 0;var xy=At(),xie=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new xy.Emitter,this.connection.onNotification(xy.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(xy.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(xy.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ay.WorkspaceFoldersFeature=xie});var X4=X(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.CallHierarchyFeature=void 0;var ob=At(),Aie=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ob.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=ob.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=ob.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};vy.CallHierarchyFeature=Aie});var ab=X(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.SemanticTokensBuilder=Ta.SemanticTokensDiff=Ta.SemanticTokensFeature=void 0;var wy=At(),vie=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(wy.SemanticTokensRefreshRequest.type),on:e=>{let r=wy.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=wy.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=wy.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ta.SemanticTokensFeature=vie;var by=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,o=r-1;for(;i>=n&&o>=n&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<n||o<n)&&(i++,o++);let s=i-n+1,a=this.modifiedSequence.slice(n,o+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:s-1}]:[{start:n,deleteCount:s,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Ta.SemanticTokensDiff=by;var sb=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,r,n,i,o){let s=e,a=r;this._dataLen>0&&(s-=this._prevLine,s===0&&(a-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new by(this._prevData,this._data).computeDiff()}:this.build()}};Ta.SemanticTokensBuilder=sb});var J4=X(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ShowDocumentFeature=void 0;var wie=At(),bie=t=>class extends t{showDocument(e){return this.connection.sendRequest(wie.ShowDocumentRequest.type,e)}};Fy.ShowDocumentFeature=bie});var Q4=X(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.FileOperationsFeature=void 0;var Ql=At(),Fie=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ql.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Ql.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Ql.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Ql.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Ql.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Ql.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Sy.FileOperationsFeature=Fie});var Z4=X(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.LinkedEditingRangeFeature=void 0;var Sie=At(),Rie=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Sie.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Ry.LinkedEditingRangeFeature=Rie});var e8=X(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.TypeHierarchyFeature=void 0;var ub=At(),Tie=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(ub.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=ub.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=ub.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ty.TypeHierarchyFeature=Tie});var r8=X(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.InlineValueFeature=void 0;var t8=At(),_ie=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t8.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(t8.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};_y.InlineValueFeature=_ie});var i8=X(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.FoldingRangeFeature=void 0;var n8=At(),kie=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(n8.FoldingRangeRefreshRequest.type),on:e=>{let r=n8.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ky.FoldingRangeFeature=kie});var o8=X(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.InlayHintFeature=void 0;var cb=At(),Pie=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(cb.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(cb.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(cb.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Py.InlayHintFeature=Pie});var s8=X(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.DiagnosticFeature=void 0;var $p=At(),Iie=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest($p.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest($p.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress($p.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest($p.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress($p.WorkspaceDiagnosticRequest.partialResult,r)))}}};Iy.DiagnosticFeature=Iie});var fb=X(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.TextDocuments=void 0;var Uu=At(),lb=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Uu.Emitter,this._onDidOpen=new Uu.Emitter,this._onDidClose=new Uu.Emitter,this._onDidSave=new Uu.Emitter,this._onWillSave=new Uu.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Uu.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,o=n.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,o,s),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let o=this._syncedDocuments.get(n.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Uu.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Ly.TextDocuments=lb});var pb=X(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.NotebookDocuments=Zl.NotebookSyncFeature=void 0;var qi=At(),a8=fb(),Lie=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(qi.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(qi.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(qi.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(qi.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};Zl.NotebookSyncFeature=Lie;var Ny=class t{onDidOpenTextDocument(e){return this.openHandler=e,qi.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qi.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qi.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Ny.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var db=class{constructor(e){e instanceof a8.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new a8.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qi.Emitter,this._onDidChange=new qi.Emitter,this._onDidSave=new qi.Emitter,this._onDidClose=new qi.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new Ny,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)r.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,o.metadata=u.metadata);let c=[],l=[],f=[],d=[];if(u.cells!==void 0){let A=u.cells;if(A.structure!==void 0){let m=A.structure.array;if(o.cells.splice(m.start,m.deleteCount,...m.cells!==void 0?m.cells:[]),A.structure.didOpen!==void 0)for(let E of A.structure.didOpen)r.openTextDocument({textDocument:E}),c.push(E.uri);if(A.structure.didClose)for(let E of A.structure.didClose)r.closeTextDocument({textDocument:E}),l.push(E.uri)}if(A.data!==void 0){let m=new Map(A.data.map(E=>[E.document,E]));for(let E=0;E<=o.cells.length;E++){let x=m.get(o.cells[E].document);if(x!==void 0){let k=o.cells.splice(E,1,x);if(f.push({old:k[0],new:x}),m.delete(x.document),m.size===0)break}}}if(A.textContent!==void 0)for(let m of A.textContent)r.changeTextDocument({textDocument:m.document,contentChanges:m.changes}),d.push(m.document.uri)}this.updateCellMap(o);let p={notebookDocument:o};a&&(p.metadata={old:s,new:o.metadata});let y=[];for(let A of c)y.push(this.getNotebookCell(A));let C=[];for(let A of l)C.push(this.getNotebookCell(A));let g=[];for(let A of d)g.push(this.getNotebookCell(A));(y.length>0||C.length>0||f.length>0||g.length>0)&&(p.cells={added:y,removed:C,changed:{data:f,textContent:g}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)r.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),qi.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Zl.NotebookDocuments=db});var u8=X(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.MonikerFeature=void 0;var Nie=At(),Oie=t=>class extends t{get moniker(){return{on:e=>{let r=Nie.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Oy.MonikerFeature=Oie});var Eb=X(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createConnection=gt.combineFeatures=gt.combineNotebooksFeatures=gt.combineLanguagesFeatures=gt.combineWorkspaceFeatures=gt.combineWindowFeatures=gt.combineClientFeatures=gt.combineTracerFeatures=gt.combineTelemetryFeatures=gt.combineConsoleFeatures=gt._NotebooksImpl=gt._LanguagesImpl=gt.BulkUnregistration=gt.BulkRegistration=gt.ErrorMessageTracker=void 0;var ie=At(),Ui=ND(),hb=rb(),Me=z4(),Bie=K4(),$ie=Y4(),Mie=X4(),jie=ab(),Vie=J4(),qie=Q4(),Uie=Z4(),Gie=e8(),Wie=r8(),Hie=i8(),zie=o8(),Kie=s8(),Yie=pb(),Xie=u8();function mb(t){if(t!==null)return t}var gb=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};gt.ErrorMessageTracker=gb;var By=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(ie.MessageType.Error,e)}warn(e){this.send(ie.MessageType.Warning,e)}info(e){this.send(ie.MessageType.Info,e)}log(e){this.send(ie.MessageType.Log,e)}debug(e){this.send(ie.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(ie.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,ie.RAL)().console.error("Sending log message failed")})}},Db=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:ie.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(ie.ShowMessageRequest.type,n).then(mb)}showWarningMessage(e,...r){let n={type:ie.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(ie.ShowMessageRequest.type,n).then(mb)}showInformationMessage(e,...r){let n={type:ie.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(ie.ShowMessageRequest.type,n).then(mb)}},c8=(0,Vie.ShowDocumentFeature)((0,Me.ProgressFeature)(Db)),l8;(function(t){function e(){return new $y}t.create=e})(l8||(gt.BulkRegistration=l8={}));var $y=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Ui.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=hb.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},f8;(function(t){function e(){return new Mp(void 0,[])}t.create=e})(f8||(gt.BulkUnregistration=f8={}));var Mp=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(ie.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Ui.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(ie.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},o=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},My=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof $y?this.registerMany(e):e instanceof Mp?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=Ui.string(r)?r:r.method,o=hb.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(ie.RegistrationRequest.type,s).then(a=>(e.add({id:o,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=Ui.string(e)?e:e.method,i=hb.generateUuid(),o={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(ie.RegistrationRequest.type,o).then(s=>ie.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(s)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(ie.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(ie.RegistrationRequest.type,r).then(()=>new Mp(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},yb=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(ie.ApplyWorkspaceEditRequest.type,n)}},d8=(0,qie.FileOperationsFeature)((0,$ie.WorkspaceFoldersFeature)((0,Bie.ConfigurationFeature)(yb))),jy=class{constructor(){this._trace=ie.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==ie.Trace.Off&&this.connection.sendNotification(ie.LogTraceNotification.type,{message:e,verbose:this._trace===ie.Trace.Verbose?r:void 0}).catch(()=>{})}},Vy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(ie.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},qy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Me.attachPartialResult)(this.connection,r)}};gt._LanguagesImpl=qy;var p8=(0,Hie.FoldingRangeFeature)((0,Xie.MonikerFeature)((0,Kie.DiagnosticFeature)((0,zie.InlayHintFeature)((0,Wie.InlineValueFeature)((0,Gie.TypeHierarchyFeature)((0,Uie.LinkedEditingRangeFeature)((0,jie.SemanticTokensFeature)((0,Mie.CallHierarchyFeature)(qy))))))))),Uy=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Me.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Me.attachPartialResult)(this.connection,r)}};gt._NotebooksImpl=Uy;var m8=(0,Yie.NotebookSyncFeature)(Uy);function h8(t,e){return function(r){return e(t(r))}}gt.combineConsoleFeatures=h8;function g8(t,e){return function(r){return e(t(r))}}gt.combineTelemetryFeatures=g8;function D8(t,e){return function(r){return e(t(r))}}gt.combineTracerFeatures=D8;function y8(t,e){return function(r){return e(t(r))}}gt.combineClientFeatures=y8;function E8(t,e){return function(r){return e(t(r))}}gt.combineWindowFeatures=E8;function C8(t,e){return function(r){return e(t(r))}}gt.combineWorkspaceFeatures=C8;function x8(t,e){return function(r){return e(t(r))}}gt.combineLanguagesFeatures=x8;function A8(t,e){return function(r){return e(t(r))}}gt.combineNotebooksFeatures=A8;function Jie(t,e){function r(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:r(t.console,e.console,h8),tracer:r(t.tracer,e.tracer,D8),telemetry:r(t.telemetry,e.telemetry,g8),client:r(t.client,e.client,y8),window:r(t.window,e.window,E8),workspace:r(t.workspace,e.workspace,C8),languages:r(t.languages,e.languages,x8),notebooks:r(t.notebooks,e.notebooks,A8)}}gt.combineFeatures=Jie;function Qie(t,e,r){let n=r&&r.console?new(r.console(By)):new By,i=t(n);n.rawAttach(i);let o=r&&r.tracer?new(r.tracer(jy)):new jy,s=r&&r.telemetry?new(r.telemetry(Vy)):new Vy,a=r&&r.client?new(r.client(My)):new My,u=r&&r.window?new(r.window(c8)):new c8,c=r&&r.workspace?new(r.workspace(d8)):new d8,l=r&&r.languages?new(r.languages(p8)):new p8,f=r&&r.notebooks?new(r.notebooks(m8)):new m8,d=[n,o,s,a,u,c,l,f];function p(m){return m instanceof Promise?m:Ui.thenable(m)?new Promise((E,x)=>{m.then(k=>E(k),k=>x(k))}):Promise.resolve(m)}let y,C,g,A={listen:()=>i.listen(),sendRequest:(m,...E)=>i.sendRequest(Ui.string(m)?m:m.method,...E),onRequest:(m,E)=>i.onRequest(m,E),sendNotification:(m,E)=>{let x=Ui.string(m)?m:m.method;return i.sendNotification(x,E)},onNotification:(m,E)=>i.onNotification(m,E),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:m=>(C=m,{dispose:()=>{C=void 0}}),onInitialized:m=>i.onNotification(ie.InitializedNotification.type,m),onShutdown:m=>(y=m,{dispose:()=>{y=void 0}}),onExit:m=>(g=m,{dispose:()=>{g=void 0}}),get console(){return n},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return f},onDidChangeConfiguration:m=>i.onNotification(ie.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>i.onNotification(ie.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>i.onNotification(ie.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>i.onNotification(ie.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>i.onNotification(ie.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>i.onNotification(ie.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>i.onRequest(ie.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>i.onNotification(ie.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>i.sendNotification(ie.PublishDiagnosticsNotification.type,m),onHover:m=>i.onRequest(ie.HoverRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),onCompletion:m=>i.onRequest(ie.CompletionRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onCompletionResolve:m=>i.onRequest(ie.CompletionResolveRequest.type,m),onSignatureHelp:m=>i.onRequest(ie.SignatureHelpRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),onDeclaration:m=>i.onRequest(ie.DeclarationRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onDefinition:m=>i.onRequest(ie.DefinitionRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onTypeDefinition:m=>i.onRequest(ie.TypeDefinitionRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onImplementation:m=>i.onRequest(ie.ImplementationRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onReferences:m=>i.onRequest(ie.ReferencesRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onDocumentHighlight:m=>i.onRequest(ie.DocumentHighlightRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onDocumentSymbol:m=>i.onRequest(ie.DocumentSymbolRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onWorkspaceSymbol:m=>i.onRequest(ie.WorkspaceSymbolRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onWorkspaceSymbolResolve:m=>i.onRequest(ie.WorkspaceSymbolResolveRequest.type,m),onCodeAction:m=>i.onRequest(ie.CodeActionRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onCodeActionResolve:m=>i.onRequest(ie.CodeActionResolveRequest.type,(E,x)=>m(E,x)),onCodeLens:m=>i.onRequest(ie.CodeLensRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onCodeLensResolve:m=>i.onRequest(ie.CodeLensResolveRequest.type,(E,x)=>m(E,x)),onDocumentFormatting:m=>i.onRequest(ie.DocumentFormattingRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),onDocumentRangeFormatting:m=>i.onRequest(ie.DocumentRangeFormattingRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),onDocumentOnTypeFormatting:m=>i.onRequest(ie.DocumentOnTypeFormattingRequest.type,(E,x)=>m(E,x)),onRenameRequest:m=>i.onRequest(ie.RenameRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),onPrepareRename:m=>i.onRequest(ie.PrepareRenameRequest.type,(E,x)=>m(E,x)),onDocumentLinks:m=>i.onRequest(ie.DocumentLinkRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onDocumentLinkResolve:m=>i.onRequest(ie.DocumentLinkResolveRequest.type,(E,x)=>m(E,x)),onDocumentColor:m=>i.onRequest(ie.DocumentColorRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onColorPresentation:m=>i.onRequest(ie.ColorPresentationRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onFoldingRanges:m=>i.onRequest(ie.FoldingRangeRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onSelectionRanges:m=>i.onRequest(ie.SelectionRangeRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),(0,Me.attachPartialResult)(i,E))),onExecuteCommand:m=>i.onRequest(ie.ExecuteCommandRequest.type,(E,x)=>m(E,x,(0,Me.attachWorkDone)(i,E),void 0)),dispose:()=>i.dispose()};for(let m of d)m.attach(A);return i.onRequest(ie.InitializeRequest.type,m=>{e.initialize(m),Ui.string(m.trace)&&(o.trace=ie.Trace.fromString(m.trace));for(let E of d)E.initialize(m.capabilities);if(C){let E=C(m,new ie.CancellationTokenSource().token,(0,Me.attachWorkDone)(i,m),void 0);return p(E).then(x=>{if(x instanceof ie.ResponseError)return x;let k=x;k||(k={capabilities:{}});let H=k.capabilities;H||(H={},k.capabilities=H),H.textDocumentSync===void 0||H.textDocumentSync===null?H.textDocumentSync=Ui.number(A.__textDocumentSync)?A.__textDocumentSync:ie.TextDocumentSyncKind.None:!Ui.number(H.textDocumentSync)&&!Ui.number(H.textDocumentSync.change)&&(H.textDocumentSync.change=Ui.number(A.__textDocumentSync)?A.__textDocumentSync:ie.TextDocumentSyncKind.None);for(let Q of d)Q.fillServerCapabilities(H);return k})}else{let E={capabilities:{textDocumentSync:ie.TextDocumentSyncKind.None}};for(let x of d)x.fillServerCapabilities(E.capabilities);return E}}),i.onRequest(ie.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new ie.CancellationTokenSource().token)}),i.onNotification(ie.ExitNotification.type,()=>{try{g&&g()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(ie.SetTraceNotification.type,m=>{o.trace=ie.Trace.fromString(m.value)}),A}gt.createConnection=Qie});var v8=X(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.resolveModulePath=oi.FileSystem=oi.resolveGlobalYarnPath=oi.resolveGlobalNodePath=oi.resolve=oi.uriToFilePath=void 0;var Zie=Ct("url"),fo=Ct("path"),Cb=Ct("fs"),wb=Ct("child_process");function eoe(t){let e=Zie.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let o=r[0],s=r[1];o.length===0&&s.length>1&&s[1]===":"&&r.shift()}return fo.normalize(r.join("/"))}oi.uriToFilePath=eoe;function xb(){return process.platform==="win32"}function Gy(t,e,r,n){let i="NODE_PATH",o=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((s,a)=>{let u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&Cb.existsSync(e)&&(c[i]?c[i]=e+fo.delimiter+c[i]:c[i]=e,n&&n(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,wb.fork)("",[],{cwd:r,env:c,execArgv:["-e",o]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",d=>{a(d)}),l.on("message",d=>{d.c==="r"&&(l.send({c:"e"}),d.s?s(d.r):a(new Error(`Failed to resolve module: ${t}`)))});let f={c:"rs",a:t};l.send(f)}catch(l){a(l)}})}oi.resolve=Gy;function Ab(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(o=>r[o]=process.env[o]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};xb()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let o=(0,wb.spawnSync)(e,["config","get","prefix"],n).stdout;if(!o){t&&t("'npm config get prefix' didn't return a value.");return}let s=o.trim();return t&&t(`'npm config get prefix' value is: ${s}`),s.length>0?xb()?fo.join(s,"node_modules"):fo.join(s,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}oi.resolveGlobalNodePath=Ab;function toe(t){let e="yarn",r={encoding:"utf8"};xb()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,wb.spawnSync)(e,["global","dir","--json"],r),o=i.stdout;if(!o){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let s=o.trim().split(/\r?\n/);for(let a of s)try{let u=JSON.parse(a);if(u.type==="log")return fo.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}oi.resolveGlobalYarnPath=toe;var vb;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Cb.existsSync(__filename.toUpperCase())||!Cb.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,o){return r()?fo.normalize(o).indexOf(fo.normalize(i))===0:fo.normalize(o).toLowerCase().indexOf(fo.normalize(i).toLowerCase())===0}t.isParent=n})(vb||(oi.FileSystem=vb={}));function roe(t,e,r,n){return r?(fo.isAbsolute(r)||(r=fo.join(t,r)),Gy(e,r,r,n).then(i=>vb.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Gy(e,Ab(n),t,n))):Gy(e,Ab(n),t,n)}oi.resolveModulePath=roe});var bb=X((EMe,w8)=>{"use strict";w8.exports=At()});var b8=X(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.InlineCompletionFeature=void 0;var noe=At(),ioe=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(noe.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Wy.InlineCompletionFeature=ioe});var R8=X(In=>{"use strict";var ooe=In&&In.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S8=In&&In.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ooe(e,t,r)};Object.defineProperty(In,"__esModule",{value:!0});In.ProposedFeatures=In.NotebookDocuments=In.TextDocuments=In.SemanticTokensBuilder=void 0;var soe=ab();Object.defineProperty(In,"SemanticTokensBuilder",{enumerable:!0,get:function(){return soe.SemanticTokensBuilder}});var aoe=b8();S8(At(),In);var uoe=fb();Object.defineProperty(In,"TextDocuments",{enumerable:!0,get:function(){return uoe.TextDocuments}});var coe=pb();Object.defineProperty(In,"NotebookDocuments",{enumerable:!0,get:function(){return coe.NotebookDocuments}});S8(Eb(),In);var F8;(function(t){t.all={__brand:"features",languages:aoe.InlineCompletionFeature}})(F8||(In.ProposedFeatures=F8={}))});var si=X(Gi=>{"use strict";var loe=Gi&&Gi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),P8=Gi&&Gi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&loe(e,t,r)};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.createConnection=Gi.Files=void 0;var T8=Ct("node:util"),Fb=ND(),foe=Eb(),jp=v8(),Gu=bb();P8(bb(),Gi);P8(R8(),Gi);var _8;(function(t){t.uriToFilePath=jp.uriToFilePath,t.resolveGlobalNodePath=jp.resolveGlobalNodePath,t.resolveGlobalYarnPath=jp.resolveGlobalYarnPath,t.resolve=jp.resolve,t.resolveModulePath=jp.resolveModulePath})(_8||(Gi.Files=_8={}));var k8;function Hy(){if(k8!==void 0)try{k8.end()}catch{}}var ef=!1,I8;function doe(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(I8=setInterval(()=>{try{process.kill(n,0)}catch{Hy(),process.exit(ef?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}doe();var poe={initialize:t=>{let e=t.processId;Fb.number(e)&&I8===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ef?0:1)}},3e3)},get shutdownReceived(){return ef},set shutdownReceived(t){ef=t},exit:t=>{Hy(),process.exit(t)}};function moe(t,e,r,n){let i,o,s,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Gu.ConnectionStrategy.is(t)||Gu.ConnectionOptions.is(t)?a=t:(o=t,s=e,a=r),hoe(o,s,a,i)}Gi.createConnection=moe;function hoe(t,e,r,n){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let f=0;f<l.length;f++){let d=l[f];if(d==="--node-ipc"){t=new Gu.IPCMessageReader(process),e=new Gu.IPCMessageWriter(process);break}else if(d==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(d==="--socket"){u=parseInt(l[f+1]);break}else if(d==="--pipe"){c=l[f+1];break}else{var o=d.split("=");if(o[0]==="--socket"){u=parseInt(o[1]);break}else if(o[0]==="--pipe"){c=o[1];break}}}if(u){let f=(0,Gu.createServerSocketTransport)(u);t=f[0],e=f[1]}else if(c){let f=(0,Gu.createServerPipeTransport)(c);t=f[0],e=f[1]}}var s="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+s);if(!e)throw new Error("Connection output stream is not set. "+s);if(Fb.func(t.read)&&Fb.func(t.on)){let u=t;u.on("end",()=>{Hy(),process.exit(ef?0:1)}),u.on("close",()=>{Hy(),process.exit(ef?0:1)})}let a=u=>{let c=(0,Gu.createProtocolConnection)(t,e,u,r);return i&&goe(u),c};return(0,foe.createConnection)(a,poe,n)}function goe(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,T8.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...o){if(!i)if(o.length===0)t.error("Assertion failed");else{let[s,...a]=o;t.error(`Assertion failed: ${s} ${e(a)}`)}},console.count=function(i="default"){let o=String(i),s=r.get(o)??0;s+=1,r.set(o,s),t.log(`${o}: ${o}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,o){t.log((0,T8.inspect)(i,o))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let o=new Error().stack.replace(/(.+\n){2}/,""),s="Trace";i.length!==0&&(s+=`: ${e(i)}`),t.log(`${s}
|
|
104
|
-
${o}`)},console.warn=function(...i){t.warn(e(i))}}});var N6=X((x5e,L6)=>{"use strict";L6.exports=t=>{let e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var L0=X((fje,U6)=>{"use strict";var Pse="\0",Wu="\0",j6="",rS=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=e.hasOwnProperty("directed")?e.directed:!0,this._isMultigraph=e.hasOwnProperty("multigraph")?e.multigraph:!1,this._isCompound=e.hasOwnProperty("compound")?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Wu]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!="function"&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(r=>Object.keys(e._in[r]).length===0)}sinks(){var e=this;return this.nodes().filter(r=>Object.keys(e._out[r]).length===0)}setNodes(e,r){var n=arguments,i=this;return e.forEach(function(o){n.length>1?i.setNode(o,r):i.setNode(o)}),this}setNode(e,r){return this._nodes.hasOwnProperty(e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Wu,this._children[e]={},this._children[Wu][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return this._nodes.hasOwnProperty(e)}removeNode(e){var r=this;if(this._nodes.hasOwnProperty(e)){var n=i=>r.removeEdge(r._edgeObjs[i]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(i){r.setParent(i)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r=Wu;else{r+="";for(var n=r;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Wu)return r}}children(e=Wu){if(this._isCompound){var r=this._children[e];if(r)return Object.keys(r)}else{if(e===Wu)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Object.keys(r)}successors(e){var r=this._sucs[e];if(r)return Object.keys(r)}neighbors(e){var r=this.predecessors(e);if(r){let i=new Set(r);for(var n of this.successors(e))i.add(n);return Array.from(i.values())}}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([s,a]){e(s)&&r.setNode(s,a)}),Object.values(this._edgeObjs).forEach(function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function o(s){var a=n.parent(s);return a===void 0||r.hasNode(a)?(i[s]=a,a):a in i?i[a]:o(a)}return this._isCompound&&r.nodes().forEach(s=>r.setParent(s,o(s))),r}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!="function"&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return e.reduce(function(o,s){return i.length>1?n.setEdge(o,s,r):n.setEdge(o,s),s}),this}setEdge(){var e,r,n,i,o=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],o=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,r=""+r,n!==void 0&&(n=""+n);var a=Xp(this._isDirected,e,r,n);if(this._edgeLabels.hasOwnProperty(a))return o&&(this._edgeLabels[a]=i),this;if(n!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[a]=o?i:this._defaultEdgeLabelFn(e,r,n);var u=Ise(this._isDirected,e,r,n);return e=u.v,r=u.w,Object.freeze(u),this._edgeObjs[a]=u,V6(this._preds[r],e),V6(this._sucs[e],r),this._in[r][a]=u,this._out[e][a]=u,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n);return this._edgeLabels[i]}edgeAsObj(){let e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n);return this._edgeLabels.hasOwnProperty(i)}removeEdge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n),o=this._edgeObjs[i];return o&&(e=o.v,r=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],q6(this._preds[r],e),q6(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Object.values(n);return r?i.filter(o=>o.v===r):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Object.values(n);return r?i.filter(o=>o.w===r):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}};function V6(t,e){t[e]?t[e]++:t[e]=1}function q6(t,e){--t[e]||delete t[e]}function Xp(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var s=i;i=o,o=s}return i+j6+o+j6+(n===void 0?Pse:n)}function Ise(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return n&&(a.name=n),a}function tS(t,e){return Xp(t,e.v,e.w,e.name)}U6.exports=rS});var W6=X((dje,G6)=>{G6.exports="2.2.2"});var z6=X((pje,H6)=>{H6.exports={Graph:L0(),version:W6()}});var Y6=X((mje,K6)=>{var Lse=L0();K6.exports={write:Nse,read:$se};function Nse(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Ose(t),edges:Bse(t)};return t.graph()!==void 0&&(e.value=structuredClone(t.graph())),e}function Ose(t){return t.nodes().map(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return r!==void 0&&(i.value=r),n!==void 0&&(i.parent=n),i})}function Bse(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),r!==void 0&&(n.value=r),n})}function $se(t){var e=new Lse(t.options).setGraph(t.value);return t.nodes.forEach(function(r){e.setNode(r.v,r.value),r.parent&&e.setParent(r.v,r.parent)}),t.edges.forEach(function(r){e.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),e}});var J6=X((hje,X6)=>{X6.exports=Mse;function Mse(t){var e={},r=[],n;function i(o){e.hasOwnProperty(o)||(e[o]=!0,n.push(o),t.successors(o).forEach(i),t.predecessors(o).forEach(i))}return t.nodes().forEach(function(o){n=[],i(o),n.length&&r.push(n)}),r}});var iS=X((gje,Q6)=>{var nS=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return this._keyIndices.hasOwnProperty(e)}priority(e){var r=this._keyIndices[e];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,r){var n=this._keyIndices;if(e=String(e),!n.hasOwnProperty(e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,r){var n=this._keyIndices[e];if(r>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+r);this._arr[n].priority=r,this._decrease(n)}_heapify(e){var r=this._arr,n=2*e,i=n+1,o=e;n<r.length&&(o=r[n].priority<r[o].priority?n:o,i<r.length&&(o=r[i].priority<r[o].priority?i:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var r=this._arr,n=r[e].priority,i;e!==0&&(i=e>>1,!(r[i].priority<n));)this._swap(e,i),e=i}_swap(e,r){var n=this._arr,i=this._keyIndices,o=n[e],s=n[r];n[e]=s,n[r]=o,i[s.key]=e,i[o.key]=r}};Q6.exports=nS});var oS=X((Dje,Z6)=>{var jse=iS();Z6.exports=qse;var Vse=()=>1;function qse(t,e,r,n){return Use(t,String(e),r||Vse,n||function(i){return t.outEdges(i)})}function Use(t,e,r,n){var i={},o=new jse,s,a,u=function(c){var l=c.v!==s?c.v:c.w,f=i[l],d=r(c),p=a.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+d);p<f.distance&&(f.distance=p,f.predecessor=s,o.decrease(l,p))};for(t.nodes().forEach(function(c){var l=c===e?0:Number.POSITIVE_INFINITY;i[c]={distance:l},o.add(c,l)});o.size()>0&&(s=o.removeMin(),a=i[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(u);return i}});var tM=X((yje,eM)=>{var Gse=oS();eM.exports=Wse;function Wse(t,e,r){return t.nodes().reduce(function(n,i){return n[i]=Gse(t,i,e,r),n},{})}});var sS=X((Eje,rM)=>{rM.exports=Hse;function Hse(t){var e=0,r=[],n={},i=[];function o(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(r.push(s),t.successors(s).forEach(function(l){n.hasOwnProperty(l)?n[l].onStack&&(a.lowlink=Math.min(a.lowlink,n[l].index)):(o(l),a.lowlink=Math.min(a.lowlink,n[l].lowlink))}),a.lowlink===a.index){var u=[],c;do c=r.pop(),n[c].onStack=!1,u.push(c);while(s!==c);i.push(u)}}return t.nodes().forEach(function(s){n.hasOwnProperty(s)||o(s)}),i}});var iM=X((Cje,nM)=>{var zse=sS();nM.exports=Kse;function Kse(t){return zse(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var sM=X((xje,oM)=>{oM.exports=Xse;var Yse=()=>1;function Xse(t,e,r){return Jse(t,e||Yse,r||function(n){return t.outEdges(n)})}function Jse(t,e,r){var n={},i=t.nodes();return i.forEach(function(o){n[o]={},n[o][o]={distance:0},i.forEach(function(s){o!==s&&(n[o][s]={distance:Number.POSITIVE_INFINITY})}),r(o).forEach(function(s){var a=s.v===o?s.w:s.v,u=e(s);n[o][a]={distance:u,predecessor:o}})}),i.forEach(function(o){var s=n[o];i.forEach(function(a){var u=n[a];i.forEach(function(c){var l=u[o],f=s[c],d=u[c],p=l.distance+f.distance;p<d.distance&&(d.distance=p,d.predecessor=f.predecessor)})})}),n}});var aS=X((Aje,uM)=>{function aM(t){var e={},r={},n=[];function i(o){if(r.hasOwnProperty(o))throw new Jp;e.hasOwnProperty(o)||(r[o]=!0,e[o]=!0,t.predecessors(o).forEach(i),delete r[o],n.push(o))}if(t.sinks().forEach(i),Object.keys(e).length!==t.nodeCount())throw new Jp;return n}var Jp=class extends Error{constructor(){super(...arguments)}};uM.exports=aM;aM.CycleException=Jp});var fM=X((vje,lM)=>{var cM=aS();lM.exports=Qse;function Qse(t){try{cM(t)}catch(e){if(e instanceof cM.CycleException)return!1;throw e}return!0}});var uS=X((wje,pM)=>{pM.exports=Zse;function Zse(t,e,r){Array.isArray(e)||(e=[e]);var n=t.isDirected()?a=>t.successors(a):a=>t.neighbors(a),i=r==="post"?eae:tae,o=[],s={};return e.forEach(a=>{if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);i(a,n,s,o)}),o}function eae(t,e,r,n){for(var i=[[t,!1]];i.length>0;){var o=i.pop();o[1]?n.push(o[0]):r.hasOwnProperty(o[0])||(r[o[0]]=!0,i.push([o[0],!0]),dM(e(o[0]),s=>i.push([s,!1])))}}function tae(t,e,r,n){for(var i=[t];i.length>0;){var o=i.pop();r.hasOwnProperty(o)||(r[o]=!0,n.push(o),dM(e(o),s=>i.push(s)))}}function dM(t,e){for(var r=t.length;r--;)e(t[r],r,t);return t}});var hM=X((bje,mM)=>{var rae=uS();mM.exports=nae;function nae(t,e){return rae(t,e,"post")}});var DM=X((Fje,gM)=>{var iae=uS();gM.exports=oae;function oae(t,e){return iae(t,e,"pre")}});var EM=X((Sje,yM)=>{var sae=L0(),aae=iS();yM.exports=uae;function uae(t,e){var r=new sae,n={},i=new aae,o;function s(u){var c=u.v===o?u.w:u.v,l=i.priority(c);if(l!==void 0){var f=e(u);f<l&&(n[c]=o,i.decrease(c,f))}}if(t.nodeCount()===0)return r;t.nodes().forEach(function(u){i.add(u,Number.POSITIVE_INFINITY),r.setNode(u)}),i.decrease(t.nodes()[0],0);for(var a=!1;i.size()>0;){if(o=i.removeMin(),n.hasOwnProperty(o))r.setEdge(o,n[o]);else{if(a)throw new Error("Input graph is not connected: "+t);a=!0}t.nodeEdges(o).forEach(s)}return r}});var xM=X((Rje,CM)=>{CM.exports={components:J6(),dijkstra:oS(),dijkstraAll:tM(),findCycles:iM(),floydWarshall:sM(),isAcyclic:fM(),postorder:hM(),preorder:DM(),prim:EM(),tarjan:sS(),topsort:aS()}});var cS=X((Tje,vM)=>{var AM=z6();vM.exports={Graph:AM.Graph,json:Y6(),alg:xM(),version:AM.version}});var f7=X((jVe,l7)=>{"use strict";function Gae(t){for(var e=5381,r=t.length;r;)e=e*33^t.charCodeAt(--r);return e>>>0}l7.exports=Gae});var E9=X((HWe,y9)=>{function que(t){let e=t.length-1,r=t[e];for(;r===" "||r===" ";)r=t[--e];return t.substring(0,e+1)}function Uue(t){return t.split(`
|
|
104
|
+
${o}`)},console.warn=function(...i){t.warn(e(i))}}});var N6=X((x5e,L6)=>{"use strict";L6.exports=t=>{let e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var L0=X((fje,U6)=>{"use strict";var Pse="\0",Wu="\0",j6="",rS=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=e.hasOwnProperty("directed")?e.directed:!0,this._isMultigraph=e.hasOwnProperty("multigraph")?e.multigraph:!1,this._isCompound=e.hasOwnProperty("compound")?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[Wu]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!="function"&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(r=>Object.keys(e._in[r]).length===0)}sinks(){var e=this;return this.nodes().filter(r=>Object.keys(e._out[r]).length===0)}setNodes(e,r){var n=arguments,i=this;return e.forEach(function(o){n.length>1?i.setNode(o,r):i.setNode(o)}),this}setNode(e,r){return this._nodes.hasOwnProperty(e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Wu,this._children[e]={},this._children[Wu][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return this._nodes.hasOwnProperty(e)}removeNode(e){var r=this;if(this._nodes.hasOwnProperty(e)){var n=i=>r.removeEdge(r._edgeObjs[i]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(i){r.setParent(i)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r=Wu;else{r+="";for(var n=r;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Wu)return r}}children(e=Wu){if(this._isCompound){var r=this._children[e];if(r)return Object.keys(r)}else{if(e===Wu)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Object.keys(r)}successors(e){var r=this._sucs[e];if(r)return Object.keys(r)}neighbors(e){var r=this.predecessors(e);if(r){let i=new Set(r);for(var n of this.successors(e))i.add(n);return Array.from(i.values())}}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([s,a]){e(s)&&r.setNode(s,a)}),Object.values(this._edgeObjs).forEach(function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function o(s){var a=n.parent(s);return a===void 0||r.hasNode(a)?(i[s]=a,a):a in i?i[a]:o(a)}return this._isCompound&&r.nodes().forEach(s=>r.setParent(s,o(s))),r}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!="function"&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return e.reduce(function(o,s){return i.length>1?n.setEdge(o,s,r):n.setEdge(o,s),s}),this}setEdge(){var e,r,n,i,o=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],o=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,r=""+r,n!==void 0&&(n=""+n);var a=Xp(this._isDirected,e,r,n);if(this._edgeLabels.hasOwnProperty(a))return o&&(this._edgeLabels[a]=i),this;if(n!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[a]=o?i:this._defaultEdgeLabelFn(e,r,n);var u=Ise(this._isDirected,e,r,n);return e=u.v,r=u.w,Object.freeze(u),this._edgeObjs[a]=u,V6(this._preds[r],e),V6(this._sucs[e],r),this._in[r][a]=u,this._out[e][a]=u,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n);return this._edgeLabels[i]}edgeAsObj(){let e=this.edge(...arguments);return typeof e!="object"?{label:e}:e}hasEdge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n);return this._edgeLabels.hasOwnProperty(i)}removeEdge(e,r,n){var i=arguments.length===1?tS(this._isDirected,arguments[0]):Xp(this._isDirected,e,r,n),o=this._edgeObjs[i];return o&&(e=o.v,r=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],q6(this._preds[r],e),q6(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Object.values(n);return r?i.filter(o=>o.v===r):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Object.values(n);return r?i.filter(o=>o.w===r):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}};function V6(t,e){t[e]?t[e]++:t[e]=1}function q6(t,e){--t[e]||delete t[e]}function Xp(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var s=i;i=o,o=s}return i+j6+o+j6+(n===void 0?Pse:n)}function Ise(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return n&&(a.name=n),a}function tS(t,e){return Xp(t,e.v,e.w,e.name)}U6.exports=rS});var W6=X((dje,G6)=>{G6.exports="2.2.2"});var z6=X((pje,H6)=>{H6.exports={Graph:L0(),version:W6()}});var Y6=X((mje,K6)=>{var Lse=L0();K6.exports={write:Nse,read:$se};function Nse(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Ose(t),edges:Bse(t)};return t.graph()!==void 0&&(e.value=structuredClone(t.graph())),e}function Ose(t){return t.nodes().map(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return r!==void 0&&(i.value=r),n!==void 0&&(i.parent=n),i})}function Bse(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return e.name!==void 0&&(n.name=e.name),r!==void 0&&(n.value=r),n})}function $se(t){var e=new Lse(t.options).setGraph(t.value);return t.nodes.forEach(function(r){e.setNode(r.v,r.value),r.parent&&e.setParent(r.v,r.parent)}),t.edges.forEach(function(r){e.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),e}});var J6=X((hje,X6)=>{X6.exports=Mse;function Mse(t){var e={},r=[],n;function i(o){e.hasOwnProperty(o)||(e[o]=!0,n.push(o),t.successors(o).forEach(i),t.predecessors(o).forEach(i))}return t.nodes().forEach(function(o){n=[],i(o),n.length&&r.push(n)}),r}});var iS=X((gje,Q6)=>{var nS=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return this._keyIndices.hasOwnProperty(e)}priority(e){var r=this._keyIndices[e];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,r){var n=this._keyIndices;if(e=String(e),!n.hasOwnProperty(e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,r){var n=this._keyIndices[e];if(r>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+r);this._arr[n].priority=r,this._decrease(n)}_heapify(e){var r=this._arr,n=2*e,i=n+1,o=e;n<r.length&&(o=r[n].priority<r[o].priority?n:o,i<r.length&&(o=r[i].priority<r[o].priority?i:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var r=this._arr,n=r[e].priority,i;e!==0&&(i=e>>1,!(r[i].priority<n));)this._swap(e,i),e=i}_swap(e,r){var n=this._arr,i=this._keyIndices,o=n[e],s=n[r];n[e]=s,n[r]=o,i[s.key]=e,i[o.key]=r}};Q6.exports=nS});var oS=X((Dje,Z6)=>{var jse=iS();Z6.exports=qse;var Vse=()=>1;function qse(t,e,r,n){return Use(t,String(e),r||Vse,n||function(i){return t.outEdges(i)})}function Use(t,e,r,n){var i={},o=new jse,s,a,u=function(c){var l=c.v!==s?c.v:c.w,f=i[l],d=r(c),p=a.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+d);p<f.distance&&(f.distance=p,f.predecessor=s,o.decrease(l,p))};for(t.nodes().forEach(function(c){var l=c===e?0:Number.POSITIVE_INFINITY;i[c]={distance:l},o.add(c,l)});o.size()>0&&(s=o.removeMin(),a=i[s],a.distance!==Number.POSITIVE_INFINITY);)n(s).forEach(u);return i}});var tM=X((yje,eM)=>{var Gse=oS();eM.exports=Wse;function Wse(t,e,r){return t.nodes().reduce(function(n,i){return n[i]=Gse(t,i,e,r),n},{})}});var sS=X((Eje,rM)=>{rM.exports=Hse;function Hse(t){var e=0,r=[],n={},i=[];function o(s){var a=n[s]={onStack:!0,lowlink:e,index:e++};if(r.push(s),t.successors(s).forEach(function(l){n.hasOwnProperty(l)?n[l].onStack&&(a.lowlink=Math.min(a.lowlink,n[l].index)):(o(l),a.lowlink=Math.min(a.lowlink,n[l].lowlink))}),a.lowlink===a.index){var u=[],c;do c=r.pop(),n[c].onStack=!1,u.push(c);while(s!==c);i.push(u)}}return t.nodes().forEach(function(s){n.hasOwnProperty(s)||o(s)}),i}});var iM=X((Cje,nM)=>{var zse=sS();nM.exports=Kse;function Kse(t){return zse(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var sM=X((xje,oM)=>{oM.exports=Xse;var Yse=()=>1;function Xse(t,e,r){return Jse(t,e||Yse,r||function(n){return t.outEdges(n)})}function Jse(t,e,r){var n={},i=t.nodes();return i.forEach(function(o){n[o]={},n[o][o]={distance:0},i.forEach(function(s){o!==s&&(n[o][s]={distance:Number.POSITIVE_INFINITY})}),r(o).forEach(function(s){var a=s.v===o?s.w:s.v,u=e(s);n[o][a]={distance:u,predecessor:o}})}),i.forEach(function(o){var s=n[o];i.forEach(function(a){var u=n[a];i.forEach(function(c){var l=u[o],f=s[c],d=u[c],p=l.distance+f.distance;p<d.distance&&(d.distance=p,d.predecessor=f.predecessor)})})}),n}});var aS=X((Aje,uM)=>{function aM(t){var e={},r={},n=[];function i(o){if(r.hasOwnProperty(o))throw new Jp;e.hasOwnProperty(o)||(r[o]=!0,e[o]=!0,t.predecessors(o).forEach(i),delete r[o],n.push(o))}if(t.sinks().forEach(i),Object.keys(e).length!==t.nodeCount())throw new Jp;return n}var Jp=class extends Error{constructor(){super(...arguments)}};uM.exports=aM;aM.CycleException=Jp});var fM=X((vje,lM)=>{var cM=aS();lM.exports=Qse;function Qse(t){try{cM(t)}catch(e){if(e instanceof cM.CycleException)return!1;throw e}return!0}});var uS=X((wje,pM)=>{pM.exports=Zse;function Zse(t,e,r){Array.isArray(e)||(e=[e]);var n=t.isDirected()?a=>t.successors(a):a=>t.neighbors(a),i=r==="post"?eae:tae,o=[],s={};return e.forEach(a=>{if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);i(a,n,s,o)}),o}function eae(t,e,r,n){for(var i=[[t,!1]];i.length>0;){var o=i.pop();o[1]?n.push(o[0]):r.hasOwnProperty(o[0])||(r[o[0]]=!0,i.push([o[0],!0]),dM(e(o[0]),s=>i.push([s,!1])))}}function tae(t,e,r,n){for(var i=[t];i.length>0;){var o=i.pop();r.hasOwnProperty(o)||(r[o]=!0,n.push(o),dM(e(o),s=>i.push(s)))}}function dM(t,e){for(var r=t.length;r--;)e(t[r],r,t);return t}});var hM=X((bje,mM)=>{var rae=uS();mM.exports=nae;function nae(t,e){return rae(t,e,"post")}});var DM=X((Fje,gM)=>{var iae=uS();gM.exports=oae;function oae(t,e){return iae(t,e,"pre")}});var EM=X((Sje,yM)=>{var sae=L0(),aae=iS();yM.exports=uae;function uae(t,e){var r=new sae,n={},i=new aae,o;function s(u){var c=u.v===o?u.w:u.v,l=i.priority(c);if(l!==void 0){var f=e(u);f<l&&(n[c]=o,i.decrease(c,f))}}if(t.nodeCount()===0)return r;t.nodes().forEach(function(u){i.add(u,Number.POSITIVE_INFINITY),r.setNode(u)}),i.decrease(t.nodes()[0],0);for(var a=!1;i.size()>0;){if(o=i.removeMin(),n.hasOwnProperty(o))r.setEdge(o,n[o]);else{if(a)throw new Error("Input graph is not connected: "+t);a=!0}t.nodeEdges(o).forEach(s)}return r}});var xM=X((Rje,CM)=>{CM.exports={components:J6(),dijkstra:oS(),dijkstraAll:tM(),findCycles:iM(),floydWarshall:sM(),isAcyclic:fM(),postorder:hM(),preorder:DM(),prim:EM(),tarjan:sS(),topsort:aS()}});var cS=X((Tje,vM)=>{var AM=z6();vM.exports={Graph:AM.Graph,json:Y6(),alg:xM(),version:AM.version}});var f7=X((MVe,l7)=>{"use strict";function Gae(t){for(var e=5381,r=t.length;r;)e=e*33^t.charCodeAt(--r);return e>>>0}l7.exports=Gae});var E9=X((WWe,y9)=>{function que(t){let e=t.length-1,r=t[e];for(;r===" "||r===" ";)r=t[--e];return t.substring(0,e+1)}function Uue(t){return t.split(`
|
|
105
105
|
`).map(n=>que(n)).join(`
|
|
106
106
|
`)}y9.exports=function(t,e){if(e=e||{},t==null)return t;var r=e.width||50,n=typeof e.indent=="string"?e.indent:" ",i=e.newline||`
|
|
107
107
|
`+n,o=typeof e.escape=="function"?e.escape:Gue,s=".{1,"+r+"}";e.cut!==!0&&(s+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var a=new RegExp(s,"g"),u=t.match(a)||[],c=n+u.map(function(l){return l.slice(-1)===`
|
|
108
|
-
`&&(l=l.slice(0,l.length-1)),o(l)}).join(i);return e.trim===!0&&(c=Uue(c)),c};function Gue(t){return t}});var J9=X((Yze,X9)=>{X9.exports=Y9;Y9.sync=qce;var z9=Ct("fs");function Vce(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function K9(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Vce(e,r)}function Y9(t,e,r){z9.stat(t,function(n,i){r(n,n?!1:K9(i,t,e))})}function qce(t,e){return K9(z9.statSync(t),t,e)}});var r5=X((Xze,t5)=>{t5.exports=Z9;Z9.sync=Uce;var Q9=Ct("fs");function Z9(t,e,r){Q9.stat(t,function(n,i){r(n,n?!1:e5(i,e))})}function Uce(t,e){return e5(Q9.statSync(t),e)}function e5(t,e){return t.isFile()&&Gce(t,e)}function Gce(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,f=r&c||r&u&&i===s||r&a&&n===o||r&l&&o===0;return f}});var i5=X((Qze,n5)=>{var Jze=Ct("fs"),SE;process.platform==="win32"||global.TESTING_WINDOWS?SE=J9():SE=r5();n5.exports=VS;VS.sync=Wce;function VS(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){VS(t,e||{},function(o,s){o?i(o):n(s)})})}SE(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Wce(t,e){try{return SE.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var f5=X((Zze,l5)=>{var hf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",o5=Ct("path"),Hce=hf?";":":",s5=i5(),a5=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),u5=(t,e)=>{let r=e.colon||Hce,n=t.match(/\//)||hf&&t.match(/\\/)?[""]:[...hf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=hf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=hf?i.split(r):[""];return hf&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},c5=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=u5(t,e),s=[],a=c=>new Promise((l,f)=>{if(c===n.length)return e.all&&s.length?l(s):f(a5(t));let d=n[c],p=/^".*"$/.test(d)?d.slice(1,-1):d,y=o5.join(p,t),C=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+y:y;l(u(C,c,0))}),u=(c,l,f)=>new Promise((d,p)=>{if(f===i.length)return d(a(l+1));let y=i[f];s5(c+y,{pathExt:o},(C,g)=>{if(!C&&g)if(e.all)s.push(c+y);else return d(c+y);return d(u(c,l,f+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},zce=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=u5(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=o5.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let f=0;f<n.length;f++){let d=l+n[f];try{if(s5.sync(d,{pathExt:i}))if(e.all)o.push(d);else return d}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw a5(t)};l5.exports=c5;c5.sync=zce});var p5=X((eKe,qS)=>{"use strict";var d5=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};qS.exports=d5;qS.exports.default=d5});var D5=X((tKe,g5)=>{"use strict";var m5=Ct("path"),Kce=f5(),Yce=p5();function h5(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Kce.sync(t.command,{path:r[Yce({env:r})],pathExt:e?m5.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=m5.resolve(i?t.options.cwd:"",s)),s}function Xce(t){return h5(t)||h5(t,!0)}g5.exports=Xce});var y5=X((rKe,GS)=>{"use strict";var US=/([()\][%!^"`<>&|;, *?])/g;function Jce(t){return t=t.replace(US,"^$1"),t}function Qce(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(US,"^$1"),e&&(t=t.replace(US,"^$1")),t}GS.exports.command=Jce;GS.exports.argument=Qce});var C5=X((nKe,E5)=>{"use strict";E5.exports=/^#!(.*)/});var A5=X((iKe,x5)=>{"use strict";var Zce=C5();x5.exports=(t="")=>{let e=t.match(Zce);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var w5=X((oKe,v5)=>{"use strict";var WS=Ct("fs"),ele=A5();function tle(t){let r=Buffer.alloc(150),n;try{n=WS.openSync(t,"r"),WS.readSync(n,r,0,150,0),WS.closeSync(n)}catch{}return ele(r.toString())}v5.exports=tle});var R5=X((sKe,S5)=>{"use strict";var rle=Ct("path"),b5=D5(),F5=y5(),nle=w5(),ile=process.platform==="win32",ole=/\.(?:com|exe)$/i,sle=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ale(t){t.file=b5(t);let e=t.file&&nle(t.file);return e?(t.args.unshift(t.file),t.command=e,b5(t)):t.file}function ule(t){if(!ile)return t;let e=ale(t),r=!ole.test(e);if(t.options.forceShell||r){let n=sle.test(e);t.command=rle.normalize(t.command),t.command=F5.command(t.command),t.args=t.args.map(o=>F5.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function cle(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:ule(n)}S5.exports=cle});var k5=X((aKe,_5)=>{"use strict";var HS=process.platform==="win32";function zS(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function lle(t,e){if(!HS)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=T5(i,e,"spawn");if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function T5(t,e){return HS&&t===1&&!e.file?zS(e.original,"spawn"):null}function fle(t,e){return HS&&t===1&&!e.file?zS(e.original,"spawnSync"):null}_5.exports={hookChildProcess:lle,verifyENOENT:T5,verifyENOENTSync:fle,notFoundError:zS}});var L5=X((uKe,gf)=>{"use strict";var P5=Ct("child_process"),KS=R5(),YS=k5();function I5(t,e,r){let n=KS(t,e,r),i=P5.spawn(n.command,n.args,n.options);return YS.hookChildProcess(i,n),i}function dle(t,e,r){let n=KS(t,e,r),i=P5.spawnSync(n.command,n.args,n.options);return i.error=i.error||YS.verifyENOENTSync(i.status,n),i}gf.exports=I5;gf.exports.spawn=I5;gf.exports.sync=dle;gf.exports._parse=KS;gf.exports._enoent=YS});var Iq=X((ztt,Rhe)=>{Rhe.exports=[{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Oq=X(Si=>{"use strict";var Nq=Iq(),tn=process.env;Object.defineProperty(Si,"_vendors",{value:Nq.map(function(t){return t.constant})});Si.name=null;Si.isPR=null;Nq.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Lq(n)});if(Si[t.constant]=r,!!r)switch(Si.name=t.name,typeof t.pr){case"string":Si.isPR=!!tn[t.pr];break;case"object":"env"in t.pr?Si.isPR=t.pr.env in tn&&tn[t.pr.env]!==t.pr.ne:"any"in t.pr?Si.isPR=t.pr.any.some(function(n){return!!tn[n]}):Si.isPR=Lq(t.pr);break;default:Si.isPR=null}});Si.isCI=!!(tn.CI!=="false"&&(tn.BUILD_ID||tn.BUILD_NUMBER||tn.CI||tn.CI_APP_ID||tn.CI_BUILD_ID||tn.CI_BUILD_NUMBER||tn.CI_NAME||tn.CONTINUOUS_INTEGRATION||tn.RUN_ID||Si.name));function Lq(t){return typeof t=="string"?!!tn[t]:"env"in t?tn[t.env]&&tn[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!tn[e]}):Object.keys(t).every(function(e){return tn[e]===t[e]})}});rx();Hm();zm();Ym();var Um=Se(Mr(),1);import{argv as $De,exit as MDe,stdout as jDe}from"node:process";var dW=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};function a2(t,e,r){var n=function(o){return t.apply(void 0,dW([o],Array.from(e),!1))},i=r??t.lazy;return i===void 0?n:Object.assign(n,{lazy:i,lazyArgs:e})}function Re(t,e,r){var n=t.length-e.length;if(n===0)return t.apply(void 0,Array.from(e));if(n===1)return a2(t,e,r);throw new Error("Wrong number of arguments")}function pc(){return Re(pW,arguments)}function pW(t,e){var r=e.min,n=e.max;return r!==void 0&&t<r?r:n!==void 0&&t>n?n:t}function pt(t){return!!t}function $s(t){for(var e,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];for(var i=t,o=r.map(function(A){return"lazy"in A?mW(A):void 0}),s=0;s<r.length;){var a=o[s];if(a===void 0||!hW(i)){var u=r[s];i=u(i),s+=1;continue}for(var c=[],l=s;l<r.length;l++){var f=o[l];if(f===void 0||(c.push(f),f.isSingle))break}for(var d=[],p=i[Symbol.iterator]();;){var y=p.next();if((e=y.done)!==null&&e!==void 0&&e)break;var C=u2(y.value,d,c);if(C)break}var g=c[c.length-1].isSingle;i=g?d[0]:d,s+=c.length}return i}function u2(t,e,r){var n;if(r.length===0)return e.push(t),!1;for(var i=t,o={done:!1,hasNext:!1},s=!1,a=0;a<r.length;a++){var u=r[a],c=u.isIndexed,l=u.index,f=u.items;if(f.push(i),o=c?u(i,l,f):u(i),u.index+=1,o.hasNext){if((n=o.hasMany)!==null&&n!==void 0&&n){for(var d=0,p=o.next;d<p.length;d++){var y=p[d],C=u2(y,e,r.slice(a+1));if(C)return!0}return!1}i=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&e.push(i),!!s}function mW(t){var e=t.lazy,r=t.lazyArgs,n=e.apply(void 0,r??[]);return Object.assign(n,{isIndexed:e.indexed,isSingle:e.single,index:0,items:[]})}function hW(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function c2(t,e){var r=e.waitMs,n=e.timing,i=n===void 0?"trailing":n,o=e.maxWaitMs;if(o!==void 0&&r!==void 0&&o<r)throw new Error("debounce: maxWaitMs (".concat(o,") cannot be less than waitMs (").concat(r,")"));var s,a,u,c,l=function(){if(u!==void 0){if(a!==void 0){var p=a;a=void 0,clearTimeout(p)}var y=u;u=void 0,c=t.apply(void 0,y)}},f=function(){if(s!==void 0){var p=s;s=void 0,clearTimeout(p),u!==void 0&&l()}},d=function(p){u=p,o!==void 0&&a===void 0&&(a=setTimeout(l,o))};return{call:function(){for(var p,y=[],C=0;C<arguments.length;C++)y[C]=arguments[C];if(s===void 0)i==="trailing"?d(y):c=t.apply(void 0,y);else{i!=="leading"&&d(y);var g=s;s=void 0,clearTimeout(g)}return s=setTimeout(f,(p=r??o)!==null&&p!==void 0?p:0),c},cancel:function(){if(s!==void 0){var p=s;s=void 0,clearTimeout(p)}if(a!==void 0){var p=a;a=void 0,clearTimeout(p)}u=void 0},flush:function(){return f(),c},get isPending(){return s!==void 0},get cachedValue(){return c}}}function ci(t,e,r){r===void 0&&(r=!1);for(var n=[],i=0;i<t.length;i++){var o=t[i],s=r?e(o,i,t):e(o);if(s.hasMany===!0?n.push.apply(n,s.next):s.hasNext&&n.push(s.next),s.done)break}return n}var l2=function(t){return{hasNext:!0,next:t,done:!1}};function mc(){return Re(gW,arguments,mc.lazy)}function gW(t,e){var r=mc.lazy(e);return ci(t,r)}(function(t){function e(n){var i=new Set(n);return function(o){return i.has(o)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:o}}}t.lazy=e;function r(){return Re(DW,arguments,f2)}t.multiset=r})(mc||(mc={}));var DW=function(t,e){return ci(t,f2(e))};function f2(t){var e;if(t.length===0)return l2;for(var r=new Map,n=0,i=t;n<i.length;n++){var o=i[n];r.set(o,((e=r.get(o))!==null&&e!==void 0?e:0)+1)}return function(s){var a=r.get(s);return a===void 0||a===0?{done:!1,hasNext:!0,next:s}:(r.set(s,a-1),{done:!1,hasNext:!1})}}function Qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Re(yW,t)}var yW=function(t,e){return t.length>=e};var p2=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},m2={asc:function(t,e){return t>e},desc:function(t,e){return t<e}};function h2(t,e){var r=Array.isArray(e)?e:Array.from(e),n=r[0],i=r.slice(1);if(!EW(n)){var o=sx.apply(void 0,i);return t(n,o)}var s=sx.apply(void 0,p2([n],i,!1));return function(a){return t(a,s)}}function sx(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=typeof t=="function"?t:t[0],o=typeof t=="function"?"asc":t[1],s=m2,a=o,u=s[a],c=e===void 0?void 0:sx.apply(void 0,p2([e],r,!1));return function(l,f){var d,p=i(l),y=i(f);return u(p,y)?1:u(y,p)?-1:(d=c?.(l,f))!==null&&d!==void 0?d:0}}function EW(t){if(d2(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;var e=t,r=e[0],n=e[1],i=e.slice(2);return d2(r)&&typeof n=="string"&&n in m2&&i.length===0}var d2=function(t){return typeof t=="function"&&t.length===1};function Wf(){return Re(Object.entries,arguments)}(function(t){t.strict=t})(Wf||(Wf={}));var Ms=function(t){return Object.assign(t,{indexed:!0})};function Fn(){return Re(D2(!1),arguments,Fn.lazy)}var D2=function(t){return function(e,r){return ci(e,t?Fn.lazyIndexed(r):Fn.lazy(r),t)}},g2=function(t){return function(e){return function(r,n,i){return(t?e(r,n,i):e(r))?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}}};(function(t){function e(){return Re(D2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=g2(!1),t.lazyIndexed=Ms(g2(!0))})(Fn||(Fn={}));var ax=function(t){return Object.assign(t,{single:!0})};function Ma(){return Re(E2(!1),arguments,Ma.lazy)}var E2=function(t){return function(e,r){return e.find(function(n,i,o){return t?r(n,i,o):r(n)})}},y2=function(t){return function(e){return function(r,n,i){return(t?e(r,n,i):e(r))?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!1}}}};(function(t){function e(){return Re(E2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=ax(y2(!1)),t.lazyIndexed=ax(Ms(y2(!0)))})(Ma||(Ma={}));function th(){return Re(C2(!1),arguments)}var C2=function(t){return function(e,r){for(var n=e.length-1;n>=0;n--)if(t?r(e[n],n,e):r(e[n]))return e[n]}};(function(t){function e(){return Re(C2(!0),arguments)}t.indexed=e})(th||(th={}));function eo(){return Re(CW,arguments,eo.lazy)}function CW(t){var e=t[0];return e}(function(t){function e(){return function(r){return{done:!0,hasNext:!0,next:r}}}t.lazy=e,function(r){r.single=!0}(e=t.lazy||(t.lazy={}))})(eo||(eo={}));function x2(){return h2(xW,arguments)}function xW(t,e){if(!Qt(t,2))return t[0];for(var r=t[0],n=t.slice(1),i=0,o=n;i<o.length;i++){var s=o[i];e(s,r)<0&&(r=s)}return r}function hc(){return Re(AW,arguments,hc.lazy)}function AW(t){return ci(t,hc.lazy())}(function(t){t.lazy=function(){return function(e){return Array.isArray(e)?{done:!1,hasNext:!0,hasMany:!0,next:e}:{done:!1,hasNext:!0,next:e}}}})(hc||(hc={}));function ja(){return Re(vW,arguments,ja.lazy)}function vW(t,e){return hc(t.map(function(r){return e(r)}))}(function(t){t.lazy=function(e){return function(r){var n=e(r);return Array.isArray(n)?{done:!1,hasNext:!0,hasMany:!0,next:n}:{done:!1,hasNext:!0,next:n}}}})(ja||(ja={}));function Va(){return Re(v2(!1),arguments,Va.lazy)}var v2=function(t){return function(e,r){return ci(e,t?Va.lazyIndexed(r):Va.lazy(r),t)}},A2=function(t){return function(e){return function(r,n,i){return t?e(r,n,i):e(r),{done:!1,hasNext:!0,next:r}}}};(function(t){function e(){return Re(v2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=A2(!1),t.lazyIndexed=Ms(A2(!0))})(Va||(Va={}));function w2(t){return Array.isArray(t)}function gc(t){return t!=null}(function(t){function e(r){return r!==void 0}t.strict=e})(gc||(gc={}));function b2(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function rh(t){return typeof t=="string"}function xo(t){return t===void 0?!0:w2(t)||rh(t)?t.length===0:b2(t)?Object.keys(t).length===0:!1}function F2(t,e){if(e===void 0){var r=new Set(t);return function(n){return r.has(n)}}return e.indexOf(t)>=0}function tt(t){return t==null}function nh(t){return typeof t=="number"&&!isNaN(t)}function ih(){return Re(Object.keys,arguments)}(function(t){t.strict=t})(ih||(ih={}));function to(){return Re(wW,arguments)}function wW(t){return t[t.length-1]}function li(){return Re(R2(!1),arguments,li.lazy)}var R2=function(t){return function(e,r){return ci(e,t?li.lazyIndexed(r):li.lazy(r),t)}},S2=function(t){return function(e){return function(r,n,i){return{done:!1,hasNext:!0,next:t?e(r,n,i):e(r)}}}};(function(t){function e(){return Re(R2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=S2(!1),t.lazyIndexed=Ms(S2(!0)),t.strict=t})(li||(li={}));function js(){return Re(T2(!1),arguments)}var T2=function(t){return function(e,r){for(var n={},i=0;i<e.length;i++){var o=e[i],s=t?r(o,i,e):r(o),a=s[0],u=s[1];n[a]=u}return n}};(function(t){function e(){return Re(T2(!0),arguments)}t.indexed=e})(js||(js={}));function _2(){return Re(bW,arguments)}function bW(t,e){if(t==null)return t;for(var r={},n=0,i=ih.strict(t);n<i.length;n++){var o=i[n];e(t[o],o)||(r[o]=t[o])}return r}var k2=function(t){return function(e){var r=t,n=e[r];return n}};function oh(){return Re(P2(!1),arguments)}var P2=function(t){return function(e,r,n){return e.reduce(function(i,o,s){return t?r(i,o,s,e):r(i,o)},n)}};(function(t){function e(){return Re(P2(!0),arguments)}t.indexed=e})(oh||(oh={}));function Dc(){return Re(FW,arguments)}function FW(t,e){var r=t.slice();return r.sort(e),r}(function(t){t.strict=t})(Dc||(Dc={}));function _i(){return Re(SW,arguments,_i.lazy)}function SW(t){return ci(t,_i.lazy())}(function(t){function e(){var r=new Set;return function(n){return r.has(n)?{done:!1,hasNext:!1}:(r.add(n),{done:!1,hasNext:!0,next:n})}}t.lazy=e})(_i||(_i={}));function Hf(){return Re(Object.values,arguments)}function sh(){return Re(RW,arguments)}function RW(t,e){for(var r=t.length>e.length?e.length:t.length,n=[],i=0;i<r;i++)n.push([t[i],e[i]]);return n}(function(t){t.strict=t})(sh||(sh={}));import{notStrictEqual as ZW,strictEqual as eH}from"assert";var TW={right:LW,center:NW},_W=0,ah=1,kW=2,uh=3,ux=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
|
|
108
|
+
`&&(l=l.slice(0,l.length-1)),o(l)}).join(i);return e.trim===!0&&(c=Uue(c)),c};function Gue(t){return t}});var J9=X((Kze,X9)=>{X9.exports=Y9;Y9.sync=qce;var z9=Ct("fs");function Vce(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function K9(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Vce(e,r)}function Y9(t,e,r){z9.stat(t,function(n,i){r(n,n?!1:K9(i,t,e))})}function qce(t,e){return K9(z9.statSync(t),t,e)}});var r5=X((Yze,t5)=>{t5.exports=Z9;Z9.sync=Uce;var Q9=Ct("fs");function Z9(t,e,r){Q9.stat(t,function(n,i){r(n,n?!1:e5(i,e))})}function Uce(t,e){return e5(Q9.statSync(t),e)}function e5(t,e){return t.isFile()&&Gce(t,e)}function Gce(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,f=r&c||r&u&&i===s||r&a&&n===o||r&l&&o===0;return f}});var i5=X((Jze,n5)=>{var Xze=Ct("fs"),SE;process.platform==="win32"||global.TESTING_WINDOWS?SE=J9():SE=r5();n5.exports=VS;VS.sync=Wce;function VS(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){VS(t,e||{},function(o,s){o?i(o):n(s)})})}SE(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Wce(t,e){try{return SE.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var f5=X((Qze,l5)=>{var hf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",o5=Ct("path"),Hce=hf?";":":",s5=i5(),a5=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),u5=(t,e)=>{let r=e.colon||Hce,n=t.match(/\//)||hf&&t.match(/\\/)?[""]:[...hf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=hf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=hf?i.split(r):[""];return hf&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},c5=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=u5(t,e),s=[],a=c=>new Promise((l,f)=>{if(c===n.length)return e.all&&s.length?l(s):f(a5(t));let d=n[c],p=/^".*"$/.test(d)?d.slice(1,-1):d,y=o5.join(p,t),C=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+y:y;l(u(C,c,0))}),u=(c,l,f)=>new Promise((d,p)=>{if(f===i.length)return d(a(l+1));let y=i[f];s5(c+y,{pathExt:o},(C,g)=>{if(!C&&g)if(e.all)s.push(c+y);else return d(c+y);return d(u(c,l,f+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},zce=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=u5(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=o5.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let f=0;f<n.length;f++){let d=l+n[f];try{if(s5.sync(d,{pathExt:i}))if(e.all)o.push(d);else return d}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw a5(t)};l5.exports=c5;c5.sync=zce});var p5=X((Zze,qS)=>{"use strict";var d5=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};qS.exports=d5;qS.exports.default=d5});var D5=X((eKe,g5)=>{"use strict";var m5=Ct("path"),Kce=f5(),Yce=p5();function h5(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Kce.sync(t.command,{path:r[Yce({env:r})],pathExt:e?m5.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=m5.resolve(i?t.options.cwd:"",s)),s}function Xce(t){return h5(t)||h5(t,!0)}g5.exports=Xce});var y5=X((tKe,GS)=>{"use strict";var US=/([()\][%!^"`<>&|;, *?])/g;function Jce(t){return t=t.replace(US,"^$1"),t}function Qce(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(US,"^$1"),e&&(t=t.replace(US,"^$1")),t}GS.exports.command=Jce;GS.exports.argument=Qce});var C5=X((rKe,E5)=>{"use strict";E5.exports=/^#!(.*)/});var A5=X((nKe,x5)=>{"use strict";var Zce=C5();x5.exports=(t="")=>{let e=t.match(Zce);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var w5=X((iKe,v5)=>{"use strict";var WS=Ct("fs"),ele=A5();function tle(t){let r=Buffer.alloc(150),n;try{n=WS.openSync(t,"r"),WS.readSync(n,r,0,150,0),WS.closeSync(n)}catch{}return ele(r.toString())}v5.exports=tle});var R5=X((oKe,S5)=>{"use strict";var rle=Ct("path"),b5=D5(),F5=y5(),nle=w5(),ile=process.platform==="win32",ole=/\.(?:com|exe)$/i,sle=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ale(t){t.file=b5(t);let e=t.file&&nle(t.file);return e?(t.args.unshift(t.file),t.command=e,b5(t)):t.file}function ule(t){if(!ile)return t;let e=ale(t),r=!ole.test(e);if(t.options.forceShell||r){let n=sle.test(e);t.command=rle.normalize(t.command),t.command=F5.command(t.command),t.args=t.args.map(o=>F5.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function cle(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:ule(n)}S5.exports=cle});var k5=X((sKe,_5)=>{"use strict";var HS=process.platform==="win32";function zS(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function lle(t,e){if(!HS)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=T5(i,e,"spawn");if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function T5(t,e){return HS&&t===1&&!e.file?zS(e.original,"spawn"):null}function fle(t,e){return HS&&t===1&&!e.file?zS(e.original,"spawnSync"):null}_5.exports={hookChildProcess:lle,verifyENOENT:T5,verifyENOENTSync:fle,notFoundError:zS}});var L5=X((aKe,gf)=>{"use strict";var P5=Ct("child_process"),KS=R5(),YS=k5();function I5(t,e,r){let n=KS(t,e,r),i=P5.spawn(n.command,n.args,n.options);return YS.hookChildProcess(i,n),i}function dle(t,e,r){let n=KS(t,e,r),i=P5.spawnSync(n.command,n.args,n.options);return i.error=i.error||YS.verifyENOENTSync(i.status,n),i}gf.exports=I5;gf.exports.spawn=I5;gf.exports.sync=dle;gf.exports._parse=KS;gf.exports._enoent=YS});var Iq=X((Htt,Rhe)=>{Rhe.exports=[{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Oq=X(Si=>{"use strict";var Nq=Iq(),tn=process.env;Object.defineProperty(Si,"_vendors",{value:Nq.map(function(t){return t.constant})});Si.name=null;Si.isPR=null;Nq.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Lq(n)});if(Si[t.constant]=r,!!r)switch(Si.name=t.name,typeof t.pr){case"string":Si.isPR=!!tn[t.pr];break;case"object":"env"in t.pr?Si.isPR=t.pr.env in tn&&tn[t.pr.env]!==t.pr.ne:"any"in t.pr?Si.isPR=t.pr.any.some(function(n){return!!tn[n]}):Si.isPR=Lq(t.pr);break;default:Si.isPR=null}});Si.isCI=!!(tn.CI!=="false"&&(tn.BUILD_ID||tn.BUILD_NUMBER||tn.CI||tn.CI_APP_ID||tn.CI_BUILD_ID||tn.CI_BUILD_NUMBER||tn.CI_NAME||tn.CONTINUOUS_INTEGRATION||tn.RUN_ID||Si.name));function Lq(t){return typeof t=="string"?!!tn[t]:"env"in t?tn[t.env]&&tn[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!tn[e]}):Object.keys(t).every(function(e){return tn[e]===t[e]})}});rx();Hm();zm();Ym();var Um=Se(Mr(),1);import{argv as $De,exit as MDe,stdout as jDe}from"node:process";var dW=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};function a2(t,e,r){var n=function(o){return t.apply(void 0,dW([o],Array.from(e),!1))},i=r??t.lazy;return i===void 0?n:Object.assign(n,{lazy:i,lazyArgs:e})}function Re(t,e,r){var n=t.length-e.length;if(n===0)return t.apply(void 0,Array.from(e));if(n===1)return a2(t,e,r);throw new Error("Wrong number of arguments")}function pc(){return Re(pW,arguments)}function pW(t,e){var r=e.min,n=e.max;return r!==void 0&&t<r?r:n!==void 0&&t>n?n:t}function pt(t){return!!t}function $s(t){for(var e,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];for(var i=t,o=r.map(function(A){return"lazy"in A?mW(A):void 0}),s=0;s<r.length;){var a=o[s];if(a===void 0||!hW(i)){var u=r[s];i=u(i),s+=1;continue}for(var c=[],l=s;l<r.length;l++){var f=o[l];if(f===void 0||(c.push(f),f.isSingle))break}for(var d=[],p=i[Symbol.iterator]();;){var y=p.next();if((e=y.done)!==null&&e!==void 0&&e)break;var C=u2(y.value,d,c);if(C)break}var g=c[c.length-1].isSingle;i=g?d[0]:d,s+=c.length}return i}function u2(t,e,r){var n;if(r.length===0)return e.push(t),!1;for(var i=t,o={done:!1,hasNext:!1},s=!1,a=0;a<r.length;a++){var u=r[a],c=u.isIndexed,l=u.index,f=u.items;if(f.push(i),o=c?u(i,l,f):u(i),u.index+=1,o.hasNext){if((n=o.hasMany)!==null&&n!==void 0&&n){for(var d=0,p=o.next;d<p.length;d++){var y=p[d],C=u2(y,e,r.slice(a+1));if(C)return!0}return!1}i=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&e.push(i),!!s}function mW(t){var e=t.lazy,r=t.lazyArgs,n=e.apply(void 0,r??[]);return Object.assign(n,{isIndexed:e.indexed,isSingle:e.single,index:0,items:[]})}function hW(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function c2(t,e){var r=e.waitMs,n=e.timing,i=n===void 0?"trailing":n,o=e.maxWaitMs;if(o!==void 0&&r!==void 0&&o<r)throw new Error("debounce: maxWaitMs (".concat(o,") cannot be less than waitMs (").concat(r,")"));var s,a,u,c,l=function(){if(u!==void 0){if(a!==void 0){var p=a;a=void 0,clearTimeout(p)}var y=u;u=void 0,c=t.apply(void 0,y)}},f=function(){if(s!==void 0){var p=s;s=void 0,clearTimeout(p),u!==void 0&&l()}},d=function(p){u=p,o!==void 0&&a===void 0&&(a=setTimeout(l,o))};return{call:function(){for(var p,y=[],C=0;C<arguments.length;C++)y[C]=arguments[C];if(s===void 0)i==="trailing"?d(y):c=t.apply(void 0,y);else{i!=="leading"&&d(y);var g=s;s=void 0,clearTimeout(g)}return s=setTimeout(f,(p=r??o)!==null&&p!==void 0?p:0),c},cancel:function(){if(s!==void 0){var p=s;s=void 0,clearTimeout(p)}if(a!==void 0){var p=a;a=void 0,clearTimeout(p)}u=void 0},flush:function(){return f(),c},get isPending(){return s!==void 0},get cachedValue(){return c}}}function ci(t,e,r){r===void 0&&(r=!1);for(var n=[],i=0;i<t.length;i++){var o=t[i],s=r?e(o,i,t):e(o);if(s.hasMany===!0?n.push.apply(n,s.next):s.hasNext&&n.push(s.next),s.done)break}return n}var l2=function(t){return{hasNext:!0,next:t,done:!1}};function mc(){return Re(gW,arguments,mc.lazy)}function gW(t,e){var r=mc.lazy(e);return ci(t,r)}(function(t){function e(n){var i=new Set(n);return function(o){return i.has(o)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:o}}}t.lazy=e;function r(){return Re(DW,arguments,f2)}t.multiset=r})(mc||(mc={}));var DW=function(t,e){return ci(t,f2(e))};function f2(t){var e;if(t.length===0)return l2;for(var r=new Map,n=0,i=t;n<i.length;n++){var o=i[n];r.set(o,((e=r.get(o))!==null&&e!==void 0?e:0)+1)}return function(s){var a=r.get(s);return a===void 0||a===0?{done:!1,hasNext:!0,next:s}:(r.set(s,a-1),{done:!1,hasNext:!1})}}function Qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Re(yW,t)}var yW=function(t,e){return t.length>=e};var p2=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},m2={asc:function(t,e){return t>e},desc:function(t,e){return t<e}};function h2(t,e){var r=Array.isArray(e)?e:Array.from(e),n=r[0],i=r.slice(1);if(!EW(n)){var o=sx.apply(void 0,i);return t(n,o)}var s=sx.apply(void 0,p2([n],i,!1));return function(a){return t(a,s)}}function sx(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=typeof t=="function"?t:t[0],o=typeof t=="function"?"asc":t[1],s=m2,a=o,u=s[a],c=e===void 0?void 0:sx.apply(void 0,p2([e],r,!1));return function(l,f){var d,p=i(l),y=i(f);return u(p,y)?1:u(y,p)?-1:(d=c?.(l,f))!==null&&d!==void 0?d:0}}function EW(t){if(d2(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;var e=t,r=e[0],n=e[1],i=e.slice(2);return d2(r)&&typeof n=="string"&&n in m2&&i.length===0}var d2=function(t){return typeof t=="function"&&t.length===1};function Wf(){return Re(Object.entries,arguments)}(function(t){t.strict=t})(Wf||(Wf={}));var Ms=function(t){return Object.assign(t,{indexed:!0})};function Fn(){return Re(D2(!1),arguments,Fn.lazy)}var D2=function(t){return function(e,r){return ci(e,t?Fn.lazyIndexed(r):Fn.lazy(r),t)}},g2=function(t){return function(e){return function(r,n,i){return(t?e(r,n,i):e(r))?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}}};(function(t){function e(){return Re(D2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=g2(!1),t.lazyIndexed=Ms(g2(!0))})(Fn||(Fn={}));var ax=function(t){return Object.assign(t,{single:!0})};function Ma(){return Re(E2(!1),arguments,Ma.lazy)}var E2=function(t){return function(e,r){return e.find(function(n,i,o){return t?r(n,i,o):r(n)})}},y2=function(t){return function(e){return function(r,n,i){return(t?e(r,n,i):e(r))?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!1}}}};(function(t){function e(){return Re(E2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=ax(y2(!1)),t.lazyIndexed=ax(Ms(y2(!0)))})(Ma||(Ma={}));function th(){return Re(C2(!1),arguments)}var C2=function(t){return function(e,r){for(var n=e.length-1;n>=0;n--)if(t?r(e[n],n,e):r(e[n]))return e[n]}};(function(t){function e(){return Re(C2(!0),arguments)}t.indexed=e})(th||(th={}));function eo(){return Re(CW,arguments,eo.lazy)}function CW(t){var e=t[0];return e}(function(t){function e(){return function(r){return{done:!0,hasNext:!0,next:r}}}t.lazy=e,function(r){r.single=!0}(e=t.lazy||(t.lazy={}))})(eo||(eo={}));function x2(){return h2(xW,arguments)}function xW(t,e){if(!Qt(t,2))return t[0];for(var r=t[0],n=t.slice(1),i=0,o=n;i<o.length;i++){var s=o[i];e(s,r)<0&&(r=s)}return r}function hc(){return Re(AW,arguments,hc.lazy)}function AW(t){return ci(t,hc.lazy())}(function(t){t.lazy=function(){return function(e){return Array.isArray(e)?{done:!1,hasNext:!0,hasMany:!0,next:e}:{done:!1,hasNext:!0,next:e}}}})(hc||(hc={}));function ja(){return Re(vW,arguments,ja.lazy)}function vW(t,e){return hc(t.map(function(r){return e(r)}))}(function(t){t.lazy=function(e){return function(r){var n=e(r);return Array.isArray(n)?{done:!1,hasNext:!0,hasMany:!0,next:n}:{done:!1,hasNext:!0,next:n}}}})(ja||(ja={}));function Va(){return Re(v2(!1),arguments,Va.lazy)}var v2=function(t){return function(e,r){return ci(e,t?Va.lazyIndexed(r):Va.lazy(r),t)}},A2=function(t){return function(e){return function(r,n,i){return t?e(r,n,i):e(r),{done:!1,hasNext:!0,next:r}}}};(function(t){function e(){return Re(v2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=A2(!1),t.lazyIndexed=Ms(A2(!0))})(Va||(Va={}));function w2(t){return Array.isArray(t)}function gc(t){return t!=null}(function(t){function e(r){return r!==void 0}t.strict=e})(gc||(gc={}));function b2(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function rh(t){return typeof t=="string"}function xo(t){return t===void 0?!0:w2(t)||rh(t)?t.length===0:b2(t)?Object.keys(t).length===0:!1}function F2(t,e){if(e===void 0){var r=new Set(t);return function(n){return r.has(n)}}return e.indexOf(t)>=0}function tt(t){return t==null}function nh(t){return typeof t=="number"&&!isNaN(t)}function ih(){return Re(Object.keys,arguments)}(function(t){t.strict=t})(ih||(ih={}));function to(){return Re(wW,arguments)}function wW(t){return t[t.length-1]}function li(){return Re(R2(!1),arguments,li.lazy)}var R2=function(t){return function(e,r){return ci(e,t?li.lazyIndexed(r):li.lazy(r),t)}},S2=function(t){return function(e){return function(r,n,i){return{done:!1,hasNext:!0,next:t?e(r,n,i):e(r)}}}};(function(t){function e(){return Re(R2(!0),arguments,t.lazyIndexed)}t.indexed=e,t.lazy=S2(!1),t.lazyIndexed=Ms(S2(!0)),t.strict=t})(li||(li={}));function js(){return Re(T2(!1),arguments)}var T2=function(t){return function(e,r){for(var n={},i=0;i<e.length;i++){var o=e[i],s=t?r(o,i,e):r(o),a=s[0],u=s[1];n[a]=u}return n}};(function(t){function e(){return Re(T2(!0),arguments)}t.indexed=e})(js||(js={}));function _2(){return Re(bW,arguments)}function bW(t,e){if(t==null)return t;for(var r={},n=0,i=ih.strict(t);n<i.length;n++){var o=i[n];e(t[o],o)||(r[o]=t[o])}return r}var k2=function(t){return function(e){var r=t,n=e[r];return n}};function oh(){return Re(P2(!1),arguments)}var P2=function(t){return function(e,r,n){return e.reduce(function(i,o,s){return t?r(i,o,s,e):r(i,o)},n)}};(function(t){function e(){return Re(P2(!0),arguments)}t.indexed=e})(oh||(oh={}));function Dc(){return Re(FW,arguments)}function FW(t,e){var r=t.slice();return r.sort(e),r}(function(t){t.strict=t})(Dc||(Dc={}));function _i(){return Re(SW,arguments,_i.lazy)}function SW(t){return ci(t,_i.lazy())}(function(t){function e(){var r=new Set;return function(n){return r.has(n)?{done:!1,hasNext:!1}:(r.add(n),{done:!1,hasNext:!0,next:n})}}t.lazy=e})(_i||(_i={}));function Hf(){return Re(Object.values,arguments)}function sh(){return Re(RW,arguments)}function RW(t,e){for(var r=t.length>e.length?e.length:t.length,n=[],i=0;i<r;i++)n.push([t[i],e[i]]);return n}(function(t){t.strict=t})(sh||(sh={}));import{notStrictEqual as ZW,strictEqual as eH}from"assert";var TW={right:LW,center:NW},_W=0,ah=1,kW=2,uh=3,ux=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
|
|
109
109
|
`).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&fi.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),fi.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=fi.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
|
|
110
110
|
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],c=this.negatePadding(e[a]),l=s;if(c>fi.stringWidth(s)&&(l+=" ".repeat(c-fi.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let d=TW[e[a].align];l=d(l,c),fi.stringWidth(l)<c&&(l+=" ".repeat((u||0)-fi.stringWidth(l)-1))}let f=e[a].padding||[0,0,0,0];f[uh]&&(o+=" ".repeat(f[uh])),o+=I2(e[a],l,"| "),o+=l,o+=I2(e[a],l," |"),f[ah]&&(o+=" ".repeat(f[ah])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=fi.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=fi.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
|
|
111
111
|
`):i=o.text.split(`
|
|
@@ -168,7 +168,7 @@ ${y.join(`
|
|
|
168
168
|
`;d.forEach(y=>{p+=y}),e.fail(p)}};let u={};o.conflicts=function(f,d){pe("<string|object> [array|string]",[f,d],arguments.length),typeof f=="object"?Object.keys(f).forEach(p=>{o.conflicts(p,f[p])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(d)?d.forEach(p=>o.conflicts(f,p)):u[f].push(d))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(d=>{u[d]&&u[d].forEach(p=>{p&&f[d]!==void 0&&f[p]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",d,p))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(d=>{u[d].forEach(p=>{p&&f[r.Parser.camelCase(d)]!==void 0&&f[r.Parser.camelCase(p)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",d,p))})})},o.recommendCommands=function(f,d){d=d.sort((g,A)=>A.length-g.length);let y=null,C=1/0;for(let g=0,A;(A=d[g])!==void 0;g++){let m=c_(f,A);m<=3&&m<C&&(C=m,y=A)}y&&e.fail(n("Did you mean %s?",y))},o.reset=function(f){return s=qs(s,d=>!f[d]),u=qs(u,d=>!f[d]),o};let c=[];return o.freeze=function(){c.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=c.pop();Ln(f,void 0,r),{implied:s,conflicting:u}=f},o}var wx=[],Yf;function Xf(t,e,r,n){Yf=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=xH(e,t.extends);else try{s=Ct.resolve(t.extends)}catch{return t}CH(s),wx.push(s),i=o?JSON.parse(Yf.readFileSync(s,"utf8")):Ct(t.extends),delete t.extends,i=Xf(i,Yf.path.dirname(s),r,Yf)}return wx=[],r?d_(i,t):Object.assign({},i,t)}function CH(t){if(wx.indexOf(t)>-1)throw new Zt(`Circular extended configurations: '${t}'.`)}function xH(t,e){return Yf.path.resolve(t,e)}function d_(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=d_(t[i],e[i]):r[i]=e[i];return r}var he=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},v=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pr,Wa,Jf,Pi,di,hh,Gs,Ha,gh,Ii,Dh,Li,Ao,pi,Ni,yh,Cc,un,ve,Eh,Ch,mi,za,xc,Ka,Ws,xh,ke,Ya,Xa,Ja,Be,Ah,vo,vr;function P_(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Nx(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var p_=Symbol("copyDoubleDash"),m_=Symbol("copyDoubleDash"),bx=Symbol("deleteFromParserHintObject"),h_=Symbol("emitWarning"),g_=Symbol("freeze"),D_=Symbol("getDollarZero"),Qa=Symbol("getParserConfiguration"),y_=Symbol("getUsageConfiguration"),Fx=Symbol("guessLocale"),E_=Symbol("guessVersion"),C_=Symbol("parsePositionalNumbers"),Sx=Symbol("pkgUp"),Hs=Symbol("populateParserHintArray"),Ac=Symbol("populateParserHintSingleValueDictionary"),Rx=Symbol("populateParserHintArrayDictionary"),Tx=Symbol("populateParserHintDictionary"),_x=Symbol("sanitizeKey"),kx=Symbol("setKey"),Px=Symbol("unfreeze"),x_=Symbol("validateAsync"),A_=Symbol("getCommandInstance"),v_=Symbol("getContext"),w_=Symbol("getHasOutput"),b_=Symbol("getLoggerInstance"),F_=Symbol("getParseContext"),S_=Symbol("getUsageInstance"),R_=Symbol("getValidationInstance"),vh=Symbol("hasParseCallback"),T_=Symbol("isGlobalContext"),Za=Symbol("postProcess"),__=Symbol("rebase"),Ix=Symbol("reset"),Qf=Symbol("runYargsParserAndExecuteCommands"),Lx=Symbol("runValidation"),k_=Symbol("setHasOutput"),eu=Symbol("kTrackManuallySetKeys"),Nx=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,Pr.set(this,void 0),Wa.set(this,void 0),Jf.set(this,{commands:[],fullCommands:[]}),Pi.set(this,null),di.set(this,null),hh.set(this,"show-hidden"),Gs.set(this,null),Ha.set(this,!0),gh.set(this,{}),Ii.set(this,!0),Dh.set(this,[]),Li.set(this,void 0),Ao.set(this,{}),pi.set(this,!1),Ni.set(this,null),yh.set(this,!0),Cc.set(this,void 0),un.set(this,""),ve.set(this,void 0),Eh.set(this,void 0),Ch.set(this,{}),mi.set(this,null),za.set(this,null),xc.set(this,{}),Ka.set(this,{}),Ws.set(this,void 0),xh.set(this,!1),ke.set(this,void 0),Ya.set(this,!1),Xa.set(this,!1),Ja.set(this,!1),Be.set(this,void 0),Ah.set(this,{}),vo.set(this,null),vr.set(this,void 0),he(this,ke,i,"f"),he(this,Ws,e,"f"),he(this,Wa,r,"f"),he(this,Eh,n,"f"),he(this,Li,new dh(this),"f"),this.$0=this[D_](),this[Ix](),he(this,Pr,v(this,Pr,"f"),"f"),he(this,Be,v(this,Be,"f"),"f"),he(this,vr,v(this,vr,"f"),"f"),he(this,ve,v(this,ve,"f"),"f"),v(this,ve,"f").showHiddenOpt=v(this,hh,"f"),he(this,Cc,this[m_](),"f")}addHelpOpt(e,r){let n="help";return pe("[string|boolean] [string]",[e,r],arguments.length),v(this,Ni,"f")&&(this[bx](v(this,Ni,"f")),he(this,Ni,null,"f")),e===!1&&r===void 0?this:(he(this,Ni,typeof e=="string"?e:n,"f"),this.boolean(v(this,Ni,"f")),this.describe(v(this,Ni,"f"),r||v(this,Be,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(pe("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:v(this,hh,"f");return this.boolean(n),this.describe(n,r||v(this,Be,"f").deferY18nLookup("Show hidden options")),v(this,ve,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return pe("<object|string|array> [string|array]",[e,r],arguments.length),this[Rx](this.alias.bind(this),"alias",e,r),this}array(e){return pe("<array|string>",[e],arguments.length),this[Hs]("array",e),this[eu](e),this}boolean(e){return pe("<array|string>",[e],arguments.length),this[Hs]("boolean",e),this[eu](e),this}check(e,r){return pe("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Ga(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&v(this,Be,"f").fail(o.toString(),o):v(this,Be,"f").fail(v(this,ke,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(v(this,Be,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return pe("<object|string|array> [string|array]",[e,r],arguments.length),this[Rx](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(pe("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Zt("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new Zt("coerce callback must be provided");return v(this,ve,"f").key[e]=!0,v(this,Li,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Ga(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let c of o[e])n[c]=a;return n},a=>{throw new Zt(a.message)}):n},e),this}conflicts(e,r){return pe("<string|object> [string|array]",[e,r],arguments.length),v(this,vr,"f").conflicts(e,r),this}config(e="config",r,n){return pe("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=Xf(e,v(this,Wa,"f"),this[Qa]()["deep-merge-config"]||!1,v(this,ke,"f")),v(this,ve,"f").configObjects=(v(this,ve,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||v(this,Be,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{v(this,ve,"f").config[i]=n||!0}),this)}completion(e,r,n){return pe("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),he(this,di,e||v(this,di,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(v(this,di,"f"),r),n&&v(this,Pi,"f").registerFunction(n),this}command(e,r,n,i,o,s){return pe("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),v(this,Pr,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){pe("<string> [object]",[e,r],arguments.length);let n=v(this,Eh,"f")||v(this,ke,"f").require;return v(this,Pr,"f").addDirectory(e,n,v(this,ke,"f").getCallerFile(),r),this}count(e){return pe("<array|string>",[e],arguments.length),this[Hs]("count",e),this[eu](e),this}default(e,r,n){return pe("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(Ex(e,v(this,ke,"f")),v(this,ve,"f").defaultDescription[e]=n),typeof r=="function"&&(Ex(e,v(this,ke,"f")),v(this,ve,"f").defaultDescription[e]||(v(this,ve,"f").defaultDescription[e]=v(this,Be,"f").functionDescription(r)),r=r.call()),this[Ac](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return pe("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),v(this,ve,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Ln(n,!0,v(this,ke,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Ln(n,!0,v(this,ke,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Ln(n,!0,v(this,ke,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return pe("<object|string|array> [string]",[e,r],arguments.length),this[Ac](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return pe("<string> [string|boolean]",[e,r],arguments.length),v(this,ve,"f").deprecatedOptions[e]=r,this}describe(e,r){return pe("<object|string|array> [string]",[e,r],arguments.length),this[kx](e,!0),v(this,Be,"f").describe(e,r),this}detectLocale(e){return pe("<boolean>",[e],arguments.length),he(this,Ha,e,"f"),this}env(e){return pe("[string|boolean]",[e],arguments.length),e===!1?delete v(this,ve,"f").envPrefix:v(this,ve,"f").envPrefix=e||"",this}epilogue(e){return pe("<string>",[e],arguments.length),v(this,Be,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return pe("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):v(this,Be,"f").example(e,r),this}exit(e,r){he(this,pi,!0,"f"),he(this,Gs,r,"f"),v(this,Ii,"f")&&v(this,ke,"f").process.exit(e)}exitProcess(e=!0){return pe("[boolean]",[e],arguments.length),he(this,Ii,e,"f"),this}fail(e){if(pe("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Zt("Invalid first argument. Expected function or boolean 'false'");return v(this,Be,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return pe("<array> [function]",[e,r],arguments.length),r?v(this,Pi,"f").getCompletion(e,r):new Promise((n,i)=>{v(this,Pi,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return pe([],0),v(this,ve,"f").demandedOptions}getDemandedCommands(){return pe([],0),v(this,ve,"f").demandedCommands}getDeprecatedOptions(){return pe([],0),v(this,ve,"f").deprecatedOptions}getDetectLocale(){return v(this,Ha,"f")}getExitProcess(){return v(this,Ii,"f")}getGroups(){return Object.assign({},v(this,Ao,"f"),v(this,Ka,"f"))}getHelp(){if(he(this,pi,!0,"f"),!v(this,Be,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Qf](v(this,Ws,"f"),void 0,void 0,0,!0);if(er(r))return r.then(()=>v(this,Be,"f").help())}let e=v(this,Pr,"f").runDefaultBuilderOn(this);if(er(e))return e.then(()=>v(this,Be,"f").help())}return Promise.resolve(v(this,Be,"f").help())}getOptions(){return v(this,ve,"f")}getStrict(){return v(this,Ya,"f")}getStrictCommands(){return v(this,Xa,"f")}getStrictOptions(){return v(this,Ja,"f")}global(e,r){return pe("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?v(this,ve,"f").local=v(this,ve,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{v(this,ve,"f").local.includes(n)||v(this,ve,"f").local.push(n)}),this}group(e,r){pe("<string|array> <string>",[e,r],arguments.length);let n=v(this,Ka,"f")[r]||v(this,Ao,"f")[r];v(this,Ka,"f")[r]&&delete v(this,Ka,"f")[r];let i={};return v(this,Ao,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return pe("<string>",[e],arguments.length),v(this,ve,"f").hiddenOptions.push(e),this}implies(e,r){return pe("<string|object> [number|string|array]",[e,r],arguments.length),v(this,vr,"f").implies(e,r),this}locale(e){return pe("[string]",[e],arguments.length),e===void 0?(this[Fx](),v(this,ke,"f").y18n.getLocale()):(he(this,Ha,!1,"f"),v(this,ke,"f").y18n.setLocale(e),this)}middleware(e,r,n){return v(this,Li,"f").addMiddleware(e,!!r,n)}nargs(e,r){return pe("<string|object|array> [number]",[e,r],arguments.length),this[Ac](this.nargs.bind(this),"narg",e,r),this}normalize(e){return pe("<array|string>",[e],arguments.length),this[Hs]("normalize",e),this}number(e){return pe("<array|string>",[e],arguments.length),this[Hs]("number",e),this[eu](e),this}option(e,r){if(pe("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[eu](e),v(this,vo,"f")&&(e==="version"||r?.alias==="version")&&this[h_](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
169
169
|
`),void 0,"versionWarning"),v(this,ve,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(v(this,ve,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=v(this,Be,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){pe("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[g_](),typeof e>"u"&&(e=v(this,Ws,"f")),typeof r=="object"&&(he(this,za,r,"f"),r=n),typeof r=="function"&&(he(this,mi,r,"f"),r=!1),r||he(this,Ws,e,"f"),v(this,mi,"f")&&he(this,Ii,!1,"f");let i=this[Qf](e,!!r),o=this.parsed;return v(this,Pi,"f").setParsed(this.parsed),er(i)?i.then(s=>(v(this,mi,"f")&&v(this,mi,"f").call(this,v(this,Gs,"f"),s,v(this,un,"f")),s)).catch(s=>{throw v(this,mi,"f")&&v(this,mi,"f")(s,this.parsed.argv,v(this,un,"f")),s}).finally(()=>{this[Px](),this.parsed=o}):(v(this,mi,"f")&&v(this,mi,"f").call(this,v(this,Gs,"f"),i,v(this,un,"f")),this[Px](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return er(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(er(i))throw new Zt(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return pe("<object>",[e],arguments.length),he(this,Ch,e,"f"),this}pkgConf(e,r){pe("<string> [string]",[e,r],arguments.length);let n=null,i=this[Sx](r||v(this,Wa,"f"));return i[e]&&typeof i[e]=="object"&&(n=Xf(i[e],r||v(this,Wa,"f"),this[Qa]()["deep-merge-config"]||!1,v(this,ke,"f")),v(this,ve,"f").configObjects=(v(this,ve,"f").configObjects||[]).concat(n)),this}positional(e,r){pe("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=qs(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=v(this,Jf,"f").fullCommands[v(this,Jf,"f").fullCommands.length-1],o=i?v(this,Pr,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return yc(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,v(this,Be,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return pe("[boolean]",[e],arguments.length),he(this,xh,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return pe("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&v(this,ve,"f").narg[e]?this:(this[Ac](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return pe("[string] [string]",[e,r],arguments.length),e=e||this.$0,v(this,Cc,"f").log(v(this,Pi,"f").generateCompletionScript(e,r||v(this,di,"f")||"completion")),this}showHelp(e){if(pe("[string|function]",[e],arguments.length),he(this,pi,!0,"f"),!v(this,Be,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Qf](v(this,Ws,"f"),void 0,void 0,0,!0);if(er(n))return n.then(()=>{v(this,Be,"f").showHelp(e)}),this}let r=v(this,Pr,"f").runDefaultBuilderOn(this);if(er(r))return r.then(()=>{v(this,Be,"f").showHelp(e)}),this}return v(this,Be,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return pe("[boolean|string] [string]",[e,r],arguments.length),v(this,Be,"f").showHelpOnFail(e,r),this}showVersion(e){return pe("[string|function]",[e],arguments.length),v(this,Be,"f").showVersion(e),this}skipValidation(e){return pe("<array|string>",[e],arguments.length),this[Hs]("skipValidation",e),this}strict(e){return pe("[boolean]",[e],arguments.length),he(this,Ya,e!==!1,"f"),this}strictCommands(e){return pe("[boolean]",[e],arguments.length),he(this,Xa,e!==!1,"f"),this}strictOptions(e){return pe("[boolean]",[e],arguments.length),he(this,Ja,e!==!1,"f"),this}string(e){return pe("<array|string>",[e],arguments.length),this[Hs]("string",e),this[eu](e),this}terminalWidth(){return pe([],0),v(this,ke,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return pe("<object>",[e],arguments.length),he(this,Ha,!1,"f"),v(this,ke,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(pe("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Ln(e,null,v(this,ke,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new Zt(".usage() description must start with $0 if being used as alias for .command()")}else return v(this,Be,"f").usage(e),this}usageConfiguration(e){return pe("<object>",[e],arguments.length),he(this,Ah,e,"f"),this}version(e,r,n){let i="version";if(pe("[boolean|string] [string] [string]",[e,r,n],arguments.length),v(this,vo,"f")&&(this[bx](v(this,vo,"f")),v(this,Be,"f").version(void 0),he(this,vo,null,"f")),arguments.length===0)n=this[E_](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return he(this,vo,typeof e=="string"?e:i,"f"),r=r||v(this,Be,"f").deferY18nLookup("Show version number"),v(this,Be,"f").version(n||void 0),this.boolean(v(this,vo,"f")),this.describe(v(this,vo,"f"),r),this}wrap(e){return pe("<number|null|undefined>",[e],arguments.length),v(this,Be,"f").wrap(e),this}[(Pr=new WeakMap,Wa=new WeakMap,Jf=new WeakMap,Pi=new WeakMap,di=new WeakMap,hh=new WeakMap,Gs=new WeakMap,Ha=new WeakMap,gh=new WeakMap,Ii=new WeakMap,Dh=new WeakMap,Li=new WeakMap,Ao=new WeakMap,pi=new WeakMap,Ni=new WeakMap,yh=new WeakMap,Cc=new WeakMap,un=new WeakMap,ve=new WeakMap,Eh=new WeakMap,Ch=new WeakMap,mi=new WeakMap,za=new WeakMap,xc=new WeakMap,Ka=new WeakMap,Ws=new WeakMap,xh=new WeakMap,ke=new WeakMap,Ya=new WeakMap,Xa=new WeakMap,Ja=new WeakMap,Be=new WeakMap,Ah=new WeakMap,vo=new WeakMap,vr=new WeakMap,p_)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[m_](){return{log:(...e)=>{this[vh]()||console.log(...e),he(this,pi,!0,"f"),v(this,un,"f").length&&he(this,un,v(this,un,"f")+`
|
|
170
170
|
`,"f"),he(this,un,v(this,un,"f")+e.join(" "),"f")},error:(...e)=>{this[vh]()||console.error(...e),he(this,pi,!0,"f"),v(this,un,"f").length&&he(this,un,v(this,un,"f")+`
|
|
171
|
-
`,"f"),he(this,un,v(this,un,"f")+e.join(" "),"f")}}}[bx](e){yc(v(this,ve,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=v(this,ve,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete v(this,Be,"f").getDescriptions()[e]}[h_](e,r,n){v(this,gh,"f")[n]||(v(this,ke,"f").process.emitWarning(e,r),v(this,gh,"f")[n]=!0)}[g_](){v(this,Dh,"f").push({options:v(this,ve,"f"),configObjects:v(this,ve,"f").configObjects.slice(0),exitProcess:v(this,Ii,"f"),groups:v(this,Ao,"f"),strict:v(this,Ya,"f"),strictCommands:v(this,Xa,"f"),strictOptions:v(this,Ja,"f"),completionCommand:v(this,di,"f"),output:v(this,un,"f"),exitError:v(this,Gs,"f"),hasOutput:v(this,pi,"f"),parsed:this.parsed,parseFn:v(this,mi,"f"),parseContext:v(this,za,"f")}),v(this,Be,"f").freeze(),v(this,vr,"f").freeze(),v(this,Pr,"f").freeze(),v(this,Li,"f").freeze()}[D_](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ke,"f").process.argv()[0])?r=v(this,ke,"f").process.argv().slice(1,2):r=v(this,ke,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[__](v(this,Wa,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),v(this,ke,"f").getEnv("_")&&v(this,ke,"f").getProcessArgvBin()===v(this,ke,"f").getEnv("_")&&(e=v(this,ke,"f").getEnv("_").replace(`${v(this,ke,"f").path.dirname(v(this,ke,"f").process.execPath())}/`,"")),e}[Qa](){return v(this,Ch,"f")}[y_](){return v(this,Ah,"f")}[Fx](){if(!v(this,Ha,"f"))return;let e=v(this,ke,"f").getEnv("LC_ALL")||v(this,ke,"f").getEnv("LC_MESSAGES")||v(this,ke,"f").getEnv("LANG")||v(this,ke,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[E_](){return this[Sx]().version||"unknown"}[C_](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)v(this,ke,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Sx](e){let r=e||"*";if(v(this,xc,"f")[r])return v(this,xc,"f")[r];let n={};try{let i=e||v(this,ke,"f").mainFilename;!e&&v(this,ke,"f").path.extname(i)&&(i=v(this,ke,"f").path.dirname(i));let o=v(this,ke,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Ln(o,void 0,v(this,ke,"f")),n=JSON.parse(v(this,ke,"f").readFileSync(o,"utf8"))}catch{}return v(this,xc,"f")[r]=n||{},v(this,xc,"f")[r]}[Hs](e,r){r=[].concat(r),r.forEach(n=>{n=this[_x](n),v(this,ve,"f")[e].push(n)})}[Ac](e,r,n,i){this[Tx](e,r,n,i,(o,s,a)=>{v(this,ve,"f")[o][s]=a})}[Rx](e,r,n,i){this[Tx](e,r,n,i,(o,s,a)=>{v(this,ve,"f")[o][s]=(v(this,ve,"f")[o][s]||[]).concat(a)})}[Tx](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of yc(n))e(s,n[s]);else o(r,this[_x](n),i)}[_x](e){return e==="__proto__"?"___proto___":e}[kx](e,r){return this[Ac](this[kx].bind(this),"key",e,r),this}[Px](){var e,r,n,i,o,s,a,u,c,l,f,d;let p=v(this,Dh,"f").pop();Ln(p,void 0,v(this,ke,"f"));let y;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,c=this,l=this,f=this,d=this,{options:{set value(C){he(e,ve,C,"f")}}.value,configObjects:y,exitProcess:{set value(C){he(r,Ii,C,"f")}}.value,groups:{set value(C){he(n,Ao,C,"f")}}.value,output:{set value(C){he(i,un,C,"f")}}.value,exitError:{set value(C){he(o,Gs,C,"f")}}.value,hasOutput:{set value(C){he(s,pi,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){he(a,Ya,C,"f")}}.value,strictCommands:{set value(C){he(u,Xa,C,"f")}}.value,strictOptions:{set value(C){he(c,Ja,C,"f")}}.value,completionCommand:{set value(C){he(l,di,C,"f")}}.value,parseFn:{set value(C){he(f,mi,C,"f")}}.value,parseContext:{set value(C){he(d,za,C,"f")}}.value}=p,v(this,ve,"f").configObjects=y,v(this,Be,"f").unfreeze(),v(this,vr,"f").unfreeze(),v(this,Pr,"f").unfreeze(),v(this,Li,"f").unfreeze()}[x_](e,r){return Ga(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[A_].bind(this),getContext:this[v_].bind(this),getHasOutput:this[w_].bind(this),getLoggerInstance:this[b_].bind(this),getParseContext:this[F_].bind(this),getParserConfiguration:this[Qa].bind(this),getUsageConfiguration:this[y_].bind(this),getUsageInstance:this[S_].bind(this),getValidationInstance:this[R_].bind(this),hasParseCallback:this[vh].bind(this),isGlobalContext:this[T_].bind(this),postProcess:this[Za].bind(this),reset:this[Ix].bind(this),runValidation:this[Lx].bind(this),runYargsParserAndExecuteCommands:this[Qf].bind(this),setHasOutput:this[k_].bind(this)}}[A_](){return v(this,Pr,"f")}[v_](){return v(this,Jf,"f")}[w_](){return v(this,pi,"f")}[b_](){return v(this,Cc,"f")}[F_](){return v(this,za,"f")||{}}[S_](){return v(this,Be,"f")}[R_](){return v(this,vr,"f")}[vh](){return!!v(this,mi,"f")}[T_](){return v(this,yh,"f")}[Za](e,r,n,i){return n||er(e)||(r||(e=this[p_](e)),(this[Qa]()["parse-positional-numbers"]||this[Qa]()["parse-positional-numbers"]===void 0)&&(e=this[C_](e)),i&&(e=Ua(e,this,v(this,Li,"f").getMiddleware(),!1))),e}[Ix](e={}){he(this,ve,v(this,ve,"f")||{},"f");let r={};r.local=v(this,ve,"f").local||[],r.configObjects=v(this,ve,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(v(this,Ka,"f"),Object.keys(v(this,Ao,"f")).reduce((s,a)=>{let u=v(this,Ao,"f")[a].filter(c=>!(c in n));return u.length>0&&(s[a]=u),s},{})),he(this,Ao,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(v(this,ve,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=qs(v(this,ve,"f")[s],a=>!n[a])}),r.envPrefix=v(this,ve,"f").envPrefix,he(this,ve,r,"f"),he(this,Be,v(this,Be,"f")?v(this,Be,"f").reset(n):o_(this,v(this,ke,"f")),"f"),he(this,vr,v(this,vr,"f")?v(this,vr,"f").reset(n):f_(this,v(this,Be,"f"),v(this,ke,"f")),"f"),he(this,Pr,v(this,Pr,"f")?v(this,Pr,"f").reset():r_(v(this,Be,"f"),v(this,vr,"f"),v(this,Li,"f"),v(this,ke,"f")),"f"),v(this,Pi,"f")||he(this,Pi,u_(this,v(this,Be,"f"),v(this,Pr,"f"),v(this,ke,"f")),"f"),v(this,Li,"f").reset(),he(this,di,null,"f"),he(this,un,"","f"),he(this,Gs,null,"f"),he(this,pi,!1,"f"),this.parsed=!1,this}[__](e,r){return v(this,ke,"f").path.relative(e,r)}[Qf](e,r,n,i=0,o=!1){let s=!!n||o;e=e||v(this,Ws,"f"),v(this,ve,"f").__=v(this,ke,"f").y18n.__,v(this,ve,"f").configuration=this[Qa]();let a=!!v(this,ve,"f").configuration["populate--"],u=Object.assign({},v(this,ve,"f").configuration,{"populate--":!0}),c=v(this,ke,"f").Parser.detailed(e,Object.assign({},v(this,ve,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),l=Object.assign(c.argv,v(this,za,"f")),f,d=c.aliases,p=!1,y=!1;Object.keys(l).forEach(C=>{C===v(this,Ni,"f")&&l[C]?p=!0:C===v(this,vo,"f")&&l[C]&&(y=!0)}),l.$0=this.$0,this.parsed=c,i===0&&v(this,Be,"f").clearCachedHelpMessage();try{if(this[Fx](),r)return this[Za](l,a,!!n,!1);v(this,Ni,"f")&&[v(this,Ni,"f")].concat(d[v(this,Ni,"f")]||[]).filter(E=>E.length>1).includes(""+l._[l._.length-1])&&(l._.pop(),p=!0),he(this,yh,!1,"f");let C=v(this,Pr,"f").getCommands(),g=v(this,Pi,"f").completionKey in l,A=p||g||o;if(l._.length){if(C.length){let m;for(let E=i||0,x;l._[E]!==void 0;E++)if(x=String(l._[E]),C.includes(x)&&x!==v(this,di,"f")){let k=v(this,Pr,"f").runCommand(x,this,c,E+1,o,p||y||o);return this[Za](k,a,!!n,!1)}else if(!m&&x!==v(this,di,"f")){m=x;break}!v(this,Pr,"f").hasDefaultCommand()&&v(this,xh,"f")&&m&&!A&&v(this,vr,"f").recommendCommands(m,C)}v(this,di,"f")&&l._.includes(v(this,di,"f"))&&!g&&(v(this,Ii,"f")&&Us(!0),this.showCompletionScript(),this.exit(0))}if(v(this,Pr,"f").hasDefaultCommand()&&!A){let m=v(this,Pr,"f").runCommand(null,this,c,0,o,p||y||o);return this[Za](m,a,!!n,!1)}if(g){v(this,Ii,"f")&&Us(!0),e=[].concat(e);let m=e.slice(e.indexOf(`--${v(this,Pi,"f").completionKey}`)+1);return v(this,Pi,"f").getCompletion(m,(E,x)=>{if(E)throw new Zt(E.message);(x||[]).forEach(k=>{v(this,Cc,"f").log(k)}),this.exit(0)}),this[Za](l,!a,!!n,!1)}if(v(this,pi,"f")||(p?(v(this,Ii,"f")&&Us(!0),s=!0,this.showHelp("log"),this.exit(0)):y&&(v(this,Ii,"f")&&Us(!0),s=!0,v(this,Be,"f").showVersion("log"),this.exit(0))),!s&&v(this,ve,"f").skipValidation.length>0&&(s=Object.keys(l).some(m=>v(this,ve,"f").skipValidation.indexOf(m)>=0&&l[m]===!0)),!s){if(c.error)throw new Zt(c.error.message);if(!g){let m=this[Lx](d,{},c.error);n||(f=Ua(l,this,v(this,Li,"f").getMiddleware(),!0)),f=this[x_](m,f??l),er(f)&&!n&&(f=f.then(()=>Ua(l,this,v(this,Li,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof Zt)v(this,Be,"f").fail(C.message,C);else throw C}return this[Za](f??l,a,!!n,!0)}[Lx](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new Zt(n.message);v(this,vr,"f").nonOptionCount(s),v(this,vr,"f").requiredArguments(s,o);let a=!1;v(this,Xa,"f")&&(a=v(this,vr,"f").unknownCommands(s)),v(this,Ya,"f")&&!a?v(this,vr,"f").unknownArguments(s,e,r,!!i):v(this,Ja,"f")&&v(this,vr,"f").unknownArguments(s,e,{},!1,!1),v(this,vr,"f").limitedChoices(s),v(this,vr,"f").implications(s),v(this,vr,"f").conflicting(s)}}[k_](){he(this,pi,!0,"f")}[eu](e){if(typeof e=="string")v(this,ve,"f").key[e]=!0;else for(let r of e)v(this,ve,"f").key[r]=!0}};function n_(t){return!!t&&typeof t.getInternalMethods=="function"}var AH=P_(yx),I_=AH;var wh={name:"likec4",version:"1.2.0",license:"MIT",homepage:"https://likec4.dev",author:"Denis Davydkov <denis@davydkov.com>",repository:{type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},engines:{node:"^18.0.0 || >=20.0.0"},bugs:"https://github.com/likec4/likec4/issues",files:["package.json","LICENSE","README.md","bin","dist","react","!dist/**/*.d.ts","!dist/**/*.map","!dist/**/metafile.json"],type:"module",bin:"./bin/likec4.mjs",exports:{".":{types:"./app/react/components/index.ts",default:"./dist/__app__/react/components.mjs"},"./react":{types:"./app/react/components/index.ts",default:"./dist/__app__/react/components.mjs"}},publishConfig:{registry:"https://registry.npmjs.org",access:"public",exports:{".":{types:"./react/index.d.ts",default:"./react/index.mjs"},"./react":{types:"./react/index.d.ts",default:"./react/index.mjs"}}},scripts:{"build:turbo":"run -T turbo run build --filter='likec4' --log-prefix=none --log-order=grouped","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.json",typecheck:"run 'typecheck:cli' && run 'typecheck:app'",build:"tsx scripts/build.ts",prepack:"tsx scripts/prepack.ts",postpack:"tsx scripts/postpack.ts",lint:"run -T eslint src/ --fix",test:"run -T vitest run","test:watch":"run -T vitest",clean:"run -T rimraf dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:bigbank":"tsx watch src/cli/index.ts serve ../../docs/likec4/bigbank","dev:index-page":"tsx watch src/cli/index.ts serve ../../docs/likec4/index-page","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example-cloud":"tsx watch src/cli/index.ts serve ../../examples/cloud-system","dev:example-dev":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev"},dependencies:{"@hpcc-js/wasm":"^2.16.2","@vitejs/plugin-react":"^4.2.1","esm-env":"^1.0.0",nanostores:"^0.10.3",playwright:"1.44.0",vite:"^5.2.11"},peerDependencies:{react:"^18.3.1","react-dom":"^18.3.1"},peerDependenciesMeta:{react:{optional:!0},"react-dom":{optional:!0}},devDependencies:{"@fontsource/ibm-plex-sans":"^5.0.19","@likec4/core":"workspace:*","@likec4/diagram":"workspace:*","@likec4/diagrams":"workspace:*","@likec4/generators":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@mantine/core":"^7.10.1","@mantine/hooks":"^7.10.1","@mantine/vanilla-extract":"^7.10.1","@nanostores/react":"^0.7.2","@react-hookz/web":"^24.0.4","@tabler/icons-react":"^3.0.0","@tanstack/react-router":"^1.31.19","@tanstack/router-vite-plugin":"^1.31.18","@types/mermaid":"^9.2.0","@types/node":"^20.13.0","@types/prop-types":"^15.7.11","@types/react":"18.3.3","@types/react-dom":"18.3.0","@types/string-hash":"^1","@types/yargs":"^17.0.32","@vanilla-extract/css":"^1.15.2","@vanilla-extract/dynamic":"^2.1.1","@vanilla-extract/vite-plugin":"^4.0.10","ci-info":"^3.9.0",classnames:"^2.3.2",clsx:"^2.1.1",consola:"^3.2.3",esbuild:"^0.21.0","esbuild-node-externals":"^1.13.0",execa:"^9.1.0","fast-equals":"^5.0.1","framer-motion":"^11.2.2","get-port":"^7.1.0","html-to-image":"^1.11.11",json5:"^2.2.3",mkdirp:"^3.0.1","p-limit":"^5.0.0",picocolors:"^1.0.0","pkg-up":"^5.0.0",postcss:"^8.4.38","postcss-preset-mantine":"^1.15.0","pretty-ms":"^9.0.0","prop-types":"^15.8.1",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.13","react-resizable-panels":"^2.0.19","react-shadow":"^20.4.0",remeda:"^1.61.0","string-hash":"^1.1.3","strip-indent":"^4.0.0",terser:"^5.30.0",tsx:"~4.9.3","type-fest":"^4.18.2",typescript:"^5.4.5",ufo:"^1.5.3","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-shadow-style":"^1.1.0",vitest:"~1.5.2",yargs:"^17.7.2"},packageManager:"yarn@4.3.0"};var yT=Se(Mr(),1);import{resolve as Mge}from"node:path";import{resolve as L_}from"node:path";var zs={type:"string",desc:"<directory> with LikeC4 source files (by default current directory)",normalize:!0,default:".",coerce:L_},Nn={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use local binaries of graphviz ("dot")',default:!1},bh={boolean:!0,type:"boolean",desc:'hash history, e.g. "/#/view" instead of "/view"'},Fh={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:L_},vc={alias:"w",type:"string",desc:'prefix for webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},Sh={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'};var N_={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},O_={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},B_={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},wc={primary:N_,blue:N_,secondary:O_,sky:O_,muted:B_,slate:B_,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#FF977D"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#FFA057"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}};var wH={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},$_={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},M_={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},j_={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},V_={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:M_,gray:wH,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:$_,primary:M_,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#FF977D"},secondary:j_,sky:j_,slate:$_};var bc={elements:wc,relationships:V_,font:"Helvetica",shadow:"#0a0a0a"};function bH(t,e){var r=Object.setPrototypeOf;r?r(t,e):t.__proto__=e}function FH(t,e){e===void 0&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}var SH=function(){var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s])},t(r,n)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),q_=function(t){SH(e,t);function e(r,n){var i=this.constructor,o=t.call(this,r,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),bH(o,i.prototype),FH(o),o}return e}(Error);function On(t){return t!=null&&typeof t=="string"}function Fc(t){return!!t&&Array.isArray(t)&&t.length>0}var Qo=class extends q_{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"BaseError"})}};var Ox=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"UnknownError"})}},Bx=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"NullableError"})}},$x=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"InvariantError"})}};function En(t,e){if(typeof t>"u"||t==null)throw new Bx(e??`Expected defined value, but received ${t}`);return t}var Zf=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"RelationRefError"})}};function Sc(t){if(t instanceof Qo||t instanceof Error)return t;let e=On(t)?t:String(t),r=new Ox(e);return Error.captureStackTrace(r,Sc),r}function fe(t,e){if(!t)throw new $x(e??"Invariant failed")}var Mx=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"NonExhaustiveError"})}};function nt(t){throw new Mx(`NonExhaustive value: ${t}`)}var tu=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"InvalidModelError"})}};function U_(t,e){return e?e+"."+t:t}var no="primary",G_="rectangle";var Ze={};Eo(Ze,{isAnyRelation:()=>TH,isCustomElement:()=>jx,isElement:()=>RH,isElementKindExpr:()=>H_,isElementRef:()=>Rh,isElementTagExpr:()=>z_,isExpandedElementExpr:()=>Th,isInOut:()=>Y_,isIncoming:()=>X_,isOutgoing:()=>J_,isRelation:()=>K_,isWildcard:()=>W_});function Rh(t){return"element"in t}function Th(t){return"expanded"in t}function jx(t){return"custom"in t}function W_(t){return"wildcard"in t}function H_(t){return"elementKind"in t&&"isEqual"in t}function z_(t){return"elementTag"in t&&"isEqual"in t}function RH(t){return Rh(t)||W_(t)||H_(t)||z_(t)||Th(t)}function K_(t){return"source"in t&&"target"in t}function Y_(t){return"inout"in t}function X_(t){return"incoming"in t}function J_(t){return"outgoing"in t}function TH(t){return K_(t)||Y_(t)||X_(t)||J_(t)}var _h="dashed",kh="normal",hi="gray";function Q_(t){return"include"in t&&Array.isArray(t.include)||"exclude"in t&&Array.isArray(t.exclude)}function Z_(t){return"style"in t&&"targets"in t}function Ph(t){return"autoLayout"in t}function ek(t){return"include"in t&&Array.isArray(t.include)}function ed(t){return tt(t.__)||t.__==="element"}function Vx(t){return ed(t)&&"extends"in t}function Ih(t){return ed(t)&&"viewOf"in t}function tk(t){return`step-${String(t).padStart(3,"0")}`}function _H(t){return t.startsWith("step-")}function rk(t){if(!_H(t))throw new Error(`Invalid step edge id: ${t}`);return Number(t.slice(5))}function nk(t){return t.__==="dynamic"}function Lh(t){return tt(t.__)||t.__==="element"}function wo(t){let e=t.lastIndexOf(".");return e>0?t.slice(e+1):t}function Zo(...t){let e=On(t[0])?t[0]:t[0].id;return(On(t[1])?t[1]:t[1].id).startsWith(e+".")}function td(t,e){let r=On(t)?t:t.id,n=On(e)?e:e.id;return r===n||n.startsWith(r+".")||r.startsWith(n+".")}function es(t,e){let r=tr(t),n=tr(e);if(r===n)return r;if(!r||!n)return null;let i=t.split("."),o=e.split("."),s=null;for(;i.length>1&&o.length>1&&i[0]&&i[0]===o[0];)s=s?`${s}.${i[0]}`:i[0],i.shift(),o.shift();return s}function tr(t){let e=t.lastIndexOf(".");return e>0?t.substring(0,e):null}function io(t){let e=t.split(".");return e.pop(),e.length===0?[]:e.reduce((r,n,i)=>{let o=e.slice(0,i+1).join(".");return r.unshift(o),r},[])}function rd(t,e){let r=t.split(".").length,n=e.split(".").length;switch(!0){case r>n:return 1;case r<n:return-1;default:return 0}}function Rc(t,e){return rd(t.id,e.id)}var kH="LIKEC4_DELAY";function ik(t=100){return new Promise(e=>{setTimeout(()=>{e(kH)},t)})}var nd=(t,e)=>{let r=es(t.source,t.target),n=es(e.source,e.target);if(r&&!n)return 1;if(!r&&n)return-1;let i=r&&n?rd(r,n):0;if(i===0){let o=rd(t.source,e.source);return o!==0?o:rd(t.target,e.target)}return i};var Tc=!1,it={trace(t){Tc||console.trace(t)},debug(t){Tc||console.debug(t)},info(t){Tc||console.info(t)},warn(t){Tc||console.warn(t)},error(t){if(!Tc){if(typeof t=="string"){console.error(t);return}console.error(Sc(t))}},silent(t=!0){Tc=t}};function bt(t){it.error(t)}function Bn(t){if(typeof t=="string"){it.warn(t);return}if(t instanceof Error){it.warn(t.stack??t.message);return}let e=Sc(t);it.warn(`${e.name}: ${e.message}`)}var Ye={};Eo(Ye,{AbstractAstReflection:()=>ru,AbstractCstNode:()=>Wd,AbstractLangiumParser:()=>Hd,AbstractParserErrorMessageProvider:()=>DD,AbstractThreadedAsyncParser:()=>_D,AstUtils:()=>Yr,BiMap:()=>_u,Cancellation:()=>de,CompositeCstNodeImpl:()=>Su,ContextCache:()=>Iu,CstNodeBuilder:()=>Gd,CstUtils:()=>Pc,DONE_RESULT:()=>jr,DatatypeSymbol:()=>gD,DefaultAstNodeDescriptionProvider:()=>up,DefaultAstNodeLocator:()=>lp,DefaultAsyncParser:()=>Ep,DefaultCommentProvider:()=>yp,DefaultConfigurationProvider:()=>fp,DefaultDocumentBuilder:()=>dp,DefaultDocumentValidator:()=>ap,DefaultHydrator:()=>xp,DefaultIndexManager:()=>pp,DefaultJsonSerializer:()=>ip,DefaultLangiumDocumentFactory:()=>Qd,DefaultLangiumDocuments:()=>Zd,DefaultLexer:()=>mp,DefaultLinker:()=>ep,DefaultNameProvider:()=>tp,DefaultReferenceDescriptionProvider:()=>cp,DefaultReferences:()=>rp,DefaultScopeComputation:()=>ku,DefaultScopeProvider:()=>Lu,DefaultServiceRegistry:()=>op,DefaultTokenBuilder:()=>Yd,DefaultValueConverter:()=>Xd,DefaultWorkspaceLock:()=>Cp,DefaultWorkspaceManager:()=>Nu,Deferred:()=>Gn,Disposable:()=>Es,DisposableCache:()=>Ll,DocumentCache:()=>bD,DocumentState:()=>Ke,DocumentValidator:()=>ys,EMPTY_SCOPE:()=>Yre,EMPTY_STREAM:()=>rs,EmptyFileSystem:()=>bp,EmptyFileSystemProvider:()=>ID,ErrorWithLocation:()=>su,GrammarAST:()=>uu,GrammarUtils:()=>Vr,JSDocDocumentationProvider:()=>Dp,LangiumCompletionParser:()=>Kd,LangiumParser:()=>zd,LangiumParserErrorMessageProvider:()=>Tl,LeafCstNodeImpl:()=>Fu,MapScope:()=>np,Module:()=>Ol,MultiMap:()=>Qr,OperationCancelled:()=>Mo,ParserWorker:()=>kD,Reduction:()=>_c,RegExpUtils:()=>Yh,RootCstNodeImpl:()=>Rl,SimpleCache:()=>Pu,StreamImpl:()=>cn,StreamScope:()=>jo,TextDocument:()=>Da,TreeStreamImpl:()=>gi,URI:()=>It,UriUtils:()=>Or,ValidationCategory:()=>Nl,ValidationRegistry:()=>sp,ValueConverter:()=>$o,WorkspaceCache:()=>ya,assertUnreachable:()=>Ks,createCompletionParser:()=>hw,createDefaultCoreModule:()=>Ap,createDefaultSharedCoreModule:()=>vp,createGrammarConfig:()=>lv,createLangiumParser:()=>gw,delayNextTick:()=>ww,diagnosticData:()=>FD,eagerLoad:()=>wp,getDiagnosticRange:()=>oB,inject:()=>Ou,interruptAndCheck:()=>Pt,isAstNode:()=>Nt,isAstNodeDescription:()=>qx,isAstNodeWithComment:()=>Fw,isCompositeCstNode:()=>zn,isIMultiModeLexerDefinition:()=>Rw,isJSDoc:()=>Pw,isLeafCstNode:()=>ts,isLinkingError:()=>nu,isNamed:()=>wD,isOperationCancelled:()=>Ds,isReference:()=>Cn,isRootCstNode:()=>id,isTokenTypeArray:()=>sB,isTokenTypeDictionary:()=>Sw,loadGrammarFromJson:()=>LD,parseJSDoc:()=>kw,prepareLangiumParser:()=>KO,setInterruptionPeriod:()=>eB,startCancelableOperation:()=>ZO,stream:()=>$e,toDiagnosticSeverity:()=>SD});var Pc={};Eo(Pc,{DefaultNameRegexp:()=>Oh,RangeComparison:()=>ns,compareRange:()=>sk,findCommentNode:()=>Hx,findDeclarationNodeAtOffset:()=>ln,findLeafNodeAtOffset:()=>Bh,findLeafNodeBeforeOffset:()=>sd,flattenCst:()=>Gx,getInteriorNodes:()=>lk,getNextNode:()=>ck,getPreviousNode:()=>uk,getStartlineNode:()=>IH,inRange:()=>od,isChildNode:()=>Wx,isCommentNode:()=>Ux,streamCst:()=>iu,toDocumentSegment:()=>ou,tokenToRange:()=>kc});function Nt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Cn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function qx(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function nu(t){return typeof t=="object"&&t!==null&&Nt(t.container)&&Cn(t.reference)&&typeof t.message=="string"}var ru=class{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Nt(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.computeIsSubtype(e,r);return n[r]=o,o}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function zn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ts(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function id(t){return zn(t)&&typeof t.fullText=="string"}var cn=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new t(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return jr})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=PH(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?jr:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return jr})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Nh(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return jr})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Nh(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return jr})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?jr:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function PH(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Nh(t){return!!t&&typeof t[Symbol.iterator]=="function"}var rs=new cn(()=>{},()=>jr),jr=Object.freeze({done:!0,value:void 0});function $e(...t){if(t.length===1){let e=t[0];if(e instanceof cn)return e;if(Nh(e))return new cn(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new cn(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:jr)}return t.length>1?new cn(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Nh(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return jr}):rs}var gi=class extends cn{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return jr})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},_c;(function(t){function e(o){return o.reduce((s,a)=>s+a,0)}t.sum=e;function r(o){return o.reduce((s,a)=>s*a,0)}t.product=r;function n(o){return o.reduce((s,a)=>Math.min(s,a))}t.min=n;function i(o){return o.reduce((s,a)=>Math.max(s,a))}t.max=i})(_c||(_c={}));function iu(t){return new gi(t,e=>zn(e)?e.content:[],{includeRoot:!0})}function Gx(t){return iu(t).filter(ts)}function Wx(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function kc(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ou(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var ns;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside"})(ns||(ns={}));function sk(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<t.start.character)return ns.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return ns.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?ns.Inside:r?ns.OverlapBack:ns.OverlapFront}function od(t,e){return sk(t,e)>ns.After}var Oh=/^[\w\p{L}]$/u;function ln(t,e,r=Oh){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Bh(t,e)}}function Hx(t,e){if(t){let r=uk(t,!0);if(r&&Ux(r,e))return r;if(id(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(Ux(o,e))return o}}}}function Ux(t,e){return ts(t)&&e.includes(t.tokenType.name)}function Bh(t,e){if(ts(t))return t;if(zn(t)){let r=ak(t,e,!1);if(r)return Bh(r,e)}}function sd(t,e){if(ts(t))return t;if(zn(t)){let r=ak(t,e,!0);if(r)return sd(r,e)}}function ak(t,e,r){let n=0,i=t.content.length-1,o;for(;n<=i;){let s=Math.floor((n+i)/2),a=t.content[s];if(a.offset<=e&&a.end>e)return a;a.end<=e?(o=r?a:void 0,n=s+1):i=s-1}return o}function uk(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function ck(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let o=r.content[n];if(e||!o.hidden)return o}t=r}}function IH(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.container;){let i=t.container,o=n??i.content.indexOf(t);if(o===0?(t=i,n=void 0):(n=o-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function lk(t,e){let r=LH(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function LH(t,e){let r=ok(t),n=ok(e),i;for(let o=0;o<r.length&&o<n.length;o++){let s=r[o],a=n[o];if(s.parent===a.parent)i={parent:s.parent,a:s.index,b:a.index};else break}return i}function ok(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}var Vr={};Eo(Vr,{findAssignment:()=>sv,findNameAssignment:()=>Jh,findNodeForKeyword:()=>$c,findNodeForProperty:()=>Xs,findNodesForKeyword:()=>Xh,findNodesForKeywordInternal:()=>ov,findNodesForProperty:()=>Ys,getActionAtElement:()=>vk,getActionType:()=>bk,getAllReachableRules:()=>hd,getCrossReferenceTerminal:()=>gd,getEntryRule:()=>md,getExplicitRuleType:()=>gu,getHiddenRules:()=>Ck,getRuleType:()=>uv,getTypeName:()=>os,isArrayCardinality:()=>av,isArrayOperator:()=>tz,isCommentTerminal:()=>nv,isDataType:()=>rz,isDataTypeRule:()=>Dd,isOptionalCardinality:()=>hu,terminalRegex:()=>Js});var su=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Ks(t){throw new Error("Error! The input value was not handled.")}var uu={};Eo(uu,{AbstractElement:()=>Kx,AbstractRule:()=>ad,AbstractType:()=>ud,Action:()=>AA,Alternatives:()=>vA,ArrayLiteral:()=>Yx,ArrayType:()=>Xx,Assignment:()=>wA,BooleanLiteral:()=>Qx,CharacterRange:()=>bA,Condition:()=>$h,Conjunction:()=>eA,CrossReference:()=>SA,Disjunction:()=>rA,EndOfFile:()=>RA,Grammar:()=>iA,GrammarImport:()=>dk,Group:()=>_A,InferredType:()=>oA,Interface:()=>sA,Keyword:()=>kA,LangiumGrammarAstReflection:()=>Ic,LangiumGrammarTerminals:()=>NH,NamedArgument:()=>pk,NegatedToken:()=>PA,Negation:()=>aA,NumberLiteral:()=>cA,Parameter:()=>lA,ParameterReference:()=>fA,ParserRule:()=>pA,ReferenceType:()=>mA,RegexToken:()=>LA,ReturnType:()=>mk,RuleCall:()=>OA,SimpleType:()=>DA,StringLiteral:()=>yA,TerminalAlternatives:()=>BA,TerminalGroup:()=>MA,TerminalRule:()=>jh,TerminalRuleCall:()=>VA,Type:()=>EA,TypeAttribute:()=>hk,TypeDefinition:()=>zx,UnionType:()=>CA,UnorderedGroup:()=>qA,UntilToken:()=>UA,ValueLiteral:()=>Mh,Wildcard:()=>WA,isAbstractElement:()=>au,isAbstractRule:()=>OH,isAbstractType:()=>BH,isAction:()=>oo,isAlternatives:()=>Lc,isArrayLiteral:()=>qH,isArrayType:()=>Jx,isAssignment:()=>Sn,isBooleanLiteral:()=>Zx,isCharacterRange:()=>FA,isCondition:()=>$H,isConjunction:()=>tA,isCrossReference:()=>so,isDisjunction:()=>nA,isEndOfFile:()=>TA,isFeatureName:()=>MH,isGrammar:()=>UH,isGrammarImport:()=>GH,isGroup:()=>Oi,isInferredType:()=>Vh,isInterface:()=>qh,isKeyword:()=>xn,isNamedArgument:()=>WH,isNegatedToken:()=>IA,isNegation:()=>uA,isNumberLiteral:()=>HH,isParameter:()=>zH,isParameterReference:()=>dA,isParserRule:()=>wr,isPrimitiveType:()=>fk,isReferenceType:()=>hA,isRegexToken:()=>NA,isReturnType:()=>gA,isRuleCall:()=>Yn,isSimpleType:()=>Uh,isStringLiteral:()=>KH,isTerminalAlternatives:()=>$A,isTerminalGroup:()=>jA,isTerminalRule:()=>Kn,isTerminalRuleCall:()=>Gh,isType:()=>cd,isTypeAttribute:()=>YH,isTypeDefinition:()=>jH,isUnionType:()=>xA,isUnorderedGroup:()=>Nc,isUntilToken:()=>GA,isValueLiteral:()=>VH,isWildcard:()=>HA,reflection:()=>Le});var NH={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ad="AbstractRule";function OH(t){return Le.isInstance(t,ad)}var ud="AbstractType";function BH(t){return Le.isInstance(t,ud)}var $h="Condition";function $H(t){return Le.isInstance(t,$h)}function MH(t){return fk(t)||t==="current"||t==="entry"||t==="extends"||t==="false"||t==="fragment"||t==="grammar"||t==="hidden"||t==="import"||t==="interface"||t==="returns"||t==="terminal"||t==="true"||t==="type"||t==="infer"||t==="infers"||t==="with"||typeof t=="string"&&/\^?[_a-zA-Z][\w_]*/.test(t)}function fk(t){return t==="string"||t==="number"||t==="boolean"||t==="Date"||t==="bigint"}var zx="TypeDefinition";function jH(t){return Le.isInstance(t,zx)}var Mh="ValueLiteral";function VH(t){return Le.isInstance(t,Mh)}var Kx="AbstractElement";function au(t){return Le.isInstance(t,Kx)}var Yx="ArrayLiteral";function qH(t){return Le.isInstance(t,Yx)}var Xx="ArrayType";function Jx(t){return Le.isInstance(t,Xx)}var Qx="BooleanLiteral";function Zx(t){return Le.isInstance(t,Qx)}var eA="Conjunction";function tA(t){return Le.isInstance(t,eA)}var rA="Disjunction";function nA(t){return Le.isInstance(t,rA)}var iA="Grammar";function UH(t){return Le.isInstance(t,iA)}var dk="GrammarImport";function GH(t){return Le.isInstance(t,dk)}var oA="InferredType";function Vh(t){return Le.isInstance(t,oA)}var sA="Interface";function qh(t){return Le.isInstance(t,sA)}var pk="NamedArgument";function WH(t){return Le.isInstance(t,pk)}var aA="Negation";function uA(t){return Le.isInstance(t,aA)}var cA="NumberLiteral";function HH(t){return Le.isInstance(t,cA)}var lA="Parameter";function zH(t){return Le.isInstance(t,lA)}var fA="ParameterReference";function dA(t){return Le.isInstance(t,fA)}var pA="ParserRule";function wr(t){return Le.isInstance(t,pA)}var mA="ReferenceType";function hA(t){return Le.isInstance(t,mA)}var mk="ReturnType";function gA(t){return Le.isInstance(t,mk)}var DA="SimpleType";function Uh(t){return Le.isInstance(t,DA)}var yA="StringLiteral";function KH(t){return Le.isInstance(t,yA)}var jh="TerminalRule";function Kn(t){return Le.isInstance(t,jh)}var EA="Type";function cd(t){return Le.isInstance(t,EA)}var hk="TypeAttribute";function YH(t){return Le.isInstance(t,hk)}var CA="UnionType";function xA(t){return Le.isInstance(t,CA)}var AA="Action";function oo(t){return Le.isInstance(t,AA)}var vA="Alternatives";function Lc(t){return Le.isInstance(t,vA)}var wA="Assignment";function Sn(t){return Le.isInstance(t,wA)}var bA="CharacterRange";function FA(t){return Le.isInstance(t,bA)}var SA="CrossReference";function so(t){return Le.isInstance(t,SA)}var RA="EndOfFile";function TA(t){return Le.isInstance(t,RA)}var _A="Group";function Oi(t){return Le.isInstance(t,_A)}var kA="Keyword";function xn(t){return Le.isInstance(t,kA)}var PA="NegatedToken";function IA(t){return Le.isInstance(t,PA)}var LA="RegexToken";function NA(t){return Le.isInstance(t,LA)}var OA="RuleCall";function Yn(t){return Le.isInstance(t,OA)}var BA="TerminalAlternatives";function $A(t){return Le.isInstance(t,BA)}var MA="TerminalGroup";function jA(t){return Le.isInstance(t,MA)}var VA="TerminalRuleCall";function Gh(t){return Le.isInstance(t,VA)}var qA="UnorderedGroup";function Nc(t){return Le.isInstance(t,qA)}var UA="UntilToken";function GA(t){return Le.isInstance(t,UA)}var WA="Wildcard";function HA(t){return Le.isInstance(t,WA)}var Ic=class extends ru{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(e,r){switch(e){case AA:case vA:case wA:case bA:case SA:case RA:case _A:case kA:case PA:case LA:case OA:case BA:case MA:case VA:case qA:case UA:case WA:return this.isSubtype(Kx,r);case Yx:case cA:case yA:return this.isSubtype(Mh,r);case Xx:case mA:case DA:case CA:return this.isSubtype(zx,r);case Qx:return this.isSubtype($h,r)||this.isSubtype(Mh,r);case eA:case rA:case aA:case fA:return this.isSubtype($h,r);case oA:case sA:case EA:return this.isSubtype(ud,r);case pA:return this.isSubtype(ad,r)||this.isSubtype(ud,r);case jh:return this.isSubtype(ad,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return ud;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return ad;case"Grammar:usedGrammars":return iA;case"NamedArgument:parameter":case"ParameterReference:parameter":return lA;case"TerminalRuleCall:rule":return jh;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}},Le=new Ic;var Yr={};Eo(Yr,{assignMandatoryProperties:()=>ld,copyAstNode:()=>KA,findLocalReferences:()=>JH,findRootNode:()=>gk,getContainerOfType:()=>Di,getDocument:()=>Vt,hasContainerOfType:()=>XH,linkContentToContainer:()=>Wh,streamAllContents:()=>yi,streamAst:()=>$n,streamContents:()=>cu,streamReferences:()=>Oc});function Wh(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Nt(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Nt(r)&&(r.$container=t,r.$containerProperty=e))}function Di(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function XH(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Vt(t){let r=gk(t).$document;if(!r)throw new Error("AST node has no document.");return r}function gk(t){for(;t.$container;)t=t.$container;return t}function cu(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new cn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let o=t[i];if(Nt(o)){if(n.keyIndex++,zA(o,r))return{done:!1,value:o}}else if(Array.isArray(o)){for(;n.arrayIndex<o.length;){let s=n.arrayIndex++,a=o[s];if(Nt(a)&&zA(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return jr})}function yi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gi(t,r=>cu(r,e))}function $n(t,e){if(t){if(e?.range&&!zA(t,e.range))return new gi(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new gi(t,r=>cu(r,e),{includeRoot:!0})}function zA(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?od(n,e):!1}function Oc(t){return new cn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Cn(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Cn(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return jr})}function JH(t,e=Vt(t).parseResult.value){let r=[];return $n(e).forEach(n=>{Oc(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),$e(r)}function ld(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Dk(i.defaultValue))}function Dk(t){return Array.isArray(t)?[...t.map(Dk)]:t}function KA(t,e){let r={$type:t.$type};for(let[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Nt(i))r[n]=KA(i,e);else if(Cn(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){let o=[];for(let s of i)Nt(s)?o.push(KA(s,e)):Cn(s)?o.push(e(r,n,s.$refNode,s.$refText)):o.push(s);r[n]=o}else r[n]=i;return Wh(r),r}var Yh={};Eo(Yh,{NEWLINE_REGEXP:()=>pu,escapeRegExp:()=>mu,getCaseInsensitivePattern:()=>ZA,getTerminalParts:()=>ez,isMultilineComment:()=>QA,isWhitespace:()=>Kh,partialMatches:()=>ev,partialRegExp:()=>Ek});function Te(t){return t.charCodeAt(0)}function Hh(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Bc(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function lu(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function fd(){throw Error("Internal Error - Should never get here!")}function YA(t){return t.type==="Character"}var dd=[];for(let t=Te("0");t<=Te("9");t++)dd.push(t);var pd=[Te("_")].concat(dd);for(let t=Te("a");t<=Te("z");t++)pd.push(t);for(let t=Te("A");t<=Te("Z");t++)pd.push(t);var XA=[Te(" "),Te("\f"),Te(`
|
|
171
|
+
`,"f"),he(this,un,v(this,un,"f")+e.join(" "),"f")}}}[bx](e){yc(v(this,ve,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=v(this,ve,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete v(this,Be,"f").getDescriptions()[e]}[h_](e,r,n){v(this,gh,"f")[n]||(v(this,ke,"f").process.emitWarning(e,r),v(this,gh,"f")[n]=!0)}[g_](){v(this,Dh,"f").push({options:v(this,ve,"f"),configObjects:v(this,ve,"f").configObjects.slice(0),exitProcess:v(this,Ii,"f"),groups:v(this,Ao,"f"),strict:v(this,Ya,"f"),strictCommands:v(this,Xa,"f"),strictOptions:v(this,Ja,"f"),completionCommand:v(this,di,"f"),output:v(this,un,"f"),exitError:v(this,Gs,"f"),hasOutput:v(this,pi,"f"),parsed:this.parsed,parseFn:v(this,mi,"f"),parseContext:v(this,za,"f")}),v(this,Be,"f").freeze(),v(this,vr,"f").freeze(),v(this,Pr,"f").freeze(),v(this,Li,"f").freeze()}[D_](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ke,"f").process.argv()[0])?r=v(this,ke,"f").process.argv().slice(1,2):r=v(this,ke,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[__](v(this,Wa,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),v(this,ke,"f").getEnv("_")&&v(this,ke,"f").getProcessArgvBin()===v(this,ke,"f").getEnv("_")&&(e=v(this,ke,"f").getEnv("_").replace(`${v(this,ke,"f").path.dirname(v(this,ke,"f").process.execPath())}/`,"")),e}[Qa](){return v(this,Ch,"f")}[y_](){return v(this,Ah,"f")}[Fx](){if(!v(this,Ha,"f"))return;let e=v(this,ke,"f").getEnv("LC_ALL")||v(this,ke,"f").getEnv("LC_MESSAGES")||v(this,ke,"f").getEnv("LANG")||v(this,ke,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[E_](){return this[Sx]().version||"unknown"}[C_](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)v(this,ke,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Sx](e){let r=e||"*";if(v(this,xc,"f")[r])return v(this,xc,"f")[r];let n={};try{let i=e||v(this,ke,"f").mainFilename;!e&&v(this,ke,"f").path.extname(i)&&(i=v(this,ke,"f").path.dirname(i));let o=v(this,ke,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Ln(o,void 0,v(this,ke,"f")),n=JSON.parse(v(this,ke,"f").readFileSync(o,"utf8"))}catch{}return v(this,xc,"f")[r]=n||{},v(this,xc,"f")[r]}[Hs](e,r){r=[].concat(r),r.forEach(n=>{n=this[_x](n),v(this,ve,"f")[e].push(n)})}[Ac](e,r,n,i){this[Tx](e,r,n,i,(o,s,a)=>{v(this,ve,"f")[o][s]=a})}[Rx](e,r,n,i){this[Tx](e,r,n,i,(o,s,a)=>{v(this,ve,"f")[o][s]=(v(this,ve,"f")[o][s]||[]).concat(a)})}[Tx](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of yc(n))e(s,n[s]);else o(r,this[_x](n),i)}[_x](e){return e==="__proto__"?"___proto___":e}[kx](e,r){return this[Ac](this[kx].bind(this),"key",e,r),this}[Px](){var e,r,n,i,o,s,a,u,c,l,f,d;let p=v(this,Dh,"f").pop();Ln(p,void 0,v(this,ke,"f"));let y;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,c=this,l=this,f=this,d=this,{options:{set value(C){he(e,ve,C,"f")}}.value,configObjects:y,exitProcess:{set value(C){he(r,Ii,C,"f")}}.value,groups:{set value(C){he(n,Ao,C,"f")}}.value,output:{set value(C){he(i,un,C,"f")}}.value,exitError:{set value(C){he(o,Gs,C,"f")}}.value,hasOutput:{set value(C){he(s,pi,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){he(a,Ya,C,"f")}}.value,strictCommands:{set value(C){he(u,Xa,C,"f")}}.value,strictOptions:{set value(C){he(c,Ja,C,"f")}}.value,completionCommand:{set value(C){he(l,di,C,"f")}}.value,parseFn:{set value(C){he(f,mi,C,"f")}}.value,parseContext:{set value(C){he(d,za,C,"f")}}.value}=p,v(this,ve,"f").configObjects=y,v(this,Be,"f").unfreeze(),v(this,vr,"f").unfreeze(),v(this,Pr,"f").unfreeze(),v(this,Li,"f").unfreeze()}[x_](e,r){return Ga(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[A_].bind(this),getContext:this[v_].bind(this),getHasOutput:this[w_].bind(this),getLoggerInstance:this[b_].bind(this),getParseContext:this[F_].bind(this),getParserConfiguration:this[Qa].bind(this),getUsageConfiguration:this[y_].bind(this),getUsageInstance:this[S_].bind(this),getValidationInstance:this[R_].bind(this),hasParseCallback:this[vh].bind(this),isGlobalContext:this[T_].bind(this),postProcess:this[Za].bind(this),reset:this[Ix].bind(this),runValidation:this[Lx].bind(this),runYargsParserAndExecuteCommands:this[Qf].bind(this),setHasOutput:this[k_].bind(this)}}[A_](){return v(this,Pr,"f")}[v_](){return v(this,Jf,"f")}[w_](){return v(this,pi,"f")}[b_](){return v(this,Cc,"f")}[F_](){return v(this,za,"f")||{}}[S_](){return v(this,Be,"f")}[R_](){return v(this,vr,"f")}[vh](){return!!v(this,mi,"f")}[T_](){return v(this,yh,"f")}[Za](e,r,n,i){return n||er(e)||(r||(e=this[p_](e)),(this[Qa]()["parse-positional-numbers"]||this[Qa]()["parse-positional-numbers"]===void 0)&&(e=this[C_](e)),i&&(e=Ua(e,this,v(this,Li,"f").getMiddleware(),!1))),e}[Ix](e={}){he(this,ve,v(this,ve,"f")||{},"f");let r={};r.local=v(this,ve,"f").local||[],r.configObjects=v(this,ve,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(v(this,Ka,"f"),Object.keys(v(this,Ao,"f")).reduce((s,a)=>{let u=v(this,Ao,"f")[a].filter(c=>!(c in n));return u.length>0&&(s[a]=u),s},{})),he(this,Ao,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(v(this,ve,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=qs(v(this,ve,"f")[s],a=>!n[a])}),r.envPrefix=v(this,ve,"f").envPrefix,he(this,ve,r,"f"),he(this,Be,v(this,Be,"f")?v(this,Be,"f").reset(n):o_(this,v(this,ke,"f")),"f"),he(this,vr,v(this,vr,"f")?v(this,vr,"f").reset(n):f_(this,v(this,Be,"f"),v(this,ke,"f")),"f"),he(this,Pr,v(this,Pr,"f")?v(this,Pr,"f").reset():r_(v(this,Be,"f"),v(this,vr,"f"),v(this,Li,"f"),v(this,ke,"f")),"f"),v(this,Pi,"f")||he(this,Pi,u_(this,v(this,Be,"f"),v(this,Pr,"f"),v(this,ke,"f")),"f"),v(this,Li,"f").reset(),he(this,di,null,"f"),he(this,un,"","f"),he(this,Gs,null,"f"),he(this,pi,!1,"f"),this.parsed=!1,this}[__](e,r){return v(this,ke,"f").path.relative(e,r)}[Qf](e,r,n,i=0,o=!1){let s=!!n||o;e=e||v(this,Ws,"f"),v(this,ve,"f").__=v(this,ke,"f").y18n.__,v(this,ve,"f").configuration=this[Qa]();let a=!!v(this,ve,"f").configuration["populate--"],u=Object.assign({},v(this,ve,"f").configuration,{"populate--":!0}),c=v(this,ke,"f").Parser.detailed(e,Object.assign({},v(this,ve,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),l=Object.assign(c.argv,v(this,za,"f")),f,d=c.aliases,p=!1,y=!1;Object.keys(l).forEach(C=>{C===v(this,Ni,"f")&&l[C]?p=!0:C===v(this,vo,"f")&&l[C]&&(y=!0)}),l.$0=this.$0,this.parsed=c,i===0&&v(this,Be,"f").clearCachedHelpMessage();try{if(this[Fx](),r)return this[Za](l,a,!!n,!1);v(this,Ni,"f")&&[v(this,Ni,"f")].concat(d[v(this,Ni,"f")]||[]).filter(E=>E.length>1).includes(""+l._[l._.length-1])&&(l._.pop(),p=!0),he(this,yh,!1,"f");let C=v(this,Pr,"f").getCommands(),g=v(this,Pi,"f").completionKey in l,A=p||g||o;if(l._.length){if(C.length){let m;for(let E=i||0,x;l._[E]!==void 0;E++)if(x=String(l._[E]),C.includes(x)&&x!==v(this,di,"f")){let k=v(this,Pr,"f").runCommand(x,this,c,E+1,o,p||y||o);return this[Za](k,a,!!n,!1)}else if(!m&&x!==v(this,di,"f")){m=x;break}!v(this,Pr,"f").hasDefaultCommand()&&v(this,xh,"f")&&m&&!A&&v(this,vr,"f").recommendCommands(m,C)}v(this,di,"f")&&l._.includes(v(this,di,"f"))&&!g&&(v(this,Ii,"f")&&Us(!0),this.showCompletionScript(),this.exit(0))}if(v(this,Pr,"f").hasDefaultCommand()&&!A){let m=v(this,Pr,"f").runCommand(null,this,c,0,o,p||y||o);return this[Za](m,a,!!n,!1)}if(g){v(this,Ii,"f")&&Us(!0),e=[].concat(e);let m=e.slice(e.indexOf(`--${v(this,Pi,"f").completionKey}`)+1);return v(this,Pi,"f").getCompletion(m,(E,x)=>{if(E)throw new Zt(E.message);(x||[]).forEach(k=>{v(this,Cc,"f").log(k)}),this.exit(0)}),this[Za](l,!a,!!n,!1)}if(v(this,pi,"f")||(p?(v(this,Ii,"f")&&Us(!0),s=!0,this.showHelp("log"),this.exit(0)):y&&(v(this,Ii,"f")&&Us(!0),s=!0,v(this,Be,"f").showVersion("log"),this.exit(0))),!s&&v(this,ve,"f").skipValidation.length>0&&(s=Object.keys(l).some(m=>v(this,ve,"f").skipValidation.indexOf(m)>=0&&l[m]===!0)),!s){if(c.error)throw new Zt(c.error.message);if(!g){let m=this[Lx](d,{},c.error);n||(f=Ua(l,this,v(this,Li,"f").getMiddleware(),!0)),f=this[x_](m,f??l),er(f)&&!n&&(f=f.then(()=>Ua(l,this,v(this,Li,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof Zt)v(this,Be,"f").fail(C.message,C);else throw C}return this[Za](f??l,a,!!n,!0)}[Lx](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new Zt(n.message);v(this,vr,"f").nonOptionCount(s),v(this,vr,"f").requiredArguments(s,o);let a=!1;v(this,Xa,"f")&&(a=v(this,vr,"f").unknownCommands(s)),v(this,Ya,"f")&&!a?v(this,vr,"f").unknownArguments(s,e,r,!!i):v(this,Ja,"f")&&v(this,vr,"f").unknownArguments(s,e,{},!1,!1),v(this,vr,"f").limitedChoices(s),v(this,vr,"f").implications(s),v(this,vr,"f").conflicting(s)}}[k_](){he(this,pi,!0,"f")}[eu](e){if(typeof e=="string")v(this,ve,"f").key[e]=!0;else for(let r of e)v(this,ve,"f").key[r]=!0}};function n_(t){return!!t&&typeof t.getInternalMethods=="function"}var AH=P_(yx),I_=AH;var wh={name:"likec4",version:"1.2.1",license:"MIT",homepage:"https://likec4.dev",author:"Denis Davydkov <denis@davydkov.com>",repository:{type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},engines:{node:"^18.0.0 || >=20.0.0"},bugs:"https://github.com/likec4/likec4/issues",files:["package.json","LICENSE","README.md","bin","dist","react","!dist/**/*.d.ts","!dist/**/*.map","!dist/**/metafile.json"],type:"module",bin:"./bin/likec4.mjs",exports:{".":{types:"./app/react/components/index.ts",default:"./dist/__app__/react/components.mjs"},"./react":{types:"./app/react/components/index.ts",default:"./dist/__app__/react/components.mjs"}},publishConfig:{registry:"https://registry.npmjs.org",access:"public",exports:{".":{types:"./react/index.d.ts",default:"./react/index.mjs"},"./react":{types:"./react/index.d.ts",default:"./react/index.mjs"}}},scripts:{"turbo-build":"run -T turbo run build --filter='likec4' --log-prefix=none --log-order=grouped","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.json",typecheck:"run 'typecheck:cli' && run 'typecheck:app'","build:cli":"tsx scripts/build-cli.ts","build:app":"tsx scripts/bundle-app.ts","build:react":"tsx scripts/bundle-react.ts","build:webcomponent":"tsx scripts/bundle-webcomponent.ts",build:"run-p --print-label 'build:*'",prepack:"tsx scripts/prepack.ts",postpack:"tsx scripts/postpack.ts",lint:"run -T eslint src/ --fix",test:"run -T vitest run","test:watch":"run -T vitest",clean:"run -T rimraf dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:bigbank":"tsx watch src/cli/index.ts serve ../../docs/likec4/bigbank","dev:index-page":"tsx watch src/cli/index.ts serve ../../docs/likec4/index-page","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example-cloud":"tsx watch src/cli/index.ts serve ../../examples/cloud-system","dev:example-dev":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev"},dependencies:{"@hpcc-js/wasm":"^2.16.2","@vitejs/plugin-react":"^4.3.1","esm-env":"^1.0.0",nanostores:"^0.10.3",playwright:"1.44.1",vite:"5.3.0"},peerDependencies:{react:"^18.3.1","react-dom":"^18.3.1"},peerDependenciesMeta:{react:{optional:!0},"react-dom":{optional:!0}},devDependencies:{"@fontsource/ibm-plex-sans":"^5.0.19","@likec4/core":"workspace:*","@likec4/diagram":"workspace:*","@likec4/diagrams":"workspace:*","@likec4/generators":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@likec4/tsconfig":"workspace:*","@mantine/core":"^7.10.1","@mantine/hooks":"^7.10.1","@mantine/vanilla-extract":"^7.10.1","@nanostores/react":"^0.7.2","@react-hookz/web":"^24.0.4","@tabler/icons-react":"^3.0.0","@tanstack/react-router":"^1.31.19","@tanstack/router-vite-plugin":"^1.31.18","@types/mermaid":"^9.2.0","@types/node":"^20.14.2","@types/prop-types":"^15.7.11","@types/react":"18.3.3","@types/react-dom":"18.3.0","@types/string-hash":"^1","@types/yargs":"^17.0.32","@vanilla-extract/css":"^1.15.2","@vanilla-extract/dynamic":"^2.1.1","@vanilla-extract/vite-plugin":"^4.0.10","ci-info":"^3.9.0",classnames:"^2.3.2",clsx:"^2.1.1",consola:"^3.2.3",esbuild:"^0.21.5","esbuild-node-externals":"^1.13.1",execa:"^9.1.0","fast-equals":"^5.0.1","framer-motion":"^11.2.2","get-port":"^7.1.0","html-to-image":"^1.11.11",json5:"^2.2.3",mkdirp:"^3.0.1","npm-run-all2":"^6.1.2","p-limit":"^5.0.0",picocolors:"^1.0.0","pkg-up":"^5.0.0",postcss:"^8.4.38","postcss-preset-mantine":"^1.15.0","pretty-ms":"^9.0.0","prop-types":"^15.8.1",react:"^18.3.1","react-dom":"^18.3.1","react-error-boundary":"^4.0.13","react-resizable-panels":"^2.0.19","react-shadow":"^20.4.0",remeda:"^1.61.0","string-hash":"^1.1.3","strip-indent":"^4.0.0",terser:"^5.30.0",tsx:"~4.9.3","type-fest":"^4.18.2",typescript:"^5.4.5",ufo:"^1.5.3","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-shadow-style":"^1.1.0",vitest:"~1.5.3",yargs:"^17.7.2"},packageManager:"yarn@4.3.0"};var yT=Se(Mr(),1);import{resolve as Mge}from"node:path";import{resolve as L_}from"node:path";var zs={type:"string",desc:"<directory> with LikeC4 source files (by default current directory)",normalize:!0,default:".",coerce:L_},Nn={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use local binaries of graphviz ("dot")',default:!1},bh={boolean:!0,type:"boolean",desc:'hash history, e.g. "/#/view" instead of "/view"'},Fh={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:L_},vc={alias:"w",type:"string",desc:'prefix for webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},Sh={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'};var N_={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},O_={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},B_={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},wc={primary:N_,blue:N_,secondary:O_,sky:O_,muted:B_,slate:B_,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#FF977D"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#FFA057"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}};var wH={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},$_={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},M_={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},j_={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},V_={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:M_,gray:wH,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:$_,primary:M_,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#FF977D"},secondary:j_,sky:j_,slate:$_};var bc={elements:wc,relationships:V_,font:"Helvetica",shadow:"#0a0a0a"};function bH(t,e){var r=Object.setPrototypeOf;r?r(t,e):t.__proto__=e}function FH(t,e){e===void 0&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}var SH=function(){var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s])},t(r,n)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),q_=function(t){SH(e,t);function e(r,n){var i=this.constructor,o=t.call(this,r,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),bH(o,i.prototype),FH(o),o}return e}(Error);function On(t){return t!=null&&typeof t=="string"}function Fc(t){return!!t&&Array.isArray(t)&&t.length>0}var Qo=class extends q_{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"BaseError"})}};var Ox=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"UnknownError"})}},Bx=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"NullableError"})}},$x=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"InvariantError"})}};function En(t,e){if(typeof t>"u"||t==null)throw new Bx(e??`Expected defined value, but received ${t}`);return t}var Zf=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"RelationRefError"})}};function Sc(t){if(t instanceof Qo||t instanceof Error)return t;let e=On(t)?t:String(t),r=new Ox(e);try{Error.captureStackTrace(r,Sc)}catch{}return r}function fe(t,e){if(!t)throw new $x(e??"Invariant failed")}var Mx=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"NonExhaustiveError"})}};function nt(t){throw new Mx(`NonExhaustive value: ${t}`)}var tu=class extends Qo{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{value:"InvalidModelError"})}};function U_(t,e){return e?e+"."+t:t}var no="primary",G_="rectangle";var Ze={};Eo(Ze,{isAnyRelation:()=>TH,isCustomElement:()=>jx,isElement:()=>RH,isElementKindExpr:()=>H_,isElementRef:()=>Rh,isElementTagExpr:()=>z_,isExpandedElementExpr:()=>Th,isInOut:()=>Y_,isIncoming:()=>X_,isOutgoing:()=>J_,isRelation:()=>K_,isWildcard:()=>W_});function Rh(t){return"element"in t}function Th(t){return"expanded"in t}function jx(t){return"custom"in t}function W_(t){return"wildcard"in t}function H_(t){return"elementKind"in t&&"isEqual"in t}function z_(t){return"elementTag"in t&&"isEqual"in t}function RH(t){return Rh(t)||W_(t)||H_(t)||z_(t)||Th(t)}function K_(t){return"source"in t&&"target"in t}function Y_(t){return"inout"in t}function X_(t){return"incoming"in t}function J_(t){return"outgoing"in t}function TH(t){return K_(t)||Y_(t)||X_(t)||J_(t)}var _h="dashed",kh="normal",hi="gray";function Q_(t){return"include"in t&&Array.isArray(t.include)||"exclude"in t&&Array.isArray(t.exclude)}function Z_(t){return"style"in t&&"targets"in t}function Ph(t){return"autoLayout"in t}function ek(t){return"include"in t&&Array.isArray(t.include)}function ed(t){return tt(t.__)||t.__==="element"}function Vx(t){return ed(t)&&"extends"in t}function Ih(t){return ed(t)&&"viewOf"in t}function tk(t){return`step-${String(t).padStart(3,"0")}`}function _H(t){return t.startsWith("step-")}function rk(t){if(!_H(t))throw new Error(`Invalid step edge id: ${t}`);return Number(t.slice(5))}function nk(t){return t.__==="dynamic"}function Lh(t){return tt(t.__)||t.__==="element"}function wo(t){let e=t.lastIndexOf(".");return e>0?t.slice(e+1):t}function Zo(...t){let e=On(t[0])?t[0]:t[0].id;return(On(t[1])?t[1]:t[1].id).startsWith(e+".")}function td(t,e){let r=On(t)?t:t.id,n=On(e)?e:e.id;return r===n||n.startsWith(r+".")||r.startsWith(n+".")}function es(t,e){let r=tr(t),n=tr(e);if(r===n)return r;if(!r||!n)return null;let i=t.split("."),o=e.split("."),s=null;for(;i.length>1&&o.length>1&&i[0]&&i[0]===o[0];)s=s?`${s}.${i[0]}`:i[0],i.shift(),o.shift();return s}function tr(t){let e=t.lastIndexOf(".");return e>0?t.substring(0,e):null}function io(t){let e=t.split(".");return e.pop(),e.length===0?[]:e.reduce((r,n,i)=>{let o=e.slice(0,i+1).join(".");return r.unshift(o),r},[])}function rd(t,e){let r=t.split(".").length,n=e.split(".").length;switch(!0){case r>n:return 1;case r<n:return-1;default:return 0}}function Rc(t,e){return rd(t.id,e.id)}var kH="LIKEC4_DELAY";function ik(t=100){return new Promise(e=>{setTimeout(()=>{e(kH)},t)})}var nd=(t,e)=>{let r=es(t.source,t.target),n=es(e.source,e.target);if(r&&!n)return 1;if(!r&&n)return-1;let i=r&&n?rd(r,n):0;if(i===0){let o=rd(t.source,e.source);return o!==0?o:rd(t.target,e.target)}return i};var Tc=!1,it={trace(t){Tc||console.trace(t)},debug(t){Tc||console.debug(t)},info(t){Tc||console.info(t)},warn(t){Tc||console.warn(t)},error(t){if(!Tc){if(typeof t=="string"){console.error(t);return}console.error(Sc(t))}},silent(t=!0){Tc=t}};function bt(t){it.error(t)}function Bn(t){if(typeof t=="string"){it.warn(t);return}if(t instanceof Error){it.warn(t.stack??t.message);return}let e=Sc(t);it.warn(`${e.name}: ${e.message}`)}var Ye={};Eo(Ye,{AbstractAstReflection:()=>ru,AbstractCstNode:()=>Wd,AbstractLangiumParser:()=>Hd,AbstractParserErrorMessageProvider:()=>DD,AbstractThreadedAsyncParser:()=>_D,AstUtils:()=>Yr,BiMap:()=>_u,Cancellation:()=>de,CompositeCstNodeImpl:()=>Su,ContextCache:()=>Iu,CstNodeBuilder:()=>Gd,CstUtils:()=>Pc,DONE_RESULT:()=>jr,DatatypeSymbol:()=>gD,DefaultAstNodeDescriptionProvider:()=>up,DefaultAstNodeLocator:()=>lp,DefaultAsyncParser:()=>Ep,DefaultCommentProvider:()=>yp,DefaultConfigurationProvider:()=>fp,DefaultDocumentBuilder:()=>dp,DefaultDocumentValidator:()=>ap,DefaultHydrator:()=>xp,DefaultIndexManager:()=>pp,DefaultJsonSerializer:()=>ip,DefaultLangiumDocumentFactory:()=>Qd,DefaultLangiumDocuments:()=>Zd,DefaultLexer:()=>mp,DefaultLinker:()=>ep,DefaultNameProvider:()=>tp,DefaultReferenceDescriptionProvider:()=>cp,DefaultReferences:()=>rp,DefaultScopeComputation:()=>ku,DefaultScopeProvider:()=>Lu,DefaultServiceRegistry:()=>op,DefaultTokenBuilder:()=>Yd,DefaultValueConverter:()=>Xd,DefaultWorkspaceLock:()=>Cp,DefaultWorkspaceManager:()=>Nu,Deferred:()=>Gn,Disposable:()=>Es,DisposableCache:()=>Ll,DocumentCache:()=>bD,DocumentState:()=>Ke,DocumentValidator:()=>ys,EMPTY_SCOPE:()=>Yre,EMPTY_STREAM:()=>rs,EmptyFileSystem:()=>bp,EmptyFileSystemProvider:()=>ID,ErrorWithLocation:()=>su,GrammarAST:()=>uu,GrammarUtils:()=>Vr,JSDocDocumentationProvider:()=>Dp,LangiumCompletionParser:()=>Kd,LangiumParser:()=>zd,LangiumParserErrorMessageProvider:()=>Tl,LeafCstNodeImpl:()=>Fu,MapScope:()=>np,Module:()=>Ol,MultiMap:()=>Qr,OperationCancelled:()=>Mo,ParserWorker:()=>kD,Reduction:()=>_c,RegExpUtils:()=>Yh,RootCstNodeImpl:()=>Rl,SimpleCache:()=>Pu,StreamImpl:()=>cn,StreamScope:()=>jo,TextDocument:()=>Da,TreeStreamImpl:()=>gi,URI:()=>It,UriUtils:()=>Or,ValidationCategory:()=>Nl,ValidationRegistry:()=>sp,ValueConverter:()=>$o,WorkspaceCache:()=>ya,assertUnreachable:()=>Ks,createCompletionParser:()=>hw,createDefaultCoreModule:()=>Ap,createDefaultSharedCoreModule:()=>vp,createGrammarConfig:()=>lv,createLangiumParser:()=>gw,delayNextTick:()=>ww,diagnosticData:()=>FD,eagerLoad:()=>wp,getDiagnosticRange:()=>oB,inject:()=>Ou,interruptAndCheck:()=>Pt,isAstNode:()=>Nt,isAstNodeDescription:()=>qx,isAstNodeWithComment:()=>Fw,isCompositeCstNode:()=>zn,isIMultiModeLexerDefinition:()=>Rw,isJSDoc:()=>Pw,isLeafCstNode:()=>ts,isLinkingError:()=>nu,isNamed:()=>wD,isOperationCancelled:()=>Ds,isReference:()=>Cn,isRootCstNode:()=>id,isTokenTypeArray:()=>sB,isTokenTypeDictionary:()=>Sw,loadGrammarFromJson:()=>LD,parseJSDoc:()=>kw,prepareLangiumParser:()=>KO,setInterruptionPeriod:()=>eB,startCancelableOperation:()=>ZO,stream:()=>$e,toDiagnosticSeverity:()=>SD});var Pc={};Eo(Pc,{DefaultNameRegexp:()=>Oh,RangeComparison:()=>ns,compareRange:()=>sk,findCommentNode:()=>Hx,findDeclarationNodeAtOffset:()=>ln,findLeafNodeAtOffset:()=>Bh,findLeafNodeBeforeOffset:()=>sd,flattenCst:()=>Gx,getInteriorNodes:()=>lk,getNextNode:()=>ck,getPreviousNode:()=>uk,getStartlineNode:()=>IH,inRange:()=>od,isChildNode:()=>Wx,isCommentNode:()=>Ux,streamCst:()=>iu,toDocumentSegment:()=>ou,tokenToRange:()=>kc});function Nt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Cn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function qx(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function nu(t){return typeof t=="object"&&t!==null&&Nt(t.container)&&Cn(t.reference)&&typeof t.message=="string"}var ru=class{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return Nt(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let o=this.computeIsSubtype(e,r);return n[r]=o,o}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let o of n)this.isSubtype(o,e)&&i.push(o);return this.allSubtypes[e]=i,i}}};function zn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ts(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function id(t){return zn(t)&&typeof t.fullText=="string"}var cn=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){let r=e[Symbol.iterator]();return new t(()=>({first:this.startFn(),firstDone:!1}),n=>{let i;if(!n.firstDone){do if(i=this.nextFn(n.first),!i.done)return i;while(!i.done);n.firstDone=!0}do if(i=r.next(),!i.done)return i;while(!i.done);return jr})}join(e=","){let r=this.iterator(),n="",i,o=!1;do i=r.next(),i.done||(o&&(n+=e),n+=PH(i.value)),o=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,o=n.next();for(;!o.done;){if(i>=r&&o.value===e)return i;o=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?jr:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return jr})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,o=n.next();for(;!o.done;)i===void 0?i=o.value:i=e(i,o.value),o=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){let i=e.next();if(i.done)return n;let o=this.recursiveReduce(e,r,n);return o===void 0?i.value:r(o,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}let{done:n,value:i}=this.nextFn(r.this);if(!n){let o=e(i);if(Nh(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(r.iterator);return jr})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}let{done:i,value:o}=r.nextFn(n.this);if(!i)if(Nh(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(n.iterator);return jr})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?jr:this.nextFn(r.state)))}distinct(e){let r=new Set;return this.filter(n=>{let i=e?e(n):n;return r.has(i)?!1:(r.add(i),!0)})}exclude(e,r){let n=new Set;for(let i of e){let o=r?r(i):i;n.add(o)}return this.filter(i=>{let o=r?r(i):i;return!n.has(o)})}};function PH(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Nh(t){return!!t&&typeof t[Symbol.iterator]=="function"}var rs=new cn(()=>{},()=>jr),jr=Object.freeze({done:!0,value:void 0});function $e(...t){if(t.length===1){let e=t[0];if(e instanceof cn)return e;if(Nh(e))return new cn(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new cn(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:jr)}return t.length>1?new cn(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){let r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){let r=t[e.collIndex++];Nh(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return jr}):rs}var gi=class extends cn{constructor(e,r,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return jr})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},_c;(function(t){function e(o){return o.reduce((s,a)=>s+a,0)}t.sum=e;function r(o){return o.reduce((s,a)=>s*a,0)}t.product=r;function n(o){return o.reduce((s,a)=>Math.min(s,a))}t.min=n;function i(o){return o.reduce((s,a)=>Math.max(s,a))}t.max=i})(_c||(_c={}));function iu(t){return new gi(t,e=>zn(e)?e.content:[],{includeRoot:!0})}function Gx(t){return iu(t).filter(ts)}function Wx(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function kc(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ou(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var ns;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside"})(ns||(ns={}));function sk(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<t.start.character)return ns.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>e.end.character)return ns.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?ns.Inside:r?ns.OverlapBack:ns.OverlapFront}function od(t,e){return sk(t,e)>ns.After}var Oh=/^[\w\p{L}]$/u;function ln(t,e,r=Oh){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return Bh(t,e)}}function Hx(t,e){if(t){let r=uk(t,!0);if(r&&Ux(r,e))return r;if(id(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let o=t.content[i];if(Ux(o,e))return o}}}}function Ux(t,e){return ts(t)&&e.includes(t.tokenType.name)}function Bh(t,e){if(ts(t))return t;if(zn(t)){let r=ak(t,e,!1);if(r)return Bh(r,e)}}function sd(t,e){if(ts(t))return t;if(zn(t)){let r=ak(t,e,!0);if(r)return sd(r,e)}}function ak(t,e,r){let n=0,i=t.content.length-1,o;for(;n<=i;){let s=Math.floor((n+i)/2),a=t.content[s];if(a.offset<=e&&a.end>e)return a;a.end<=e?(o=r?a:void 0,n=s+1):i=s-1}return o}function uk(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function ck(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let o=r.content[n];if(e||!o.hidden)return o}t=r}}function IH(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.container;){let i=t.container,o=n??i.content.indexOf(t);if(o===0?(t=i,n=void 0):(n=o-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function lk(t,e){let r=LH(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function LH(t,e){let r=ok(t),n=ok(e),i;for(let o=0;o<r.length&&o<n.length;o++){let s=r[o],a=n[o];if(s.parent===a.parent)i={parent:s.parent,a:s.index,b:a.index};else break}return i}function ok(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}var Vr={};Eo(Vr,{findAssignment:()=>sv,findNameAssignment:()=>Jh,findNodeForKeyword:()=>$c,findNodeForProperty:()=>Xs,findNodesForKeyword:()=>Xh,findNodesForKeywordInternal:()=>ov,findNodesForProperty:()=>Ys,getActionAtElement:()=>vk,getActionType:()=>bk,getAllReachableRules:()=>hd,getCrossReferenceTerminal:()=>gd,getEntryRule:()=>md,getExplicitRuleType:()=>gu,getHiddenRules:()=>Ck,getRuleType:()=>uv,getTypeName:()=>os,isArrayCardinality:()=>av,isArrayOperator:()=>tz,isCommentTerminal:()=>nv,isDataType:()=>rz,isDataTypeRule:()=>Dd,isOptionalCardinality:()=>hu,terminalRegex:()=>Js});var su=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Ks(t){throw new Error("Error! The input value was not handled.")}var uu={};Eo(uu,{AbstractElement:()=>Kx,AbstractRule:()=>ad,AbstractType:()=>ud,Action:()=>AA,Alternatives:()=>vA,ArrayLiteral:()=>Yx,ArrayType:()=>Xx,Assignment:()=>wA,BooleanLiteral:()=>Qx,CharacterRange:()=>bA,Condition:()=>$h,Conjunction:()=>eA,CrossReference:()=>SA,Disjunction:()=>rA,EndOfFile:()=>RA,Grammar:()=>iA,GrammarImport:()=>dk,Group:()=>_A,InferredType:()=>oA,Interface:()=>sA,Keyword:()=>kA,LangiumGrammarAstReflection:()=>Ic,LangiumGrammarTerminals:()=>NH,NamedArgument:()=>pk,NegatedToken:()=>PA,Negation:()=>aA,NumberLiteral:()=>cA,Parameter:()=>lA,ParameterReference:()=>fA,ParserRule:()=>pA,ReferenceType:()=>mA,RegexToken:()=>LA,ReturnType:()=>mk,RuleCall:()=>OA,SimpleType:()=>DA,StringLiteral:()=>yA,TerminalAlternatives:()=>BA,TerminalGroup:()=>MA,TerminalRule:()=>jh,TerminalRuleCall:()=>VA,Type:()=>EA,TypeAttribute:()=>hk,TypeDefinition:()=>zx,UnionType:()=>CA,UnorderedGroup:()=>qA,UntilToken:()=>UA,ValueLiteral:()=>Mh,Wildcard:()=>WA,isAbstractElement:()=>au,isAbstractRule:()=>OH,isAbstractType:()=>BH,isAction:()=>oo,isAlternatives:()=>Lc,isArrayLiteral:()=>qH,isArrayType:()=>Jx,isAssignment:()=>Sn,isBooleanLiteral:()=>Zx,isCharacterRange:()=>FA,isCondition:()=>$H,isConjunction:()=>tA,isCrossReference:()=>so,isDisjunction:()=>nA,isEndOfFile:()=>TA,isFeatureName:()=>MH,isGrammar:()=>UH,isGrammarImport:()=>GH,isGroup:()=>Oi,isInferredType:()=>Vh,isInterface:()=>qh,isKeyword:()=>xn,isNamedArgument:()=>WH,isNegatedToken:()=>IA,isNegation:()=>uA,isNumberLiteral:()=>HH,isParameter:()=>zH,isParameterReference:()=>dA,isParserRule:()=>wr,isPrimitiveType:()=>fk,isReferenceType:()=>hA,isRegexToken:()=>NA,isReturnType:()=>gA,isRuleCall:()=>Yn,isSimpleType:()=>Uh,isStringLiteral:()=>KH,isTerminalAlternatives:()=>$A,isTerminalGroup:()=>jA,isTerminalRule:()=>Kn,isTerminalRuleCall:()=>Gh,isType:()=>cd,isTypeAttribute:()=>YH,isTypeDefinition:()=>jH,isUnionType:()=>xA,isUnorderedGroup:()=>Nc,isUntilToken:()=>GA,isValueLiteral:()=>VH,isWildcard:()=>HA,reflection:()=>Le});var NH={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ad="AbstractRule";function OH(t){return Le.isInstance(t,ad)}var ud="AbstractType";function BH(t){return Le.isInstance(t,ud)}var $h="Condition";function $H(t){return Le.isInstance(t,$h)}function MH(t){return fk(t)||t==="current"||t==="entry"||t==="extends"||t==="false"||t==="fragment"||t==="grammar"||t==="hidden"||t==="import"||t==="interface"||t==="returns"||t==="terminal"||t==="true"||t==="type"||t==="infer"||t==="infers"||t==="with"||typeof t=="string"&&/\^?[_a-zA-Z][\w_]*/.test(t)}function fk(t){return t==="string"||t==="number"||t==="boolean"||t==="Date"||t==="bigint"}var zx="TypeDefinition";function jH(t){return Le.isInstance(t,zx)}var Mh="ValueLiteral";function VH(t){return Le.isInstance(t,Mh)}var Kx="AbstractElement";function au(t){return Le.isInstance(t,Kx)}var Yx="ArrayLiteral";function qH(t){return Le.isInstance(t,Yx)}var Xx="ArrayType";function Jx(t){return Le.isInstance(t,Xx)}var Qx="BooleanLiteral";function Zx(t){return Le.isInstance(t,Qx)}var eA="Conjunction";function tA(t){return Le.isInstance(t,eA)}var rA="Disjunction";function nA(t){return Le.isInstance(t,rA)}var iA="Grammar";function UH(t){return Le.isInstance(t,iA)}var dk="GrammarImport";function GH(t){return Le.isInstance(t,dk)}var oA="InferredType";function Vh(t){return Le.isInstance(t,oA)}var sA="Interface";function qh(t){return Le.isInstance(t,sA)}var pk="NamedArgument";function WH(t){return Le.isInstance(t,pk)}var aA="Negation";function uA(t){return Le.isInstance(t,aA)}var cA="NumberLiteral";function HH(t){return Le.isInstance(t,cA)}var lA="Parameter";function zH(t){return Le.isInstance(t,lA)}var fA="ParameterReference";function dA(t){return Le.isInstance(t,fA)}var pA="ParserRule";function wr(t){return Le.isInstance(t,pA)}var mA="ReferenceType";function hA(t){return Le.isInstance(t,mA)}var mk="ReturnType";function gA(t){return Le.isInstance(t,mk)}var DA="SimpleType";function Uh(t){return Le.isInstance(t,DA)}var yA="StringLiteral";function KH(t){return Le.isInstance(t,yA)}var jh="TerminalRule";function Kn(t){return Le.isInstance(t,jh)}var EA="Type";function cd(t){return Le.isInstance(t,EA)}var hk="TypeAttribute";function YH(t){return Le.isInstance(t,hk)}var CA="UnionType";function xA(t){return Le.isInstance(t,CA)}var AA="Action";function oo(t){return Le.isInstance(t,AA)}var vA="Alternatives";function Lc(t){return Le.isInstance(t,vA)}var wA="Assignment";function Sn(t){return Le.isInstance(t,wA)}var bA="CharacterRange";function FA(t){return Le.isInstance(t,bA)}var SA="CrossReference";function so(t){return Le.isInstance(t,SA)}var RA="EndOfFile";function TA(t){return Le.isInstance(t,RA)}var _A="Group";function Oi(t){return Le.isInstance(t,_A)}var kA="Keyword";function xn(t){return Le.isInstance(t,kA)}var PA="NegatedToken";function IA(t){return Le.isInstance(t,PA)}var LA="RegexToken";function NA(t){return Le.isInstance(t,LA)}var OA="RuleCall";function Yn(t){return Le.isInstance(t,OA)}var BA="TerminalAlternatives";function $A(t){return Le.isInstance(t,BA)}var MA="TerminalGroup";function jA(t){return Le.isInstance(t,MA)}var VA="TerminalRuleCall";function Gh(t){return Le.isInstance(t,VA)}var qA="UnorderedGroup";function Nc(t){return Le.isInstance(t,qA)}var UA="UntilToken";function GA(t){return Le.isInstance(t,UA)}var WA="Wildcard";function HA(t){return Le.isInstance(t,WA)}var Ic=class extends ru{getAllTypes(){return["AbstractElement","AbstractRule","AbstractType","Action","Alternatives","ArrayLiteral","ArrayType","Assignment","BooleanLiteral","CharacterRange","Condition","Conjunction","CrossReference","Disjunction","EndOfFile","Grammar","GrammarImport","Group","InferredType","Interface","Keyword","NamedArgument","NegatedToken","Negation","NumberLiteral","Parameter","ParameterReference","ParserRule","ReferenceType","RegexToken","ReturnType","RuleCall","SimpleType","StringLiteral","TerminalAlternatives","TerminalGroup","TerminalRule","TerminalRuleCall","Type","TypeAttribute","TypeDefinition","UnionType","UnorderedGroup","UntilToken","ValueLiteral","Wildcard"]}computeIsSubtype(e,r){switch(e){case AA:case vA:case wA:case bA:case SA:case RA:case _A:case kA:case PA:case LA:case OA:case BA:case MA:case VA:case qA:case UA:case WA:return this.isSubtype(Kx,r);case Yx:case cA:case yA:return this.isSubtype(Mh,r);case Xx:case mA:case DA:case CA:return this.isSubtype(zx,r);case Qx:return this.isSubtype($h,r)||this.isSubtype(Mh,r);case eA:case rA:case aA:case fA:return this.isSubtype($h,r);case oA:case sA:case EA:return this.isSubtype(ud,r);case pA:return this.isSubtype(ad,r)||this.isSubtype(ud,r);case jh:return this.isSubtype(ad,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return ud;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return ad;case"Grammar:usedGrammars":return iA;case"NamedArgument:parameter":case"ParameterReference:parameter":return lA;case"TerminalRuleCall:rule":return jh;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case"AbstractElement":return{name:"AbstractElement",properties:[{name:"cardinality"},{name:"lookahead"}]};case"ArrayLiteral":return{name:"ArrayLiteral",properties:[{name:"elements",defaultValue:[]}]};case"ArrayType":return{name:"ArrayType",properties:[{name:"elementType"}]};case"BooleanLiteral":return{name:"BooleanLiteral",properties:[{name:"true",defaultValue:!1}]};case"Conjunction":return{name:"Conjunction",properties:[{name:"left"},{name:"right"}]};case"Disjunction":return{name:"Disjunction",properties:[{name:"left"},{name:"right"}]};case"Grammar":return{name:"Grammar",properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case"GrammarImport":return{name:"GrammarImport",properties:[{name:"path"}]};case"InferredType":return{name:"InferredType",properties:[{name:"name"}]};case"Interface":return{name:"Interface",properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case"NamedArgument":return{name:"NamedArgument",properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case"Negation":return{name:"Negation",properties:[{name:"value"}]};case"NumberLiteral":return{name:"NumberLiteral",properties:[{name:"value"}]};case"Parameter":return{name:"Parameter",properties:[{name:"name"}]};case"ParameterReference":return{name:"ParameterReference",properties:[{name:"parameter"}]};case"ParserRule":return{name:"ParserRule",properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case"ReferenceType":return{name:"ReferenceType",properties:[{name:"referenceType"}]};case"ReturnType":return{name:"ReturnType",properties:[{name:"name"}]};case"SimpleType":return{name:"SimpleType",properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case"StringLiteral":return{name:"StringLiteral",properties:[{name:"value"}]};case"TerminalRule":return{name:"TerminalRule",properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case"Type":return{name:"Type",properties:[{name:"name"},{name:"type"}]};case"TypeAttribute":return{name:"TypeAttribute",properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case"UnionType":return{name:"UnionType",properties:[{name:"types",defaultValue:[]}]};case"Action":return{name:"Action",properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case"Alternatives":return{name:"Alternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"Assignment":return{name:"Assignment",properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case"CharacterRange":return{name:"CharacterRange",properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case"CrossReference":return{name:"CrossReference",properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case"EndOfFile":return{name:"EndOfFile",properties:[{name:"cardinality"},{name:"lookahead"}]};case"Group":return{name:"Group",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case"Keyword":return{name:"Keyword",properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case"NegatedToken":return{name:"NegatedToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"RegexToken":return{name:"RegexToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case"RuleCall":return{name:"RuleCall",properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"TerminalAlternatives":return{name:"TerminalAlternatives",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalGroup":return{name:"TerminalGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"TerminalRuleCall":return{name:"TerminalRuleCall",properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case"UnorderedGroup":return{name:"UnorderedGroup",properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case"UntilToken":return{name:"UntilToken",properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case"Wildcard":return{name:"Wildcard",properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}},Le=new Ic;var Yr={};Eo(Yr,{assignMandatoryProperties:()=>ld,copyAstNode:()=>KA,findLocalReferences:()=>JH,findRootNode:()=>gk,getContainerOfType:()=>Di,getDocument:()=>Vt,hasContainerOfType:()=>XH,linkContentToContainer:()=>Wh,streamAllContents:()=>yi,streamAst:()=>$n,streamContents:()=>cu,streamReferences:()=>Oc});function Wh(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{Nt(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):Nt(r)&&(r.$container=t,r.$containerProperty=e))}function Di(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function XH(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function Vt(t){let r=gk(t).$document;if(!r)throw new Error("AST node has no document.");return r}function gk(t){for(;t.$container;)t=t.$container;return t}function cu(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e?.range;return new cn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let o=t[i];if(Nt(o)){if(n.keyIndex++,zA(o,r))return{done:!1,value:o}}else if(Array.isArray(o)){for(;n.arrayIndex<o.length;){let s=n.arrayIndex++,a=o[s];if(Nt(a)&&zA(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return jr})}function yi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new gi(t,r=>cu(r,e))}function $n(t,e){if(t){if(e?.range&&!zA(t,e.range))return new gi(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new gi(t,r=>cu(r,e),{includeRoot:!0})}function zA(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?od(n,e):!1}function Oc(t){return new cn(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){let r=e.keys[e.keyIndex];if(!r.startsWith("$")){let n=t[r];if(Cn(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){let i=e.arrayIndex++,o=n[i];if(Cn(o))return{done:!1,value:{reference:o,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return jr})}function JH(t,e=Vt(t).parseResult.value){let r=[];return $n(e).forEach(n=>{Oc(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),$e(r)}function ld(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Dk(i.defaultValue))}function Dk(t){return Array.isArray(t)?[...t.map(Dk)]:t}function KA(t,e){let r={$type:t.$type};for(let[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Nt(i))r[n]=KA(i,e);else if(Cn(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){let o=[];for(let s of i)Nt(s)?o.push(KA(s,e)):Cn(s)?o.push(e(r,n,s.$refNode,s.$refText)):o.push(s);r[n]=o}else r[n]=i;return Wh(r),r}var Yh={};Eo(Yh,{NEWLINE_REGEXP:()=>pu,escapeRegExp:()=>mu,getCaseInsensitivePattern:()=>ZA,getTerminalParts:()=>ez,isMultilineComment:()=>QA,isWhitespace:()=>Kh,partialMatches:()=>ev,partialRegExp:()=>Ek});function Te(t){return t.charCodeAt(0)}function Hh(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Bc(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function lu(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function fd(){throw Error("Internal Error - Should never get here!")}function YA(t){return t.type==="Character"}var dd=[];for(let t=Te("0");t<=Te("9");t++)dd.push(t);var pd=[Te("_")].concat(dd);for(let t=Te("a");t<=Te("z");t++)pd.push(t);for(let t=Te("A");t<=Te("Z");t++)pd.push(t);var XA=[Te(" "),Te("\f"),Te(`
|
|
172
172
|
`),Te("\r"),Te(" "),Te("\v"),Te(" "),Te("\xA0"),Te("\u1680"),Te("\u2000"),Te("\u2001"),Te("\u2002"),Te("\u2003"),Te("\u2004"),Te("\u2005"),Te("\u2006"),Te("\u2007"),Te("\u2008"),Te("\u2009"),Te("\u200A"),Te("\u2028"),Te("\u2029"),Te("\u202F"),Te("\u205F"),Te("\u3000"),Te("\uFEFF")];var QH=/[0-9a-fA-F]/,zh=/[0-9]/,ZH=/[1-9]/,fu=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Bc(n,"global");break;case"i":Bc(n,"ignoreCase");break;case"m":Bc(n,"multiLine");break;case"u":Bc(n,"unicode");break;case"y":Bc(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}lu(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return fd()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;lu(r);break}if(!(e===!0&&r===void 0)&&lu(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),lu(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):fd()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Te(`
|
|
173
173
|
`),Te("\r"),Te("\u2028"),Te("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=dd;break;case"D":e=dd,r=!0;break;case"s":e=XA;break;case"S":e=XA,r=!0;break;case"w":e=pd;break;case"W":e=pd,r=!0;break}return lu(e)?{type:"Set",value:e,complement:r}:fd()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Te("\f");break;case"n":e=Te(`
|
|
174
174
|
`);break;case"r":e=Te("\r");break;case"t":e=Te(" ");break;case"v":e=Te("\v");break}return lu(e)?{type:"Character",value:e}:fd()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Te("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:Te(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
@@ -312,14 +312,14 @@ ${" ".repeat(2+n.range.start.character)}autoLayout ${i}`;return G0.TextEdit.inse
|
|
|
312
312
|
`)}`),await s.update(l,d,c)}),i.onRequest(w7,u=>{if("element"in u)return r.locateElement(u.element,u.property??"name");if("relation"in u)return r.locateRelation(u.relation);if("view"in u)return r.locateView(u.view);nt(u)}),i.onRequest(b7,async(u,c)=>await n.applyChange(u)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(r){bt(r)}}};var Yt=Se(At(),1);var Y0=class{constructor(e){this.services=e}getSymbolKind(e){let r=n=>"type"in e&&this.services.AstReflection.isSubtype(e.type,n);switch(!0){case(I.isElement(e)||r(I.Element)||I.isExtendElement(e)||r(I.ExtendElement)):return Yt.SymbolKind.Constructor;case(I.isModel(e)||I.isModelViews(e)||I.isSpecificationRule(e)||r(I.Model)||r(I.ModelViews)||r(I.SpecificationRule)):return Yt.SymbolKind.Namespace;case(I.isLikeC4View(e)||r(I.LikeC4View)):return Yt.SymbolKind.Class;case(I.isTag(e)||r(I.Tag)||I.isSpecificationTag(e)||r(I.SpecificationTag)):return Yt.SymbolKind.EnumMember;case(I.isRelationshipKind(e)||r(I.RelationshipKind)||I.isSpecificationRelationshipKind(e)||r(I.SpecificationRelationshipKind)):return Yt.SymbolKind.Event;case(I.isElementKind(e)||r(I.ElementKind)||I.isSpecificationElementKind(e)||r(I.SpecificationElementKind)):return Yt.SymbolKind.TypeParameter}return Yt.SymbolKind.Constant}getCompletionItemKind(e){switch(this.getSymbolKind(e)){case Yt.SymbolKind.Constructor:return Yt.CompletionItemKind.Constructor;case Yt.SymbolKind.Namespace:return Yt.CompletionItemKind.Module;case Yt.SymbolKind.Class:return Yt.CompletionItemKind.Class;case Yt.SymbolKind.Enum:return Yt.CompletionItemKind.Enum;case Yt.SymbolKind.EnumMember:return Yt.CompletionItemKind.EnumMember;case Yt.SymbolKind.TypeParameter:return Yt.CompletionItemKind.TypeParameter;case Yt.SymbolKind.Interface:return Yt.CompletionItemKind.Interface;case Yt.SymbolKind.Event:return Yt.CompletionItemKind.Event;default:return Yt.CompletionItemKind.Reference}}};var X0=class extends Nu{loadAdditionalDocuments(e,r){return Promise.resolve()}workspace(){return this.folders&&Qt(this.folders,1)?this.folders[0]:null}get workspaceUri(){let e=this.workspace();return fe(e,"Workspace not initialized"),It.parse(e.uri)}get workspaceURL(){let e=this.workspace();return fe(e,"Workspace not initialized"),new URL(e.uri)}};var J0=class extends of{};var F7=t=>(e,r)=>{try{for(let n of e.expressions)switch(!0){case I.isElementRef(n):case I.isDescedantsExpr(n):case I.isCustomElementExpr(n):case I.isExpandElementExpr(n):return;case I.isRelationExpr(n):case I.isInOutExpr(n):case I.isIncomingExpr(n):case I.isOutgoingExpr(n):case I.isElementKindExpr(n):case I.isElementTagExpr(n):case I.isWildcardExpr(n):return r("warning","Expression is not supported by dynamic views",{node:n});default:nt(n)}}catch(n){bt(n)}};var S7=t=>{let e=t.likec4.FqnIndex;return(r,n)=>{try{let i=zr(r.source),o=i&&e.getFqn(i);o||n("error","Source not found (not parsed/indexed yet)",{node:r,property:"source"});let s=zr(r.target),a=s&&e.getFqn(s);a||n("error","Target not found (not parsed/indexed yet)",{node:r,property:"target"}),o&&a&&(Zo(o,a)||Zo(a,o))&&n("error","Invalid parent-child relationship",{node:r})}catch(i){bt(i)}}};var{getDocument:Zae}=Yr,R7=t=>{let e=t.likec4.FqnIndex;return(r,n)=>{let i=e.getFqn(r);if(!i){n("error","Not indexed element",{node:r,property:"name"});return}let o=e.byFqn(i).filter(s=>s.el!==r).head();if(o){let s=o.doc.uri!==Zae(r).uri;n("error",`Duplicate element name ${r.name!==i?r.name+" ("+i+")":r.name}`,{node:r,property:"name",...s&&{relatedInformation:[{location:{range:o.el.$cstNode.range,uri:o.doc.uri.toString()},message:"conflicting element"}]}})}}};var T7=t=>(e,r)=>{let n=parseFloat(e.value);(isNaN(n)||n<0||n>100)&&r("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})};var _7=t=>{let e=t.likec4.FqnIndex;return(r,n)=>{try{let i=zr(r.target),o=i&&e.getFqn(i);o||n("error","Target not found (not parsed/indexed yet)",{node:r,property:"target"});let s;if(I.isExplicitRelation(r)){if(s=zr(r.source),!s)return n("error","Source not found (not parsed/indexed yet)",{node:r,property:"source"})}else s=r.$container.$container;let a=e.getFqn(s);a||n("error","Source not found (not parsed/indexed yet)",{node:r}),a&&o&&td(a,o)&&n("error","Invalid parent-child relationship",{node:r}),r.tags?.value&&r.body?.tags?.value&&n("error","Relation cannot have tags in both header and body",{node:r,property:"tags"})}catch(i){bt(i)}}};var k7=t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one specification per document is allowed",{node:e,property:"name"})},P7=t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one model per document is allowed",{node:e,property:"name"})},I7=t=>(e,r)=>{e.$containerIndex&&e.$containerIndex>0&&r("error","Only one views block per document is allowed",{node:e,property:"name"})},L7=t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{let i=e.allElements(I.ElementKind).filter(o=>o.name===r.name&&o.node!==r).head();if(i){let o=i.documentUri!==Yr.getDocument(r).uri;n("error",`Duplicate element kind '${r.name}'`,{node:r,property:"name",...o&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}}},N7=t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{let i="#"+r.name,o=e.allElements(I.Tag).filter(s=>s.name===i&&s.node!==r).head();if(o){let s=o.documentUri!==Yr.getDocument(r).uri;n("error",`Duplicate tag '${r.name}'`,{node:r,property:"name",...s&&{relatedInformation:[{location:{range:o.nameSegment.range,uri:o.documentUri.toString()},message:"conflicting definition"}]}})}}},O7=t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{e.allElements(I.RelationshipKind).filter(o=>o.name===r.name).limit(2).count()>1&&n("error",`Duplicate RelationshipKind '${r.name}'`,{node:r,property:"name"})}};var B7=t=>{let e=t.shared.workspace.IndexManager;return(r,n)=>{if(!r.name)return;e.allElements(I.LikeC4View).filter(o=>o.name===r.name).limit(2).count()>1&&n("error",`Duplicate view '${r.name}'`,{node:r,property:"name"})}};var $7=t=>(e,r)=>{I.isExcludePredicate(e.$container)&&r("error",'Invalid inside "exclude"',{node:e}),I.isElementRef(e.target)||r("error","Invalid target for customization",{node:e,property:"target"})};var M7=t=>(e,r)=>{switch(!0){case I.isIncludePredicate(e.$container):case I.isDynamicViewRulePredicate(e.$container):case I.isViewRuleStyle(e.$container):return;case I.isCustomElementExpr(e.$container):return r("warning","Custom rules apply only to parent",{node:e});case I.isExcludePredicate(e.$container):return r("warning","Ignored, as can't be used in exclude",{node:e});case I.isInOutExpr(e.$container):case I.isIncomingExpr(e.$container):case I.isOutgoingExpr(e.$container):case I.isRelationExpr(e.$container):return r("warning","Wrong usage of expanded element in relations predicate",{node:e});default:nt(e.$container)}};var j7=t=>(e,r)=>{if(I.isWildcardExpr(e.to)&&I.isViewRulePredicate(e.$container)){let n=e.$container.$container.$container;tt(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}};var V7=t=>(e,r)=>{if(I.isWildcardExpr(e.from)){let n=e.$container.$container.$container;n.$type==="ElementView"&&tt(n.viewOf)&&r("warning","Predicate is ignored as it concerns all relationships",{node:e})}};function q7(t){it.info("registerValidationChecks"),t.validation.ValidationRegistry.register({OpacityProperty:T7(t),SpecificationRule:k7(t),Model:P7(t),ModelViews:I7(t),DynamicViewStep:S7(t),LikeC4View:B7(t),Element:R7(t),ElementKind:L7(t),Relation:_7(t),Tag:N7(t),DynamicViewRulePredicate:F7(t),CustomElementExpr:$7(t),ExpandElementExpr:M7(t),RelationshipKind:O7(t),IncomingExpr:j7(t),OutgoingExpr:V7(t)});let r=t.shared.lsp.Connection;r&&t.shared.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let o of i)it.debug(`clear diagnostics for deleted ${o.path}`),r.sendDiagnostics({uri:o.toString(),diagnostics:[]})})}var eue={lsp:{NodeKindProvider:t=>new Y0(t),WorkspaceSymbolProvider:t=>new J0(t)},workspace:{WorkspaceManager:t=>new X0(t)}};function ai(t){return e=>new t(e)}var U7={WorkspaceCache:t=>new ya(t.shared),Rpc:ai(K0),likec4:{ModelChanges:ai(W0),FqnIndex:ai(_0),ModelParser:ai(q0),ModelBuilder:ai(M0),ModelLocator:ai(j0)},lsp:{DocumentHighlightProvider:ai(w0),DocumentSymbolProvider:ai(S0),SemanticTokenProvider:ai(T0),HoverProvider:ai(R0),CodeLensProvider:ai(v0),DocumentLinkProvider:ai(F0)},references:{ScopeComputation:ai(H0),ScopeProvider:ai(z0)}};function hS(t,e,r,n){let i=tue(t),o=[K8({shared:i}),v6,U7,e,r,n].reduce(G7,{}),s=Ou(o);return i.ServiceRegistry.register(s),q7(s),s.Rpc.init(),{shared:i,likec4:s}}function tue(t={}){let e=t.connection;if(e){let n=it.error.bind(it);it.error=i=>{if(typeof i=="string"){n(i),e.telemetry.logEvent({eventName:"error",error:i});return}let o=Sc(i);n(o),e.telemetry.logEvent({eventName:"error",error:o.stack??o.message})}}let r={...bp,...t};return Ou(Y8(r),A6,eue)}function G7(t,e){if(e){for(let[r,n]of Object.entries(e))if(n!==void 0){let i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=G7(i,n):t[r]=n}}return t}var Q0={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?t+(e-t)*6*r:r<.5?e:r<.6666666666666666?t+(e-t)*(.6666666666666666-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;let i=r<.5?r*(1+e):r+e-r*e,o=2*r-i;switch(n){case"r":return Q0.hue2rgb(o,i,t+.3333333333333333)*255;case"g":return Q0.hue2rgb(o,i,t)*255;case"b":return Q0.hue2rgb(o,i,t-.3333333333333333)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;let i=Math.max(t,e,r),o=Math.min(t,e,r),s=(i+o)/2;if(n==="l")return s*100;if(i===o)return 0;let a=i-o,u=s>.5?a/(2-i-o):a/(i+o);if(n==="s")return u*100;switch(i){case t:return((e-r)/a+(e<r?6:0))*60;case e:return((r-t)/a+2)*60;case r:return((t-e)/a+4)*60;default:return-1}}},W7=Q0;var rue={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},H7=rue;var nue={dec2hex:t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},z7=nue;var iue={channel:W7,lang:H7,unit:z7},Ne=iue;var bs={};for(let t=0;t<=255;t++)bs[t]=Ne.unit.dec2hex(t);var Zr={ALL:0,RGB:1,HSL:2};var gS=class{constructor(){this.type=Zr.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Zr.ALL}is(e){return this.type===e}},K7=gS;var DS=class{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new K7}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Zr.ALL,this}_ensureHSL(){let e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Ne.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Ne.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ne.channel.rgb2hsl(e,"l"))}_ensureRGB(){let e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Ne.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Ne.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ne.channel.hsl2rgb(e,"b"))}get r(){let e=this.data,r=e.r;return!this.type.is(Zr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ne.channel.hsl2rgb(e,"r"))}get g(){let e=this.data,r=e.g;return!this.type.is(Zr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ne.channel.hsl2rgb(e,"g"))}get b(){let e=this.data,r=e.b;return!this.type.is(Zr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ne.channel.hsl2rgb(e,"b"))}get h(){let e=this.data,r=e.h;return!this.type.is(Zr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ne.channel.rgb2hsl(e,"h"))}get s(){let e=this.data,r=e.s;return!this.type.is(Zr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ne.channel.rgb2hsl(e,"s"))}get l(){let e=this.data,r=e.l;return!this.type.is(Zr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ne.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Zr.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Zr.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Zr.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Zr.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Zr.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Zr.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}},Y7=DS;var oue=new Y7({r:0,g:0,b:0,a:0},"transparent"),ff=oue;var X7={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;let e=t.match(X7.re);if(!e)return;let r=e[1],n=parseInt(r,16),i=r.length,o=i%4===0,s=i>4,a=s?1:17,u=s?8:4,c=o?0:-1,l=s?255:15;return ff.set({r:(n>>u*(c+3)&l)*a,g:(n>>u*(c+2)&l)*a,b:(n>>u*(c+1)&l)*a,a:o?(n&l)*a/255:1},t)},stringify:t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`#${bs[Math.round(e)]}${bs[Math.round(r)]}${bs[Math.round(n)]}${bs[Math.round(i*255)]}`:`#${bs[Math.round(e)]}${bs[Math.round(r)]}${bs[Math.round(n)]}`}},zu=X7;var Z0={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{let e=t.match(Z0.hueRe);if(e){let[,r,n]=e;switch(n){case"grad":return Ne.channel.clamp.h(parseFloat(r)*.9);case"rad":return Ne.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Ne.channel.clamp.h(parseFloat(r)*360)}}return Ne.channel.clamp.h(parseFloat(t))},parse:t=>{let e=t.charCodeAt(0);if(e!==104&&e!==72)return;let r=t.match(Z0.re);if(!r)return;let[,n,i,o,s,a]=r;return ff.set({h:Z0._hue2deg(n),s:Ne.channel.clamp.s(parseFloat(i)),l:Ne.channel.clamp.l(parseFloat(o)),a:s?Ne.channel.clamp.a(a?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{let{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Ne.lang.round(e)}, ${Ne.lang.round(r)}%, ${Ne.lang.round(n)}%, ${i})`:`hsl(${Ne.lang.round(e)}, ${Ne.lang.round(r)}%, ${Ne.lang.round(n)}%)`}},rm=Z0;var eE={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();let e=eE.colors[t];if(e)return zu.parse(e)},stringify:t=>{let e=zu.stringify(t);for(let r in eE.colors)if(eE.colors[r]===e)return r}},yS=eE;var J7={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{let e=t.charCodeAt(0);if(e!==114&&e!==82)return;let r=t.match(J7.re);if(!r)return;let[,n,i,o,s,a,u,c,l]=r;return ff.set({r:Ne.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Ne.channel.clamp.g(s?parseFloat(o)*2.55:parseFloat(o)),b:Ne.channel.clamp.b(u?parseFloat(a)*2.55:parseFloat(a)),a:c?Ne.channel.clamp.a(l?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{let{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Ne.lang.round(e)}, ${Ne.lang.round(r)}, ${Ne.lang.round(n)}, ${Ne.lang.round(i)})`:`rgb(${Ne.lang.round(e)}, ${Ne.lang.round(r)}, ${Ne.lang.round(n)})`}},nm=J7;var sue={format:{keyword:yS,hex:zu,rgb:nm,rgba:nm,hsl:rm,hsla:rm},parse:t=>{if(typeof t!="string")return t;let e=zu.parse(t)||nm.parse(t)||rm.parse(t)||yS.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Zr.HSL)||t.data.r===void 0?rm.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?nm.stringify(t):zu.stringify(t)},vi=sue;var aue=(t,e)=>{let r=vi.parse(t);for(let n in e)r[n]=Ne.channel.clamp[n](e[n]);return vi.stringify(r)},Q7=aue;var uue=t=>vi.format.hex.stringify(vi.parse(t)),tE=uue;var cue=(t,e,r)=>{let n=vi.parse(t),i=n[e],o=Ne.channel.clamp[e](i+r);return i!==o&&(n[e]=o),vi.stringify(n)},Z7=cue;var lue=(t,e)=>Z7(t,"a",-e),ES=lue;var fue=(t,e)=>{let r=vi.parse(t),n={};for(let i in e)e[i]&&(n[i]=r[i]+e[i]);return Q7(t,n)},e9=fue;var due=(t,e)=>{let r=vi.parse(t),n={},i=(o,s,a)=>s>0?(a-o)*s/100:o*s/100;for(let o in e)n[o]=i(r[o],e[o],Ne.channel.max[o]);return e9(t,n)},CS=due;function Kr(t){return t.children.length>0}function po(t){switch(t){case"open":return"vee";default:return t}}function wi(t){return Array.isArray(t)?[wi(t[0]),wi(t[1])]:(fe(isFinite(t),`Invalid not finite point value ${t}`),Math.ceil(t))}var xS=t=>(fe(isFinite(t),`Invalid not finite inch value ${t}`),Math.ceil(t*72)),Dt=t=>Math.ceil(t/72*1e3)/1e3,Cr=t=>Math.ceil(t),rE=Cr(40).toString(),t9=t=>{switch(t){case"l":return"left";case"r":return"right";case"c":return"center"}nt(`Invalid align: ${t}`)};function df(t,e){return tE(CS(t,{l:-35-5*e,s:-15-5*e}))}function nE(t){return tE(ES(t,.3))}function r9(t){let[e,r,n,i]=t?t.split(",").map(a=>wi(+a)):[0,0,0,0],o=Math.ceil(n-e),s=Math.ceil(r-i);return{x:Math.ceil(e),y:Math.ceil(i),width:o,height:s}}function i9(t){try{let[e,r]=t.split(",");return{x:wi(parseFloat(e)),y:wi(parseFloat(r))}}catch(e){throw console.error(`failed on parsing pos: ${t}`),e}}function pue({pos:t,width:e,height:r}){let{x:n,y:i}=i9(t),o=xS(+e),s=xS(+r);return{x:n-Math.ceil(o/2),y:i-Math.ceil(s/2),width:o,height:s}}function o9({_ldraw_:t=[]},[e,r]=[0,0]){let n=[],i,o,s;for(let a of t){if(a.op==="F"){i=wi(a.size);continue}if(a.op==="c"){o=a.color;continue}if(a.op==="t"){a.fontchar===1?s="bold":s=void 0;continue}if(a.op==="T"){i&&a.text.trim()!==""&&n.push({fontSize:i,...s?{fontStyle:s}:{},...o?{color:o}:{},text:a.text,pt:[wi(a.pt[0])-e,wi(a.pt[1])-r],align:t9(a.align),width:wi(a.width)});continue}}return n}function mue({_draw_:t,likec4_id:e="???"}){try{let r=t.filter(i=>i.op.toLowerCase()==="b");fe(Qt(r,1),`edge ${e} should have at least one bezier draw op`),r.length>1&&console.warn(`edge ${e} has more than one bezier draw op, using the first one only`);let n=r[0].points.map(i=>wi(i));return fe(Qt(n,2),`edge ${e}should have at least two points`),n}catch(r){throw console.error(`failed on parsing edge ${e} _draw_:
|
|
313
313
|
${JSON.stringify(t,null,2)}`),r}}function hue(t){try{let e={},r=t.split(" ").slice(0,3);for(let n of r){let i=n.startsWith("s,"),o=n.startsWith("e,");if(i||o){let{x:s,y:a}=i9(n.substring(2));i?e.tailArrowPoint=[s,a]:e.headArrowPoint=[s,a]}}return e}catch(e){throw console.error(`failed on parsing edge pos: ${t}`),e}}function n9(t,e){try{let r=e.filter(o=>o.op.toLowerCase()==="p");fe(Qt(r,1),`edge ${t} arrow should have at least one polygon`),r.length>1&&console.warn(`edge ${t} arrow has more than one polygon, using the first one only`);let i=r[0].points.map(o=>wi(o));return fe(Qt(i,1)),i}catch{console.error(`failed on parsing edge ${t} arrow polygon:
|
|
314
314
|
${JSON.stringify(e,null,2)}`);return}}function gue(t,e){if(!t.likec4_id)return null;let r=e.find(a=>a.id===t.likec4_id);if(!r)return console.warn(`Edge ${t.likec4_id} not found, how did it get into the graphviz output?`),null;let n={...r,points:mue(t)};t.pos&&Object.assign(n,hue(t.pos));let i=o9(t);if(Qt(i,1)){let a={x:0,y:0,width:0,height:0},u=wi(4),c=eo(i);a.y=c.pt[1]-c.fontSize-u;let l=x2(i,[p=>p.width,"desc"]);a.x=l.pt[0]-u,a.width=l.width+u*2;let d=to(i).pt[1]+u;a.height=d-a.y,n.labels=i,n.labelBBox=a}let o=t._hdraw_&&n9(n.id+" head ",t._hdraw_),s=t._tdraw_&&n9(n.id+" tail ",t._tdraw_);return o&&(n.headArrow=o),s&&(n.tailArrow=s),n}function iE(t,e){let r=JSON.parse(t),n=r9(r.bb),{nodes:i,edges:o,...s}=e,a={...s,width:n.x+n.width,height:n.y+n.height,nodes:[],edges:[]},u=r.objects??[];for(let{likec4_id:l,...f}of u){if(!l)continue;let d=i.find(E=>E.id===l);if(!d){console.warn(`Node likec4_id=${l} not found, how did it get into the graphviz output?`);continue}let{x:p,y,width:C,height:g}="bb"in f?r9(f.bb):pue(f),A=[p,y],m={...d,position:A,width:C,height:g,labels:o9(f,A)};a.nodes.push(m)}let c=r.edges??[];for(let l of c)try{let f=gue(l,o);if(!f)continue;a.edges.push(f)}catch(f){console.error(`failed on parsing edge ${l.likec4_id}:
|
|
315
|
-
${String(f)}`)}return a}import{Graphviz as dm}from"@hpcc-js/wasm/graphviz";var AS=class{value;next;constructor(e){this.value=e}},im=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new AS(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};import{AsyncResource as Due}from"async_hooks";function Fs(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new im,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,c)=>{r++;let l=(async()=>a(...c))();u(l);try{await l}catch{}n()},o=(a,u,c)=>{e.enqueue(Due.bind(i.bind(void 0,a,u,c))),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(c=>{o(a,c,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}}}),s}function vS(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function oE(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function s9(t){return oE(t)||vS(t)}function pf(t){return typeof t=="string"||s9(t)}function a9(t){return Array.isArray(t)&&t.every(pf)}function yue(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function wS(t){if(s9(t))return t;let[e,r,n]=t.split(":");return yue(n)?{id:e,port:r,compass:n}:{id:e,port:r}}function u9(t){if(t.length<2&&(pf(t[0])&&pf(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>wS(e))}var om=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function bS(t){return Object.assign(Object.seal(Object.assign({},om)),t)}function Eue(...t){let[e,...r]=t;return(...n)=>r.reduce((i,o)=>o(i),e(...n))}function bi(t,...e){return Eue(t,...e)}var c9=t=>(...e)=>r=>t(r,...e),l9=t=>({[Symbol.iterator]:t}),Wi=c9((t,e)=>Array.from(l9(function*(){for(let r of t)yield e(r)}))),
|
|
315
|
+
${String(f)}`)}return a}import{Graphviz as dm}from"@hpcc-js/wasm/graphviz";var AS=class{value;next;constructor(e){this.value=e}},im=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new AS(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};import{AsyncResource as Due}from"async_hooks";function Fs(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new im,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,c)=>{r++;let l=(async()=>a(...c))();u(l);try{await l}catch{}n()},o=(a,u,c)=>{e.enqueue(Due.bind(i.bind(void 0,a,u,c))),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(c=>{o(a,c,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}}}),s}function vS(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function oE(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function s9(t){return oE(t)||vS(t)}function pf(t){return typeof t=="string"||s9(t)}function a9(t){return Array.isArray(t)&&t.every(pf)}function yue(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function wS(t){if(s9(t))return t;let[e,r,n]=t.split(":");return yue(n)?{id:e,port:r,compass:n}:{id:e,port:r}}function u9(t){if(t.length<2&&(pf(t[0])&&pf(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>wS(e))}var om=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function bS(t){return Object.assign(Object.seal(Object.assign({},om)),t)}function Eue(...t){let[e,...r]=t;return(...n)=>r.reduce((i,o)=>o(i),e(...n))}function bi(t,...e){return Eue(t,...e)}var c9=t=>(...e)=>r=>t(r,...e),l9=t=>({[Symbol.iterator]:t}),Wi=c9((t,e)=>Array.from(l9(function*(){for(let r of t)yield e(r)}))),_We=c9((t,e)=>Array.from(l9(function*(){for(let r of t)e(r)&&(yield r)})));var uE=class{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,r,n=[]){return{location:this.getLocation(),...r,type:e,children:n}}},yt=uE.prototype.createElement.bind(new uE),Cue=/\r?\n/;function mo(t){return e=>e.join(t)}function xue(t){return e=>t+e+t}function Pa(t,e){return r=>t+r+e}function sE(t){return e=>t+e}var f9=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),aE=t=>t.split(Cue),sm=(t,e,r)=>bi(aE,Wi(sE(t==="space"?" ".repeat(e):`
|
|
316
316
|
`)),mo(r)),Yu=t=>{switch(t){case"crlf":return`\r
|
|
317
317
|
`;case"lf":return`
|
|
318
|
-
`}},Aue={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;let r=Yu(t.endOfLine);return bi(Wi(t.print),mo(r),sm(t.indentStyle,t.indentSize,r),Pa(`${e.kind.toLocaleLowerCase()} [${r}`,`${r}];`))(e.children)}},vue={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},wue={match(t){return t.type==="Comment"},print(t,e){let r=Yu(t.endOfLine);switch(e.kind){case"Block":return bi(aE,Wi(sE(" * ")),mo(r),Pa(`/**${r}`,`${r} */`))(e.value);case"Macro":return bi(aE,Wi(sE("# ")),mo(r))(e.value);case"Slash":default:return bi(aE,Wi(sE("// ")),mo(r))(e.value)}}},bue={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Yu(t.endOfLine))}},Fue={match(t){return t.type==="Edge"},print(t,e){let r=bi(Wi(t.print),mo(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${r};`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Sue={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;let r=[];if(e.strict&&r.push("strict"),r.push(e.directed?"digraph":"graph"),e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Rue=bi(f9,xue('"')),Tue=Pa("<",">"),_ue={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return Tue(e.value);case!0:return Rue(e.value);case!1:default:return f9(e.value)}}},kue={match(t){return t.type==="Node"},print(t,e){let r=t.print(e.id);if(e.children.length===0)return`${r};`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Pue={match(t){return t.type==="NodeRefGroup"},print(t,e){return bi(Wi(t.print),mo(" "),Pa("{","}"))(e.children)}},Iue={match(t){return t.type==="NodeRef"},print(t,e){let r=[t.print(e.id)];return e.port&&r.push(t.print(e.port)),e.compass&&r.push(t.print(e.compass)),r.join(":")}},Lue={match(t){return t.type==="Subgraph"},print(t,e){let r=["subgraph"];if(e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Nue=[Aue,vue,wue,bue,Fue,Sue,_ue,kue,Pue,Iue,Lue],FS=class{options;#e=[...Nue];constructor(e={}){this.options=e}print(e){let r=[...this.#e],{indentSize:n=2,indentStyle:i="space",endOfLine:o="lf"}=this.options,s={directed:!0,indentSize:n,indentStyle:i,endOfLine:o,print(a){for(let u of r)if(u.match(a))return u.print(s,a);throw Error()}};return s.print(e)}};function d9(t,e){let r=new FS(e).print(t);if(!r)throw new Error;return r}function cE(t,e){if(typeof e=="string"){let r=e.trim();return/^<.+>$/ms.test(r)?yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:r.slice(1,r.length-1),quoted:"html"},[])},[]):yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:e,quoted:!0},[])},[])}return yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:String(e),quoted:!1},[])},[])}function Ku(t,e){return yt("Comment",{kind:e,value:t},[])}function p9(t,e){return Array.from(function*(){for(let[r,n]of e.values)yield cE(r,n);for(let r of Object.values(e.attributes))r.size>0&&(r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r));for(let r of e.nodes)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.subgraphs)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.edges)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r)}())}var Oue={match(t){return t.$$type==="AttributeList"},convert(t,e){return yt("AttributeList",{kind:e.$$kind},e.values.map(([r,n])=>cE(r,n)))}},Bue={match(t){return t.$$type==="Edge"},convert(t,e){return yt("Edge",{targets:e.targets.map(r=>oE(r)?yt("NodeRef",{id:yt("Literal",{value:r.id,quoted:!0},[])},[]):vS(r)?yt("NodeRef",{id:yt("Literal",{value:r.id,quoted:!0},[]),port:r.port?yt("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?yt("Literal",{value:r.compass,quoted:!0},[]):void 0},[]):yt("NodeRefGroup",{},r.map(n=>oE(n)?yt("NodeRef",{id:yt("Literal",{value:n.id,quoted:!0},[])},[]):yt("NodeRef",{id:yt("Literal",{value:n.id,quoted:!0},[]),port:n.port?yt("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?yt("Literal",{value:n.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ku(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>cE(r,n))])}},$ue={match(t){return t.$$type==="Graph"},convert(t,e){return yt("Dot",{},[...e.comment?[Ku(e.comment,t.commentKind)]:[],yt("Graph",{directed:e.directed,strict:e.strict,id:e.id?yt("Literal",{value:e.id,quoted:!0},[]):void 0},p9(t,e))])}},Mue={match(t){return t.$$type==="Node"},convert(t,e){return yt("Node",{id:yt("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ku(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>cE(r,n))])}},jue={match(t){return t.$$type==="Subgraph"},convert(t,e){return yt("Subgraph",{id:e.id?yt("Literal",{value:e.id,quoted:!0},[]):void 0},p9(t,e))}},Vue=[Oue,Bue,Mue,$ue,jue],SS=class{options;#e=[...Vue];constructor(e={}){this.options=e}convert(e){let r=[...this.#e],{commentKind:n="Slash"}=this.options,i={commentKind:n,convert(o){for(let s of r)if(s.match(o))return s.convert(i,o);throw Error()}};return i.convert(e)}};function m9(t,e){return new SS(e).convert(t)}var N=new Proxy(Object.freeze({}),{get:(t,e)=>e}),um=class{},cm=class extends um{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,r){r!=null&&this.#e.set(e,r)}delete(e){this.#e.delete(e)}apply(e){let r=Array.isArray(e)?e:Object.entries(e);for(let[n,i]of r)this.set(n,i)}clear(){this.#e.clear()}},am=class extends cm{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,r){super(r),this.$$kind=e}},lE=class extends cm{#e=om;id;comment;attributes=Object.freeze({graph:new am("Graph"),edge:new am("Edge"),node:new am("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=bS(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){let r=new this.#e.Subgraph(...e);return r.with(this.#e),this.addSubgraph(r),r}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,r){let n=new this.#e.Node(e,r);return this.addNode(n),n}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(r=>r.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,r){let n=e.map(o=>a9(o)?u9(o):wS(o)),i=new this.#e.Edge(n,r);return this.addEdge(i),i}subgraph(...e){let r=e.find(s=>typeof s=="string"),n=e.find(s=>typeof s=="object"&&s!==null),i=e.find(s=>typeof s=="function"),o=r?this.getSubgraph(r)??this.createSubgraph(r):this.createSubgraph();return n!==void 0&&o.apply(n),i!==void 0&&i(o),o}node(e,...r){if(typeof e=="string"){let n=e,i=r.find(a=>typeof a=="object"&&a!==null),o=r.find(a=>typeof a=="function"),s=this.getNode(n)??this.createNode(n);return i!==void 0&&s.attributes.apply(i),o!==void 0&&o(s),s}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...r){if(Array.isArray(e)){let n=e,i=r.find(a=>typeof a=="object"),o=r.find(a=>typeof a=="function"),s=this.createEdge(n,i);return o!==void 0&&o(s),s}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}},fE=class extends lE{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(n=>typeof n=="string"),this.strict=e.find(n=>typeof n=="boolean")??!1;let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}},RS=class extends fE{get directed(){return!0}},TS=class extends fE{get directed(){return!1}},_S=class extends lE{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(n=>typeof n=="string");let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}},dE=class extends cm{comment},kS=class extends um{id;get $$type(){return"Node"}comment;attributes;constructor(e,r){super(),this.id=e,this.attributes=new dE(r)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}},PS=class extends um{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,r){if(super(),this.targets=e,e.length<2&&(pf(e[0])&&pf(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new dE(r)}};Object.assign(om,{Graph:TS,Digraph:RS,Subgraph:_S,Node:kS,Edge:PS});function h9(t,e){return(...r)=>{let n=t?this.Digraph:this.Graph,i=r.find(u=>typeof u=="string"),o=r.find(u=>typeof u=="object"),s=r.find(u=>typeof u=="function"),a=new n(i,e,o);return a.with(this),typeof s=="function"&&s(a),a}}function g9(t,e=om){return Object.freeze({digraph:h9.call(e,!0,t),graph:h9.call(e,!1,t)})}var D9=g9(!1),pE=D9.digraph,
|
|
318
|
+
`}},Aue={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;let r=Yu(t.endOfLine);return bi(Wi(t.print),mo(r),sm(t.indentStyle,t.indentSize,r),Pa(`${e.kind.toLocaleLowerCase()} [${r}`,`${r}];`))(e.children)}},vue={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},wue={match(t){return t.type==="Comment"},print(t,e){let r=Yu(t.endOfLine);switch(e.kind){case"Block":return bi(aE,Wi(sE(" * ")),mo(r),Pa(`/**${r}`,`${r} */`))(e.value);case"Macro":return bi(aE,Wi(sE("# ")),mo(r))(e.value);case"Slash":default:return bi(aE,Wi(sE("// ")),mo(r))(e.value)}}},bue={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Yu(t.endOfLine))}},Fue={match(t){return t.type==="Edge"},print(t,e){let r=bi(Wi(t.print),mo(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${r};`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Sue={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;let r=[];if(e.strict&&r.push("strict"),r.push(e.directed?"digraph":"graph"),e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Rue=bi(f9,xue('"')),Tue=Pa("<",">"),_ue={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return Tue(e.value);case!0:return Rue(e.value);case!1:default:return f9(e.value)}}},kue={match(t){return t.type==="Node"},print(t,e){let r=t.print(e.id);if(e.children.length===0)return`${r};`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`[${n}`,`${n}];`))(e.children);return`${r} ${i}`}},Pue={match(t){return t.type==="NodeRefGroup"},print(t,e){return bi(Wi(t.print),mo(" "),Pa("{","}"))(e.children)}},Iue={match(t){return t.type==="NodeRef"},print(t,e){let r=[t.print(e.id)];return e.port&&r.push(t.print(e.port)),e.compass&&r.push(t.print(e.compass)),r.join(":")}},Lue={match(t){return t.type==="Subgraph"},print(t,e){let r=["subgraph"];if(e.id&&r.push(t.print(e.id)),e.children.length===0)return`${r.join(" ")} {}`;let n=Yu(t.endOfLine),i=bi(Wi(t.print),mo(n),sm(t.indentStyle,t.indentSize,n),Pa(`{${n}`,`${n}}`))(e.children);return`${r.join(" ")} ${i}`}},Nue=[Aue,vue,wue,bue,Fue,Sue,_ue,kue,Pue,Iue,Lue],FS=class{options;#e=[...Nue];constructor(e={}){this.options=e}print(e){let r=[...this.#e],{indentSize:n=2,indentStyle:i="space",endOfLine:o="lf"}=this.options,s={directed:!0,indentSize:n,indentStyle:i,endOfLine:o,print(a){for(let u of r)if(u.match(a))return u.print(s,a);throw Error()}};return s.print(e)}};function d9(t,e){let r=new FS(e).print(t);if(!r)throw new Error;return r}function cE(t,e){if(typeof e=="string"){let r=e.trim();return/^<.+>$/ms.test(r)?yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:r.slice(1,r.length-1),quoted:"html"},[])},[]):yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:e,quoted:!0},[])},[])}return yt("Attribute",{key:yt("Literal",{value:t,quoted:!1},[]),value:yt("Literal",{value:String(e),quoted:!1},[])},[])}function Ku(t,e){return yt("Comment",{kind:e,value:t},[])}function p9(t,e){return Array.from(function*(){for(let[r,n]of e.values)yield cE(r,n);for(let r of Object.values(e.attributes))r.size>0&&(r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r));for(let r of e.nodes)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.subgraphs)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r);for(let r of e.edges)r.comment&&(yield Ku(r.comment,t.commentKind)),yield t.convert(r)}())}var Oue={match(t){return t.$$type==="AttributeList"},convert(t,e){return yt("AttributeList",{kind:e.$$kind},e.values.map(([r,n])=>cE(r,n)))}},Bue={match(t){return t.$$type==="Edge"},convert(t,e){return yt("Edge",{targets:e.targets.map(r=>oE(r)?yt("NodeRef",{id:yt("Literal",{value:r.id,quoted:!0},[])},[]):vS(r)?yt("NodeRef",{id:yt("Literal",{value:r.id,quoted:!0},[]),port:r.port?yt("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?yt("Literal",{value:r.compass,quoted:!0},[]):void 0},[]):yt("NodeRefGroup",{},r.map(n=>oE(n)?yt("NodeRef",{id:yt("Literal",{value:n.id,quoted:!0},[])},[]):yt("NodeRef",{id:yt("Literal",{value:n.id,quoted:!0},[]),port:n.port?yt("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?yt("Literal",{value:n.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ku(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>cE(r,n))])}},$ue={match(t){return t.$$type==="Graph"},convert(t,e){return yt("Dot",{},[...e.comment?[Ku(e.comment,t.commentKind)]:[],yt("Graph",{directed:e.directed,strict:e.strict,id:e.id?yt("Literal",{value:e.id,quoted:!0},[]):void 0},p9(t,e))])}},Mue={match(t){return t.$$type==="Node"},convert(t,e){return yt("Node",{id:yt("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ku(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([r,n])=>cE(r,n))])}},jue={match(t){return t.$$type==="Subgraph"},convert(t,e){return yt("Subgraph",{id:e.id?yt("Literal",{value:e.id,quoted:!0},[]):void 0},p9(t,e))}},Vue=[Oue,Bue,Mue,$ue,jue],SS=class{options;#e=[...Vue];constructor(e={}){this.options=e}convert(e){let r=[...this.#e],{commentKind:n="Slash"}=this.options,i={commentKind:n,convert(o){for(let s of r)if(s.match(o))return s.convert(i,o);throw Error()}};return i.convert(e)}};function m9(t,e){return new SS(e).convert(t)}var N=new Proxy(Object.freeze({}),{get:(t,e)=>e}),um=class{},cm=class extends um{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,r){r!=null&&this.#e.set(e,r)}delete(e){this.#e.delete(e)}apply(e){let r=Array.isArray(e)?e:Object.entries(e);for(let[n,i]of r)this.set(n,i)}clear(){this.#e.clear()}},am=class extends cm{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,r){super(r),this.$$kind=e}},lE=class extends cm{#e=om;id;comment;attributes=Object.freeze({graph:new am("Graph"),edge:new am("Edge"),node:new am("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=bS(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){let r=new this.#e.Subgraph(...e);return r.with(this.#e),this.addSubgraph(r),r}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,r){let n=new this.#e.Node(e,r);return this.addNode(n),n}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(r=>r.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,r){let n=e.map(o=>a9(o)?u9(o):wS(o)),i=new this.#e.Edge(n,r);return this.addEdge(i),i}subgraph(...e){let r=e.find(s=>typeof s=="string"),n=e.find(s=>typeof s=="object"&&s!==null),i=e.find(s=>typeof s=="function"),o=r?this.getSubgraph(r)??this.createSubgraph(r):this.createSubgraph();return n!==void 0&&o.apply(n),i!==void 0&&i(o),o}node(e,...r){if(typeof e=="string"){let n=e,i=r.find(a=>typeof a=="object"&&a!==null),o=r.find(a=>typeof a=="function"),s=this.getNode(n)??this.createNode(n);return i!==void 0&&s.attributes.apply(i),o!==void 0&&o(s),s}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...r){if(Array.isArray(e)){let n=e,i=r.find(a=>typeof a=="object"),o=r.find(a=>typeof a=="function"),s=this.createEdge(n,i);return o!==void 0&&o(s),s}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}},fE=class extends lE{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(n=>typeof n=="string"),this.strict=e.find(n=>typeof n=="boolean")??!1;let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}},RS=class extends fE{get directed(){return!0}},TS=class extends fE{get directed(){return!1}},_S=class extends lE{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(n=>typeof n=="string");let r=e.find(n=>typeof n=="object"&&n!==null);r!==void 0&&this.apply(r)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}},dE=class extends cm{comment},kS=class extends um{id;get $$type(){return"Node"}comment;attributes;constructor(e,r){super(),this.id=e,this.attributes=new dE(r)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}},PS=class extends um{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,r){if(super(),this.targets=e,e.length<2&&(pf(e[0])&&pf(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new dE(r)}};Object.assign(om,{Graph:TS,Digraph:RS,Subgraph:_S,Node:kS,Edge:PS});function h9(t,e){return(...r)=>{let n=t?this.Digraph:this.Graph,i=r.find(u=>typeof u=="string"),o=r.find(u=>typeof u=="object"),s=r.find(u=>typeof u=="function"),a=new n(i,e,o);return a.with(this),typeof s=="function"&&s(a),a}}function g9(t,e=om){return Object.freeze({digraph:h9.call(e,!0,t),graph:h9.call(e,!1,t)})}var D9=g9(!1),pE=D9.digraph,MWe=D9.graph,jWe=g9(!0);function mE(t,e){let r=m9(t,e?.convert);return d9(r,e?.print)}var C9=Se(E9(),1);function fm(t){return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function Wue(t,e){return(0,C9.default)(t,{width:e,indent:"",escape:fm}).split(`
|
|
319
319
|
`)}function lm({text:t,maxchars:e,fontsize:r,lineHeight:n=1.25,bold:i,color:o,align:s}){let a=s?` ALIGN="${s.toUpperCase()}"`:"",u=n!==1?` VALIGN="BOTTOM" HEIGHT="${Cr(r*n)}"`:"",c=` POINT-SIZE="${Cr(r)}"${o?` COLOR="${o}"`:""}`,l=Wue(t,e).map(f=>xo(f)?" ":f).map(f=>`<FONT${c}>${f}</FONT>`).map(f=>i?`<B>${f}</B>`:f).map(f=>`<TR><TD${a}${u}>${f}</TD></TR>`).join("");return`<TABLE${a} BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="0">${l}</TABLE>`}function Hue(t){return`<TABLE FIXEDSIZE="TRUE" BGCOLOR="#11223300" WIDTH="${rE}" HEIGHT="${rE}" BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD> </TD></TR></TABLE>`}function hE(t){let e=[lm({text:t.title,fontsize:20,maxchars:30,color:wc[t.color].hiContrast})];if(pt(t.technology)&&e.push(lm({text:t.technology,fontsize:12,lineHeight:1.125,maxchars:45,color:wc[t.color].loContrast})),pt(t.description)&&e.push(lm({text:t.description,fontsize:14,lineHeight:1.25,maxchars:45,color:wc[t.color].loContrast})),e.length===1&&!t.icon)return`<${e[0]}>`;let r=e.map(i=>`<TR><TD>${i}</TD></TR>`);return t.icon&&r.unshift(`<TR><TD ALIGN="CENTER" HEIGHT="${rE}">${Hue(t.icon)}</TD></TR>`),`<<TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="5">${r.join("")}</TABLE>>`}function x9(t){return`<<TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="4"><TR><TD WIDTH="2"></TD><TD>${lm({text:t,maxchars:35,fontsize:13,lineHeight:1.25,bold:t==="[...]",align:"left"})}</TD></TR></TABLE>>`}var zue=`BGCOLOR="${bc.relationships[hi].labelBgColor}"`;function A9(t,e){let r=`<TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="0" ${zue} STYLE="ROUNDED" FIXEDSIZE="TRUE"><TR><TD ALIGN="CENTER" WIDTH="20" HEIGHT="18" VALIGN="MIDDLE"><FONT POINT-SIZE="${Cr(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;if(!pt(e))return`<${r}>`;let n=lm({text:e,maxchars:30,fontsize:13,lineHeight:1.25,align:"left"});return`<<TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="4"><TR><TD VALIGN="MIDDLE">${r}</TD><TD VALIGN="TOP">${n}</TD></TR></TABLE>>`}var gE="dashed";function Kue({autoLayout:t,nodes:e,edges:r}){function n(x){if(x===null)return e.filter(H=>!Kr(H));let k=x+".";return e.filter(H=>!Kr(H)&&(H.parent===x||H.parent?.startsWith(k)))}function i(x){return En(e.find(k=>k.id===x),`Node ${x} not found`)}function o(x){return!0}function s(x){if(x===null)return r.filter(o);let k=x+".";return r.filter(H=>H.parent&&(H.parent===x||H.parent.startsWith(k))&&o(H))}let a=bc,u=pE({[N.bgcolor]:"transparent",[N.layout]:"dot",[N.compound]:!0,[N.rankdir]:t,[N.TBbalance]:"min",[N.splines]:"spline",[N.outputorder]:"nodesfirst",[N.nodesep]:Dt(100),[N.ranksep]:Dt(110),[N.pack]:Cr(180),[N.packmode]:"array_3",[N.pad]:Dt(10)});u.attributes.graph.apply({[N.fontname]:a.font,[N.fontsize]:Cr(13),[N.labeljust]:t==="RL"?"r":"l",[N.labelloc]:t==="BT"?"b":"t",[N.margin]:33.21,[N.penwidth]:Cr(1)}),u.attributes.node.apply({[N.fontname]:a.font,[N.fontsize]:Cr(20),[N.fontcolor]:a.elements[no].hiContrast,[N.shape]:"rect",[N.width]:Dt(330),[N.height]:Dt(185),[N.style]:"filled,rounded",[N.fillcolor]:a.elements[no].fill,[N.color]:a.elements[no].stroke,[N.penwidth]:0,[N.margin]:Dt(26)}),u.attributes.edge.apply({[N.fontname]:a.font,[N.fontsize]:Cr(13),[N.penwidth]:Cr(2),[N.style]:gE,[N.color]:a.relationships[hi].lineColor,[N.fontcolor]:a.relationships[hi].labelColor});let c=new Set,l=new Map,f=new Map;function d(x,k=!1){return k?x="cluster_"+x:x.toLowerCase().startsWith("cluster")&&(x="nd_"+x),c.has(x)?null:(c.add(x),x)}function p(x){let k=Kr(x),H=wo(x.id).toLowerCase(),Q=d(H,k);if(Q!==null)return Q;let xe=x.id,Pe;for(;Pe=tr(xe);){if(H=wo(Pe).toLowerCase()+"_"+H,Q=d(H,k),Q!==null)return Q;xe=Pe}H=wo(x.id).toLowerCase();let se=1;do Q=d(H+"_"+se++,k);while(Q===null);return Q}function y(x){fe(!Kr(x),"compound node should be added by traverseClusters");let k=p(x),H=x.parent?l.get(x.parent):u;fe(H,"parentGraph should be defined");let Q=H.node(k,{[N.likec4_id]:x.id,[N.likec4_level]:x.level,[N.margin]:Dt(26)});switch(x.color!==no&&Q.attributes.apply({[N.fillcolor]:a.elements[x.color].fill}),x.shape){case"browser":{Q.attributes.apply({[N.margin]:`${Dt(30)},${Dt(32)}`});break}case"queue":{Q.attributes.apply({[N.width]:Dt(330),[N.height]:Dt(170),[N.margin]:`${Dt(30)},${Dt(26)}`});break}case"cylinder":case"storage":{Q.attributes.apply({[N.margin]:`${Dt(26)},${Dt(30)}`,[N.color]:a.elements[x.color].stroke,[N.penwidth]:Cr(2),[N.shape]:"cylinder"});break}default:break}return Q.attributes.set(N.label,hE(x)),f.set(x.id,Q),Q}let C=0;function g(x,k){fe(Kr(x),"node should be compound"),fe(nh(x.depth),"node.depth should be defined");let H=p(x),Q=k.subgraph(H,{[N.likec4_id]:x.id,[N.likec4_level]:x.level,[N.likec4_depth]:x.depth,[N.fillcolor]:df(a.elements[x.color].fill,x.depth),[N.color]:df(a.elements[x.color].stroke,x.depth),[N.style]:"filled",[N.margin]:Cr(40)}),xe=fm(x.title.toUpperCase());if(pt(xe)){let Pe=nE(a.elements[x.color].loContrast);Q.apply({[N.fontcolor]:Pe,[N.label]:`<<B>${xe}</B>>`})}l.set(x.id,Q),C=Math.max(C,x.depth);for(let Pe of e.filter(se=>Kr(se)&&se.parent===x.id))g(Pe,Q)}function A(x,k=eo){let H=i(x),Q=f.get(x),xe;return Q||(fe(Kr(H),"endpoint node should be compound"),xe=l.get(x)?.id,fe(xe,`subgraph ${x} not found`),H=En(k(n(x)),`leaf element in ${x} not found`),Q=En(f.get(H.id),`source graphviz node ${H.id} not found`)),[H,Q,xe]}function m(x,k){let[H,Q]=x.dir==="back"?[x.target,x.source]:[x.source,x.target],[xe,Pe,se]=A(H,ye=>to(ye)),[M,_,j]=A(Q,eo),G=x.parent,Z=k.edge([Pe,_],{[N.likec4_id]:x.id,[N.style]:x.line??gE});if(j&&Z.attributes.set(N.lhead,j),se&&Z.attributes.set(N.ltail,se),j||se){let ye=Pe.attributes.get(N.likec4_id),me=_.attributes.get(N.likec4_id);r.find(mr=>mr.source===ye&&mr.target===me)&&Z.attributes.set(N.weight,0)}let ae=x.label?.trim()??"";if(pt(ae)&&Z.attributes.apply({[N.label]:x9(ae)}),x.color&&Z.attributes.apply({[N.color]:a.relationships[x.color].lineColor,[N.fontcolor]:a.relationships[x.color].labelColor}),x.dir==="back"){x.head&&Z.attributes.set(N.arrowtail,po(x.head)),x.tail&&x.tail!=="none"?Z.attributes.set(N.arrowhead,po(x.tail)):Z.attributes.set(N.arrowhead,"none"),Z.attributes.set(N.dir,"back");return}if(x.head&&Z.attributes.apply({[N.arrowhead]:po(x.head)}),x.tail&&x.tail!=="none"&&(x.head==="none"?Z.attributes.apply({[N.arrowtail]:po(x.tail),[N.dir]:"back"}):Z.attributes.apply({[N.arrowtail]:po(x.tail),[N.dir]:"both"})),x.head==="none"&&(tt(x.tail)||x.tail==="none")){Z.attributes.apply({[N.arrowtail]:"none",[N.arrowhead]:"none",[N.dir]:"none",[N.constraint]:!1});return}let V;G===null&&xe.parent==null&&M.parent==null?V=r.filter(ye=>{if(ye.id===x.id||ye.source===x.source&&ye.target===x.target||ye.source===x.target&&ye.target===x.source||ye.parent!==null)return!1;let me=i(ye.source),Tt=i(ye.target);return Kr(me)||Kr(Tt)?!1:me.parent==null&&Tt.parent==null}):V=s(G).filter(ye=>!(ye.id===x.id||ye.source===x.source&&ye.target===x.target||ye.source===x.target&&ye.target===x.source)),V.length===0&&(G===null||n(G).length<=3)&&Z.attributes.set(N.constraint,!1)}let E=[];for(let x of e)Kr(x)?tt(x.parent)&&g(x,u):E.push(x);for(let x of E)y(x);for(let x of r){let k=x.parent?l.get(x.parent):u;fe(k,"Edge parent graph should be defined"),m(x,k)}return u}function DE(t){return mE(Kue(t))}function Yue({autoLayout:t,nodes:e,edges:r}){function n(m){if(m===null)return e.filter(x=>!Kr(x)&&tt(x.parent));let E=m+".";return e.filter(x=>!Kr(x)&&(x.parent===m||x.parent?.startsWith(E)))}function i(m){return En(e.find(E=>E.id===m),`Node ${m} not found`)}let o=bc,s=pE({[N.bgcolor]:"transparent",[N.layout]:"dot",[N.compound]:!0,[N.rankdir]:t,[N.TBbalance]:"max",[N.splines]:"spline",[N.outputorder]:"nodesfirst",[N.newrank]:!0,[N.nodesep]:Dt(110),[N.ranksep]:Dt(130),[N.pack]:Cr(180),[N.packmode]:"array_4",[N.pad]:Dt(10)});s.attributes.graph.apply({[N.fontname]:o.font,[N.fontsize]:Cr(13),[N.labeljust]:t==="RL"?"r":"l",[N.labelloc]:t==="BT"?"b":"t",[N.margin]:33.21,[N.penwidth]:Cr(1)}),s.attributes.node.apply({[N.fontname]:o.font,[N.fontsize]:Cr(20),[N.shape]:"rect",[N.width]:Dt(330),[N.height]:Dt(185),[N.style]:"filled,rounded",[N.fillcolor]:o.elements[no].fill,[N.color]:o.elements[no].stroke,[N.penwidth]:0,[N.margin]:Dt(26)}),s.attributes.edge.apply({[N.fontname]:o.font,[N.fontsize]:Cr(13),[N.penwidth]:Cr(2),[N.style]:"dashed",[N.color]:o.relationships[hi].lineColor,[N.fontcolor]:o.relationships[hi].labelColor});let a=new Set,u=new Map,c=new Map;function l(m,E=!1){return E?m="cluster_"+m:m.toLowerCase().startsWith("cluster")&&(m="nd_"+m),a.has(m)?null:(a.add(m),m)}function f(m){let E=Kr(m),x=wo(m.id).toLowerCase(),k=l(x,E);if(k!==null)return k;let H=m.id,Q;for(;Q=tr(H);){if(x=wo(Q).toLowerCase()+"_"+x,k=l(x,E),k!==null)return k;H=Q}x=wo(m.id).toLowerCase();let xe=1;do k=l(x+"_"+xe++,E);while(k===null);return k}function d(m){fe(!Kr(m),"compound node should be added by traverseClusters");let E=f(m),x=m.parent?u.get(m.parent):s;fe(x,"parentGraph should be defined");let k=x.node(E,{[N.likec4_id]:m.id,[N.likec4_level]:m.level,[N.margin]:Dt(26)});switch(m.color!==no&&k.attributes.apply({[N.fillcolor]:o.elements[m.color].fill}),m.shape){case"browser":{k.attributes.apply({[N.margin]:`${Dt(30)},${Dt(32)}`});break}case"queue":{k.attributes.apply({[N.width]:Dt(330),[N.height]:Dt(170),[N.margin]:`${Dt(30)},${Dt(26)}`});break}case"cylinder":case"storage":{k.attributes.apply({[N.margin]:`${Dt(26)},${Dt(30)}`,[N.color]:o.elements[m.color].stroke,[N.penwidth]:Cr(2),[N.shape]:"cylinder"});break}default:break}return k.attributes.set(N.label,hE(m)),c.set(m.id,k),k}let p=0;function y(m,E){fe(Kr(m),"node should be compound"),fe(nh(m.depth),"node.depth should be defined");let x=f(m),k=E.subgraph(x,{[N.likec4_id]:m.id,[N.likec4_level]:m.level,[N.likec4_depth]:m.depth,[N.fillcolor]:df(o.elements[m.color].fill,m.depth),[N.color]:df(o.elements[m.color].stroke,m.depth),[N.style]:"filled",[N.margin]:Cr(40)}),H=fm(m.title.toUpperCase());if(pt(H)){let Q=nE(o.elements[m.color].loContrast);k.apply({[N.fontcolor]:Q,[N.label]:`<<B>${H}</B>>`})}u.set(m.id,k),p=Math.max(p,m.depth);for(let Q of e.filter(xe=>Kr(xe)&&xe.parent===m.id))y(Q,k)}function C(m,E=eo){let x=i(m),k=c.get(m),H;return k||(fe(Kr(x),"endpoint node should be compound"),H=u.get(m)?.id,fe(H,`subgraph ${m} not found`),x=En(E(n(m)),`leaf element in ${m} not found`),k=En(c.get(x.id),`source graphviz node ${x.id} not found`)),[k,H]}function g(m,E){let[x,k]=m.dir==="back"?[m.target,m.source]:[m.source,m.target],[H,Q]=C(x,Z=>to(Z)),[xe,Pe]=C(k,eo),se=E.edge([H,xe],{[N.likec4_id]:m.id,[N.style]:m.line??gE});Pe&&se.attributes.set(N.lhead,Pe),Q&&se.attributes.set(N.ltail,Q);let M=rk(m.id),_=m.label?.trim();if(se.attributes.apply({[N.label]:A9(M,_)}),m.color&&m.color!==hi&&se.attributes.apply({[N.color]:o.relationships[m.color].lineColor,[N.fontcolor]:o.relationships[m.color].labelColor}),m.head==="none"&&(tt(m.tail)||m.tail==="none")){se.attributes.apply({[N.arrowtail]:"none",[N.arrowhead]:"none",[N.dir]:"none",[N.minlen]:0,[N.weight]:0});return}if(m.dir==="back"){se.attributes.set(N.arrowtail,po(m.head??"normal")),m.tail&&m.tail!=="none"?se.attributes.set(N.arrowhead,po(m.tail)):se.attributes.set(N.arrowhead,"none"),se.attributes.apply({[N.dir]:"back",[N.weight]:0});return}let j=e.findIndex(Z=>Z.id===x);e.findIndex(Z=>Z.id===k)<j&&se.attributes.apply({[N.minlen]:0,[N.weight]:0}),m.head&&m.head!=="normal"&&se.attributes.set(N.arrowhead,po(m.head)),m.tail&&m.tail!=="none"&&se.attributes.set(N.arrowtail,po(m.tail))}let A=[];for(let m of e)Kr(m)?tt(m.parent)&&y(m,s):A.push(m);for(let m of A)d(m);for(let m of r){let E=m.parent?u.get(m.parent):s;fe(E,"Edge parent graph should be defined"),g(m,E)}return s}function yE(t){return mE(Yue(t))}var IS=Fs(1);function Xue(t,e){if(nk(e))return yE(e);let r=DE(e);return t.unflatten(r,1,!0,2).replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")}var Xu=class{dispose(){IS.clearQueue(),dm.unload()}async layout(e){return await IS(async()=>{let r=await this.attempt(e);if(r)return r;if(console.warn("Retrying..."),await ik(50),r=await this.attempt(e),r)return console.info("Retry succeeded"),r;throw new Error("Failed to layout with graphviz")})}async attempt(e){try{let r=await dm.load(),n=Xue(r,e),i=r.dot(n,"json",{yInvert:!0}),o=iE(i,e);return{dot:n.split(`
|
|
320
320
|
`).filter(s=>!s.includes("margin=33.21")&&!s.includes("margin = 33.21")).join(`
|
|
321
321
|
`),diagram:o}}catch(r){return console.error(`Failed attempt to layout with graphviz: ${e.id}`),console.error(r),null}finally{dm.unload()}}async svg(e,r){return await IS(async()=>{try{return(await dm.load()).layout(e,"svg","dot",{yInvert:!0})}finally{dm.unload()}})}};var Nm=Se(Mr(),1);import{resolve as Bhe}from"node:path";function Br(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}import{fileURLToPath as Jue}from"node:url";var mf=(t,e)=>{let r=LS(t);if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},LS=t=>t instanceof URL?Jue(t):t;var EE=(t,e=[],r={})=>{let n=mf(t,"First argument"),[i,o]=Br(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Br(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]};import{ChildProcess as ice}from"node:child_process";import{StringDecoder as Que}from"node:string_decoder";var{toString:v9}=Object.prototype,w9=t=>v9.call(t)==="[object ArrayBuffer]",en=t=>v9.call(t)==="[object Uint8Array]",Ss=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Zue=new TextEncoder,b9=t=>Zue.encode(t),ece=new TextDecoder,CE=t=>ece.decode(t),F9=(t,e)=>tce(t,e).join(""),tce=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new Que(e),n=t.map(o=>typeof o=="string"?b9(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},pm=t=>t.length===1&&en(t[0])?t[0]:NS(rce(t)),rce=t=>t.map(e=>typeof e=="string"?b9(e):e),NS=t=>{let e=new Uint8Array(nce(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},nce=t=>{let e=0;for(let r of t)e+=r.length;return e};var _9=t=>Array.isArray(t)&&Array.isArray(t.raw),k9=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=oce({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},oce=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=sce(i,t.raw[n]),u=R9(r,o,s);if(n===e.length)return u;let c=e[n],l=Array.isArray(c)?c.map(f=>T9(f)):[T9(c)];return R9(u,l,a)},sce=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=S9.has(e[0]);for(let s=0,a=0;s<t.length;s+=1,a+=1){let u=e[a];if(S9.has(u))n!==s&&r.push(t.slice(n,s)),n=s+1;else if(u==="\\"){let c=e[a+1];c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=ace[c]??1}}let o=n===t.length;return o||r.push(t.slice(n)),{nextTokens:r,leadingWhitespaces:i,trailingWhitespaces:o}},S9=new Set([" "," ","\r",`
|
|
322
|
-
`]),ace={x:3,u:5},R9=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],T9=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Br(t)&&("stdout"in t||"isMaxBuffer"in t))return uce(t);throw t instanceof ice||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},uce=({stdout:t})=>{if(typeof t=="string")return t;if(en(t))return CE(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};import{spawnSync as Tpe}from"node:child_process";import cce from"node:tty";var lce=cce.WriteStream.prototype.hasColors(),We=(t,e)=>{if(!lce)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,u=0;for(;s!==-1;)a+=o.slice(u,s)+r,u=s+n.length,s=o.indexOf(n,u);return a+=o.slice(u)+n,a}},
|
|
322
|
+
`]),ace={x:3,u:5},R9=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],T9=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Br(t)&&("stdout"in t||"isMaxBuffer"in t))return uce(t);throw t instanceof ice||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},uce=({stdout:t})=>{if(typeof t=="string")return t;if(en(t))return CE(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};import{spawnSync as Tpe}from"node:child_process";import cce from"node:tty";var lce=cce.WriteStream.prototype.hasColors(),We=(t,e)=>{if(!lce)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,u=0;for(;s!==-1;)a+=o.slice(u,s)+r,u=s+n.length,s=o.indexOf(n,u);return a+=o.slice(u)+n,a}},PHe=We(0,0),P9=We(1,22),IHe=We(2,22),LHe=We(3,23),NHe=We(4,24),OHe=We(53,55),BHe=We(7,27),$He=We(8,28),MHe=We(9,29),jHe=We(30,39),VHe=We(31,39),qHe=We(32,39),UHe=We(33,39),GHe=We(34,39),WHe=We(35,39),HHe=We(36,39),zHe=We(37,39),mm=We(90,39),KHe=We(40,49),YHe=We(41,49),XHe=We(42,49),JHe=We(43,49),QHe=We(44,49),ZHe=We(45,49),eze=We(46,49),tze=We(47,49),rze=We(100,49),I9=We(91,39),nze=We(92,39),L9=We(93,39),ize=We(94,39),oze=We(95,39),sze=We(96,39),aze=We(97,39),uze=We(101,49),cze=We(102,49),lze=We(103,49),fze=We(104,49),dze=We(105,49),pze=We(106,49),mze=We(107,49);import{debuglog as fce}from"node:util";var O9=fce("execa").enabled?"full":"none",B9=t=>{let e=hm(t)?dce++:void 0;return pce(t),{verbose:t,verboseId:e}},dce=0n,hm=t=>t.some(e=>e!=="none"),pce=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!N9.has(e)){let r=[...N9].map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r}.`)}}},N9=new Set(["none","short","full"]);import{writeFileSync as Ece}from"node:fs";import Wo from"node:process";function OS(){return Wo.platform!=="win32"?Wo.env.TERM!=="linux":!!Wo.env.WT_SESSION||!!Wo.env.TERMINUS_SUBLIME||Wo.env.ConEmuTask==="{cmd::Cmder}"||Wo.env.TERM_PROGRAM==="Terminus-Sublime"||Wo.env.TERM_PROGRAM==="vscode"||Wo.env.TERM==="xterm-256color"||Wo.env.TERM==="alacritty"||Wo.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $9={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},M9={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},mce={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},hce={...$9,...M9},gce={...$9,...mce},Dce=OS(),yce=Dce?hce:gce,xE=yce,xze=Object.entries(M9);var Ia=(t,e,r,n)=>{let i=xce(t,e,r,n);Ece(Cce,`${i}
|
|
323
323
|
`)},Cce=2,xce=(t,e,r,n)=>t.includes(`
|
|
324
324
|
`)?t.split(`
|
|
325
325
|
`).map(i=>j9(i,e,r,n)).join(`
|
|
@@ -337,7 +337,7 @@ Please rename it to one of: ${r}.`)},Ile=new Set(["utf8","utf16le"]),Fi=new Set(
|
|
|
337
337
|
${t.message}`,t}},tj=(t,e)=>{if(e===ej())return t;let r;try{r=Nle(e)}catch(n){return`The "cwd" option is invalid: ${e}.
|
|
338
338
|
${n.message}
|
|
339
339
|
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
340
|
-
${t}`};var PE=(t,e,r)=>{r.cwd=Z5(r.cwd);let[n,i,o]=X5(t,e,r),{command:s,args:a,options:u}=nj.default._parse(n,i,o),c=H9(u),l=Mle(c);return z5(l),Q5(l),l.shell=LS(l.shell),l.env=jle(l),l.killSignal=q5(l.killSignal),l.forceKillAfterDelay=W5(l.forceKillAfterDelay),l.lines=l.lines.map((f,d)=>f&&!Fi.has(l.encoding)&&l.buffer[d]),rj.platform==="win32"&&$le(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:l}},Mle=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,ipc:f=!1,serialization:d="advanced",...p})=>({...p,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:u,killSignal:c,forceKillAfterDelay:l,ipc:f,serialization:d}),jle=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...rj.env,...t}:t;return r||n?O5({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s};import{constants as Gle}from"node:os";var ij=()=>{let t=sj-oj+1;return Array.from({length:t},Vle)},Vle=(t,e)=>({name:`SIGRT${e+1}`,number:oj+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),oj=34,sj=64;import{constants as qle}from"node:os";var aj=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var QS=()=>{let t=ij();return[...aj,...t].map(Ule)},Ule=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=qle,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}};var Wle=()=>{let t=QS();return Object.fromEntries(t.map(Hle))},Hle=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],uj=Wle(),zle=()=>{let t=QS(),e=65,r=Array.from({length:e},(n,i)=>Kle(i,t));return Object.assign({},...r)},Kle=(t,e)=>{let r=Yle(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:u}}},Yle=(t,e)=>{let r=e.find(({name:n})=>Gle.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},
|
|
340
|
+
${t}`};var PE=(t,e,r)=>{r.cwd=Z5(r.cwd);let[n,i,o]=X5(t,e,r),{command:s,args:a,options:u}=nj.default._parse(n,i,o),c=H9(u),l=Mle(c);return z5(l),Q5(l),l.shell=LS(l.shell),l.env=jle(l),l.killSignal=q5(l.killSignal),l.forceKillAfterDelay=W5(l.forceKillAfterDelay),l.lines=l.lines.map((f,d)=>f&&!Fi.has(l.encoding)&&l.buffer[d]),rj.platform==="win32"&&$le(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:l}},Mle=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,ipc:f=!1,serialization:d="advanced",...p})=>({...p,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:u,killSignal:c,forceKillAfterDelay:l,ipc:f,serialization:d}),jle=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...rj.env,...t}:t;return r||n?O5({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s};import{constants as Gle}from"node:os";var ij=()=>{let t=sj-oj+1;return Array.from({length:t},Vle)},Vle=(t,e)=>({name:`SIGRT${e+1}`,number:oj+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),oj=34,sj=64;import{constants as qle}from"node:os";var aj=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var QS=()=>{let t=ij();return[...aj,...t].map(Ule)},Ule=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=qle,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}};var Wle=()=>{let t=QS();return Object.fromEntries(t.map(Hle))},Hle=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],uj=Wle(),zle=()=>{let t=QS(),e=65,r=Array.from({length:e},(n,i)=>Kle(i,t));return Object.assign({},...r)},Kle=(t,e)=>{let r=Yle(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:u}}},Yle=(t,e)=>{let r=e.find(({name:n})=>Gle.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},eYe=zle();function Df(t){if(typeof t=="string")return Xle(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Jle(t)}var Xle=t=>t.at(-1)===cj?t.slice(0,t.at(-2)===lj?-2:-1):t,Jle=t=>t.at(-1)===Qle?t.subarray(0,t.at(-2)===Zle?-2:-1):t,cj=`
|
|
341
341
|
`,Qle=cj.codePointAt(0),lj="\r",Zle=lj.codePointAt(0);import{on as bfe}from"node:events";import{finished as Ffe}from"node:stream/promises";function Do(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function ZS(t,{checkOpen:e=!0}={}){return Do(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Qu(t,{checkOpen:e=!0}={}){return Do(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function eR(t,e){return ZS(t,e)&&Qu(t,e)}var efe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),tR=class{#e;#t;#r=!1;#n=void 0;constructor(e,r){this.#e=e,this.#t=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(r){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),r}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){let r=this.#e.cancel(e);return this.#e.releaseLock(),await r,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}},rR=Symbol();function fj(){return this[rR].next()}Object.defineProperty(fj,"name",{value:"next"});function dj(t){return this[rR].return(t)}Object.defineProperty(dj,"name",{value:"return"});var tfe=Object.create(efe,{next:{enumerable:!0,configurable:!0,writable:!0,value:fj},return:{enumerable:!0,configurable:!0,writable:!0,value:dj}});function nR({preventCancel:t=!1}={}){let e=this.getReader(),r=new tR(e,t),n=Object.create(tfe);return n[rR]=r,n}var pj=t=>{if(Qu(t,{checkOpen:!1})&&xm.on!==void 0)return nfe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(rfe.call(t)==="[object ReadableStream]")return nR.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:rfe}=Object.prototype,nfe=async function*(t){let e=new AbortController,r={};ife(t,e,r);try{for await(let[n]of xm.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},ife=async(t,e,r)=>{try{await xm.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},xm={};var yf=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{let c=pj(t),l=e();l.length=0;try{for await(let f of c){let d=sfe(f),p=r[d](f,l);gj({convertedChunk:p,state:l,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:u})}return ofe({state:l,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:u}),a(l)}catch(f){let d=typeof f=="object"&&f!==null?f:new Error(f);throw d.bufferedData=a(l),d}},ofe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&gj({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},gj=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){mj(t,e,i,a);return}let u=n(t,o-e.length);throw u!==void 0&&mj(u,e,i,o),new Rs},mj=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},sfe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=hj.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&hj.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:hj}=Object.prototype,Rs=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Ts=t=>t,Am=()=>{},IE=({contents:t})=>t,LE=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},NE=t=>t.length;async function OE(t,e){return yf(t,lfe,e)}var afe=()=>({contents:[]}),ufe=()=>1,cfe=(t,{contents:e})=>(e.push(t),e),lfe={init:afe,convertChunk:{string:Ts,buffer:Ts,arrayBuffer:Ts,dataView:Ts,typedArray:Ts,others:Ts},getSize:ufe,truncateChunk:Am,addChunk:cfe,getFinalChunk:Am,finalize:IE};async function BE(t,e){return yf(t,Efe,e)}var ffe=()=>({contents:new ArrayBuffer(0)}),dfe=t=>pfe.encode(t),pfe=new TextEncoder,Dj=t=>new Uint8Array(t),yj=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),mfe=(t,e)=>t.slice(0,e),hfe=(t,{contents:e,length:r},n)=>{let i=xj()?Dfe(e,n):gfe(e,n);return new Uint8Array(i).set(t,r),i},gfe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(Cj(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Dfe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:Cj(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},Cj=t=>Ej**Math.ceil(Math.log(t)/Math.log(Ej)),Ej=2,yfe=({contents:t,length:e})=>xj()?t:t.slice(0,e),xj=()=>"resize"in ArrayBuffer.prototype,Efe={init:ffe,convertChunk:{string:dfe,buffer:Dj,arrayBuffer:Dj,dataView:yj,typedArray:yj,others:LE},getSize:NE,truncateChunk:mfe,addChunk:hfe,getFinalChunk:Am,finalize:yfe};async function ME(t,e){return yf(t,wfe,e)}var Cfe=()=>({contents:"",textDecoder:new TextDecoder}),$E=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),xfe=(t,{contents:e})=>e+t,Afe=(t,e)=>t.slice(0,e),vfe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},wfe={init:Cfe,convertChunk:{string:Ts,buffer:$E,arrayBuffer:$E,dataView:$E,typedArray:$E,others:LE},getSize:NE,truncateChunk:Afe,addChunk:xfe,getFinalChunk:vfe,finalize:IE};Object.assign(xm,{on:bfe,finished:Ffe});var Aj=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Rs))throw t;if(o==="all")return t;let s=Sfe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},Sfe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",vj=(t,e)=>{let{streamName:r,threshold:n,unit:i}=Rfe(t,e);return`Command's ${r} was larger than ${n} ${i}`},Rfe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;return delete t.maxBufferInfo,{streamName:bE(r),threshold:e[r],unit:n}},wj=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>jE(r)),bj=(t,e,r)=>{if(!e)return t;let n=jE(r);return t.length>n?t.slice(0,n):t},jE=([,t])=>t;var Sj=({stdio:t,all:e,originalError:r,signal:n,signalDescription:i,exitCode:o,escapedCommand:s,timedOut:a,isCanceled:u,isMaxBuffer:c,maxBuffer:l,timeout:f,cwd:d})=>{let p=r?.code,y=Tfe({originalError:r,timedOut:a,timeout:f,isMaxBuffer:c,maxBuffer:l,errorCode:p,signal:n,signalDescription:i,exitCode:o,isCanceled:u}),C=_fe(r,d),g=C===void 0?"":`
|
|
342
342
|
${C}`,A=`${y}: ${s}${g}`,m=e===void 0?[t[2],t[1]]:[e],E=[A,...m,...t.slice(3)].map(x=>Ju(Df(kfe(x)))).filter(Boolean).join(`
|
|
343
343
|
|
|
@@ -353,7 +353,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
353
353
|
`,LF:`
|
|
354
354
|
`,concatBytes:mR},Xde=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Jde={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Xde};import{Buffer as Qde}from"node:buffer";var mV=(t,e)=>t?void 0:Zde.bind(void 0,e),Zde=function*(t,e){if(typeof e!="string"&&!en(e)&&!Qde.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},hV=(t,e)=>t?epe.bind(void 0,e):tpe.bind(void 0,e),epe=function*(t,e){gV(t,e),yield e},tpe=function*(t,e){if(gV(t,e),typeof e!="string"&&!en(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},gV=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
355
355
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
356
|
-
if (condition) { yield value; }`)};import{Buffer as rpe}from"node:buffer";import{StringDecoder as npe}from"node:string_decoder";var XE=(t,e,r)=>{if(r)return;if(t)return{transform:ipe.bind(void 0,new TextEncoder)};let n=new npe(e);return{transform:ope.bind(void 0,n),final:spe.bind(void 0,n)}},ipe=function*(t,e){rpe.isBuffer(e)?yield Ss(e):typeof e=="string"?yield t.encode(e):yield e},ope=function*(t,e){yield en(e)?t.write(e):e},spe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as DV}from"node:util";var gR=DV(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),JE=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=upe}=e[r];for await(let i of n(t))yield*JE(i,e,r+1)},yV=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*ape(r,Number(e),t)},ape=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*JE(n,r,e+1)},EV=DV(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),upe=function*(t){yield t};var DR=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},CV=(t,e)=>[...e.flatMap(r=>[...tc(r,t,0)]),...Fm(t)],tc=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=lpe}=e[r];for(let i of n(t))yield*tc(i,e,r+1)},Fm=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*cpe(r,Number(e),t)},cpe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*tc(n,r,e+1)},lpe=function*(t){yield t};var yR=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},u=AV(t,s,o),c=Zu(e),l=Zu(r),f=c?gR.bind(void 0,JE,a):DR.bind(void 0,tc),d=c||l?gR.bind(void 0,yV,a):DR.bind(void 0,Fm),p=c||l?EV.bind(void 0,a):void 0;return{stream:new fpe({writableObjectMode:n,writableHighWaterMark:xV(n),readableObjectMode:i,readableHighWaterMark:xV(i),transform(C,g,A){f([C,u,0],this,A)},flush(C){d([u],this,C)},destroy:p})}},QE=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let u=AV(s,r,a);t=CV(u,t)}return t},AV=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let u={};return[{transform:mV(n,a)},XE(r,s,n),YE(r,o,n,u),{transform:t,final:e},{transform:hV(i,a)},pV({binary:r,preserveNewlines:o,readableObjectMode:i,state:u})].filter(Boolean)};var vV=(t,e)=>{for(let r of dpe(t))ppe(t,r,e)},dpe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ppe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${La[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>mpe(a,n));r.input=pm(s)},mpe=(t,e)=>{let r=QE(t,e,"utf8",!0);return hpe(r),pm(r)},hpe=t=>{let e=t.find(r=>typeof r!="string"&&!en(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as xpe,appendFileSync as Ape}from"node:fs";import{inspect as gpe}from"node:util";var ZE=({stdioItems:t,encoding:e,verboseInfo:{verbose:r},fdNumber:n})=>n!=="all"&&r[n]==="full"&&!Fi.has(e)&&Dpe(n)&&(t.some(({type:i,value:o})=>i==="native"&&ype.has(o))||t.every(({type:i})=>zi.has(i))),Dpe=t=>t===1||t===2,ype=new Set(["pipe","overlapped"]),wV=async(t,e,r)=>{for await(let n of t)Epe(e)||FV(n,r)},bV=(t,e)=>{for(let r of t)FV(r,e)},Epe=t=>t._readableState.pipes.length>0,FV=(t,{verboseId:e})=>{let r=typeof t=="string"?t:gpe(t),i=Ju(r).replaceAll(" "," ".repeat(Cpe));Ia(i,e,"output")},Cpe=2;var SV=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((u,c)=>vpe({result:u,fileDescriptors:t,fdNumber:c,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},vpe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:f})=>{if(t===null)return;let d=bj(t,o,f),p=Ss(d),{stdioItems:y,objectMode:C}=e[r],g=wpe([p],y,u,n),{serializedResult:A,finalResult:m=A}=bpe({chunks:g,objectMode:C,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});if(ZE({stdioItems:y,encoding:u,verboseInfo:s,fdNumber:r})){let x=hR(A,!1,C);bV(x,s)}let E=a[r]?m:void 0;try{return n.error===void 0&&Fpe(A,y,i),E}catch(x){return n.error=x,E}},wpe=(t,e,r,n)=>{try{return QE(t,e,r,!1)}catch(i){return n.error=i,t}},bpe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:pm(t)};let s=F9(t,r);return n[o]?{serializedResult:s,finalResult:hR(s,!i[o],e)}:{serializedResult:s}},Fpe=(t,e,r)=>{for(let{path:n}of e.filter(({type:i})=>WE.has(i))){let i=typeof n=="string"?n:n.toString();r.has(i)?Ape(n,t):(r.add(i),xpe(n,t))}};var RV=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,_s(e,r,"all")]:Array.isArray(e)?[_s(t,r,"all"),...e]:en(t)&&en(e)?NS([t,e]):`${t}${e}`};import{once as ER}from"node:events";var TV=async t=>{let[e,r]=await Promise.allSettled([ER(t,"spawn"),ER(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?_V(t):r.value},_V=async t=>{try{return await ER(t,"exit")}catch{return _V(t)}},kV=async t=>{let[e,r]=await t;if(!Spe(e,r)&&CR(e,r))throw new go;return[e,r]},Spe=(t,e)=>t===void 0&&e===void 0,CR=(t,e)=>t!==0||e!==null;var PV=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=Rpe(t,e,r),s=o?.code==="ETIMEDOUT",a=wj(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},Rpe=(t,e,r)=>t!==void 0?t:CR(e,r)?new go:void 0;var IV=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=_pe(t,e,r),f=Ipe({file:n,commandArguments:i,options:c,command:o,escapedCommand:s,verboseInfo:u,fileDescriptors:l,startTime:a});return Cf(f,u,c)},_pe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=FE(t,e,r);try{let a=kpe(r),{file:u,commandArguments:c,options:l}=PE(t,e,a);Ppe(l);let f=cV(l,s);return{file:u,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:l,fileDescriptors:f}}catch(a){throw qE(a,o,s),a}},kpe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Ppe=({ipc:t,detached:e,cancelSignal:r})=>{t&&xR("ipc: true"),e&&xR("detached: true"),r&&xR("cancelSignal")},xR=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Ipe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let u=Lpe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p}=PV(u,r),{output:y,error:C=c}=SV({fileDescriptors:s,syncResult:u,options:r,isMaxBuffer:p,verboseInfo:o}),g=y.map((m,E)=>_s(m,r,E)),A=_s(RV(y,r),r,"all");return Ope({error:C,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p,stdio:g,all:A,options:r,command:n,escapedCommand:i,startTime:a})},Lpe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{vV(o,r);let a=Npe(r);return Tpe(t,e,a)}catch(a){return Ef({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},Npe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:jE(e)}),Ope=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?VE({command:u,escapedCommand:c,stdio:o,all:s,options:a,startTime:l}):vm({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isMaxBuffer:i,exitCode:e,signal:r,stdio:o,all:s,options:a,startTime:l,isSync:!0});import{setMaxListeners as mhe}from"node:events";import{spawn as hhe}from"node:child_process";import{ChildProcess as Bpe}from"node:child_process";import{PassThrough as $pe,Readable as Mpe,Writable as jpe,Duplex as Vpe}from"node:stream";var LV=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{dR(n);let a=new Bpe;qpe(a,n),Object.assign(a,{readable:Upe,writable:Gpe,duplex:Wpe});let u=Ef({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),c=Hpe(u,s,i);return{subprocess:a,promise:c}},qpe=(t,e)=>{let r=Sm(),n=Sm(),i=Sm(),o=Array.from({length:e.length-3},Sm),s=Sm(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Sm=()=>{let t=new $pe;return t.end(),t},Upe=()=>new Mpe({read(){}}),Gpe=()=>new jpe({write(){}}),Wpe=()=>new Vpe({read(){},write(){}}),Hpe=async(t,e,r)=>Cf(t,e,r);import{createReadStream as NV,createWriteStream as OV}from"node:fs";import{Buffer as zpe}from"node:buffer";import{Readable as Rm,Writable as Kpe,Duplex as Ype}from"node:stream";var $V=(t,e)=>KE(Xpe,t,e,!1),Tm=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${La[t]}.`)},BV={fileNumber:Tm,generator:yR,asyncGenerator:yR,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Ype.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Xpe={input:{...BV,fileUrl:({value:t})=>({stream:NV(t)}),filePath:({value:{file:t}})=>({stream:NV(t)}),webStream:({value:t})=>({stream:Rm.fromWeb(t)}),iterable:({value:t})=>({stream:Rm.from(t)}),asyncIterable:({value:t})=>({stream:Rm.from(t)}),string:({value:t})=>({stream:Rm.from(t)}),uint8Array:({value:t})=>({stream:Rm.from(zpe.from(t))})},output:{...BV,fileUrl:({value:t})=>({stream:OV(t)}),filePath:({value:{file:t}})=>({stream:OV(t)}),webStream:({value:t})=>({stream:Kpe.fromWeb(t)}),iterable:Tm,asyncIterable:Tm,string:Tm,uint8Array:Tm}};import{on as Jpe,once as MV}from"node:events";import{PassThrough as Qpe,getDefaultHighWaterMark as Zpe}from"node:stream";import{finished as qV}from"node:stream/promises";function rc(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)vR(i);let e=t.some(({readableObjectMode:i})=>i),r=eme(t,e),n=new AR({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var eme=(t,e)=>{if(t.length===0)return Zpe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},AR=class extends Qpe{#e=new Set([]);#t=new Set([]);#r=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(vR(e),this.#e.has(e))return;this.#e.add(e),this.#n??=tme(this,this.#e,this.#o);let r=ime({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#r,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(vR(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},tme=async(t,e,r)=>{eC(t,jV);let n=new AbortController;try{await Promise.race([rme(t,n),nme(t,e,r,n)])}finally{n.abort(),eC(t,-jV)}},rme=async(t,{signal:e})=>{try{await qV(t,{signal:e,cleanup:!0})}catch(r){throw UV(t,r),r}},nme=async(t,e,r,{signal:n})=>{for await(let[i]of Jpe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},vR=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},ime=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{eC(t,VV);let a=new AbortController;try{await Promise.race([ome(o,e,a),sme({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),ame({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),eC(t,-VV)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?wR(t):ume(t))},ome=async(t,e,{signal:r})=>{try{await t,r.aborted||wR(e)}catch(n){r.aborted||UV(e,n)}},sme=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await qV(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;GV(s)?i.add(e):WV(t,s)}},ame=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await MV(t,i,{signal:o}),!t.readable)return MV(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},ume=t=>{t.writable&&t.end()},UV=(t,e)=>{GV(e)?wR(t):WV(t,e)},GV=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",wR=t=>{(t.readable||t.writable)&&t.destroy()},WV=(t,e)=>{t.destroyed||(t.once("error",cme),t.destroy(e))},cme=()=>{},eC=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},jV=2,VV=1;import{addAbortListener as lme}from"node:events";var _m=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),lme(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};import{finished as HV}from"node:stream/promises";var vf=(t,e)=>{t.pipe(e),fme(t,e),dme(t,e)},fme=async(t,e)=>{if(!(ho(t)||ho(e))){try{await HV(t,{cleanup:!0,readable:!0,writable:!1})}catch{}bR(e)}},bR=t=>{t.writable&&t.end()},dme=async(t,e)=>{if(!(ho(t)||ho(e))){try{await HV(e,{cleanup:!0,readable:!1,writable:!0})}catch{}FR(t)}},FR=t=>{t.readable&&t.destroy()};var zV=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:u})=>zi.has(u)))pme(t,a,s,i);for(let{stream:a}of o.filter(({type:u})=>!zi.has(u)))hme({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:rc(o);vf(s,i)}},pme=(t,e,r,n)=>{r==="output"?vf(t.stdio[n],e):vf(e,t.stdio[n]);let i=mme[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},mme=["stdin","stdout","stderr"],hme=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;gme(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=i.get(s)??[];i.set(s,[...u,a])},gme=(t,{signal:e})=>{ho(t)&&_m(t,Dme,e)},Dme=2;import{addAbortListener as Cme}from"node:events";var nc=[];nc.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&nc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&nc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var tC=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",SR=Symbol.for("signal-exit emitter"),RR=globalThis,yme=Object.defineProperty.bind(Object),TR=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(RR[SR])return RR[SR];yme(RR,SR,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},rC=class{},Eme=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),_R=class extends rC{onExit(){return()=>{}}load(){}unload(){}},kR=class extends rC{#e=PR.platform==="win32"?"SIGINT":"SIGHUP";#t=new TR;#r;#n;#o;#i={};#s=!1;constructor(e){super(),this.#r=e,this.#i={};for(let r of nc)this.#i[r]=()=>{let n=this.#r.listeners(r),{count:i}=this.#t,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#t.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!tC(this.#r))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#t.count+=1;for(let e of nc)try{let r=this.#i[e];r&&this.#r.on(e,r)}catch{}this.#r.emit=(e,...r)=>this.#u(e,...r),this.#r.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,nc.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,r)}catch{}}),this.#r.emit=this.#n,this.#r.reallyExit=this.#o,this.#t.count-=1)}#a(e){return tC(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#o.call(this.#r,this.#r.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&tC(this.#r)){typeof r[0]=="number"&&(this.#r.exitCode=r[0]);let i=n.call(this.#r,e,...r);return this.#t.emit("exit",this.#r.exitCode,null),i}else return n.call(this.#r,e,...r)}},PR=globalThis.process,{onExit:KV,load:HQe,unload:zQe}=Eme(tC(PR)?new kR(PR):new _R);var YV=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=KV(()=>{t.kill()});Cme(n,()=>{i()})};var JV=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=vE(),{destination:s,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=xme(r,n,i),{sourceStream:f,sourceError:d}=vme(t,c),{options:p,fileDescriptors:y}=ec.get(t);return{sourcePromise:e,sourceStream:f,sourceOptions:p,sourceError:d,destination:s,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:y,startTime:o}},xme=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=Ame(t,e,...r),a=zE(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},Ame=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(XV,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=EE(r,...n);return{destination:e(XV)(i,o,s),pipeOptions:s}}if(ec.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},XV=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),vme=(t,e)=>{try{return{sourceStream:Af(t,e)}}catch(r){return{sourceError:r}}};var ZV=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=wme({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw IR({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},wme=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return FR(t),n;if(e!==void 0)return bR(r),e},IR=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Ef({error:t,command:QV,escapedCommand:QV,fileDescriptors:e,options:r,startTime:n,isSync:!1}),QV="source.pipe(destination)";var eq=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as bme}from"node:stream/promises";var tq=(t,e,r)=>{let n=nC.has(e)?Sme(t,e):Fme(t,e);return _m(t,Tme,r.signal),_m(e,_me,r.signal),Rme(e),n},Fme=(t,e)=>{let r=rc([t]);return vf(r,e),nC.set(e,r),r},Sme=(t,e)=>{let r=nC.get(e);return r.add(t),r},Rme=async t=>{try{await bme(t,{cleanup:!0,readable:!1,writable:!0})}catch{}nC.delete(t)},nC=new WeakMap,Tme=2,_me=1;import{aborted as kme}from"node:util";var rq=(t,e)=>t===void 0?[]:[Pme(t,e)],Pme=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await kme(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw IR({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var iC=(t,...e)=>{if(Br(e[0]))return iC.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=JV(t,...e),i=Ime({...n,destination:r});return i.pipe=iC.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Ime=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=Lme(t,i);ZV({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:u,sourceOptions:r,startTime:c});let f=new AbortController;try{let d=tq(e,o,f);return await Promise.race([eq(l),...rq(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{f.abort()}},Lme=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as Vme}from"node:timers/promises";import{on as Nme}from"node:events";import{getDefaultHighWaterMark as Ome}from"node:stream";var oC=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return Bme(e,s),iq({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},Bme=async(t,e)=>{try{await t}catch{}finally{e.abort()}},LR=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;$me(e,s,t);let a=t.readableObjectMode&&!o;return iq({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},$me=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},iq=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=Nme(t,"data",{signal:e.signal,highWaterMark:nq,highWatermark:nq});return Mme({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},NR=Ome(!0),nq=NR,Mme=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=jme({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[u]of t)yield*tc(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*Fm(a)}},jme=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[XE(t,r,!e),YE(t,i,!n,{})].filter(Boolean);var oq=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:{fileDescriptors:l}})=>{if(ZE({stdioItems:l[r]?.stdioItems,encoding:n,verboseInfo:c,fdNumber:r})){let p=LR({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:a});wV(p,t,c)}if(!i){await qme(t);return}let f=pR(u,r),d=LR({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a});return Ume({stream:t,iterable:d,fdNumber:r,encoding:n,maxBuffer:o,lines:s})},qme=async t=>{await Vme(),t.readableFlowing===null&&t.resume()},Ume=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await OE(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await BE(r,{maxBuffer:o})):await ME(r,{maxBuffer:o})}catch(a){return sq(Aj({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},OR=async t=>{try{return await t}catch(e){return sq(e)}},sq=({bufferedData:t})=>w9(t)?new Uint8Array(t):t;import{finished as Gme}from"node:stream/promises";var km=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Wme(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],Gme(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Kme(a,e,r,n)}finally{s.abort()}},Wme=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Hme(t,r,n),n},Hme=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{zme(e,r),n.call(t,...i)}},zme=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Kme=(t,e,r,n)=>{if(!Yme(t,e,r,n))throw t},Yme=(t,e,r,n=!0)=>r.propagating?aq(t)||sC(t):(r.propagating=!0,BR(r,e)===n?aq(t):sC(t)),BR=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",sC=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aq=t=>t?.code==="EPIPE";var uq=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((u,c)=>$R({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:i[c],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),$R=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=km(t,e,c);if(BR(c,e)){await l;return}let[f]=await Promise.all([oq({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return f};var cq=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?rc([t,e].filter(Boolean)):void 0,lq=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>$R({...Xme(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Jme(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Xme=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Jme=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as Qme}from"node:events";var fq=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,stripFinalNewline:s},context:a,verboseInfo:u,fileDescriptors:c,originalStreams:l,onInternalError:f,controller:d})=>{let p=TV(t),y={originalStreams:l,fileDescriptors:c,subprocess:t,exitPromise:p,propagating:!1},C=uq({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:u,streamInfo:y}),g=lq({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:u,streamInfo:y}),A=Zme(l,t,y),m=ehe(c,y);try{return await Promise.race([Promise.all([{},kV(p),Promise.all(C),g,...A,...m]),f,the(t,d),...K5(t,o,a,d)])}catch(E){return Promise.all([{error:E},p,Promise.all(C.map(x=>OR(x))),OR(g),Promise.allSettled(A),Promise.allSettled(m)])}},Zme=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:km(n,i,r)),ehe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Do(o,{checkOpen:!1})&&!ho(o)).map(({type:i,value:o,stream:s=o})=>km(s,n,e,{isSameDirection:zi.has(i),stopOnExit:i==="native"}))),the=async(t,{signal:e})=>{let[r]=await Qme(t,"error",{signal:e});throw r};var wf=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)};var dq=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Pm=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=wf();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},bf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as rhe}from"node:stream";import{callbackify as nhe}from"node:util";import{finished as pq}from"node:stream/promises";var MR=async t=>{if(t!==void 0)try{await jR(t)}catch{}},mq=async t=>{if(t!==void 0)try{await VR(t)}catch{}},jR=async t=>{await pq(t,{cleanup:!0,readable:!1,writable:!0})},VR=async t=>{await pq(t,{cleanup:!0,readable:!0,writable:!1})},aC=async(t,e)=>{if(await t,e)throw e},uC=(t,e,r)=>{r&&!sC(r)?t.destroy(r):e&&t.destroy()};var hq=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Fi.has(r),{subprocessStdout:a,waitReadableDestroy:u}=qR(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:f}=UR(a,s),{read:d,onStdoutDataDone:p}=GR({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),y=new rhe({read:d,destroy:nhe(HR.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:f,objectMode:l,encoding:c});return WR({subprocessStdout:a,onStdoutDataDone:p,readable:y,subprocess:t}),y},qR=(t,e,r)=>{let n=Af(t,e),i=Pm(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},UR=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:NR},GR=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=wf(),s=oC({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){ihe(this,s,o)},onStdoutDataDone:o}},ihe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},WR=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await VR(t),await n,await MR(i),await e,r.readable&&r.push(null)}catch(o){await MR(i),gq(r,o)}},HR=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await bf(r,e)&&(gq(t,n),await aC(e,n))},gq=(t,e)=>{uC(t,t.readable,e)};import{Writable as ohe}from"node:stream";import{callbackify as Dq}from"node:util";var yq=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=zR(t,r,e),s=new ohe({...KR(n,t,i),destroy:Dq(XR.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return YR(n,s),s},zR=(t,e,r)=>{let n=zE(t,e),i=Pm(r,n,"writableFinal"),o=Pm(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},KR=(t,e,r)=>({write:she.bind(void 0,t),final:Dq(ahe.bind(void 0,t,e,r))}),she=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},ahe=async(t,e,r)=>{await bf(r,e)&&(t.writable&&t.end(),await e)},YR=async(t,e,r)=>{try{await jR(t),e.writable&&e.end()}catch(n){await mq(r),Eq(e,n)}},XR=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await bf(r,e),await bf(n,e)&&(Eq(t,i),await aC(e,i))},Eq=(t,e)=>{uC(t,t.writable,e)};import{Duplex as uhe}from"node:stream";import{callbackify as che}from"node:util";var Cq=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Fi.has(r),{subprocessStdout:u,waitReadableDestroy:c}=qR(t,n,e),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:d}=zR(t,i,e),{readableEncoding:p,readableObjectMode:y,readableHighWaterMark:C}=UR(u,a),{read:g,onStdoutDataDone:A}=GR({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),m=new uhe({read:g,...KR(l,t,f),destroy:che(lhe.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:f,waitWritableDestroy:d})),readableHighWaterMark:C,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:y,writableObjectMode:l.writableObjectMode,encoding:p});return WR({subprocessStdout:u,onStdoutDataDone:A,readable:m,subprocess:t,subprocessStdin:l}),YR(l,m,u),m},lhe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([HR({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),XR({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var JR=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Fi.has(e),s=Af(t,r),a=oC({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return fhe(a,s,t)},fhe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var xq=(t,{encoding:e})=>{let r=dq();t.readable=hq.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=yq.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Cq.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=JR.bind(void 0,t,e),t[Symbol.asyncIterator]=JR.bind(void 0,t,e,{})};var Aq=(t,e)=>{for(let[r,n]of phe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},dhe=(async()=>{})().constructor.prototype,phe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(dhe,t)]);var vq=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:f}=ghe(t,e,r),{subprocess:d,promise:p}=yhe({file:i,commandArguments:o,options:l,startTime:u,verboseInfo:c,command:s,escapedCommand:a,fileDescriptors:f});return d.pipe=iC.bind(void 0,{source:d,sourcePromise:p,boundOptions:{},createNested:n}),Aq(d,p),ec.set(d,{options:l,fileDescriptors:f}),d},ghe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=FE(t,e,r);try{let{file:a,commandArguments:u,options:c}=PE(t,e,r),l=Dhe(c),f=$V(l,s);return{file:a,commandArguments:u,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:l,fileDescriptors:f}}catch(a){throw qE(a,o,s),a}},Dhe=({timeout:t,signal:e,cancelSignal:r,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t,signal:r}},yhe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let u;try{u=hhe(t,e,r)}catch(p){return LV({error:p,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;mhe(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];zV(u,a,c),YV(u,r,c);let f=wf();u.kill=H5.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:f,controller:c}),u.all=cq(u,r),xq(u,r);let d=Ehe({subprocess:u,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:s,onInternalError:f,controller:c});return{subprocess:u,promise:d}},Ehe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,onInternalError:u,controller:c})=>{let l={timedOut:!1},[f,[d,p],y,C]=await fq({subprocess:t,options:e,context:l,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:u,controller:c});c.abort(),u.resolve();let g=y.map((E,x)=>_s(E,e,x)),A=_s(C,e,"all"),m=Che({errorInfo:f,exitCode:d,signal:p,stdio:g,all:A,context:l,options:e,command:s,escapedCommand:a,startTime:r});return Cf(m,n,e)},Che=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,context:o,options:s,command:a,escapedCommand:u,startTime:c})=>"error"in t?vm({error:t.error,command:a,escapedCommand:u,timedOut:o.timedOut,isCanceled:s.signal?.aborted===!0,isMaxBuffer:t.error instanceof Rs,exitCode:e,signal:r,stdio:n,all:i,options:s,startTime:c,isSync:!1}):VE({command:a,escapedCommand:u,stdio:n,all:i,options:s,startTime:c});var cC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,xhe(n,t[n],i)]));return{...t,...r}},xhe=(t,e,r)=>Ahe.has(t)&&Br(e)&&Br(r)?{...e,...r}:r,Ahe=new Set(["env",...jS]);var Na=(t,e,r,n)=>{let i=(s,a,u)=>Na(s,a,r,u),o=(...s)=>vhe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},vhe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Br(o))return i(t,cC(r,o),n);let{file:a,commandArguments:u,options:c,isSync:l}=whe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return l?IV(a,u,c):vq(a,u,c,i)},whe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=_9(e)?k9(e,r):[e,...r],[s,a,u]=EE(...o),c=cC(cC(n,i),u),{file:l=s,commandArguments:f=a,options:d=c,isSync:p=!1}=t({file:s,commandArguments:a,options:c});return{file:l,commandArguments:f,options:d,isSync:p}};var wq=({file:t,commandArguments:e})=>Fq(t,e),bq=({file:t,commandArguments:e})=>({...Fq(t,e),isSync:!0}),Fq=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let r=[];for(let o of t.trim().split(bhe)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${o}`:r.push(o)}let[n,...i]=r;return{file:n,commandArguments:i}},bhe=/ +/g;var Sq=(t,e,r)=>{t.sync=e(Fhe,r),t.s=t.sync},Rq=({options:t})=>Tq(t),Fhe=({options:t})=>({...Tq(t),isSync:!0}),Tq=t=>({options:{...She(t),...t}}),She=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},_q={preferLocal:!0};var lC=Na(()=>({})),wtt=Na(()=>({isSync:!0})),btt=Na(wq),Ftt=Na(bq),Stt=Na(Y5),Rtt=Na(Rq,{},_q,Sq);var kq=Fs(2),Im=class{constructor(e="dot"){this.path=e}dispose(){}async prepareElementViewDot(e){let r=DE(e),n=await lC("unflatten",["-f","-l 1","-c 2"],{reject:!1,timeout:5e3,input:r,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?console.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
356
|
+
if (condition) { yield value; }`)};import{Buffer as rpe}from"node:buffer";import{StringDecoder as npe}from"node:string_decoder";var XE=(t,e,r)=>{if(r)return;if(t)return{transform:ipe.bind(void 0,new TextEncoder)};let n=new npe(e);return{transform:ope.bind(void 0,n),final:spe.bind(void 0,n)}},ipe=function*(t,e){rpe.isBuffer(e)?yield Ss(e):typeof e=="string"?yield t.encode(e):yield e},ope=function*(t,e){yield en(e)?t.write(e):e},spe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as DV}from"node:util";var gR=DV(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),JE=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=upe}=e[r];for await(let i of n(t))yield*JE(i,e,r+1)},yV=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*ape(r,Number(e),t)},ape=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*JE(n,r,e+1)},EV=DV(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),upe=function*(t){yield t};var DR=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},CV=(t,e)=>[...e.flatMap(r=>[...tc(r,t,0)]),...Fm(t)],tc=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=lpe}=e[r];for(let i of n(t))yield*tc(i,e,r+1)},Fm=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*cpe(r,Number(e),t)},cpe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*tc(n,r,e+1)},lpe=function*(t){yield t};var yR=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},u=AV(t,s,o),c=Zu(e),l=Zu(r),f=c?gR.bind(void 0,JE,a):DR.bind(void 0,tc),d=c||l?gR.bind(void 0,yV,a):DR.bind(void 0,Fm),p=c||l?EV.bind(void 0,a):void 0;return{stream:new fpe({writableObjectMode:n,writableHighWaterMark:xV(n),readableObjectMode:i,readableHighWaterMark:xV(i),transform(C,g,A){f([C,u,0],this,A)},flush(C){d([u],this,C)},destroy:p})}},QE=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let u=AV(s,r,a);t=CV(u,t)}return t},AV=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let u={};return[{transform:mV(n,a)},XE(r,s,n),YE(r,o,n,u),{transform:t,final:e},{transform:hV(i,a)},pV({binary:r,preserveNewlines:o,readableObjectMode:i,state:u})].filter(Boolean)};var vV=(t,e)=>{for(let r of dpe(t))ppe(t,r,e)},dpe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ppe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${La[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>mpe(a,n));r.input=pm(s)},mpe=(t,e)=>{let r=QE(t,e,"utf8",!0);return hpe(r),pm(r)},hpe=t=>{let e=t.find(r=>typeof r!="string"&&!en(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as xpe,appendFileSync as Ape}from"node:fs";import{inspect as gpe}from"node:util";var ZE=({stdioItems:t,encoding:e,verboseInfo:{verbose:r},fdNumber:n})=>n!=="all"&&r[n]==="full"&&!Fi.has(e)&&Dpe(n)&&(t.some(({type:i,value:o})=>i==="native"&&ype.has(o))||t.every(({type:i})=>zi.has(i))),Dpe=t=>t===1||t===2,ype=new Set(["pipe","overlapped"]),wV=async(t,e,r)=>{for await(let n of t)Epe(e)||FV(n,r)},bV=(t,e)=>{for(let r of t)FV(r,e)},Epe=t=>t._readableState.pipes.length>0,FV=(t,{verboseId:e})=>{let r=typeof t=="string"?t:gpe(t),i=Ju(r).replaceAll(" "," ".repeat(Cpe));Ia(i,e,"output")},Cpe=2;var SV=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((u,c)=>vpe({result:u,fileDescriptors:t,fdNumber:c,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},vpe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:f})=>{if(t===null)return;let d=bj(t,o,f),p=Ss(d),{stdioItems:y,objectMode:C}=e[r],g=wpe([p],y,u,n),{serializedResult:A,finalResult:m=A}=bpe({chunks:g,objectMode:C,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});if(ZE({stdioItems:y,encoding:u,verboseInfo:s,fdNumber:r})){let x=hR(A,!1,C);bV(x,s)}let E=a[r]?m:void 0;try{return n.error===void 0&&Fpe(A,y,i),E}catch(x){return n.error=x,E}},wpe=(t,e,r,n)=>{try{return QE(t,e,r,!1)}catch(i){return n.error=i,t}},bpe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:pm(t)};let s=F9(t,r);return n[o]?{serializedResult:s,finalResult:hR(s,!i[o],e)}:{serializedResult:s}},Fpe=(t,e,r)=>{for(let{path:n}of e.filter(({type:i})=>WE.has(i))){let i=typeof n=="string"?n:n.toString();r.has(i)?Ape(n,t):(r.add(i),xpe(n,t))}};var RV=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,_s(e,r,"all")]:Array.isArray(e)?[_s(t,r,"all"),...e]:en(t)&&en(e)?NS([t,e]):`${t}${e}`};import{once as ER}from"node:events";var TV=async t=>{let[e,r]=await Promise.allSettled([ER(t,"spawn"),ER(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?_V(t):r.value},_V=async t=>{try{return await ER(t,"exit")}catch{return _V(t)}},kV=async t=>{let[e,r]=await t;if(!Spe(e,r)&&CR(e,r))throw new go;return[e,r]},Spe=(t,e)=>t===void 0&&e===void 0,CR=(t,e)=>t!==0||e!==null;var PV=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=Rpe(t,e,r),s=o?.code==="ETIMEDOUT",a=wj(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},Rpe=(t,e,r)=>t!==void 0?t:CR(e,r)?new go:void 0;var IV=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=_pe(t,e,r),f=Ipe({file:n,commandArguments:i,options:c,command:o,escapedCommand:s,verboseInfo:u,fileDescriptors:l,startTime:a});return Cf(f,u,c)},_pe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=FE(t,e,r);try{let a=kpe(r),{file:u,commandArguments:c,options:l}=PE(t,e,a);Ppe(l);let f=cV(l,s);return{file:u,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:l,fileDescriptors:f}}catch(a){throw qE(a,o,s),a}},kpe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Ppe=({ipc:t,detached:e,cancelSignal:r})=>{t&&xR("ipc: true"),e&&xR("detached: true"),r&&xR("cancelSignal")},xR=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Ipe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let u=Lpe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p}=PV(u,r),{output:y,error:C=c}=SV({fileDescriptors:s,syncResult:u,options:r,isMaxBuffer:p,verboseInfo:o}),g=y.map((m,E)=>_s(m,r,E)),A=_s(RV(y,r),r,"all");return Ope({error:C,exitCode:l,signal:f,timedOut:d,isMaxBuffer:p,stdio:g,all:A,options:r,command:n,escapedCommand:i,startTime:a})},Lpe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{vV(o,r);let a=Npe(r);return Tpe(t,e,a)}catch(a){return Ef({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},Npe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:jE(e)}),Ope=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?VE({command:u,escapedCommand:c,stdio:o,all:s,options:a,startTime:l}):vm({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isMaxBuffer:i,exitCode:e,signal:r,stdio:o,all:s,options:a,startTime:l,isSync:!0});import{setMaxListeners as mhe}from"node:events";import{spawn as hhe}from"node:child_process";import{ChildProcess as Bpe}from"node:child_process";import{PassThrough as $pe,Readable as Mpe,Writable as jpe,Duplex as Vpe}from"node:stream";var LV=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{dR(n);let a=new Bpe;qpe(a,n),Object.assign(a,{readable:Upe,writable:Gpe,duplex:Wpe});let u=Ef({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),c=Hpe(u,s,i);return{subprocess:a,promise:c}},qpe=(t,e)=>{let r=Sm(),n=Sm(),i=Sm(),o=Array.from({length:e.length-3},Sm),s=Sm(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Sm=()=>{let t=new $pe;return t.end(),t},Upe=()=>new Mpe({read(){}}),Gpe=()=>new jpe({write(){}}),Wpe=()=>new Vpe({read(){},write(){}}),Hpe=async(t,e,r)=>Cf(t,e,r);import{createReadStream as NV,createWriteStream as OV}from"node:fs";import{Buffer as zpe}from"node:buffer";import{Readable as Rm,Writable as Kpe,Duplex as Ype}from"node:stream";var $V=(t,e)=>KE(Xpe,t,e,!1),Tm=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${La[t]}.`)},BV={fileNumber:Tm,generator:yR,asyncGenerator:yR,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Ype.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Xpe={input:{...BV,fileUrl:({value:t})=>({stream:NV(t)}),filePath:({value:{file:t}})=>({stream:NV(t)}),webStream:({value:t})=>({stream:Rm.fromWeb(t)}),iterable:({value:t})=>({stream:Rm.from(t)}),asyncIterable:({value:t})=>({stream:Rm.from(t)}),string:({value:t})=>({stream:Rm.from(t)}),uint8Array:({value:t})=>({stream:Rm.from(zpe.from(t))})},output:{...BV,fileUrl:({value:t})=>({stream:OV(t)}),filePath:({value:{file:t}})=>({stream:OV(t)}),webStream:({value:t})=>({stream:Kpe.fromWeb(t)}),iterable:Tm,asyncIterable:Tm,string:Tm,uint8Array:Tm}};import{on as Jpe,once as MV}from"node:events";import{PassThrough as Qpe,getDefaultHighWaterMark as Zpe}from"node:stream";import{finished as qV}from"node:stream/promises";function rc(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)vR(i);let e=t.some(({readableObjectMode:i})=>i),r=eme(t,e),n=new AR({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var eme=(t,e)=>{if(t.length===0)return Zpe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},AR=class extends Qpe{#e=new Set([]);#t=new Set([]);#r=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(vR(e),this.#e.has(e))return;this.#e.add(e),this.#n??=tme(this,this.#e,this.#o);let r=ime({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#r,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(vR(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},tme=async(t,e,r)=>{eC(t,jV);let n=new AbortController;try{await Promise.race([rme(t,n),nme(t,e,r,n)])}finally{n.abort(),eC(t,-jV)}},rme=async(t,{signal:e})=>{try{await qV(t,{signal:e,cleanup:!0})}catch(r){throw UV(t,r),r}},nme=async(t,e,r,{signal:n})=>{for await(let[i]of Jpe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},vR=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},ime=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{eC(t,VV);let a=new AbortController;try{await Promise.race([ome(o,e,a),sme({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),ame({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),eC(t,-VV)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?wR(t):ume(t))},ome=async(t,e,{signal:r})=>{try{await t,r.aborted||wR(e)}catch(n){r.aborted||UV(e,n)}},sme=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await qV(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;GV(s)?i.add(e):WV(t,s)}},ame=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await MV(t,i,{signal:o}),!t.readable)return MV(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},ume=t=>{t.writable&&t.end()},UV=(t,e)=>{GV(e)?wR(t):WV(t,e)},GV=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",wR=t=>{(t.readable||t.writable)&&t.destroy()},WV=(t,e)=>{t.destroyed||(t.once("error",cme),t.destroy(e))},cme=()=>{},eC=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},jV=2,VV=1;import{addAbortListener as lme}from"node:events";var _m=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),lme(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};import{finished as HV}from"node:stream/promises";var vf=(t,e)=>{t.pipe(e),fme(t,e),dme(t,e)},fme=async(t,e)=>{if(!(ho(t)||ho(e))){try{await HV(t,{cleanup:!0,readable:!0,writable:!1})}catch{}bR(e)}},bR=t=>{t.writable&&t.end()},dme=async(t,e)=>{if(!(ho(t)||ho(e))){try{await HV(e,{cleanup:!0,readable:!1,writable:!0})}catch{}FR(t)}},FR=t=>{t.readable&&t.destroy()};var zV=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:u})=>zi.has(u)))pme(t,a,s,i);for(let{stream:a}of o.filter(({type:u})=>!zi.has(u)))hme({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:rc(o);vf(s,i)}},pme=(t,e,r,n)=>{r==="output"?vf(t.stdio[n],e):vf(e,t.stdio[n]);let i=mme[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},mme=["stdin","stdout","stderr"],hme=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;gme(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=i.get(s)??[];i.set(s,[...u,a])},gme=(t,{signal:e})=>{ho(t)&&_m(t,Dme,e)},Dme=2;import{addAbortListener as Cme}from"node:events";var nc=[];nc.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&nc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&nc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var tC=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",SR=Symbol.for("signal-exit emitter"),RR=globalThis,yme=Object.defineProperty.bind(Object),TR=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(RR[SR])return RR[SR];yme(RR,SR,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},rC=class{},Eme=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),_R=class extends rC{onExit(){return()=>{}}load(){}unload(){}},kR=class extends rC{#e=PR.platform==="win32"?"SIGINT":"SIGHUP";#t=new TR;#r;#n;#o;#i={};#s=!1;constructor(e){super(),this.#r=e,this.#i={};for(let r of nc)this.#i[r]=()=>{let n=this.#r.listeners(r),{count:i}=this.#t,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#t.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!tC(this.#r))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#t.count+=1;for(let e of nc)try{let r=this.#i[e];r&&this.#r.on(e,r)}catch{}this.#r.emit=(e,...r)=>this.#u(e,...r),this.#r.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,nc.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,r)}catch{}}),this.#r.emit=this.#n,this.#r.reallyExit=this.#o,this.#t.count-=1)}#a(e){return tC(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#o.call(this.#r,this.#r.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&tC(this.#r)){typeof r[0]=="number"&&(this.#r.exitCode=r[0]);let i=n.call(this.#r,e,...r);return this.#t.emit("exit",this.#r.exitCode,null),i}else return n.call(this.#r,e,...r)}},PR=globalThis.process,{onExit:KV,load:WQe,unload:HQe}=Eme(tC(PR)?new kR(PR):new _R);var YV=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=KV(()=>{t.kill()});Cme(n,()=>{i()})};var JV=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=vE(),{destination:s,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=xme(r,n,i),{sourceStream:f,sourceError:d}=vme(t,c),{options:p,fileDescriptors:y}=ec.get(t);return{sourcePromise:e,sourceStream:f,sourceOptions:p,sourceError:d,destination:s,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:y,startTime:o}},xme=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=Ame(t,e,...r),a=zE(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},Ame=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(XV,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=EE(r,...n);return{destination:e(XV)(i,o,s),pipeOptions:s}}if(ec.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},XV=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),vme=(t,e)=>{try{return{sourceStream:Af(t,e)}}catch(r){return{sourceError:r}}};var ZV=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=wme({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw IR({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},wme=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return FR(t),n;if(e!==void 0)return bR(r),e},IR=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Ef({error:t,command:QV,escapedCommand:QV,fileDescriptors:e,options:r,startTime:n,isSync:!1}),QV="source.pipe(destination)";var eq=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as bme}from"node:stream/promises";var tq=(t,e,r)=>{let n=nC.has(e)?Sme(t,e):Fme(t,e);return _m(t,Tme,r.signal),_m(e,_me,r.signal),Rme(e),n},Fme=(t,e)=>{let r=rc([t]);return vf(r,e),nC.set(e,r),r},Sme=(t,e)=>{let r=nC.get(e);return r.add(t),r},Rme=async t=>{try{await bme(t,{cleanup:!0,readable:!1,writable:!0})}catch{}nC.delete(t)},nC=new WeakMap,Tme=2,_me=1;import{aborted as kme}from"node:util";var rq=(t,e)=>t===void 0?[]:[Pme(t,e)],Pme=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await kme(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw IR({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var iC=(t,...e)=>{if(Br(e[0]))return iC.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=JV(t,...e),i=Ime({...n,destination:r});return i.pipe=iC.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Ime=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=Lme(t,i);ZV({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:u,sourceOptions:r,startTime:c});let f=new AbortController;try{let d=tq(e,o,f);return await Promise.race([eq(l),...rq(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{f.abort()}},Lme=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as Vme}from"node:timers/promises";import{on as Nme}from"node:events";import{getDefaultHighWaterMark as Ome}from"node:stream";var oC=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return Bme(e,s),iq({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},Bme=async(t,e)=>{try{await t}catch{}finally{e.abort()}},LR=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;$me(e,s,t);let a=t.readableObjectMode&&!o;return iq({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},$me=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},iq=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=Nme(t,"data",{signal:e.signal,highWaterMark:nq,highWatermark:nq});return Mme({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},NR=Ome(!0),nq=NR,Mme=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=jme({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[u]of t)yield*tc(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*Fm(a)}},jme=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[XE(t,r,!e),YE(t,i,!n,{})].filter(Boolean);var oq=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:{fileDescriptors:l}})=>{if(ZE({stdioItems:l[r]?.stdioItems,encoding:n,verboseInfo:c,fdNumber:r})){let p=LR({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:a});wV(p,t,c)}if(!i){await qme(t);return}let f=pR(u,r),d=LR({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a});return Ume({stream:t,iterable:d,fdNumber:r,encoding:n,maxBuffer:o,lines:s})},qme=async t=>{await Vme(),t.readableFlowing===null&&t.resume()},Ume=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await OE(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await BE(r,{maxBuffer:o})):await ME(r,{maxBuffer:o})}catch(a){return sq(Aj({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},OR=async t=>{try{return await t}catch(e){return sq(e)}},sq=({bufferedData:t})=>w9(t)?new Uint8Array(t):t;import{finished as Gme}from"node:stream/promises";var km=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Wme(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],Gme(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Kme(a,e,r,n)}finally{s.abort()}},Wme=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Hme(t,r,n),n},Hme=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{zme(e,r),n.call(t,...i)}},zme=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Kme=(t,e,r,n)=>{if(!Yme(t,e,r,n))throw t},Yme=(t,e,r,n=!0)=>r.propagating?aq(t)||sC(t):(r.propagating=!0,BR(r,e)===n?aq(t):sC(t)),BR=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",sC=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aq=t=>t?.code==="EPIPE";var uq=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((u,c)=>$R({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:i[c],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),$R=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=km(t,e,c);if(BR(c,e)){await l;return}let[f]=await Promise.all([oq({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return f};var cq=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?rc([t,e].filter(Boolean)):void 0,lq=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>$R({...Xme(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Jme(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Xme=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Jme=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as Qme}from"node:events";var fq=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,stripFinalNewline:s},context:a,verboseInfo:u,fileDescriptors:c,originalStreams:l,onInternalError:f,controller:d})=>{let p=TV(t),y={originalStreams:l,fileDescriptors:c,subprocess:t,exitPromise:p,propagating:!1},C=uq({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:u,streamInfo:y}),g=lq({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:u,streamInfo:y}),A=Zme(l,t,y),m=ehe(c,y);try{return await Promise.race([Promise.all([{},kV(p),Promise.all(C),g,...A,...m]),f,the(t,d),...K5(t,o,a,d)])}catch(E){return Promise.all([{error:E},p,Promise.all(C.map(x=>OR(x))),OR(g),Promise.allSettled(A),Promise.allSettled(m)])}},Zme=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:km(n,i,r)),ehe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Do(o,{checkOpen:!1})&&!ho(o)).map(({type:i,value:o,stream:s=o})=>km(s,n,e,{isSameDirection:zi.has(i),stopOnExit:i==="native"}))),the=async(t,{signal:e})=>{let[r]=await Qme(t,"error",{signal:e});throw r};var wf=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)};var dq=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Pm=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=wf();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},bf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as rhe}from"node:stream";import{callbackify as nhe}from"node:util";import{finished as pq}from"node:stream/promises";var MR=async t=>{if(t!==void 0)try{await jR(t)}catch{}},mq=async t=>{if(t!==void 0)try{await VR(t)}catch{}},jR=async t=>{await pq(t,{cleanup:!0,readable:!1,writable:!0})},VR=async t=>{await pq(t,{cleanup:!0,readable:!0,writable:!1})},aC=async(t,e)=>{if(await t,e)throw e},uC=(t,e,r)=>{r&&!sC(r)?t.destroy(r):e&&t.destroy()};var hq=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Fi.has(r),{subprocessStdout:a,waitReadableDestroy:u}=qR(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:f}=UR(a,s),{read:d,onStdoutDataDone:p}=GR({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),y=new rhe({read:d,destroy:nhe(HR.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:f,objectMode:l,encoding:c});return WR({subprocessStdout:a,onStdoutDataDone:p,readable:y,subprocess:t}),y},qR=(t,e,r)=>{let n=Af(t,e),i=Pm(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},UR=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:NR},GR=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=wf(),s=oC({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){ihe(this,s,o)},onStdoutDataDone:o}},ihe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},WR=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await VR(t),await n,await MR(i),await e,r.readable&&r.push(null)}catch(o){await MR(i),gq(r,o)}},HR=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await bf(r,e)&&(gq(t,n),await aC(e,n))},gq=(t,e)=>{uC(t,t.readable,e)};import{Writable as ohe}from"node:stream";import{callbackify as Dq}from"node:util";var yq=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=zR(t,r,e),s=new ohe({...KR(n,t,i),destroy:Dq(XR.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return YR(n,s),s},zR=(t,e,r)=>{let n=zE(t,e),i=Pm(r,n,"writableFinal"),o=Pm(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},KR=(t,e,r)=>({write:she.bind(void 0,t),final:Dq(ahe.bind(void 0,t,e,r))}),she=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},ahe=async(t,e,r)=>{await bf(r,e)&&(t.writable&&t.end(),await e)},YR=async(t,e,r)=>{try{await jR(t),e.writable&&e.end()}catch(n){await mq(r),Eq(e,n)}},XR=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await bf(r,e),await bf(n,e)&&(Eq(t,i),await aC(e,i))},Eq=(t,e)=>{uC(t,t.writable,e)};import{Duplex as uhe}from"node:stream";import{callbackify as che}from"node:util";var Cq=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Fi.has(r),{subprocessStdout:u,waitReadableDestroy:c}=qR(t,n,e),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:d}=zR(t,i,e),{readableEncoding:p,readableObjectMode:y,readableHighWaterMark:C}=UR(u,a),{read:g,onStdoutDataDone:A}=GR({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),m=new uhe({read:g,...KR(l,t,f),destroy:che(lhe.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:f,waitWritableDestroy:d})),readableHighWaterMark:C,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:y,writableObjectMode:l.writableObjectMode,encoding:p});return WR({subprocessStdout:u,onStdoutDataDone:A,readable:m,subprocess:t,subprocessStdin:l}),YR(l,m,u),m},lhe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([HR({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),XR({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var JR=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Fi.has(e),s=Af(t,r),a=oC({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return fhe(a,s,t)},fhe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var xq=(t,{encoding:e})=>{let r=dq();t.readable=hq.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=yq.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Cq.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=JR.bind(void 0,t,e),t[Symbol.asyncIterator]=JR.bind(void 0,t,e,{})};var Aq=(t,e)=>{for(let[r,n]of phe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},dhe=(async()=>{})().constructor.prototype,phe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(dhe,t)]);var vq=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:f}=ghe(t,e,r),{subprocess:d,promise:p}=yhe({file:i,commandArguments:o,options:l,startTime:u,verboseInfo:c,command:s,escapedCommand:a,fileDescriptors:f});return d.pipe=iC.bind(void 0,{source:d,sourcePromise:p,boundOptions:{},createNested:n}),Aq(d,p),ec.set(d,{options:l,fileDescriptors:f}),d},ghe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=FE(t,e,r);try{let{file:a,commandArguments:u,options:c}=PE(t,e,r),l=Dhe(c),f=$V(l,s);return{file:a,commandArguments:u,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:l,fileDescriptors:f}}catch(a){throw qE(a,o,s),a}},Dhe=({timeout:t,signal:e,cancelSignal:r,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t,signal:r}},yhe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let u;try{u=hhe(t,e,r)}catch(p){return LV({error:p,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;mhe(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];zV(u,a,c),YV(u,r,c);let f=wf();u.kill=H5.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:f,controller:c}),u.all=cq(u,r),xq(u,r);let d=Ehe({subprocess:u,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:s,onInternalError:f,controller:c});return{subprocess:u,promise:d}},Ehe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,onInternalError:u,controller:c})=>{let l={timedOut:!1},[f,[d,p],y,C]=await fq({subprocess:t,options:e,context:l,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:u,controller:c});c.abort(),u.resolve();let g=y.map((E,x)=>_s(E,e,x)),A=_s(C,e,"all"),m=Che({errorInfo:f,exitCode:d,signal:p,stdio:g,all:A,context:l,options:e,command:s,escapedCommand:a,startTime:r});return Cf(m,n,e)},Che=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,context:o,options:s,command:a,escapedCommand:u,startTime:c})=>"error"in t?vm({error:t.error,command:a,escapedCommand:u,timedOut:o.timedOut,isCanceled:s.signal?.aborted===!0,isMaxBuffer:t.error instanceof Rs,exitCode:e,signal:r,stdio:n,all:i,options:s,startTime:c,isSync:!1}):VE({command:a,escapedCommand:u,stdio:n,all:i,options:s,startTime:c});var cC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,xhe(n,t[n],i)]));return{...t,...r}},xhe=(t,e,r)=>Ahe.has(t)&&Br(e)&&Br(r)?{...e,...r}:r,Ahe=new Set(["env",...jS]);var Na=(t,e,r,n)=>{let i=(s,a,u)=>Na(s,a,r,u),o=(...s)=>vhe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},vhe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Br(o))return i(t,cC(r,o),n);let{file:a,commandArguments:u,options:c,isSync:l}=whe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return l?IV(a,u,c):vq(a,u,c,i)},whe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=_9(e)?k9(e,r):[e,...r],[s,a,u]=EE(...o),c=cC(cC(n,i),u),{file:l=s,commandArguments:f=a,options:d=c,isSync:p=!1}=t({file:s,commandArguments:a,options:c});return{file:l,commandArguments:f,options:d,isSync:p}};var wq=({file:t,commandArguments:e})=>Fq(t,e),bq=({file:t,commandArguments:e})=>({...Fq(t,e),isSync:!0}),Fq=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let r=[];for(let o of t.trim().split(bhe)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${o}`:r.push(o)}let[n,...i]=r;return{file:n,commandArguments:i}},bhe=/ +/g;var Sq=(t,e,r)=>{t.sync=e(Fhe,r),t.s=t.sync},Rq=({options:t})=>Tq(t),Fhe=({options:t})=>({...Tq(t),isSync:!0}),Tq=t=>({options:{...She(t),...t}}),She=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},_q={preferLocal:!0};var lC=Na(()=>({})),vtt=Na(()=>({isSync:!0})),wtt=Na(wq),btt=Na(bq),Ftt=Na(Y5),Stt=Na(Rq,{},_q,Sq);var kq=Fs(2),Im=class{constructor(e="dot"){this.path=e}dispose(){}async prepareElementViewDot(e){let r=DE(e),n=await lC("unflatten",["-f","-l 1","-c 2"],{reject:!1,timeout:5e3,input:r,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?console.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
357
357
|
|
|
358
358
|
but returned
|
|
359
359
|
${n.stdout}`):console.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
@@ -362,7 +362,7 @@ nothing returned, ignoring...`)),n.stdout&&(r=n.stdout.replaceAll(/\t\[/g," [").
|
|
|
362
362
|
`).filter(o=>!o.includes("margin=33.21")).join(`
|
|
363
363
|
`),i=await lC(this.path,["-Tsvg","-y"],{reject:!1,timeout:5e3,input:n,stdin:"pipe",encoding:"utf8"});if(i instanceof Error){if(!i.stdout)throw console.error(`[BinaryGraphvizLayouter.layout] '${i.command}' nothing returned and failed: ${i.stderr}`),i;console.warn(`[BinaryGraphvizLayouter.layout] '${i.command}' returned result but also failed ${i.stderr}`)}return i.stdout})}};import*as QR from"node:fs";var ZR=class{constructor(){this.encoding="utf-8"}readFile(e){return QR.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await QR.promises.readdir(e.fsPath,{withFileTypes:!0})).map(n=>({dirent:n,isFile:n.isFile(),isDirectory:n.isDirectory(),uri:Or.joinPath(e,n.name)}))}},Pq={fileSystemProvider:()=>new ZR};var eT=Se(Oq(),1);var ks=Se(Mr(),1);import{hrtime as $q}from"node:process";import{createLogger as The}from"vite";var Bq=ks.default.bold(ks.default.bgRed(ks.default.white("ERROR"))),_he=ks.default.bold(ks.default.yellow("WARN")),khe=ks.default.bold(ks.default.green("INFO"));function gn(t){let e=The(void 0,{prefix:t,allowClearScreen:!eT.isCI}),r=!eT.isCI;return{...e,info(n,i){e.info(`${khe} ${n}`,{timestamp:r,...i})},warn(n,i){e.warn(`${_he} ${n}`,{timestamp:r,...i})},error(n,i){if(n instanceof Error){e.error(`${Bq} ${n.stack??n.message}`,{timestamp:r,error:n,...i});return}e.error(`${Bq} ${n}`,{timestamp:r,...i})}}}var Phe=1e6;function tT(t){let[e,r]=$q(t),n=e*1e3+r/Phe;return{ms:n,pretty:wm(n)}}function zo(){let t=$q();return{stopAndLog(e="done in "){wt.success(ks.default.green(`${e}${tT(t).pretty}`))}}}var Ihe=Fs(2),fC=class{constructor(e){this.services=e;this.layouter=e.likec4.Layouter}cache=new WeakMap;svgCache=new Pu;layouter;previousAction=Promise.resolve();async computedViews(){let e=await this.services.likec4.ModelBuilder.buildComputedModel();return Object.values(e?.views??{})}async layoutViews(){let e=this.services.logger,r=this.previousAction.then(async()=>{let i=(await this.computedViews()).map(async o=>{try{let s=this.cache.get(o);return s||(s=await this.layouter.layout(o),this.cache.set(o,s)),s}catch(s){return e.error(s),null}});return(await Promise.all(i)).filter(pt)});return this.previousAction=r.catch(n=>(e.error(n),Promise.resolve([]))),await r}async diagrams(){return(await this.layoutViews()).map(r=>r.diagram)}async viewsAsGraphvizOut(){let e="All-LayoutedViews-DotWithSvg",r=this.services.WorkspaceCache;if(r.has(e))return await Promise.resolve(r.get(e));let n=await this.layoutViews(),i=this.svgCache,o=n.map(a=>Ihe(async()=>{let u=i.get(a.dot);return u||(u=await this.layouter.svg(a.dot,a.diagram),i.set(a.dot,u)),{id:a.diagram.id,dot:a.dot,svg:u}})),s=await Promise.all(o);return r.set(e,s),s}};var Lm=Se(Mr(),1);import{basename as Lhe}from"node:path";import{pathToFileURL as Nhe}from"node:url";var dC=class{constructor(e){this.services=e}isInitialized=!1;async init(e){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;let r=this.services.logger,n=this.services.likec4.ModelBuilder,i=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.WorkspaceManager,s=this.services.shared.workspace.DocumentBuilder;r.info(`${Lm.default.dim("workspace:")} ${e}`),await o.initializeWorkspace([{name:Lhe(e),uri:Nhe(e).toString()}]);let a=i.all.toArray();if(a.length===0)throw r.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");r.info(`${Lm.default.dim("workspace:")} found ${a.length} sources`),await s.build(a,{validation:!0});let u=await n.buildComputedModel(),c=Hf(u?.views??{}).length;r.info(`${Lm.default.dim("workspace:")} ${Lm.default.green(`\u2713 built ${c} views`)}`)}};function Mq(t){return e=>new t(e)}var Ohe={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")},Views:Mq(fC)},cli:{Workspace:Mq(dC)}};function jq({logger:t=gn("c4:lsp "),useDotBin:e=!1}={}){let r={logger:()=>t,likec4:{Layouter:()=>e===!0?new Im:new Xu}};return it.silent(!0),hS(Pq,Ohe,r)}var Vq=Se(Mr(),1),qq=Se(At(),1);function Uq(t){let e=t.logger,r=t.LanguageMetaData,n=t.shared.workspace.LangiumDocuments,i=t.shared.workspace.DocumentBuilder,o=t.likec4.ModelBuilder;function s(){return n.all.toArray().flatMap(d=>(d.diagnostics??[]).filter(p=>p.severity===qq.DiagnosticSeverity.Error).map(p=>({...p,sourceFsPath:d.uri.fsPath})))}function a(){return s().length>0}let u=t.shared.workspace.WorkspaceLock;async function c({changed:f,removed:d}){wt.debug(`notify update ${Vq.default.dim(f??d)}`);try{let p=!1;return await u.write(async y=>{await i.update(f?[It.file(f)]:[],d?[It.file(d)]:[],y),p=!y.isCancellationRequested}),p}catch(p){return e.error(p),!1}}function l(f){let d=o.onModelParsed(()=>f());return()=>{d.dispose()}}return{errorDiagnostics:s,hasErrors:a,notifyUpdate:c,onModelUpdate:l}}function $he(t,e){let r=t.shared.workspace.LangiumDocuments;return(n=r.all.toArray())=>{let i=!0;for(let o of n){let s=o.diagnostics?.filter(a=>a.severity===1);if(s&&s.length>0){i&&(e.clearScreen("error"),i=!1);let a=s.map(u=>{let c=u.range.start.line;return" "+Nm.default.dim(`Line ${c}: `)+Nm.default.gray(u.message)}).join(`
|
|
364
364
|
`);e.error(`invalid ${o.uri.fsPath}
|
|
365
|
-
${a}`)}}return i!==!0}}async function Mhe({path:t,logValidationErrors:e=!0,useDotBin:r=!1}){let n=jq({useDotBin:r}).likec4,i=n.logger;i.info(`${Nm.default.dim("version")} ${wh.version}`),i.info(`${Nm.default.dim("layout")} ${n.likec4.Layouter instanceof Xu?"wasm":"binary"}`);let o=Bhe(t);await n.cli.Workspace.init(t);let{errorDiagnostics:s,hasErrors:a,notifyUpdate:u,onModelUpdate:c}=Uq(n),l=$he(n,i);return e&&n.shared.workspace.DocumentBuilder.onBuildPhase(Ke.Validated,f=>{l(f)}),{workspace:o,model:n.likec4.ModelBuilder,views:n.likec4.Views,notifyUpdate:u,onModelUpdate:c,hasErrors:a,getErrors:s,printErrors:()=>l()}}var rn;(e=>{async function t(r){let n=globalThis.LikeC4LanguageServices;return n||(n=await Mhe({path:r?.path??process.cwd(),logValidationErrors:r?.logValidationErrors??!0,useDotBin:r?.useDotBin??!1}),n.printErrors()&&process.exit(1),globalThis.LikeC4LanguageServices=n),n}e.get=t})(rn||={});import{resolve as Bge}from"node:path";var ac=Se(Mr(),1);function Gq(t){var e,r;if(t){if("astNode"in t)return qhe(t);if(Array.isArray(t))return t.reduce(Wq,void 0);{let n=t,i=jhe(n)?Vhe((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return Ff(n,i)}}else return}function jhe(t){return typeof t<"u"&&"element"in t&&"text"in t}function Vhe(t){try{return Vt(t).uri.toString()}catch{return}}function qhe(t){var e,r;let{astNode:n,property:i,index:o}=t??{},s=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||s===void 0)){if(i===void 0)return Ff(s,rT(n));{let a=u=>o!==void 0&&o>-1&&Array.isArray(n[i])?o<u.length?u[o]:void 0:u.reduce(Wq,void 0);if(!((r=s.assignments)===null||r===void 0)&&r[i]){let u=a(s.assignments[i]);return u&&Ff(u,rT(n))}else if(n.$cstNode){let u=a(Ys(n.$cstNode,i));return u&&Ff(u,rT(n))}else return}}}function rT(t){var e,r,n,i;return t.$cstNode?(r=(e=Vt(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new gi(t,o=>o.$container?[o.$container]:[]).find(o=>{var s;return(s=o.$textRegion)===null||s===void 0?void 0:s.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function Ff(t,e){var r,n;let i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function Wq(t,e){var r,n;if(t){if(!e)return t&&Ff(t)}else return e&&Ff(e);let i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,o=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,s=Math.min(t.offset,e.offset),a=Math.max(i,o),u=a-s,c={offset:s,end:a,length:u};if(t.range&&e.range&&(c.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){let l=t.fileURI,f=e.fileURI,d=l&&f&&l!==f?`<unmergable text regions of ${l}, ${f}>`:l??f;c.fileURI=d}return c}var nT=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.length>0){let n=r&&this.currentPosition;this.lines[this.currentLineNumber].push(e),this.length+=e.length,n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let r=this.traceData.length-1;r>=0;r--){let n=this.traceData[r];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join("").length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){let r=Uhe(e,this.currentPosition,n=>{var i,o;return(o=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||o===void 0?void 0:o.push(n)});return this.traceData.push(r),r}popTraceRegion(e){let r=this.traceData.pop();return this.assertTrue(r===e,"Trace region mismatch!"),r}getParentTraceSourceFileURI(){var e;for(let r=this.traceData.length-1;r>-1;r--){let n=(e=this.traceData[r].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,r){if(!e)throw new Error(r)}};function Uhe(t,e,r){let n={sourceRegion:t,targetRegion:void 0,children:[],targetStart:e,complete:i=>{var o,s;return n.targetRegion={offset:n.targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((o=n.children)===null||o===void 0?void 0:o.length)===0&&delete n.children,!((s=n.targetRegion)===null||s===void 0)&&s.length&&r(n),delete n.complete,n}};return n}function Hq(t,e){let r=new nT(e),n=r.pushTraceRegion(void 0);zq(t,r),r.popTraceRegion(n),n.complete&&n.complete(r.currentPosition);let i=n.children&&n.children.length===1?n.children[0]:void 0,o=i?.targetRegion,s=n.targetRegion;return o&&i.sourceRegion&&o.offset===s.offset&&o.length===s.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function zq(t,e){typeof t=="string"?Ghe(t,e):t instanceof Sf?Whe(t,e):t instanceof Et?Xq(t,e):t instanceof Oa&&Hhe(t,e)}function Kq(t,e){return typeof t=="string"?t.length!==0:t instanceof Et?t.contents.some(r=>Kq(r,e)):t instanceof Oa?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function Ghe(t,e){t&&(e.pendingIndent&&Yq(e,!1),e.append(t))}function Yq(t,e){var r;let n="";for(let i of t.relevantIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function Xq(t,e){let r,n=Gq(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(let i of t.contents)zq(i,e);if(r){e.popTraceRegion(r);let i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}function Whe(t,e){var r;if(Kq(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),Xq(t,e)}finally{e.decreaseIndent()}}}function Hhe(t,e){t.ifNotEmpty&&!zhe(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&Yq(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function zhe(t){return t.trimStart()!==""}var
|
|
365
|
+
${a}`)}}return i!==!0}}async function Mhe({path:t,logValidationErrors:e=!0,useDotBin:r=!1}){let n=jq({useDotBin:r}).likec4,i=n.logger;i.info(`${Nm.default.dim("version")} ${wh.version}`),i.info(`${Nm.default.dim("layout")} ${n.likec4.Layouter instanceof Xu?"wasm":"binary"}`);let o=Bhe(t);await n.cli.Workspace.init(t);let{errorDiagnostics:s,hasErrors:a,notifyUpdate:u,onModelUpdate:c}=Uq(n),l=$he(n,i);return e&&n.shared.workspace.DocumentBuilder.onBuildPhase(Ke.Validated,f=>{l(f)}),{workspace:o,model:n.likec4.ModelBuilder,views:n.likec4.Views,notifyUpdate:u,onModelUpdate:c,hasErrors:a,getErrors:s,printErrors:()=>l()}}var rn;(e=>{async function t(r){let n=globalThis.LikeC4LanguageServices;return n||(n=await Mhe({path:r?.path??process.cwd(),logValidationErrors:r?.logValidationErrors??!0,useDotBin:r?.useDotBin??!1}),n.printErrors()&&process.exit(1),globalThis.LikeC4LanguageServices=n),n}e.get=t})(rn||={});import{resolve as Bge}from"node:path";var ac=Se(Mr(),1);function Gq(t){var e,r;if(t){if("astNode"in t)return qhe(t);if(Array.isArray(t))return t.reduce(Wq,void 0);{let n=t,i=jhe(n)?Vhe((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return Ff(n,i)}}else return}function jhe(t){return typeof t<"u"&&"element"in t&&"text"in t}function Vhe(t){try{return Vt(t).uri.toString()}catch{return}}function qhe(t){var e,r;let{astNode:n,property:i,index:o}=t??{},s=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||s===void 0)){if(i===void 0)return Ff(s,rT(n));{let a=u=>o!==void 0&&o>-1&&Array.isArray(n[i])?o<u.length?u[o]:void 0:u.reduce(Wq,void 0);if(!((r=s.assignments)===null||r===void 0)&&r[i]){let u=a(s.assignments[i]);return u&&Ff(u,rT(n))}else if(n.$cstNode){let u=a(Ys(n.$cstNode,i));return u&&Ff(u,rT(n))}else return}}}function rT(t){var e,r,n,i;return t.$cstNode?(r=(e=Vt(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new gi(t,o=>o.$container?[o.$container]:[]).find(o=>{var s;return(s=o.$textRegion)===null||s===void 0?void 0:s.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function Ff(t,e){var r,n;let i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function Wq(t,e){var r,n;if(t){if(!e)return t&&Ff(t)}else return e&&Ff(e);let i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,o=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,s=Math.min(t.offset,e.offset),a=Math.max(i,o),u=a-s,c={offset:s,end:a,length:u};if(t.range&&e.range&&(c.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){let l=t.fileURI,f=e.fileURI,d=l&&f&&l!==f?`<unmergable text regions of ${l}, ${f}>`:l??f;c.fileURI=d}return c}var nT=class{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.length>0){let n=r&&this.currentPosition;this.lines[this.currentLineNumber].push(e),this.length+=e.length,n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let r=this.traceData.length-1;r>=0;r--){let n=this.traceData[r];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join("").length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){let r=Uhe(e,this.currentPosition,n=>{var i,o;return(o=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||o===void 0?void 0:o.push(n)});return this.traceData.push(r),r}popTraceRegion(e){let r=this.traceData.pop();return this.assertTrue(r===e,"Trace region mismatch!"),r}getParentTraceSourceFileURI(){var e;for(let r=this.traceData.length-1;r>-1;r--){let n=(e=this.traceData[r].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,r){if(!e)throw new Error(r)}};function Uhe(t,e,r){let n={sourceRegion:t,targetRegion:void 0,children:[],targetStart:e,complete:i=>{var o,s;return n.targetRegion={offset:n.targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((o=n.children)===null||o===void 0?void 0:o.length)===0&&delete n.children,!((s=n.targetRegion)===null||s===void 0)&&s.length&&r(n),delete n.complete,n}};return n}function Hq(t,e){let r=new nT(e),n=r.pushTraceRegion(void 0);zq(t,r),r.popTraceRegion(n),n.complete&&n.complete(r.currentPosition);let i=n.children&&n.children.length===1?n.children[0]:void 0,o=i?.targetRegion,s=n.targetRegion;return o&&i.sourceRegion&&o.offset===s.offset&&o.length===s.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function zq(t,e){typeof t=="string"?Ghe(t,e):t instanceof Sf?Whe(t,e):t instanceof Et?Xq(t,e):t instanceof Oa&&Hhe(t,e)}function Kq(t,e){return typeof t=="string"?t.length!==0:t instanceof Et?t.contents.some(r=>Kq(r,e)):t instanceof Oa?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}function Ghe(t,e){t&&(e.pendingIndent&&Yq(e,!1),e.append(t))}function Yq(t,e){var r;let n="";for(let i of t.relevantIndents.filter(o=>o.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function Xq(t,e){let r,n=Gq(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(let i of t.contents)zq(i,e);if(r){e.popTraceRegion(r);let i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}function Whe(t,e){var r;if(Kq(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),Xq(t,e)}finally{e.decreaseIndent()}}}function Hhe(t,e){t.ifNotEmpty&&!zhe(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&Yq(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function zhe(t){return t.trimStart()!==""}var Brt=Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__"),Khe=/\S|$/;function Jq(t){let e=t.filter(n=>n.length>0).map(n=>n.search(Khe)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function bn(t,...e){let r=Yhe(t),n=Xhe(t,e,r);return Qhe(n)}function eU(t,e,r){return(n,...i)=>oT(t,e,r)(bn(n,...i))}function Yhe(t){let e=t.join("_").split(pu),r=e.length>1&&e[0].trim().length===0,n=r&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:r,omitLastLine:n,trimLastLine:e.length!==1&&e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(s=>s.length!==0);let o=Jq(i);return{indentation:o,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<o||!e[e.length-1].startsWith(i[0].substring(0,o)))}}}function Xhe(t,e,{indentation:r,omitFirstLine:n,omitLastLine:i,trimLastLine:o}){let s=[];t.forEach((c,l)=>{s.push(...c.split(pu).map((f,d)=>d===0||f.length<r?f:f.substring(r)).reduce(l===0?(f,d,p)=>p===0?n?[]:[d]:p===1&&f.length===0?[d]:f.concat(pC,d):(f,d,p)=>p===0?[d]:f.concat(pC,d),[]).filter(f=>!(typeof f=="string"&&f.length===0)).concat(ic(e[l])?e[l]:e[l]!==void 0?{content:String(e[l])}:l<e.length?tU:[]))});let a=s.length,u=a!==0?s[a-1]:void 0;return(i||o)&&typeof u=="string"&&u.trim().length===0?n&&a!==1&&s[a-2]===pC?s.slice(0,a-2):s.slice(0,a-1):s}var pC={isNewLine:!0},tU={isUndefinedSegment:!0},Zq=t=>t===pC,iT=t=>t===tU,Jhe=t=>t.content!==void 0;function Qhe(t){return t.reduce((r,n,i)=>iT(n)?r:Zq(n)?{node:i!==0&&(iT(t[i-1])||ic(t[i-1]))||i>1&&typeof t[i-1]=="string"&&(iT(t[i-2])||ic(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var o;let s=(i===0||Zq(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=Jhe(n)?n.content:n,u;return{node:r.indented?r.node:s.length!==0?r.node.indent({indentation:s,indentImmediately:!1,indentedChildren:c=>u=c.append(a)}):r.node.append(a),indented:u??((o=r.indented)===null||o===void 0?void 0:o.append(a))}})(),{node:new Et}).node}var Qq=typeof process>"u"?`
|
|
366
366
|
`:process.platform==="win32"?`\r
|
|
367
367
|
`:`
|
|
368
368
|
`;function ic(t){return t instanceof Et||t instanceof Sf||t instanceof Oa}function nn(t,e){return ic(t)?Hq(t,e).text:String(t)}var Et=class t{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,r,n){if(Nt(e)){if(this.tracedSource={astNode:e,property:r,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negative value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(let r of e)typeof r=="function"?r(this):r&&this.contents.push(r);return this}appendIf(e,...r){return e?this.append(...r):this}appendNewLine(){return this.append(Fe)}appendNewLineIf(e){return e?this.append(Fe):this}appendNewLineIfNotEmpty(){return this.append(Zhe)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...r){return this.append(bn(e,...r))}appendTemplateIf(e){return e?(r,...n)=>this.appendTemplate(r,...n):()=>this}indent(e){let{indentedChildren:r,indentation:n,indentEmptyLines:i,indentImmediately:o}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},s=new Sf(n,o,i);return this.contents.push(s),Array.isArray(r)?s.append(...r):r&&s.append(r),this}appendTraced(e,r,n){return i=>this.append(new t().trace(e,r,n).append(i))}appendTracedIf(e,r,n,i){return e?this.appendTraced(typeof r=="function"?r():r,n,i):()=>this}appendTracedTemplate(e,r,n){return(i,...o)=>this.append(eU(e,r,n)(i,...o))}appendTracedTemplateIf(e,r,n,i){return e?this.appendTracedTemplate(typeof r=="function"?r():r,n,i):()=>this}};function oT(t,e,r){return n=>n instanceof Et&&n.tracedSource===void 0?n.trace(t,e,r):new Et().trace(t,e,r).append(n)}var Sf=class extends Et{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}},Oa=class{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??Qq,this.ifNotEmpty=r}},Fe=new Oa,Zhe=new Oa(void 0,!0);var rU=t=>t===void 0||typeof t=="string"||ic(t)?t:String(t);function Tr(t,e=rU,r={}){let n=typeof e=="function"?e:rU,{filter:i,prefix:o,suffix:s,separator:a,appendNewLineIfNotEmpty:u,skipNewLineAfterLastItem:c}=typeof e=="object"?e:r,l=typeof o=="function"?o:()=>o,f=typeof s=="function"?s:()=>s;return ege(t,(d,p,y,C)=>{if(i&&!i(p,y,C))return d;let g=n(p,y,C);return g===void 0?d:(d??(d=new Et)).append(l(p,y,C)).append(g).append(f(p,y,C)).appendIf(!C,a).appendNewLineIfNotEmptyIf(!d.isEmpty()&&!!u&&(!C||!c))})}function ege(t,e,r){let n=t[Symbol.iterator](),i=n.next(),o=0,s=r;for(;!i.done;){let a=n.next();s=e(s,i.value,o,!!a.done),i=a,o++}return s}var tge=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),rge=t=>t.split(".").map(tge).join(""),nge=t=>rge(t.parent?t.id.slice(t.parent.length+1):t.id),ige=({autoLayout:t})=>{switch(t){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},oge=({shape:t})=>{switch(t){case"queue":case"cylinder":case"rectangle":case"person":return t;case"storage":return"stored_data";case"mobile":case"browser":return"rectangle"}};function Om(t){let{nodes:e,edges:r}=t,n=new Map,i=(s,a)=>{let u=nge(s),c=(a?a+".":"")+u;n.set(s.id,c);let l=JSON.stringify(s.title),f=oge(s);return new Et().append(u,": {",Fe).indent({indentedChildren:d=>d.append("label: ",l,Fe).appendIf(f!=="rectangle","shape: ",f,Fe).appendIf(s.children.length>0,Fe,Tr(e.filter(p=>p.parent===s.id),p=>i(p,c))),indentation:2}).append("}",Fe)},o=s=>new Et().append(n.get(s.source)," -> ",n.get(s.target)).append(a=>s.label&&a.append(": ",JSON.stringify(s.label)));return nn(new Et().append("direction: ",ige(t),Fe,Fe).append(Tr(e.filter(s=>tt(s.parent)),s=>i(s),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,Fe,Tr(r,s=>o(s),{appendNewLineIfNotEmpty:!0})))}var sge=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),age=t=>t.split(".").map(sge).join(""),uge=t=>age(t.parent?t.id.slice(t.parent.length+1):t.id),cge=({shape:t})=>{switch(t){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([","])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function Bm(t){let{nodes:e,edges:r}=t,n=new Map,i=(s,a)=>{let u=uge(s),c=(a?a+".":"")+u;n.set(s.id,c);let l=s.title.replaceAll(`
|
|
@@ -599,7 +599,7 @@ if (import.meta.env.DEV) {
|
|
|
599
599
|
|
|
600
600
|
/* prettier-ignore-end */
|
|
601
601
|
`,EC={banner:Nge,footer:Oge};function Tf(){let t=Pge(Lge,"../__app__");if(!Sge(t))throw wt.error(`likec4 app root does not exist: ${t}`),new Error(`likec4 app root does not exist: ${t}`);return t}async function _f(){let t=await Rge(cU(_ge(),".likec4-public-"));return await Tge(cU(t,"likec4-views.js"),`// generated by likec4
|
|
602
|
-
`),t}var CC=1e4;var kf=async t=>{let e=gn("c4:vite"),r=Tf();e.info(`${ac.default.cyan("likec4 app root")} ${ac.default.dim(r)}`);let n=t?.languageServices??await rn.get({path:t?.workspaceDir??process.cwd(),logValidationErrors:!0}),i=t?.outputDir??Bge(n.workspace,"dist");e.info(ac.default.cyan("output")+" "+ac.default.dim(i));let o="/";t?.base&&(o=ZF(t.base),Kp(o)||(o=k6(o))),o!=="/"&&e.info(`${ac.default.green("app base url")} ${ac.default.dim(o)}`);let s=t?.webcomponentPrefix??"likec4";return{isDev:!1,webcomponentPrefix:s,root:r,languageServices:n,clearScreen:!1,base:o,configFile:!1,resolve:{alias:{"@emotion/is-prop-valid":"fast-equals"}},mode:"production",define:{WEBCOMPONENT_PREFIX:JSON.stringify(s),__USE_SHADOW_STYLE__:"false",__USE_HASH_HISTORY__:t?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},optimizeDeps:{
|
|
602
|
+
`),t}var CC=1e4;var kf=async t=>{let e=gn("c4:vite"),r=Tf();e.info(`${ac.default.cyan("likec4 app root")} ${ac.default.dim(r)}`);let n=t?.languageServices??await rn.get({path:t?.workspaceDir??process.cwd(),logValidationErrors:!0}),i=t?.outputDir??Bge(n.workspace,"dist");e.info(ac.default.cyan("output")+" "+ac.default.dim(i));let o="/";t?.base&&(o=ZF(t.base),Kp(o)||(o=k6(o))),o!=="/"&&e.info(`${ac.default.green("app base url")} ${ac.default.dim(o)}`);let s=t?.webcomponentPrefix??"likec4";return{isDev:!1,webcomponentPrefix:s,root:r,languageServices:n,clearScreen:!1,base:o,configFile:!1,resolve:{alias:{"@emotion/is-prop-valid":"fast-equals"}},mode:"production",define:{WEBCOMPONENT_PREFIX:JSON.stringify(s),__USE_SHADOW_STYLE__:"false",__USE_HASH_HISTORY__:t?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},optimizeDeps:{include:["nanostores"],force:!0},build:{outDir:i,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:CC,commonjsOptions:{ignoreTryCatch:"remove"}},customLogger:e,plugins:[Rf({languageServices:n})]}};var DT=Se(Mr(),1);async function Pf({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){let o=gn("c4:lib"),s=Tf();return o.info(DT.default.cyan("outDir")+" "+DT.default.dim(e)),{root:s,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},optimizeDeps:{noDiscovery:!0,include:[]},esbuild:{...EC},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:CC,commonjsOptions:{ignoreTryCatch:"remove"},lib:{entry:"src/lib/webcomponent.mjs",fileName(a,u){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{output:{compact:!0}}},customLogger:o,plugins:[Rf({languageServices:t})]}}import{copyFileSync as lU,existsSync as fU}from"node:fs";import{resolve as xC}from"node:path";import{build as dU}from"vite";var $ge=["favicon.ico","robots.txt"],AC=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",...r})=>{let{isDev:n,...i}=await kf({...r,webcomponentPrefix:e}),o=await _f();for(let a of $ge){let u=xC(i.root,a);fU(u)&&lU(u,xC(o,a))}if(t){let a=await Pf({webcomponentPrefix:e,languageServices:i.languageServices,outDir:o,base:i.base});await dU(a)}await dU({...i,publicDir:o,mode:"production"});let s=xC(i.build.outDir,"index.html");fU(s)&&lU(s,xC(i.build.outDir,"404.html"))};async function pU({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,output:i,base:o}){let s=await rn.get({path:t,useDotBin:e});await AC({base:o,useHashHistory:r,webcomponentPrefix:n,languageServices:s,outputDir:i})}var jge={command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",zs).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:Mge}).option("base",Sh).option("use-hash-history",bh).option("use-dot",Nn).option("webcomponent-prefix",vc).example(`${yT.default.green("$0 build -o ./build ./src")}`,yT.default.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async t=>{await pU({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],webcomponentPrefix:t["webcomponent-prefix"]})}},mU=jge;var CU=Se(Mr(),1);import{resolve as vC}from"path";var Ki=Se(Mr(),1);import{mkdir as jm,writeFile as ET}from"node:fs/promises";import{dirname as Vge,extname as qge,relative as CT,resolve as Vm}from"node:path";async function Uge(t,e,r,n){let i=e==="react"?".tsx":".ts";r=r??Vm(t.workspace,"likec4.generated"+i),qge(r)!==i&&(r=r+i),await jm(Vge(r),{recursive:!0});let o=await t.views.diagrams(),a=(e==="react"?mT:pT)([...o]);await ET(r,a),n.info(`${Ki.default.dim("generated")} ${CT(process.cwd(),r)}`)}async function Gge(t,e,r){await jm(e,{recursive:!0}),r.info(`${Ki.default.dim("format")} ${Ki.default.green("dot")}`),r.info(`${Ki.default.dim("outdir")} ${e}`);let n=new Set,i=await t.views.layoutViews(),o=0;for(let{diagram:s,dot:a}of i)try{let u=s.relativePath??"";u!==""&&!n.has(u)&&(await jm(Vm(e,u),{recursive:!0}),n.add(u));let c=Vm(e,u,s.id+".dot");fe(a,`dot for ${s.id} not found`),await ET(c,a),r.info(`${Ki.default.dim("generated")} ${CT(process.cwd(),c)}`),o++}catch(u){r.error(`error while generating ${s.id}`,{error:u})}o>0&&r.info(`${Ki.default.dim("total")} ${o} files`)}async function Wge(t,e,r,n){await jm(r,{recursive:!0}),n.info(`${Ki.default.dim("format")} ${Ki.default.green(e)}`),n.info(`${Ki.default.dim("outdir")} ${r}`);let i,o;switch(e){case"d2":i=".d2",o=Om;break;case"mermaid":i=".mmd",o=Bm;break;default:nt(e)}let s=new Set,a=await t.views.diagrams(),u=0;for(let c of a)try{let l=c.relativePath??"";l!==""&&!s.has(l)&&(await jm(Vm(r,l),{recursive:!0}),s.add(l));let f=Vm(r,l,c.id+i),d=o(c);await ET(f,d),n.info(`${Ki.default.dim("generated")} ${CT(process.cwd(),f)}`),u++}catch(l){n.error(`error while generating ${c.id}`,{error:l})}u>0&&n.info(`${Ki.default.dim("total")} ${u} files`)}async function If({path:t,useDotBin:e,...r}){let n=gn("c4:codegen"),i=zo(),o=await rn.get({path:t,useDotBin:e});if((await o.views.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"react":case"views":{await Uge(o,r.format,r.outfile,n);break}case"dot":{await Gge(o,r.outdir??t,n);break}case"d2":case"mermaid":{await Wge(o,r.format,r.outdir??t,n);break}default:nt(r)}i.stopAndLog()}var xT=Se(Mr(),1);import Hge from"@vitejs/plugin-react";import{extname as zge}from"node:path";async function hU({languageServices:t,outDir:e,filename:r="likec4-react.mjs"}){let n=gn("c4:react"),i=Tf();n.info(xT.default.cyan("outDir")+" "+xT.default.dim(e));let o=zge(r)===".jsx";return{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,esbuild:{...EC,jsx:o?"preserve":"automatic",minifyIdentifiers:!1,minifySyntax:!0,minifyWhitespace:!0},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:"esbuild",copyPublicDir:!1,chunkSizeWarningLimit:2e3,lib:{entry:"react/likec4.tsx",fileName(s,a){return r},formats:["es"]},rollupOptions:{external:["likec4/react","react","react-dom","react/jsx-runtime","react-dom/client"]}},plugins:[Hge({}),Rf({languageServices:t})]}}var Os=Se(Mr(),1);import{existsSync as Kge}from"node:fs";import{stat as Yge,writeFile as Xge}from"node:fs/promises";import{basename as gU,dirname as Jge,extname as Qge,isAbsolute as Zge,relative as eDe,resolve as AT}from"node:path";import{cwd as tDe}from"node:process";import{build as rDe}from"vite";async function DU({path:t,useDotBin:e,outfile:r}){let n=gn("c4:codegen"),i=zo(),o=await rn.get({path:t,useDotBin:e});n.info(`${Os.default.dim("format")} ${Os.default.green("react")}`);let s=await o.views.diagrams();if(s.length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");let a=AT(o.workspace,"likec4-views.mjs");if(r&&(a=Zge(r)?r:AT(r),Kge(r)&&(await Yge(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);wt.debug(`${Os.default.dim("outfilepath")} ${a}`);let u=Jge(a);wt.debug(`${Os.default.dim("outdir")} ${u}`);let c=gU(a);wt.debug(`${Os.default.dim("filename")} ${c}`);let l=Qge(c).toLocaleLowerCase();if(l!==".js"&&l!==".mjs"&&l!==".jsx")throw console.warn(`output file ${r} has extension "${l}"`),new Error(`output file ${r} must be a .js, .jsx or .mjs`);let f=await hU({languageServices:o,outDir:u,filename:c});await rDe({...f,logLevel:"warn"});let d=s.map(p=>` | '${p.id}'`).join(`
|
|
603
603
|
`);await Xge(AT(u,gU(a,l)+".d.ts"),`
|
|
604
604
|
/// <reference types="react" />
|
|
605
605
|
|
|
@@ -649,4 +649,4 @@ ${C}`),p<o&&(c.push({view:d,attempt:p+1}),n.info(Bf.default.dim(`retry ${y}`))),
|
|
|
649
649
|
`+"".padEnd(9," ")),RC.default.dim("Network: ")+t.resolvedUrls.network.join(`
|
|
650
650
|
`+"".padEnd(9," "))].join(`
|
|
651
651
|
`))}async function _U({path:t,output:e,base:r}){let n=await rn.get({path:t,useDotBin:!1}),i=await SC({base:r,languageServices:n,outputDir:e,open:!0});TC(i)}var LDe={command:"preview [path]",describe:"Start local server to preview production build",builder:t=>t.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
652
|
-
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"}}).coerce(["path","output"],kU).default("path",kU("."),"."),async handler(t){await _U(t)}},PU=LDe;import{build as NDe,createServer as ODe}from"vite";async function IU({webcomponentPrefix:t="likec4",...e}){let{isDev:r,languageServices:n,...i}=await kf({...e,webcomponentPrefix:t}),o=await Nf({port:[5173,...Of(61e3,61010),...Of(62002,62010)]}),s=await Nf({port:Of(24678,24690)}),a=await _f(),u;if(!r){let l=await Pf({webcomponentPrefix:t,languageServices:n,outDir:a,base:i.base});u=NDe({...l,logLevel:"warn"}).catch(f=>(wt.warn("webcomponent build failed",f),wt.warn("Ignoring error and continuing"),Promise.resolve()))}let c=await ODe({...i,publicDir:a,server:{host:"0.0.0.0",port:o,
|
|
652
|
+
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"}}).coerce(["path","output"],kU).default("path",kU("."),"."),async handler(t){await _U(t)}},PU=LDe;import{build as NDe,createServer as ODe}from"vite";async function IU({webcomponentPrefix:t="likec4",...e}){let{isDev:r,languageServices:n,...i}=await kf({...e,webcomponentPrefix:t}),o=await Nf({port:[5173,...Of(61e3,61010),...Of(62002,62010)]}),s=await Nf({port:Of(24678,24690)}),a=await _f(),u;if(!r){let l=await Pf({webcomponentPrefix:t,languageServices:n,outDir:a,base:i.base});u=NDe({...l,logLevel:"warn"}).catch(f=>(wt.warn("webcomponent build failed",f),wt.warn("Ignoring error and continuing"),Promise.resolve()))}let c=await ODe({...i,publicDir:a,server:{host:"0.0.0.0",port:o,hmr:{overlay:!0,port:s},fs:{strict:!1},open:!r}});return await c.listen(),c.config.logger.clearScreen("info"),TC(c),u&&await u,c}async function LU({path:t,useDotBin:e,webcomponentPrefix:r,useHashHistory:n,base:i}){let o=await rn.get({path:t,useDotBin:e});await IU({base:i,webcomponentPrefix:r,languageServices:o,useHashHistory:n})}var BDe={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:t=>t.positional("path",zs).option("base",Sh).option("webcomponent-prefix",vc).option("use-hash-history",bh).option("use-dot",Nn),handler:async t=>{await LU({path:t.path,useDotBin:t["use-dot"],base:t.base,webcomponentPrefix:t["webcomponent-prefix"],useHashHistory:t["use-hash-history"]})}},NU=BDe;wt.wrapConsole();wt.debug("running in prod mode");var VDe=I_(gx($De)).scriptName("likec4").usage("Usage: $0 <command>").command(NU).command(mU).command(xU).command(TU).command(PU).help("help").version(wh.version).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!1,"Something is wrong, run with --help for available options").updateStrings({"Options:":Um.default.bold("Options:"),"Positionals:":Um.default.bold("Arguments:"),"Commands:":Um.default.bold("Commands:"),"Examples:":Um.default.bold("Examples:")}).wrap(pc(jDe.columns-20,{min:80,max:120})).parseAsync();VDe.catch(()=>MDe(1));
|